Commit graph

11891 commits

Author SHA1 Message Date
Sebastian Ullrich
876a2bee46 feat(frontends/lean/elaborator): flag expr quotes containing universe params 2017-03-05 08:37:16 -08:00
Sebastian Ullrich
5d68938a9c feat(frontends/lean): expr literals ```(...) 2017-03-05 08:37:16 -08:00
Sebastian Ullrich
4bad1bea82 chore(script/gen_*): +x 2017-03-05 08:37:16 -08:00
Sebastian Ullrich
3dd7a69068 chore(bin/lean-gdb): fix mismatched type? 2017-03-05 08:37:16 -08:00
Simon Hudon
b34eac6f1d feat(library/init/data/nat): add theorem decomposing numbers into quotient and remainder 2017-03-05 08:29:34 -08:00
Leonardo de Moura
471c3644a3 chore(library/init/data/option/basic): add lift for option_t 2017-03-05 08:17:55 -08:00
Leonardo de Moura
aeb370ac6b feat(library/init/data/bool/lemmas): add more simp lemmas for bool 2017-03-04 17:01:52 -08:00
Leonardo de Moura
c812e12651 chore(library/init/data/list/lemmas): remove old comment 2017-03-04 16:31:31 -08:00
Leonardo de Moura
05962604f1 feat(library/init/data/bool): add basic simp lemmas for bool 2017-03-04 16:31:16 -08:00
Leonardo de Moura
5189a002bf chore(tests/lean/run/ginductive_induction_tactic): remove using ...
Otherwise, we are not testing anything.
2017-03-04 15:15:39 -08:00
Leonardo de Moura
35952f2941 test(tests/lean/run/ginductive_pred): mutually inductive predicates
@dselsam We do not have a "story" for this kind of inductive definition.
2017-03-04 15:06:36 -08:00
Leonardo de Moura
d50da0feb7 feat(library/tactic/induction_tactic): add support for ginductive in the induction tactic 2017-03-04 14:55:35 -08:00
Leonardo de Moura
c456bceafa feat(library/tactic/cases_tactic): remove m_dep_elim since we are now always using dependent eliminators 2017-03-04 14:35:42 -08:00
Leonardo de Moura
1ae23708f5 test(tests/lean/run/nested_inductive_code_gen): add code gen test 2017-03-04 14:23:55 -08:00
Leonardo de Moura
22988bb95d feat(library/compiler): avoid pack/unpack overhead produced by the inductive_compiler in the code generator
TODO: make sure the user is not manually using cases_on for the
auxiliary datatype generated by the inductive_compiler to
destruct nested inductives.
2017-03-04 13:54:44 -08:00
Leonardo de Moura
060d6b66b2 fix(library/inductive_compiler/ginductive): incorrect assertion 2017-03-04 13:31:34 -08:00
Leonardo de Moura
b74740648e fix(library/tactic): fixes #1414 2017-03-03 20:50:00 -08:00
Daniel Selsam
4e1967c242 feat(inductive_compiler): is_pack and is_unpack API 2017-03-03 20:39:47 -08:00
Daniel Selsam
dc5b57bff6 fix(inductive_compiler/ginductive.cpp): populate new fields of entry 2017-03-03 20:39:39 -08:00
Daniel Selsam
616a4ce5c5 fix(inductive_compiler/ginductive.cpp): debug code did not compile 2017-03-03 20:39:27 -08:00
Leonardo de Moura
0768bb28f4 chore(library/init/wf): rename parameter 2017-03-03 16:56:40 -08:00
Daniel Selsam
e9c05f727c feat(inductive_compiler): APIs for simulated constructor offsets 2017-03-03 12:43:48 -08:00
Jeremy Avigad
f460cbdf2e feat(library/init/classical): simpler choice axiom 2017-03-03 12:43:31 -08:00
Leonardo de Moura
d9da6f05b5 fix(library/tactic/cases_tactic): issue reported by @johoelzl at slack 2017-03-02 18:00:55 -08:00
Daniel Selsam
5ef892bb45 feat(inductive_compiler): cases_on for mutual and nested 2017-03-02 16:08:00 -08:00
Daniel Selsam
9590f2b7d0 feat(inductive_compiler): support nested inductive propositions 2017-03-02 16:01:45 -08:00
Leonardo de Moura
259d9271ab fix(library/equations_compiler): use ginductive API
fixes #1334
2017-03-02 15:48:03 -08:00
Leonardo de Moura
6b3e651de7 fix(library/util): get_datatype_level should not assume inductive datatype result type is a sort
It may be something that is reducible to a sort.
2017-03-02 11:42:16 -08:00
Leonardo de Moura
525242561a fix(library/init/meta/tactic): use zeta reduction by default in the abstract tactic
Abstracting let-exprs may produce type errors.
In the future we may consider another strategy for `abstract`.
First, we try to abstract the `let`, then if it fails, we expand.
Not sure if this is a good idea.
2017-03-02 11:34:28 -08:00
Leonardo de Moura
b1848efbc4 chore(library/init/meta): add head prefix to head reduction tactics, and add zeta tactic (that applies zeta reduction to all subterms) 2017-03-02 10:55:38 -08:00
Sebastian Ullrich
b9dc1c251e fix(library/inductive_compiler/ginductive_decl): assertion 2017-03-02 08:02:55 -08:00
Sebastian Ullrich
852df8872b fix(library/constructions/drec): assertion 2017-03-02 08:01:38 -08:00
Leonardo de Moura
d8371a4b0d feat(library/data/hash_map): avoid read' and write' operations that require an extra test 2017-03-01 22:06:48 -08:00
Daniel Selsam
1f6306d068 perf(library/inductive_compiler): simplification with sizeof lemmas 2017-03-01 21:13:20 -08:00
Jeremy Avigad
4108e5c98b feat(library/init/classical): replace strong indefinite description with indefinite description 2017-03-01 21:13:03 -08:00
Johannes Hölzl
f44cbb896c fix(src/library/equations_compiler/elim_match): handle mixing of inaccessible terms and variables 2017-03-01 21:12:42 -08:00
Leonardo de Moura
04991692bf feat(library/init/data/nat/lemmas): aux lemmas 2017-03-01 20:28:27 -08:00
Leonardo de Moura
1542cd750f feat(library/tactic/induction_tactic): use drec in the induction tactic
The new test failed before this change.
2017-03-01 18:34:24 -08:00
Leonardo de Moura
e9f18502a7 chore(library/user_recursors): add drec_on and dcases_on 2017-03-01 15:56:06 -08:00
Leonardo de Moura
1ded3b70b8 feat(library/constructions/drec): add dcases_on 2017-03-01 15:46:19 -08:00
Leonardo de Moura
2fb5f6a49e feat(library/init/meta): add subst_vars tactic 2017-03-01 15:11:17 -08:00
Leonardo de Moura
132a629eb7 fix(library/tactic/induction_tactic): use whnf when inferring C.rec name 2017-03-01 14:29:26 -08:00
Leonardo de Moura
7b0a18167b feat(library/constructions/drec): add drec_on and refactor 2017-03-01 14:12:10 -08:00
Leonardo de Moura
5fa7d765ac chore(emacs/lean-server): remove leftover from experiment 2017-02-28 22:57:20 -08:00
Leonardo de Moura
17556758cb feat(library/constructions,library/inductive_compiler): automatically generate dependent eliminator for inductive predicates
The dependent eliminator for an inductive predicate C is called C.drec

TODO: construct dcases_on and drec_on using C.drec

We need this recursor for implementing dependent elimination for
inductive predicates.

We don't need to define acc.drec and eq.drec in the standard library anymore.
2017-02-28 20:58:04 -08:00
Leonardo de Moura
cad379333d feat(util/memory_pool): put limit on the size of memory_pool free_lists
See #1405

Memory consumption is still high, but I didn't manage to cross the 2Gb
limit anymore with this commit even after hundreds of modifications.

@gebner I'm not seeing a big difference betwee Lean without memory_pool,
with bounded memory_pool and unbounded memory_pool. We may even consider
removing it in the future after a more careful benchmarking.

In the benchmark (https://gist.github.com/leodemoura/b27fb4203a13a67274b388a602149303),
I'm getting the following numbers:

- No memory_pool: runtimes between 3.532s - 3.556s

- With memory_pool bounded by 8192: runtimes between 3.32s - 3.44s

- With memory_pool (with no limit): runtimes between 3.32s - 3.44s

On the other hand, the small object allocator makes a big difference.
I used your list_rev.lean example.

- with:    2.62s
- without: 3.75s
2017-02-28 15:16:43 -08:00
Leonardo de Moura
1fa1312c57 chore(CMakeLists,frontends/lean): add SAVE_SNAPSHOT=OFF SAVE_INFO=OFF compilation options 2017-02-28 12:09:19 -08:00
Gabriel Ebner
f5ae60e667 feat(init/init): write allocation stats to stderr 2017-02-28 11:56:52 -08:00
diakopter
cbaf060a80 chore(library): override warning 2017-02-28 11:24:21 -08:00
Leonardo de Moura
db5b709d9c feat(CMakeLists,util): add CUSTOM_ALLOCATORS=OFF compilation option 2017-02-28 11:13:54 -08:00