Commit graph

272 commits

Author SHA1 Message Date
Leonardo de Moura
160b7e8847 refactor(library/init/meta/expr): local_const will have only one field
In Lean3, we supported two kinds of local constant:
context-less (inherited from Lean2) and context-based (type,
binder-info and pretty printing name are stored in the context).
The context-less was used in the kernel and a few modules we kept when
we moved from Lean2 to Lean3. Even if we keep the hybrind
representation, we should not expose the context-less to users.
2018-05-21 15:36:09 -07:00
Leonardo de Moura
d04f0b2022 chore(library/init/meta): remove old code 2018-05-21 15:30:12 -07:00
Leonardo de Moura
afd018d7cc chore(*): remove several tactics 2018-05-21 06:53:01 -07:00
Leonardo de Moura
0955962f65 chore(*): remove some unnecessary files and tactics 2018-05-21 06:29:50 -07:00
Leonardo de Moura
92ff42776c chore(library/tactic): remove match_tactic 2018-05-20 17:33:31 -07:00
Leonardo de Moura
d92679f969 refactor(*): replace name with lean.name 2018-05-20 09:42:44 -07:00
Leonardo de Moura
a52b418452 refactor(*): mk sure old name has same shape of new lean.name type 2018-05-20 08:48:48 -07:00
Leonardo de Moura
8a6d2125b3 chore(library/init/control/combinators): remove top-level mmap and related combinators
The top-level `mmap` should use the `traversable` typeclass that will be
defined in the future.
2018-05-09 15:49:13 -07:00
Leonardo de Moura
3be7540efe chore(library/init): use mfor instead of mmap' 2018-05-09 15:41:53 -07:00
Leonardo de Moura
d85c30fde1 perf(library/init/data): mark usize, uint16, uint32 and uint64 as [irreducible]
Without these annotations, Lean will timeout when trying to synthesize
the type class instance `decidable_eq uint32`. The type class resolution
problem will produce the unification problem:
```
decidable (@eq uint32 a b) =?= decidable (@eq usize ?x ?y)
```
which Lean tries to solve by assigning `?x := a`.
During the assignment, the types of `?x` and `a` are unified with "full
force". Thus, we get the constraint
```
usize_sz =?= uint32_sz
```
which will take forever to be solved when peforming the computation in
unary arithmetic.

Remark: this commit also makes sure that `type_context` will not unfold
irreducible definitions when trying to unify/match the types.

The new test `type_class_performance1.lean` exposes the problem fixed
by this commit.
2018-05-07 18:07:04 -07:00
Leonardo de Moura
d5fe509c36 chore(*): remove end after each match-expression
`end` is not optional anymore
2018-05-04 11:30:06 -07:00
Leonardo de Moura
ead68376b7 chore(library/init/meta): remove @[derive] and mk_has_reflect_instance 2018-04-30 13:12:10 -07:00
Leonardo de Moura
0aceeaf307 chore(library/init/meta): define has_reflect instances manually 2018-04-30 13:10:33 -07:00
Leonardo de Moura
77d3a788e8 refactor(init): init/category ==> init.control 2018-04-27 08:33:08 -07:00
Leonardo de Moura
c427fb4086 refactor(*): create library/init/lean folder
The new folder will contain the new parser, macro expander and compiler.
This commit also renames the namespace for the old parser `lean3.parser`
2018-04-27 08:02:40 -07:00
Leonardo de Moura
a2f0bf7c1b chore(*): disable SMT tactic framework and backward chaining 2018-04-10 12:05:51 -07:00
Leonardo de Moura
2889482fe9 fix(library/init/meta/interactive): fixes #1943 2018-03-06 17:36:18 -08:00
Leonardo de Moura
c0267727a8 fix(library/init/meta): mk_fresh_name should not be used to create user facing names
The tactic `mk_fresh_name` is used to create internal unique ids.
We should not use them to create (temporary) user facing
names. Reasons:
1- They are "cryptic".
2- They are not very stable. Minor changes in Lean may change the
value returned and may break proofs that rely on these fresh names.
2018-02-26 10:49:53 -08:00
Leonardo de Moura
21812768b0 fix(library/init/meta/interactive): fixes #1889 2018-02-23 12:39:11 -08:00
Leonardo de Moura
46ed0ad677 refactor(library/congr_lemma): remove mk_rel_iff_congr_lemma and mk_rel_eq_congr_lemma 2018-02-21 15:04:20 -08:00
Leonardo de Moura
9331945e8b fix(library/init/meta/interactive): alternative fix for issue at #1913
We also document the problem to make sure we don't spend time again
trying to understand the workaround. This is an instance of a bigger
problem that should be addressed later.
2018-01-28 09:07:11 -08:00
Leonardo de Moura
368f17d0b1 feat(library/tactic/simplify): add simp! 2018-01-16 17:29:24 -08:00
Leonardo de Moura
cebde17bec feat(library/tactic/simplify): simp reduces c a_1 ... a_n = c b_1 ... b_n into a_1 = b_1 /\ ... /\ a_n = b_n 2018-01-12 18:18:56 -08:00
Leonardo de Moura
9eb22cd548 feat(library/constructions/injective): automatically generate auxiliary lemma *.inj_eq for constructors
We are going to use these lemmas in the simplifier.
2018-01-12 16:41:12 -08:00
Leonardo de Moura
58fce78282 feat(library/init/meta/interactive): add interactive tactic subst_vars 2018-01-12 14:37:11 -08:00
Leonardo de Moura
c3d4a9456e feat(library/init/meta/interactive): add sorry interactive tactic (alias for admit). 2018-01-11 16:58:46 -08:00
Leonardo de Moura
040722c7e7 feat(library/init/meta): add unify config option to apply_cfg
This commit also fixes a problem in the `apply` tactic error messages.
2018-01-04 12:51:59 -08:00
Leonardo de Moura
746134d11c feat(library/init/meta/interactive): add goal tagging support for by_cases
This commit also incorporates changes suggested at commit 84a1911949dec94.
2017-12-13 15:17:13 -08:00
Leonardo de Moura
cb74ef1670 chore(library/init/meta/interactive): fix docstring 2017-12-11 16:27:04 -08:00
Leonardo de Moura
533ddc0279 fix(library/init/meta/interactive): remove buggy generalizing param from with_cases 2017-12-11 16:27:04 -08:00
Leonardo de Moura
5217ae735d feat(library/init/meta/interactive): do not make tag longer when constructor/apply create a single subgoal 2017-12-11 16:27:03 -08:00
Leonardo de Moura
f0231f17bc feat(library/init/meta): propagate tags in constructor-like tactics 2017-12-11 16:27:03 -08:00
Leonardo de Moura
ebeb5f713a feat(library/init/meta/interactive): do not make tag longer when induction/cases create a single subgoal 2017-12-11 16:27:03 -08:00
Leonardo de Moura
8bda71af6f feat(library/init/meta/interactive): new case tactic with support for with_cases and tagging 2017-12-11 16:27:03 -08:00
Leonardo de Moura
d44996e034 feat(library/init/meta): propagate tag information 2017-12-10 19:15:41 -08:00
Leonardo de Moura
e23db3970a feat(library/init/meta/tactic): apply tactic return parameter name associated with new metavars 2017-12-10 12:11:58 -08:00
Leonardo de Moura
8577fe6984 fix(library/init/meta/interactive): induction ... generalizing ... bug 2017-12-10 08:57:25 -08:00
Leonardo de Moura
623ff2454b chore(library/init/meta/interactive): remove TODO
We now have `whnf_ginductive`
2017-12-08 11:47:20 -08:00
Leonardo de Moura
49e7a642c3 feat(library/init/meta/interactive): merge ginduction and induction
This commit is based on 638b34b16de6443.
The changes were applied manually to make sure all changes are
compatible with our plans to `induction`.
2017-12-07 19:10:10 -08:00
Leonardo de Moura
84db9e9e43 feat(library/init/meta/interactive): add constructor_matching tactic 2017-12-06 13:17:06 -08:00
Leonardo de Moura
c89e2457bb feat(library/init/meta/interactive): add cases_type tactic
see doc/changes.md
2017-12-06 12:55:10 -08:00
Leonardo de Moura
4f1f15a425 refactor(library/init/meta/match_tactic): cleanup match_tactic interface 2017-12-06 12:52:41 -08:00
Leonardo de Moura
03eda2ecc0 feat(library/init/meta/interactive): add cases_matching p tactic 2017-12-05 18:17:44 -08:00
Leonardo de Moura
b06549bc05 feat(library/init/meta): add guard_names { t } tactical 2017-12-05 16:29:46 -08:00
Leonardo de Moura
0c5ecf6441 feat(library/init/meta/interactive): add iterate n { t } 2017-12-05 12:52:18 -08:00
Leonardo de Moura
6f943d77a2 feat(library/init/meta/interactive): add match_target pat interactive tactic 2017-12-05 12:25:17 -08:00
Leonardo de Moura
b5358b1b3e chore(library/init/meta/interactive): add comment to avoid confusion 2017-12-05 12:07:17 -08:00
Leonardo de Moura
c943576e5a feat(library/init): add funext tactic 2017-12-04 14:54:39 -08:00
Leonardo de Moura
53c9737c70 feat(library/init): new repeat tactic 2017-12-04 12:55:53 -08:00
Leonardo de Moura
75aa94b34c refactor(library): rename repeat ==> iterate
Reason: we will implement a new `repeat` tactic.
2017-12-04 12:34:59 -08:00