Commit graph

3605 commits

Author SHA1 Message Date
Leonardo de Moura
bcfaeaceab feat: change ite and dite argument order
Motivation: make sure `propagateExpectedType` heuristic is applied in
the new frontend when processing them.
2020-02-03 14:11:29 -08:00
Leonardo de Moura
a474850f5e feat: use automatic liftM at ensureHasType 2020-02-03 13:06:36 -08:00
Leonardo de Moura
48acc748ef feat: improve automatic liftM at do blocks
We now don't need to use `decide` in the following example:

```
def pred (x : Nat) : IO Bool := do
pure $ decide $ (← g 1) > 0
```
2020-02-03 12:16:57 -08:00
Leonardo de Moura
ba915d90f5 feat: do not enable constApprox in the combinator approxDefEq 2020-02-03 11:50:40 -08:00
Leonardo de Moura
a134db5e07 feat: add Coe instances for monads 2020-02-03 11:41:00 -08:00
Sebastian Ullrich
4279df4170 perf: special-case antiquotation syntax in Pratt parser to avoid choice nodes
fixes #99
2020-02-03 09:43:41 -08:00
Leonardo de Moura
17cc925115 feat: change liftMethod notation
cc @Kha
2020-02-03 09:38:05 -08:00
Leonardo de Moura
f8bfe88d6b fix: consume unnecessary let-decls at isDefEq
Make sure we solve unification constraints such as `(let x := v; ?m) =?= ?m`
2020-02-02 21:54:44 -08:00
Leonardo de Moura
2ad065eb93 feat: add expandNonAtomicExplicitSource and getStructName 2020-02-02 21:24:14 -08:00
Leonardo de Moura
f40129ad8d fix: precedence 2020-02-02 17:37:46 -08:00
Leonardo de Moura
c6b3b1f6f0 chore: add StructInst skeleton 2020-02-02 17:36:43 -08:00
Leonardo de Moura
4427d4468b feat: add modifyOp 2020-02-02 17:30:56 -08:00
Leonardo de Moura
cdb7e0cfae feat: add structInstLVal 2020-02-02 17:30:36 -08:00
Leonardo de Moura
2abfa1bcff fix: closes #108 2020-02-01 23:17:00 -08:00
Leonardo de Moura
8487216b1e feat: fallback to constApprox when foApprox fails 2020-02-01 22:50:29 -08:00
Leonardo de Moura
8de49b157c feat: add new approximation at isDefEq 2020-02-01 22:38:58 -08:00
Leonardo de Moura
6252b07735 refactor: make sure CheckAssignmentM can use MetaM 2020-02-01 21:29:23 -08:00
Leonardo de Moura
a7c8978d81 feat: insert liftM automatically in do notation when needed
@Kha The new example demonstrates the feature in action.
I added a comment explaining why it is more effective than relying on coercions.
2020-02-01 17:33:04 -08:00
Leonardo de Moura
57f62c4bec chore: use MacroM 2020-02-01 14:47:10 -08:00
Leonardo de Moura
a370eb3167 feat: try macros first at elabCommand 2020-02-01 01:03:35 -08:00
Leonardo de Moura
cd4ec6313e chore: try macros first 2020-02-01 00:53:49 -08:00
Leonardo de Moura
ca919c2021 refactor: move instance to LeanInit 2020-02-01 00:52:52 -08:00
Leonardo de Moura
3dfc93550a feat: add liftMacroM
We implement `expandDoElems` using `MacroM`.
2020-02-01 00:26:42 -08:00
Leonardo de Moura
b332d5e74d feat: add proper withFreshMacroScope to MacroM
This is useful, for example, for users that want to write recursive
procedural macros.
2020-02-01 00:12:13 -08:00
Leonardo de Moura
d8c738bef8 feat: elaborate do notation 2020-01-31 20:11:06 -08:00
Leonardo de Moura
4b0284778c feat: expand ^(...) notation 2020-01-31 18:21:28 -08:00
Leonardo de Moura
34a6029a28 feat: expand do elements 2020-01-31 17:39:32 -08:00
Leonardo de Moura
adc8b7f447 chore: missing attribute 2020-01-31 17:39:20 -08:00
Leonardo de Moura
9a505a0900 chore: name instance 2020-01-31 17:39:00 -08:00
Leonardo de Moura
398aa32f4d refactor: move elabDo to its own file 2020-01-31 14:40:58 -08:00
Leonardo de Moura
b604eb997a feat: add lift notation
@Kha The motivation is to avoid conflicts with the power operator.
I am assuming users will write `2^n` and `2^(n+1)`. So, we can't use
the space sensitiviy trick nor the token `^(`. So, I am using `(^` for
now.
2020-01-31 14:37:39 -08:00
Leonardo de Moura
61f5bdf09b feat: MutQuot basic definition 2020-01-31 10:56:15 -08:00
Leonardo de Moura
21618361b7 refactor: remove ParserKind 2020-01-30 20:56:46 -08:00
Leonardo de Moura
6b1e64d7ea chore: prepare for refactoring 2020-01-30 20:41:10 -08:00
Leonardo de Moura
54bdddb98f fix: toParserDescrAux 2020-01-30 20:38:14 -08:00
Leonardo de Moura
31ebccea58 chore: remove ParserDescr.pushLeading 2020-01-30 19:04:07 -08:00
Leonardo de Moura
410d295429 refactor: remove unnecessary pushLeading, add ParserDescr.trailingNode 2020-01-30 18:32:28 -08:00
Leonardo de Moura
72ff3da6cd refactor: preparing to remove ParserKind 2020-01-30 17:31:53 -08:00
Leonardo de Moura
3f32d9eb0b fix: closes #111 2020-01-30 14:09:47 -08:00
Leonardo de Moura
50327205c9 chore: erase macro scopes
cc @Kha
2020-01-30 12:22:27 -08:00
Leonardo de Moura
2f0ac98b51 feat: extend scope of cdot notation 2020-01-30 11:42:37 -08:00
Leonardo de Moura
fe6502493b chore: use macros instead of elab
@Kha The motivation is to avoid code duplication. The `match`
elaborator will need a `elabPattern`. We can use the macros for
`elabTerm` and `elabPattern`.
2020-01-30 10:58:23 -08:00
Leonardo de Moura
5d3db23d4b chore: remove hack 2020-01-30 10:10:46 -08:00
Leonardo de Moura
38cfa1dcb6 feat: add elabMatch skeleton 2020-01-30 10:02:15 -08:00
Leonardo de Moura
018891b168 fix: subgoal order at hasMonadLiftTTrans 2020-01-30 09:58:21 -08:00
Leonardo de Moura
d11c2321c8 chore: precedence of nested parsers 2020-01-30 08:58:49 -08:00
Sebastian Ullrich
470e1623de chore: hide "expected '$'" 2020-01-30 08:56:14 -08:00
Sebastian Ullrich
b818994bbe fix: do not swallow errors from parser interpreter
@leodemoura I think we should only use `throwUnsupportedSyntax` in the
top level `match_syntax` of a transformer/elaborator
2020-01-30 08:56:14 -08:00
Sebastian Ullrich
9160c561c1 feat: postfix syntax for optional syntax parser 2020-01-30 08:56:14 -08:00
Leonardo de Moura
0c4030137f feat: simplify Coe again
Users may add the expensive instances if they want.
The goal is to make sure the default configuration is solid, and
covers all examples we really want to support.

cc @kha @dselsam
2020-01-29 22:08:42 -08:00