Commit graph

857 commits

Author SHA1 Message Date
Leonardo de Moura
b3d8766b09 chore: use doubleticks at WHNF.lean 2021-12-18 08:43:50 -08:00
Leonardo de Moura
b6fbdd8679 feat: add Meta.Context.canUnfold? 2021-12-18 08:25:56 -08:00
Leonardo de Moura
c954fc9ec7 fix: bug at simpLoop 2021-12-18 06:48:08 -08:00
Leonardo de Moura
81f7335269 fix: ensure motive is type correct at simpProj 2021-12-15 17:07:31 -08:00
Leonardo de Moura
0a81093db5 fix: bug at simpProj
This bug was reported at https://github.com/dwrensha/lean4-maze/issues/1
2021-12-15 17:07:00 -08:00
Leonardo de Moura
1c83ea9e40 fix: typo at hasUnusedArguments
See comment at #815
2021-12-14 06:50:34 -08:00
Leonardo de Moura
a3361e7d86 fix: missing universe assignments made during TC resolution
closes #796
2021-12-12 07:07:13 -08:00
Leonardo de Moura
68bd55af32 chore: fix codebase 2021-12-10 13:12:09 -08:00
Leonardo de Moura
96e0e1db98 fix: nontermination at simp [OfNat.ofNat]
closes #788
2021-12-10 12:29:33 -08:00
Leonardo de Moura
41040a81de fix: auxiliary matcher definitions should be treated as abbreviations
The motivation is to prevent performance problems such as the one
described at issue #854.

Fixes #854 after a update stage0
2021-12-07 16:43:20 -08:00
Leonardo de Moura
b0fe1e5d10 feat: add Tomas Skrivan's TC resolution improvement
This commit implements the TC resolution improvement suggested by
Tomas at #815.

Closes #815.
2021-12-06 17:46:11 -08:00
Leonardo de Moura
7b6732a137 refactor: ExprDefEq.lean and LevelDefEq.lean are now implementation only files
We use the export/extern idiom to define `isLevelDefEqAux`, and then
define the `isDefEq` user facing functions at `Meta/Basic.lean`.
2021-12-06 09:57:00 -08:00
Leonardo de Moura
7de749a23c refactor: move setElabConfig to Elab directory
see #849
2021-12-06 08:12:59 -08:00
Sebastian Ullrich
80c3d88e3e refactor: optimize critical import path 2021-12-06 08:05:24 -08:00
Sebastian Ullrich
458dc64fcb refactor: Lean.Meta should not depend on Lean.Elab 2021-12-06 08:05:24 -08:00
Leonardo de Moura
0aa32d643e fix: eta struct and proof irrelevance issue
see #777
2021-11-27 07:15:57 -08:00
Leonardo de Moura
2d113e83f9 feat: eta struct support for unit-like datatypes
For example, given `a b : Unit`, we have that `a` and `b` are
definitionally equal by `etaStruct`.

See #777
2021-11-26 08:36:25 -08:00
Leonardo de Moura
693a96681a doc: fix eta struct comment 2021-11-26 08:36:25 -08:00
Leonardo de Moura
88b6ad4756 feat: add etaStruct to Meta.Simp.Config 2021-11-25 11:31:00 -08:00
Leonardo de Moura
d806344ee2 fix: set etaStruct := false at MatchEqns 2021-11-25 11:31:00 -08:00
Leonardo de Moura
43217884c0 feat: add Meta.Config.etaStruct
It is useful to disable eta for structures for meta programs.
2021-11-25 11:31:00 -08:00
Leonardo de Moura
0fc8c1da77 feat: eta for structures at recursors
see #777
2021-11-25 11:31:00 -08:00
Leonardo de Moura
9e1704f658 chore: simplify toCtorWhenK 2021-11-25 11:31:00 -08:00
Leonardo de Moura
ccc3f99507 chore: use isStructureLike 2021-11-25 11:31:00 -08:00
Leonardo de Moura
0de700fe45 chore: naming convetion 2021-11-25 11:31:00 -08:00
Leonardo de Moura
a8f4146070 feat: support eta struct recursively
Addresses issues raised by @gebner at #777
2021-11-23 17:38:48 -08:00
Gabriel Ebner
7537fa7795 fix: unfold x<y in discrimination tree module 2021-11-23 07:34:51 -08:00
Leonardo de Moura
d685c545b4 feat: eta for structures 2021-11-23 06:21:25 -08:00
Gabriel Ebner
f55649f81b fix: prefer simp lemmas with *higher* priority 2021-11-22 11:52:45 -08:00
Leonardo de Moura
2a7b33089a fix: transparency settings at simp TC check
fixes #790
2021-11-15 18:09:31 -08:00
Leonardo de Moura
a5b1b8de4f fix: bug at Offset.lean
Offset equalities should not assume default `Nat` instances for
numerals, `+`, `*`, and `-` have been used.

fixes #755
2021-11-08 18:27:25 -08:00
Leonardo de Moura
84d4d771ca fix: bug at addPPExplicitToExposeDiff 2021-11-08 18:25:57 -08:00
Leonardo de Moura
3367501511 fix: inaccessible annotations at isDefEq issue
Issue was reported at
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Change.20in.20pattern.20matching.3B.20expected.20behaviour.3F/near/259059096

fixes #742
2021-10-27 09:26:12 -07:00
Leonardo de Moura
57f02804f3 feat: use forallTelescopeReducing
This is needed now that we allow definitions at `inductive`.
2021-10-25 13:05:23 -07:00
Leonardo de Moura
3dbd1fd074 chore: style 2021-10-25 13:02:15 -07:00
Leonardo de Moura
851ac3809e feat: extend isInductivePredicate 2021-10-25 12:37:04 -07:00
Leonardo de Moura
83cf5b20a1 fix: simpLet
Given `let x := v; b`, `simpLet` was using an incorrect local context to simplify `v`.
2021-10-22 16:29:00 -07:00
Leonardo de Moura
b4a6b4f882 fix: do not consume pretty print hints at isDefEq
TODO: improve the solution. It is too hackish.

The issue was reported here https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/.E2.9C.94.20MData.20and.20unification/near/258352713
2021-10-20 15:58:56 -07:00
Leonardo de Moura
58430704e5 refactor: move inaccessible? to Expr.lean 2021-10-20 15:54:18 -07:00
Leonardo de Moura
b5e640a423 fix: avoid getMVarType' at cleanup tactic
`getMVarType'` applies `whnf`
2021-10-19 06:43:07 -07:00
Leonardo de Moura
67c8e76b08 fix: preserve unused let declarations
This commit fixes reported at
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/unused.20let.20disappears/near/257528105
2021-10-18 17:40:15 -07:00
Leonardo de Moura
6b2303b243 fix: bug at tryLemmaCore when numExtraArgs > 1
Fixes bug reported at
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Simp.20bug.20-.20produces.60application.20type.20mismatch.60/near/257711901
2021-10-18 13:59:19 -07:00
Sebastian Ullrich
e068833e8d fix: register missing simp trace classes 2021-10-11 15:37:56 +02:00
Leonardo de Moura
91d2f6d4fc feat: add cleanup tactic 2021-10-06 19:54:28 -07:00
Leonardo de Moura
c02b4f2675 refactor: move to Meta namespace 2021-10-06 19:05:37 -07:00
Leonardo de Moura
def7641926 feat: add helper methods for checking dependencies 2021-10-06 19:04:02 -07:00
Leonardo de Moura
59d7b00557 feat: add mapping from mvar user name to MVarId 2021-10-02 15:26:44 -07:00
Leonardo de Moura
dba358067a chore: remove workaround 2021-09-30 22:37:20 -07:00
Leonardo de Moura
3fed9c9df7 feat: reject partial when if constant is not a function
fixes #697
2021-09-28 21:07:14 -07:00
Leonardo de Moura
d0462153a0 fix: bug at smart unfolding procedure
It fixes an issue reported at https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/Simplifications.20in.20proofs.2Ftype-checking.20not.20happening.3B.20wh.2E.2E.2E
2021-09-28 10:45:54 -07:00