Commit graph

190 commits

Author SHA1 Message Date
Leonardo de Moura
3fd2250799 feat: add higherOrderOutParam to ParamInfo
Helper info for #1299
2022-07-11 18:52:01 -07:00
Leonardo de Moura
709f22c8e4 feat: add field dependsOnHigherOrderOutParam to ParamInfo
See issue #1299
2022-07-11 17:49:49 -07:00
Gabriel Ebner
a8cab84735 refactor: use computed fields for Expr 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
Leonardo de Moura
55ad7beb8d feat: add coercion placeholder for applications that return an output parameter of a local instance 2022-07-06 15:42:39 -07:00
Leonardo de Moura
2446c64a99 chore: cleanup 2022-07-04 07:15:04 -07:00
Leonardo de Moura
88fc0b2503 fix: isAssigned-like functions should set usedAssignment 2022-07-04 06:20:37 -07:00
Leonardo de Moura
6b2d2ffac6 fix: preserve usedAssignment flag when replacing MetavarContext 2022-07-04 05:49:54 -07:00
Leonardo de Moura
a1413b8fa1 feat: cache failures at isDefEq
We can compile Lean with these changes, but 3 tests are still broken.
This cache is used to address a performance issue reported at
  https://leanprover.zulipchat.com/#narrow/stream/270676-lean4/topic/deterministic.20timeout.20with.20structures/near/288180087
2022-07-03 21:52:01 -07:00
Leonardo de Moura
aae657571f doc: docstrings for src/Lean/Meta/Basic.lean 2022-07-03 15:32:15 -07:00
Leonardo de Moura
2ebcf29cde chore: use a[i]! for array accesses that may panic 2022-07-02 15:12:05 -07:00
Leonardo de Moura
e9e75af834 doc: Lean/Meta/Basic.lean
Add some docstrings
2022-06-30 13:32:19 -07:00
E.W.Ayers
cc9293af09 doc: isDefEq explain mvar levels 2022-06-24 15:24:52 -07:00
Leonardo de Moura
f6d1e48cb8 fix: constant => opaque issues 2022-06-14 17:19:54 -07:00
Leonardo de Moura
041827bed5 chore: unused variables 2022-06-07 17:54:10 -07:00
Sebastian Ullrich
ae7b895f7a refactor: unname some unused variables 2022-06-07 16:37:45 -07:00
Leonardo de Moura
e997cd94c6 chore: style 2022-05-31 06:04:48 -07:00
Leonardo de Moura
6af1da450e feat: disable only eta for classes during TC resolution
closes #1123
2022-04-26 08:20:39 -07:00
Leonardo de Moura
7d99f6f555 perf: isClassQuick? was incorrectly producing undef
Then `isClassExpensive?` was being invoked too often. In some
benchmarks the performance hit was substantial. For example,
in the new test `state8.lean`. The runtime on my machine went from 2s
to 0.76s.
2022-04-09 10:38:49 -07:00
Leonardo de Moura
6e02514eee chore: style 2022-04-09 10:27:31 -07:00
Leonardo de Moura
cd0d7e676f chore: rename renameMVar => setMVarUserName 2022-04-07 13:50:58 -07:00
Leonardo de Moura
46ce3013d0 feat: cleanup local context before elaborating match alternatives RHS 2022-03-29 18:52:07 -07:00
E.W.Ayers
534aa88188 doc: MetaM 2022-03-24 16:57:42 -07:00
Leonardo de Moura
6007147d71 fix: allow universes to be postponed further
closes #1058
2022-03-22 13:57:58 -07:00
Leonardo de Moura
3193acecfa fix: flush the CoreM and MetaM caches at modifyEnv
This fix may impact performance. Note that we don't need to flush the
cache if we are "adding" stuff to the environment. We only need to
flush the caches if the change is not monotonic. BTW, most of the
changes are monotonic. I think this is why we did not hit this bug before.

We may also move all these caches to an environment extension. It is
an easy way to make sure we preserve the cache when extending the
environment.

I tried a few benchmarks and did not notice a significant difference.

cc @kha @gebner

fixes #1051
2022-03-17 16:02:30 -07:00
Leonardo de Moura
0bd9de1cb9 perf: add InstantiateLevelCaches for types and values at CoreM 2022-03-15 17:42:38 -07:00
Leonardo de Moura
ca253c43e1 refactor: pattern elaboration
We don't use the following hack anymore:
-  /- HACK: `fvarId` is not in the scope of `mvarId`
-     If this generates problems in the future, we should update the metavariable declarations. -/
-  assignExprMVar mvarId (mkFVar fvarId)

This hack was corrupting the `InfoTree`.
2022-03-09 18:19:14 -08:00
Leonardo de Moura
50ae170bcc feat: allow mkLambdaFVars and mkForallFVars to abstract unassigned metavars too 2022-03-09 11:27:58 -08:00
Leonardo de Moura
1263cea6af feat: add support for unassigned metavariables at dependsOn 2022-03-09 11:27:58 -08:00
Leonardo de Moura
82bce7ebec fix: declare local instaces occurring in patterns 2022-02-12 12:01:08 -08:00
Leonardo de Moura
123e0f42e9 feat: support partial and over applications at WF/PackDomain.lean
closes #1013
2022-02-11 09:28:17 -08:00
Leonardo de Moura
a028a69159 feat: cache isProp and isDecInst at FunInfo 2022-02-04 17:57:28 -08:00
Leonardo de Moura
bac91b9b5b chore: remove arbitrary 2022-01-15 12:14:27 -08:00
Leonardo de Moura
b6fbdd8679 feat: add Meta.Context.canUnfold? 2021-12-18 08:25:56 -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
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
851ac3809e feat: extend isInductivePredicate 2021-10-25 12:37:04 -07:00
Leonardo de Moura
91d2f6d4fc feat: add cleanup tactic 2021-10-06 19:54:28 -07:00
Leonardo de Moura
def7641926 feat: add helper methods for checking dependencies 2021-10-06 19:04:02 -07:00
Leonardo de Moura
5fe40fbccf refactor: add sortFVarIds to Meta/Basic.lean 2021-09-20 11:32:53 -07:00
Leonardo de Moura
0726b85adb feat: add option for disabling Offset.lean 2021-09-12 18:37:25 -07:00
Leonardo de Moura
445cc3085f refactor: avoid Name, MVarId, and FVarId confusion 2021-09-07 19:06:50 -07:00
Leonardo de Moura
3714cf16ec refactor: lazy evaluation for <|>
see #617
2021-09-07 17:06:10 -07:00
Leonardo de Moura
55f01fb6e1 feat: elaborate binop_lazy% 2021-09-07 13:30:09 -07:00
Leonardo de Moura
5a7044365b feat: add instances Alternative MetaM and Alternative TacticM 2021-08-22 22:29:09 -07:00
Leonardo de Moura
d0d7799a7b doc: document (and rename) the new configuration option ignoreLevelMVarDepth 2021-08-18 20:38:18 -07:00
Leonardo de Moura
99e8a98f06 feat: allow universes metavariables from any depth to be assigned when ignoreLevelDepth is true
We set `ignoreLevelDepth` to true during type class resolution.
2021-08-18 20:20:51 -07:00
Sebastian Ullrich
16026e9edd perf: restore monad instance specialization hack 2021-08-12 21:09:09 +02:00