Commit graph

3956 commits

Author SHA1 Message Date
Leonardo de Moura
d1c9a440d8 feat: add missing Expr.update* functions 2019-10-24 15:10:03 -07:00
Leonardo de Moura
ccfa57d657 chore: rename constructors
Before we start writing a lot of Expr code.

- `Expr.pi` does not make sense anymore.
- `Expr.elet` is weird. `«let»` is too inconvenient to write. So, I
   used `letE` short for `letExpr`. GHC avoids this issue because
   keywords are lowercase and constructors are capitalized.
2019-10-24 13:53:33 -07:00
Leonardo de Moura
0032c02247 feat: expose Expr.equal (structural equality) and adding Expr mappings aliases 2019-10-23 10:49:51 -07:00
Leonardo de Moura
c330600197 chore: add example to demonstrate that messages are computed lazily 2019-10-22 17:12:42 -07:00
Leonardo de Moura
d51c291f2a refactor: simplify traceCtx 2019-10-22 16:36:18 -07:00
Leonardo de Moura
6498055656 chore: helper instances 2019-10-22 16:18:28 -07:00
Leonardo de Moura
f88561ae68 feat: add trace! macro 2019-10-22 16:08:37 -07:00
Leonardo de Moura
45e21168d2 feat: hierarchical trace kinds 2019-10-22 15:13:57 -07:00
Leonardo de Moura
0a0bc0b7b9 fix: remove unused parameter and add missing disableTracing 2019-10-22 15:04:44 -07:00
Leonardo de Moura
16099189f2 chore: minor adjustments 2019-10-22 14:57:26 -07:00
Leonardo de Moura
13faf9fdf6 feat: add trace prefix to options 2019-10-22 14:43:02 -07:00
Leonardo de Moura
3cd8dc6366 fix: minor issues and add MonadTracer test 2019-10-22 14:33:07 -07:00
Leonardo de Moura
1418f12248 fix: reject [class] at declarations that are not inductive datatypes or structures
closes #42
2019-10-21 22:52:13 -07:00
Leonardo de Moura
870db93c8e feat: add EState.Backtrackable class
@dselsam @kha: The new class allows us to use `EState` even when part of
the state must be backtrackable. The default instance ensures that
there is no backtrackable state. The new test shows how to use it.
2019-10-21 18:39:59 -07:00
Leonardo de Moura
a8d3803089 chore: remove weird idiom 2019-10-21 17:41:23 -07:00
Leonardo de Moura
9baf91e641 feat: add Level.isEquiv 2019-10-21 10:56:59 -07:00
Leonardo de Moura
d18305297d feat: add Expr.getAppRevArgs 2019-10-21 10:49:01 -07:00
Leonardo de Moura
447482e489 refactor: use Array instead of List at mkApp and getAppArgs
Preparation for new unifier.

@dselsam: I had to make minor changes at `Synth.Lean`, and add messy
code to `Context.lean`. `Context.lean` will be deleted in the future.
So, it is not a big deal.
2019-10-21 09:12:36 -07:00
Daniel Selsam
8b7975fab8 test: add (perf) test for typeclass append 2019-10-19 18:07:37 -07:00
Sebastian Ullrich
9160949df3 test: fix test 2019-10-18 13:47:23 +02:00
Sebastian Ullrich
2866824b51 test: capture stderr as well
This might or might not give more information on randomly failing tests on CI
/cc @leodemoura
2019-10-15 17:36:28 +02:00
Leonardo de Moura
7a11f3b0a9 test: add getCtorLayout test 2019-10-11 15:11:24 -07:00
Leonardo de Moura
38f66c580b chore: fix tests 2019-10-07 15:57:02 -07:00
Leonardo de Moura
0714716477 fix: file and import names, tests and stage0
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2019-10-04 17:04:02 -07:00
Leonardo de Moura
e596089a2d chore: one module per import command 2019-10-04 12:27:47 -07:00
Daniel Selsam
1a1daf8aba fix(typeclass/context): standardize eUnify fail message 2019-10-03 17:23:53 -07:00
Daniel Selsam
a82266c652 feat(library/init/lean/typeclass): #synth with tabled resolution 2019-10-03 17:23:53 -07:00
Leonardo de Moura
cc18c0ef91 feat(library/init/lean/expr): add Expr.hasFVar and Expr.hasMVar
cc @dselsam
2019-10-02 10:07:26 -07:00
Leonardo de Moura
fdab3b90b9 refactor(library/init/data/array): new name convention for Array functions 2019-10-01 16:46:05 -07:00
Leonardo de Moura
a507145eb1 feat(library/init/lean/level): add instance : HasBeq Level 2019-10-01 09:47:44 -07:00
Leonardo de Moura
2b252a441e feat(library/init/lean/declaration): add ConstantInfo.instantiateTypeUnivParams and ConstantInfo.instantiateValueUnivParams
cc @dselsam

See new test for an example.
2019-09-30 15:46:19 -07:00
Leonardo de Moura
faebe15a7f feat(library/init/lean/expr): add efficient instantiate1
cc: @dselsam
2019-09-30 14:33:32 -07:00
Leonardo de Moura
4db4b26de6 test(tests): use #eval and move tests 2019-09-19 14:38:52 -07:00
Leonardo de Moura
b147ebad67 chore(tests/lean/run/array1): remove #exit 2019-09-19 10:47:40 -07:00
Sebastian Ullrich
f22c17e94b chore(library/init/data/string/basic): remove broken lineColumn obsoleted by FileMap 2019-09-19 18:12:51 +02:00
Sebastian Ullrich
8cb387e599 chore(tests/lean/extract): reactivate some #eval tests 2019-09-19 18:12:51 +02:00
Leonardo de Moura
306ff7d7e5 fix(library/compiler): fixes #34
`csimp` assumes constructors and `casesOn` applications match.  That
is, given `I.casesOn x ...`, then if `x` is an constructor, then it is
a constructor of the inductive datatype `I`.
The transformation `erase_irrelevant` was violating this property when
it mixes `Decidable` and `Bool`. We fix this issue by mapping
`Decidable.casesOn`, `Decidable.isTrue` and `Decidable.isFalse` to
`Bool.casesOn`, `Bool.true` and `Bool.false` respectively.
2019-09-13 10:20:50 -07:00
Leonardo de Moura
9d37f53d83 fix(tests/lean/run/new_compiler): broken test 2019-08-16 09:46:44 -07:00
Leonardo de Moura
8e37fc512b fix(library/init/data/persistentarray/basic): bug at pop
fixes #28
2019-08-14 16:14:20 -07:00
Leonardo de Moura
ae7167d626 fix(library/equations_compiler): equation compiler bug reported by @dselsam on Zulip
@kha @dselsam: I added a small repro for the bug reported by Daniel on
Zulip. The current fix is not polished at all since we will replace
the equation compiler with one implemented in Lean.  The bug is once
again on the code that handle nested `match`-expressions containing
recursive calls. We had problems in this module before, and the
current compilation strategy using auxiliary `*._match_<id>` functions
is also very inconvenient for users. They are often puzzled when they
see these auxiliary functions appearing in proof goals after unfolding
and/or simplification.  They usually don't know what to do with these
auxiliary definitions, and have no idea how they were defined and what
they correspond to if the function has several nested
`match`-expression. Right now, the best option is to use `#print
<fun-name>._match_<id>` which is far from ideal.

@kha: @dselsam and I discussed an alternative approach where we do not
create the auxiliary definitions, annotate the generated `cases_on`
applications with meta-data indicating they correspond to a nested
match, and modify the pretty printer to display these annotated
`cases_on` applications using the `match` syntax. With these
modifications, the behavior will be similar to the one in Coq where
complex `match`-expressions are reduced to atomic ones. The only
difference is that we represent these "atomic" `match`-expressions
using `cases_on` applications.
This commit uses a simpler version of this approach where we do not
create auxiliary `*._match_<id>` functions, and more importantly do
not use the dreadful `pull_nested_rec_fn` code.
2019-08-12 19:20:26 -07:00
Sebastian Ullrich
5b296cbb33 chore(tests/lean/ll_infer_type_bug): fix partial file manually 2019-08-09 11:11:34 +02:00
Sebastian Ullrich
3ed67138d5 chore(*): update equation syntax in files and old parser
for f in ../../**/*.lean; do echo $f; ./patch.lean.out $f > tmp && cat tmp > $f; done
2019-08-09 11:11:34 +02:00
Sebastian Ullrich
8f55517d8c chore(tests/lean/run/coroutine): abbreviate abbreviation 2019-08-09 11:11:34 +02:00
Sebastian Ullrich
934054b8d0 chore(tests/lean/trust0/basic): use nomatch 2019-08-09 11:11:34 +02:00
Leonardo de Moura
10fe453cf6 test(tests/lean/run/ubscalar): save UB scalar field test 2019-07-28 10:11:35 -07:00
Sebastian Ullrich
b902dc3dac fix(tests/lean/run/inline_fn): pretty-printer segfaults, disable for now 2019-07-26 12:39:35 -07:00
Sebastian Ullrich
aef4a7159b chore(*): remove obsolete leanpkg.path files 2019-07-25 17:46:53 -07:00
Leonardo de Moura
b0d0cf973d chore(tests): fix tests 2019-07-25 17:44:25 -07:00
Leonardo de Moura
40943f84f3 chore(tests): fix tests 2019-07-17 10:46:35 -07:00
Leonardo de Moura
53c946a305 chore(tests/lean): fix tests 2019-07-08 22:11:19 -07:00