Sebastian Ullrich
607227dc7f
feat: delaborator: tolerate ill-typed terms (such as IR)
2020-09-17 08:12:28 -07:00
Leonardo de Moura
544d2f4ce5
fix: kind for type metavariable
...
For example, `mkFreshExprMVar none MetavarKind.synthetic` should
create a fresh synthetic metavariable `?m` with type `?t` where `?t`
is a fresh natural metavariable. If users want a synthetic
metavariable `?t`, then it must create it themselves.
2020-09-16 08:24:15 -07:00
Leonardo de Moura
0abca5475f
refactor: move ppExpr to IO
...
@Kha I am also tracking `currNamespace` and `openDecls`.
BTW, I also tried an experiment where I added `currNamespace` and
`openDecls` to `Meta.Context`, but it looked weird. This information
is only needed in the elaborator and pretty printer.
The `PPContext` object should contain everything you need. You
can put `currNamespace` and `openDecls` in the `Delaborator.Context`.
2020-09-15 18:48:21 -07:00
Leonardo de Moura
e181c1adee
refactor: add DefEqM
...
The idea is to make clear that the field `posponed` is transient
state. It is only used during `isDefEq`.
The refactoring was motivated by a bug I found where the `posponed`
constraints were not being handled correctly. For example,
the `check (e : Expr)` method was returning `true`, but leaving pending
universe constraints at `postponed`.
cc @Kha
2020-09-12 16:42:16 -07:00
Leonardo de Moura
f28def6c5e
feat: add Meta.ppExpr
2020-09-10 17:27:14 -07:00
Leonardo de Moura
96ffd206ca
feat: add findRecArg
2020-09-08 17:25:35 -07:00
Leonardo de Moura
87db970cfa
chore: control code size explosion
2020-09-07 08:42:39 -07:00
Leonardo de Moura
936b8d34dd
chore: add auxiliary declaration to stop specialization
2020-09-07 08:30:08 -07:00
Leonardo de Moura
ddf12c91c2
fix: do not consider auxiliary declarations as local instances
2020-09-07 08:08:35 -07:00
Leonardo de Moura
36bc65385d
chore: naming convention
2020-09-07 08:03:41 -07:00
Leonardo de Moura
f30b5bdcba
chore: control code size explosion
2020-09-07 07:23:44 -07:00
Leonardo de Moura
102d2ae57d
fix: avoid unnecessary reduction
...
```lean
forallBoundedTelescope `(Nat -> IO Nat) 1 fun xs type => ...
```
should assign `IO Nat` to `type` instead of `IO.RealWorld -> ...`
2020-09-06 06:57:52 -07:00
Leonardo de Moura
12f69a78b7
chore: change meaning of lambdaTelescope
...
`lambdaTelescope` now only consumes `lambda`s.
`lambdaLetTelescope` implements the old behavior.
2020-09-04 13:35:17 -07:00
Leonardo de Moura
f34fd3e6b4
refactor: move Closure.lean to Meta
...
We will need to improve the support for let-decls. We will use
the new `trackZeta`.
2020-09-03 11:54:08 -07:00
Leonardo de Moura
ad774ae397
feat: support for tracking which let-decls have been zeta expanded
2020-09-03 11:32:46 -07:00
Leonardo de Moura
238c38fed9
feat: preserve nonDep flag at LocalDecl.ldecl
2020-09-03 09:08:59 -07:00
Leonardo de Moura
f2a6562eed
feat: validate 'let rec' types
2020-09-02 17:02:40 -07:00
Leonardo de Moura
e5c35d3a4e
feat: add AddMessageDataContext
2020-08-28 18:05:42 -07:00
Leonardo de Moura
99f3296828
refactor: simplify Util/Trace.lean
2020-08-28 17:36:44 -07:00
Leonardo de Moura
39d456cb09
feat: add polymorphic trace and logTrace
...
This commit also makes sure we always use `withContext` when logging.
2020-08-28 16:49:24 -07:00
Leonardo de Moura
62177069fd
fix: induction tactic
2020-08-28 09:18:22 -07:00
Leonardo de Moura
7a6effa54f
chore: cleanup
2020-08-27 15:47:58 -07:00
Leonardo de Moura
691e73ca3a
fix: collect metavars occurring in delayed assignments
2020-08-27 14:59:54 -07:00
Leonardo de Moura
7db6f420f5
refactor: move mkAuxDefinitionCore
2020-08-26 16:20:09 -07:00
Leonardo de Moura
813a964767
refactor: move polymorphic Meta methods back to Meta namespace
2020-08-25 14:57:58 -07:00
Leonardo de Moura
cf0149a1a7
refactor: use MonadControlT
2020-08-25 13:54:42 -07:00
Leonardo de Moura
49f5e4db20
refactor: cleanup
2020-08-24 17:47:27 -07:00
Leonardo de Moura
eaed6ba6a3
refactor: polymorphic MetaM combinators
2020-08-24 17:03:54 -07:00
Leonardo de Moura
ac565de96c
refactor: add MonadMetaM class
2020-08-24 12:17:47 -07:00
Leonardo de Moura
57a6998426
chore: minor
2020-08-24 12:17:47 -07:00
Leonardo de Moura
5b23b5302f
refactor: move TransparencyMode to its own file
2020-08-24 12:17:47 -07:00
Leonardo de Moura
143760d443
refactor: polymorphic withIncRecDepth
2020-08-24 12:17:47 -07:00
Leonardo de Moura
4f14fe3b79
refactor: polymorphic withRef
2020-08-24 12:17:47 -07:00
Leonardo de Moura
6fc935f6d1
refactor: add MonadNameGenerator
2020-08-23 19:56:01 -07:00
Leonardo de Moura
50f779e858
refactor: polymorphic setTraceState, getTraceState, etc
2020-08-23 19:10:38 -07:00
Leonardo de Moura
5ffbada3df
feat: add Lean.MonadEnv, Lean.MonadError, and Lean.MonadOptions
...
This is the first set of polymorphic methods. I will add more later,
and keep reducing code duplication.
cc @Kha
2020-08-22 16:00:43 -07:00
Leonardo de Moura
39a14aee0f
refactor: move Lean.Core.Exception to Lean.Exception
2020-08-22 13:36:15 -07:00
Leonardo de Moura
5cc173788e
chore: remove ECoreM
2020-08-21 17:29:13 -07:00
Leonardo de Moura
9b27d3201f
chore: remove liftCoreM and liftMetaM
2020-08-21 17:21:25 -07:00
Leonardo de Moura
f46c5d01b1
feat: uniform Exceptions
2020-08-21 17:02:21 -07:00
Leonardo de Moura
04eab3c705
chore: remove dead code
2020-08-21 13:08:49 -07:00
Leonardo de Moura
32a55d5b9c
refactor: remove special support for IO errors
...
They are now just regular errors.
2020-08-21 11:55:58 -07:00
Leonardo de Moura
97692be811
fix: throwError missing addContext
...
This commit also remove `Exception.kernel`
2020-08-21 11:24:46 -07:00
Leonardo de Moura
916b395d1b
chore: cleanup
2020-08-21 09:29:09 -07:00
Leonardo de Moura
05a0e7f6d0
refactor: build all main monads on top of ECoreM
2020-08-20 18:36:04 -07:00
Leonardo de Moura
87d506cb90
feat: instantiate metavariables in LocalDecls
2020-08-14 19:02:38 -07:00
Leonardo de Moura
57533726f6
feat: add mkFreshExprMVarWithId
2020-08-12 10:35:38 -07:00
Leonardo de Moura
c8ab63ea75
feat: mark auxiliary eliminators as [inline]
2020-08-10 09:41:55 -07:00
Leonardo de Moura
f934a86646
feat: add (ref : Syntax) to Meta.Exception.other
...
@Kha The Syntax is here just to provide possition information. The
goal is to improve error message location information in code such as `DepElim`.
2020-08-06 09:40:16 -07:00
Leonardo de Moura
fe0d298657
fix: mkAuxDefinition was not correctly handling delayed metavar assignments
2020-07-31 15:38:38 -07:00