lean4-htt/src/library/inductive_compiler
Leonardo de Moura 5cef84709f refactor(library): avoid auxiliary definitions such as add/mul/le/etc
See Section "Other goodies" at
https://github.com/leanprover/lean/wiki/Refactoring-structures

This commit also improves the support for projections in the
unifier/matcher.

Now, we consider the extra case-split for projections.
Given a projection `proj`, and the constraint `proj s =?= proj t`, we need to try first `s =?= t` and if it fails, then try to reduce.
This is needed in the standard library because we now have constraints such as:
```
@has_le.le ?A ?s ?a ?b  =?=  @has_le.le nat nat.has_add x y
```
If we reduce the right hand side, we get the unsolvable constraint
```
@has_le.le ?A ?s ?a ?b  =?=  nat.le x y
```
Before this change, the constraint was `@le ?A ?s ?a ?b  =?=  @le nat nat.has_add x y`, and we already perform a case-split in this case.
Moreover, projections were eagerly reduced whenever possible.
The extra case-split generates a performance problem in several tests. For example `fib 8 = 34` was timing out.
I worked around this issue by performing the case-split only when the constraint contains meta-variables.
There are also minor issues. Example. `<` is notation for `has_lt.lt`, but `>` is for `gt`.
2017-05-01 08:52:19 -07:00
..
add_decl.cpp feat(inductive_compiler): get_ginductive_num_indices 2017-03-06 10:53:58 -08:00
add_decl.h feat(frontends/lean): force user to use meta keyword on meta inductive/structure/class 2016-09-29 17:56:35 -07:00
basic.cpp feat(library): do not generate C.destruct (for structures), and C.induction_on (for structures and inductive datatypes) 2017-03-15 14:45:13 -07:00
basic.h feat(frontends/lean): force user to use meta keyword on meta inductive/structure/class 2016-09-29 17:56:35 -07:00
CMakeLists.txt feat(src/library/inductive_compiler): support for nested inductive types 2016-09-16 12:50:59 -07:00
compiler.cpp perf(library/inductive_compiler): simplification with sizeof lemmas 2017-03-01 21:13:20 -08:00
compiler.h perf(library/inductive_compiler): simplification with sizeof lemmas 2017-03-01 21:13:20 -08:00
ginductive.cpp feat(inductive_compiler): API for is_ginductive_inner_* 2017-03-06 14:01:59 -08:00
ginductive.h feat(inductive_compiler): API for is_ginductive_inner_* 2017-03-06 14:01:59 -08:00
ginductive_decl.cpp fix(library/util): get_datatype_level should not assume inductive datatype result type is a sort 2017-03-02 11:42:16 -08:00
ginductive_decl.h feat(inductive_compiler): API for is_ginductive_inner_* 2017-03-06 14:01:59 -08:00
init_module.cpp feat(src/library/inductive_compiler): support for nested inductive types 2016-09-16 12:50:59 -07:00
init_module.h
mutual.cpp feat(inductive_compiler): generate injectivity lemmas 2017-03-10 22:27:18 -08:00
mutual.h perf(library/inductive_compiler): simplification with sizeof lemmas 2017-03-01 21:13:20 -08:00
nested.cpp refactor(library): avoid auxiliary definitions such as add/mul/le/etc 2017-05-01 08:52:19 -07:00
nested.h perf(library/inductive_compiler): simplification with sizeof lemmas 2017-03-01 21:13:20 -08:00
util.cpp fix(frontends/lean/structure_cmd): call inductive compiler without params in type 2017-03-06 14:01:46 -08:00
util.h fix(frontends/lean/structure_cmd): call inductive compiler without params in type 2017-03-06 14:01:46 -08:00