Leonardo de Moura
fc7c1d1053
chore: remove unnecessary set_option
2022-06-28 17:37:10 -07:00
Sebastian Ullrich
99f5e94efe
feat: MonadExcept.ofExcept
2022-06-28 16:54:29 -07:00
Sebastian Ullrich
9816331562
chore: clean up bootstrapping cleanup
2022-06-28 16:28:36 +02:00
Sebastian Ullrich
77c6f433c7
chore: clean up bootstrapping workarounds
2022-06-28 16:01:07 +02:00
Sebastian Ullrich
89a101e9b8
refactor: remove group(·)s
2022-06-28 11:50:59 +02:00
Leonardo de Moura
34dc2572f3
fix: make sure OfScientific Float instance is never unfolded during type class resolution
...
This commit fixes issue reported at
https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/deterministic.20timeout/near/287654818
Type class resolution was diverging when trying to synthesize
```lean
HSub (optParam Float 0.0) (optParam Float 1.0) ?m.472
```
and Lean was diverging while unfolding
```lean
instance : OfScientific Float where
ofScientific m s e :=
if s then
let s := 64 - m.log2 -- ensure we have 64 bits of mantissa left after division
let m := (m <<< (3 * e + s)) / 5^e
Float.ofBinaryScientific m (-4 * e - s)
else
Float.ofBinaryScientific (m * 5^e) e
```
was being unfolded.
Anothe potential solution for the problem above is to erase the
`optParam` annotations before performing type class resolution.
2022-06-27 17:40:34 -07:00
Sebastian Ullrich
19c2644d88
chore: add more comments
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
22475b8669
refactor: introduce common TSyntax abbreviations
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
e47f248161
doc: TSyntax
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
8b4d8b8dc9
feat: TSyntax singleton kind unexpanders
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
6af00ff23e
chore: changes to placate coercions
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
d9cfda4893
refactor: make more use of quotations
...
Automatically fixes many TSyntax type errors
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
5e334b3e90
chore: postpone TSyntax adoption for some parts
...
The namespace `TSyntax.Compat` can be opened for a coercion
`Syntax -> TSyntax k` for any `k`, as otherwise this PR would never be done.
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
fe22d84143
fix: unclear TSyntax breakage
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
86cd656fc6
refactor: adapt raw syntax manipulations to TSyntax
...
Sometimes there's just no structure to work on
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
498c7a6a97
refactor: remove some unnecessary antiquotation kind annotations
...
These are just the ones I stumbled upon, there should be a lot more now
rendered obsolete by the coercions.
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
a78302243c
refactor: strengthen Syntax signatures
...
Most notable change: `Quote` is now parameterized by the target kind.
Which means that `Name` etc. could actually have different
implementations for quoting into `term` and `level`, if that need ever
arises.
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
f90e4ae30c
feat: more TSyntax API & coercions
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
a12cde41e1
chore: work around macro limitations
...
It would be nice if `macro` was as expressive as syntax quotations, but
right now it's not.
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
43ba121e98
feat: upgrade TSyntax to union of kinds
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
e6954bb4f3
fix: quote Name.anonymous
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
df499a5b64
feat: early coercion from TSyntax to Syntax
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
c2b4c37792
refactor: make Init.Coe independent of Init.Notation
2022-06-27 22:37:02 +02:00
Sebastian Ullrich
8bbae8b8da
feat: introduce TSyntax
2022-06-27 22:37:02 +02:00
Leonardo de Moura
6ebae968a7
feat: use IO.getRandomBytes to initialize random seed
...
See https://github.com/leanprover/lean4-samples/pull/2
2022-06-27 13:01:20 -07:00
Leonardo de Moura
fc25689f21
feat: add Syntax.eraseSuffix?
2022-06-27 10:30:57 -07:00
Sebastian Ullrich
5a0c3b8d80
fix: String.isNat
2022-06-25 18:42:08 +02:00
Wojciech Nawrocki
aacfd11508
feat: boolean inequality lemmas
2022-06-25 11:18:09 +02:00
Leonardo de Moura
220d2e3816
feat: add filterTR and [csimp] theorem
2022-06-24 06:40:38 -07:00
Gabriel Ebner
733f220ee3
feat: $[...]* antiquotations for sepByIndent
2022-06-24 10:59:55 +02:00
Leonardo de Moura
4d1c6dd557
feat: add zeta conv tactic
2022-06-22 19:15:10 -07:00
Leonardo de Moura
986de33097
fix: fixes #1230
2022-06-20 09:58:27 -07:00
E.W.Ayers
a7c33a963f
doc: docstrings for List.isPrefixOf
2022-06-17 17:47:51 -07:00
Leonardo de Moura
d56163bd0e
refactor: resolveNamespace now return a List
2022-06-16 17:16:36 -07:00
François G. Dorais
bc206b2992
fix: LawfulBEq class
...
make arguments implicit and protect `LawfulBEq.rfl`
2022-06-16 15:33:32 -07:00
Leonardo de Moura
8d9428261e
chore: remove Fix.lean
...
see #1208
2022-06-16 15:30:47 -07:00
Leonardo de Moura
d2888a49d7
chore: remove old hack that is not needed anymore
2022-06-15 16:36:54 -07:00
Leonardo de Moura
f6d1e48cb8
fix: constant => opaque issues
2022-06-14 17:19:54 -07:00
Leonardo de Moura
02c4e548df
feat: replace constant with opaque
2022-06-14 17:02:59 -07:00
Jakob von Raumer
d7cb93e9e4
feat: allow conv mode's arg command to access implicit arguments
2022-06-14 16:15:38 -07:00
Leonardo de Moura
daeb271678
feat: update induction and cases syntax
...
We can now write
```
induction x with
| foo | bar => ...
| boo => ...
```
TODO: expand alternatives containing multiple LHSs.
2022-06-14 11:25:15 -07:00
Wojciech Nawrocki
46257dfb0e
feat: show bitwise terminates
2022-06-12 14:01:05 -07:00
Wojciech Nawrocki
4d05803782
feat: WF lemma for Nat division
2022-06-12 14:01:05 -07:00
Wojciech Nawrocki
2a53857928
feat: add strong Nat induction principle
2022-06-12 14:01:05 -07:00
Wojciech Nawrocki
ff15e31e85
refactor: remove redundant theorem
2022-06-12 14:01:05 -07:00
Leonardo de Moura
041827bed5
chore: unused variables
2022-06-07 17:54:10 -07:00
Leonardo de Moura
c2ddebc193
chore: unused variables
2022-06-07 16:47:04 -07:00
Sebastian Ullrich
f9e2a65f75
chore: further cleanup
...
Co-authored-by: Gabriel Ebner <gebner@gebner.org>
2022-06-07 16:37:45 -07:00
Sebastian Ullrich
897a5de6ac
chore: revert some questionable signature changes
2022-06-07 16:37:45 -07:00
Sebastian Ullrich
fb2a2b3de2
fix: fixup previous commit
2022-06-07 16:37:45 -07:00