Commit graph

7919 commits

Author SHA1 Message Date
E.W.Ayers
5bf5abe84f test: update 533 test to include docstring 2022-07-20 15:30:30 -07:00
Sebastian Ullrich
c43a84ca30 fix: unsafe initialize 2022-07-20 22:37:01 +02:00
Mario Carneiro
a2ef6bd19e fix: malformed/misaligned markdown code fences 2022-07-20 11:12:42 +02:00
Leonardo de Moura
3846dd60fd fix: evalTactic
This commit fixes bug reported by Patrick Massot.
It happened when using `macro_rules` and `elab_rules` for the same
`SyntaxNodeKind`.

It also fixes missing error messages when there is more than one
elaboration functions and there is `abortTactic` exception.

Remark: this commit also changes the evaluation order. Macros are
now tried before elaboration rules. The motivation is that macros are
already applied before elaboration functions in the term elaborator.
2022-07-19 23:28:14 -04:00
Gabriel Ebner
f2e7cbfbaf chore: use inaccessible name for RpcEncodingPacket 2022-07-19 22:55:42 +02:00
Gabriel Ebner
4ce56f7c05 fix: use field names if specified 2022-07-19 22:55:42 +02:00
Gabriel Ebner
59f528e678 fix: support empty inductives in json derive 2022-07-19 22:55:42 +02:00
Gabriel Ebner
2c0f8fac99 feat: support unused params in RpcEncoding deriver 2022-07-19 22:55:42 +02:00
Gabriel Ebner
ed5e0f098c fix: support non-type params in RpcEncoding 2022-07-19 22:55:42 +02:00
Gabriel Ebner
62ede1fdfd chore: update test 2022-07-19 22:55:42 +02:00
Gabriel Ebner
bffd762822 feat: improve RpcEncoding derive test 2022-07-19 22:55:42 +02:00
Gabriel Ebner
eda3eae18e perf: implement Expr.update* in Lean 2022-07-19 05:55:13 -07:00
Sebastian Ullrich
987785242f fix: disable auto implicits in structure field default values 2022-07-18 21:09:56 -07:00
Leonardo de Moura
73fce217f6 test: for issue #1321 2022-07-18 23:50:41 -04:00
Leonardo de Moura
3325987be4 chore: fix tests 2022-07-18 23:18:59 -04:00
Gabriel Ebner
3edf22f3f5 fix: crash in binop% 2022-07-17 09:57:56 -07:00
Gabriel Ebner
ff3c67d1ad feat: recover from errors in attributes 2022-07-16 06:19:54 -07:00
Gabriel Ebner
69da058c03 fix: tests/lean/625.lean 2022-07-16 06:19:54 -07:00
Leonardo de Moura
fb9b093cf9 chore: update example 2022-07-13 15:15:00 -07:00
Leonardo de Moura
94df25e99b chore: update example 2022-07-13 15:13:31 -07:00
Leonardo de Moura
cce2d3500e test: for issue #1301
closes #1301
2022-07-13 06:05:12 -07:00
larsk21
15f9c0585a fix: consider macro expansions in unused variables linter 2022-07-13 10:35:37 +02:00
larsk21
ced8df3e86 fix: references of variables with equal ranges 2022-07-13 10:35:37 +02:00
Leonardo de Moura
b6860968ff fix: catch exception at elabMutualDef
closes #1301
2022-07-12 18:39:30 -07:00
Leonardo de Moura
fdef55339f fix: use binop% for elaborating ^
closes #1298
2022-07-12 18:20:02 -07:00
Leonardo de Moura
5e333191a2 feat: improve binop% and binrel% elaboration functions
Add support for operators that may not have homogeneous instances for
all types. For example, we have `HPow Nat Nat Nat` and `HPow Int Nat Int`,
but we don't have `HPow Int Int Int`.
2022-07-12 18:12:20 -07:00
Leonardo de Moura
d1f0db7072 fix: resumePostponed backtracking
Note that test for issue #1200 broke.
The bug fixed by this commit was allowing the example to be elaborated
correctly :(
Initially, the type of the discriminant is not available, and
`.none (α:=α)` can only be elaborated when the expected type is of the
form `C ...`. Lean then tries to elaborate the alternatives, learn
that the discriminant should be `Option ?m`, and fails because the
patterns still have metavariables after elaboration. Before the bug
fix, `resumePostpone` was **not** restoring the metavariable context,
and the assingnment would stay there. With this information, Lean
can now elaborate `.none (α:=α)`.
Although the bug had a positive impact in this case, it produced
incorrect behavior in other examples.
The fixed example looks reasonable. Thus, we will not reopen
issue #1200
2022-07-12 16:52:45 -07:00
Leonardo de Moura
b8ed579289 fix: fixes #1300 2022-07-12 14:08:47 -07:00
Leonardo de Moura
5bd1f7bba1 fix: special support for higher order output parameters at isDefEqArgs
closes #1299
2022-07-11 19:05:24 -07:00
Gabriel Ebner
a8cab84735 refactor: use computed fields for Expr 2022-07-11 14:19:41 -07:00
Gabriel Ebner
eba400543d refactor: use computed fields for Name 2022-07-11 14:19:41 -07:00
Gabriel Ebner
3176943750 refactor: use computed fields for Level 2022-07-11 14:19:41 -07:00
Gabriel Ebner
c100f45b77 feat: add simp lemmas and instances for LawfulBEq 2022-07-11 14:19:41 -07:00
Gabriel Ebner
a7e8a82e89 chore: require @[computedField] attribute 2022-07-11 12:26:53 -07:00
Gabriel Ebner
6fe3e36804 feat: support extern computed fields 2022-07-11 12:26:53 -07:00
Gabriel Ebner
243439a75c feat: support modifiers in computed fields 2022-07-11 12:26:53 -07:00
Gabriel Ebner
b1eb022027 feat: computed fields 2022-07-11 12:26:53 -07:00
Leonardo de Moura
c568f11ddf feat: use default transparency at isDefEqProofIrrel
closes #1302
2022-07-11 12:11:10 -07:00
Leonardo de Moura
451abdf79d fix: Level.update* functions
see #1291
2022-07-10 09:16:02 -07:00
Leonardo de Moura
ba606debf7 fix: Expr.update* issue
See #1291
2022-07-10 08:33:14 -07:00
Leonardo de Moura
4b543d5edd feat: add option for disabling dsimp during simp 2022-07-10 07:57:41 -07:00
Leonardo de Moura
7553dc12c0 chore: fix tests 2022-07-10 07:43:01 -07:00
Leonardo de Moura
35018dbea2 feat: unexpanders for a[i], a[i]' h, a[i]!, and a[i]? 2022-07-10 06:47:23 -07:00
Leonardo de Moura
881589fc46 chore: remove parser workarounds 2022-07-09 16:42:39 -07:00
Leonardo de Moura
aa52eebcdc feat: add instance GetElem (Array α) USize α fun xs i => LT.lt i.toNat xs.size where 2022-07-09 16:18:29 -07:00
Leonardo de Moura
1caff852fb chore: remove getOp functions 2022-07-09 16:09:28 -07:00
Leonardo de Moura
36ebccb822 chore: fix tests 2022-07-09 15:59:44 -07:00
Leonardo de Moura
4c707d3b3c feat: use binop% to elaborate %-applications
Motivation: make sure the behavior is consistent with other arithmetic
operators.

This commit also removes the instance
```
instance : HMod (Fin n) Nat (Fin n) where
  hMod := Fin.modn
```
because we have a coercion from `Fin n` to `Nat`.
Thus, given `a : Fin n` and `b : Nat`, `a % b` is ambiguous.
2022-07-09 14:38:35 -07:00
Leonardo de Moura
305630cc23 fix: ElabAppArgs.finalize bug 2022-07-09 13:53:15 -07:00
Leonardo de Moura
0074038405 fix: missing term info 2022-07-09 12:19:10 -07:00