Commit graph

211 commits

Author SHA1 Message Date
Leonardo de Moura
64f575a2d5 perf(library/equations_compiler): performance problem for definitions that produce many equational lemmas
The new test and comment at src/library/equations_compiler/util.cpp
explains the issue.
2017-11-22 16:16:11 -08:00
Leonardo de Moura
bdc8e1ced8 feat(library/init/data/char): char as an unicode scalar value
TODO: this is the first step to have better unicode support.
2017-10-23 10:55:26 -07:00
Sebastian Ullrich
ea6a4159a9 feat(library/tactic/user_attribute,init/meta/attribute): implement parameterized user attributes 2017-09-05 23:14:34 +02:00
Sebastian Ullrich
3188c4cbcf refactor(library/tactic/user_attribute,init/meta/attribute): merge caching_user_attribute into user_attribute
The inheritance-based approach doesn't scale to a second subclass for parameterized attributes
2017-09-05 23:14:34 +02:00
Gabriel Ebner
ce509e621a refactor(library/init/algebra): remove order_pair classes 2017-08-02 14:41:35 +01:00
Leonardo de Moura
4faae27069 perf(frontends/lean): add notation #[...]
The new notation should be use to input long sequences.
Closes #1755
2017-07-21 04:20:48 -07:00
Leonardo de Moura
9b03309d83 fix(library/equations_compiler): performance problem reported by @dselsam 2017-06-27 15:24:12 -07:00
Leonardo de Moura
070a888f80 chore(library/constants): remove unnecessary constant 2017-06-27 14:56:28 -07:00
Gabriel Ebner
30a9217a78 feat(library/type_context): unfold lemmas in major premise of acc.rec 2017-06-22 08:33:11 -07:00
Leonardo de Moura
dc1a1c8540 refactor(library): has_to_string ==> has_repr
See issue #1664

This is just the first step to implement proposal described at issue #1664.
2017-06-18 18:29:19 -07:00
Leonardo de Moura
dac6eec556 feat(library/tactic): add hole_command bookkeeping 2017-06-13 21:12:29 -07:00
Johannes Hölzl
1352d4a5b3 feat(src/frontents/lean): support for coinduction command in frontend 2017-06-12 20:42:48 -07:00
Sebastian Ullrich
dd91630a83 feat(frontends/lean/user_notation): more error checking 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
20ab8feeae feat(init/meta/lean/parser): pexpr parser that does not use quoted mode 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
18063fa9ba feat(frontends/lean): user-defined notation parsers 2017-06-07 10:09:38 -07:00
Leonardo de Moura
a8173c8194 feat(library/init): heterogeneous andthen type class, and tactic.seq_focus implementation 2017-06-02 10:38:27 -07:00
Leonardo de Moura
62c24f9bb5 chore(*): remove pos_num and num from stdlib 2017-05-25 18:24:16 -07:00
Leonardo de Moura
229b730c15 feat(library/equations_compiler): invoke tactics for building well founded relation, and proving recursive calls are "decreasing" 2017-05-23 16:04:55 -07:00
Leonardo de Moura
4fbb65d9f1 feat(frontends/lean,library/equations_compiler): store tactics for generating well founded relation and decreasing proofs 2017-05-23 15:00:29 -07:00
Leonardo de Moura
f742d9c9d8 feat(library/equations_compiler/pack_domain): use psigma instead of sigma 2017-05-20 19:14:10 -07:00
Leonardo de Moura
fa863496da feat(library/equations_compiler): prove equational lemmas for auxiliary definition 2017-05-20 16:38:32 -07:00
Leonardo de Moura
737136e8fd feat(library/equations_compiler/wf_rec): apply well_founded.fix 2017-05-17 16:44:53 -07:00
Leonardo de Moura
56823a22b7 feat(library/equations_compiler/wf_rec): use has_well_founded type class to generate default well founded relation when one is not provided 2017-05-17 14:37:21 -07:00
Sebastian Ullrich
84997bf4de refactor(init/meta/expr): unify expr and pexpr 2017-05-17 10:38:12 -07:00
Sebastian Ullrich
ead6318ee0 feat(frontends/lean/elaborator): substitute reflected locals into expr quotes 2017-05-09 16:02:41 -07:00
Daniel Selsam
b7d20a333f chore(src/library/constants): rm unused constants 2017-05-04 16:34:32 -07:00
Sebastian Ullrich
b37b1fb7c6 refactor(library/type_context,frontends/lean/elaborator): move reflected code back into elaborator
Since we do not want recursive special handling of `reflected`, this seems to be
the simpler design.
2017-05-03 13:27:35 -07:00
Leonardo de Moura
ba5eccdca8 refactor(library/init/core): rename out_param => inout_param
It is really input/output.
2017-05-01 14:01:41 -07:00
Leonardo de Moura
66a1fec94e feat(library/init/category): add has_orelse type class 2017-05-01 09:58:27 -07:00
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
Sebastian Ullrich
e9a6c544af refactor(frontends/lean/{elaborator,structure_cmd}): compile structure inheritance to nested fields 2017-04-24 19:35:15 +02:00
Leonardo de Moura
0d97700c60 feat(library/compiler): add support for and.rec in the code generator 2017-04-16 13:31:37 -07:00
Sebastian Ullrich
c7b47c7b7f fix(system/io): try to fix io monad 2017-03-27 13:42:08 -07:00
Leonardo de Moura
527c8851a8 refactor(library/system/io): use type classes 2017-03-23 14:29:07 -07:00
Leonardo de Moura
60dd85719c feat(library/system/io): system.io without axioms 2017-03-22 23:36:05 -07:00
Sebastian Ullrich
421a6d6f01 feat(frontends/lean/interactive,emacs): highlight current tactic parameter 2017-03-17 18:20:44 -07:00
Daniel Selsam
538ac8d187 feat(inductive_compiler): generate injectivity lemmas 2017-03-10 22:27:18 -08:00
Sebastian Ullrich
16558bf082 refactor(library,library): rename pre_monad to has_bind 2017-03-09 20:32:25 -08:00
Sebastian Ullrich
763097dbd2 refactor(library): revise the monadic hierarchy 2017-03-09 20:30:03 -08:00
Leonardo de Moura
4ab0a6d8d2 fix(library): problems with the subtype constructor and field renaming
The problem was not detected by the test suite because of issue #1446
2017-03-08 19:42:12 -08:00
Leonardo de Moura
839645c489 feat(library/system/io): replace io.monad with io.bind, io.return and io.map 2017-03-07 16:10:47 -08:00
Sebastian Ullrich
5d68938a9c feat(frontends/lean): expr literals ```(...) 2017-03-05 08:37:16 -08:00
Sebastian Ullrich
908a7bd9f3 feat(frontends/lean/parser): expr patterns 2017-02-23 01:52:13 +01:00
Leonardo de Moura
19cf5e916b chore(script/gen_constants_cpp): generates a warning if automatically generated C++ function is not used in the source code 2017-02-21 12:05:41 -08:00
Leonardo de Moura
d1d5428808 feat(library): add check_constants.lean validation, cleanup unused names, minor stdlib fixes 2017-02-21 10:45:31 -08:00
Sebastian Ullrich
d15591a2d8 feat(library,frontends/lean): expose parser to Lean and use for parsing tactic parameters 2017-02-17 13:45:56 +01:00
Leonardo de Moura
edd5e97045 feat(frontends/lean/elaborator): coercion from (decidable) Prop to bool
This is a hard coded extra case. It is not an instance of has_coe.
Even if we change has_coe to accomodate this case, it will not be a
satisfactory solution because this coercion depends on the element and
not the type, and the element usually contains metavariables.

We should eventually write a tactic for synthesizing coercions.
2017-02-14 18:41:32 -08:00
Leonardo de Moura
1a698d9065 refactor(library/arith_instance_manager): rename to arith_instance, avoid copy&paste, and add support for norm_num 2017-02-12 19:11:58 -08:00
Rob Lewis
46a46c9ee0 feat(norm_num): handle nat subtraction as a special case 2017-02-12 17:15:08 -08:00
Leonardo de Moura
9210e45da0 feat(frontends/lean): add notation for ';' and '<|>' in the tactic interactive mode 2017-02-10 22:53:30 -08:00