Commit graph

3052 commits

Author SHA1 Message Date
Mario Carneiro
dfbcb72f38 chore(init/meta/tactic): remove superfluous fail clause 2017-07-20 01:28:21 -07:00
Mario Carneiro
4ae2f87bc8 refactor(init/meta/tactic): use dite instead of cases in by_cases
This fixes the issue in PR #1752 by using `dite`, which is essentially nondependent cases, so that the decidable instances are not substituted.
2017-07-20 01:28:21 -07:00
Gabriel Ebner
ba2718a89d feat(library/init/meta/environment): expose function to unfold all macros 2017-07-18 19:49:53 +01:00
Sebastian Ullrich
cbf65c1339 fix(init/meta/interactive): implement generalize2 via generalize/kabstract 2017-07-17 13:59:21 +02:00
Leonardo de Moura
9afb53fad5 feat(kernel/expr): allow metavariables to have user-facing names
We need this feature for:
1) Defining nonlinear search patterns. Example: (?m <= ?m + 1)
2) Preprocessing recursive equations and support the pattern
refinement approach used in Agda. Example: in Agda, they accept
```
def append {A : Type} : Π (m n : nat), Vec A m -> Vec A n -> Vec A (m + n)
| m n nil            ys := ys
| m n (cons m' x xs) ys := cons x (append m' n xs ys)
```
These equations have to be refined. For example, `m` has to be
replaced with `0` (in the first equation), and `succ m'` in the
second. To implement this kind of refinement, we need to convert
the pattern variables (local constants) into metavariables during
elaboration. Then, the unassigned metavariables become local constants
again. This preprocessing step will fix some of the issues on #1594.
To completely fix #1594, we will need yet another preprocessing step
which will implement "complete transition" used in the equation
compiler before we start elim_match.cpp
2017-07-16 07:16:41 -07:00
Gabriel Ebner
563c1bcffe chore(library/init/meta/tactic): make first argument of id_locked implicit 2017-07-15 17:47:46 +01:00
Gabriel Ebner
ee56f71260 fix(library/init/data/nat/lemmas): make various lemmas rfl 2017-07-15 10:38:06 +01:00
Leonardo de Moura
8dcccd3bfc fix(frontends/lean/parser): make sure imax and max level arguments are parsed using the same precendence we use to parse application arguments
This commit addresses an issue raised by @digama0 on the Lean slack channel.
2017-07-07 12:43:07 -07:00
Leonardo de Moura
9555a104d6 feat(library/init/meta/tactic): simplify ‹p› notation
@jroesch See the new test :)
2017-07-07 12:05:02 -07:00
Leonardo de Moura
b7b331957a chore(library/init/data/nat/bitwise): we now support rw [f] for applying f-eqn_lemmas 2017-07-07 12:03:47 -07:00
Sebastian Ullrich
ac8de2472e feat(library/tactic/induction_tactic): clear hypothesis before introducing new ones 2017-07-07 10:06:30 -07:00
Gabriel Ebner
c5b6c52ad1 feat(library/init/data/nat/lemmas): decidable_linear_ordered_cancel_comm_monoid instance 2017-07-07 08:49:12 +02:00
Leonardo de Moura
ced4b6a54d fix(library/init/meta/interactive): fixes #1733 2017-07-06 22:34:24 -07:00
Sebastian Ullrich
1c389cb925 chore(init/meta/interactive): hide rw ASCII notation in syntax description 2017-07-06 14:03:08 +02:00
Jeremy Avigad
5fd113f50f feat(library/init/logic): add simp rule for 'true implies p' 2017-07-05 14:26:04 -07:00
Leonardo de Moura
70ade81a30 feat(library/init/meta/interactive): allow user to set configuration options at unfold_projs
See issue #1725
2017-07-05 13:00:43 -07:00
Leonardo de Moura
9645e7588e chore(library/init/data): recent changes 2017-07-05 12:44:56 -07:00
Mario Carneiro
b557d9012d refactor(init/data/nat/gcd): swap args in gcd.induction
to match swapped induction arg of gcd
2017-07-05 12:37:54 -07:00
Mario Carneiro
50bf075d73 feat(data/hash_map): hash_map.of_list 2017-07-05 12:37:54 -07:00
Mario Carneiro
a1cfce88d5 feat(init/data/list): filter theorems, non-meta qsort 2017-07-05 12:37:54 -07:00
Mario Carneiro
8920d55f8d feat(init/logic): decidability of partial functions 2017-07-05 12:37:54 -07:00
Mario Carneiro
35ed9e9301 feat(init/data/ordering): ordering.or_else, string lex order 2017-07-05 12:37:54 -07:00
Mario Carneiro
0a77c8338b feat(data/list/set): map is nodup 2017-07-05 12:37:54 -07:00
Mario Carneiro
90fc8b1d45 feat(init/logic): mark dif_pos and dif_neg as @[simp]
This is needed for simplifying `dite` after a case split
2017-07-05 12:37:54 -07:00
Mario Carneiro
387c7d46b4 refactor(init/data/fin/basic): shorten fin dec eq proof 2017-07-05 12:37:54 -07:00
Mario Carneiro
42d26a3954 feat(init/data/array): array theorems 2017-07-05 12:37:54 -07:00
Mario Carneiro
1ca6aba076 feat(data/buffer): decidable_eq instance 2017-07-05 12:37:54 -07:00
Mario Carneiro
9d8a898529 feat(data/hash_map): find_empty 2017-07-05 12:37:54 -07:00
Mario Carneiro
9239056c4f feat(data/list/set): nodup is decidable 2017-07-05 12:37:54 -07:00
Mario Carneiro
b422f3f372 feat(data/buffer/parser): foldl and foldr parsers 2017-07-05 12:37:54 -07:00
Mario Carneiro
9fc04ae812 feat(init/data/option/instances): = none of is_none 2017-07-05 12:37:54 -07:00
Mario Carneiro
0172c17447 feat(init/data/bool/lemmas): theorems about to_bool and bool coercion 2017-07-05 12:37:54 -07:00
Mario Carneiro
e2a3331c7c refactor(init/data/option/instances): option_map 2017-07-05 12:37:54 -07:00
Mario Carneiro
803af7cd63 feat(library/data/stream): more stream theorems 2017-07-05 12:37:53 -07:00
Mario Carneiro
1e2157e210 fix(init/meta/constructor_tactic): constructor tac uses whnf 2017-07-05 12:37:53 -07:00
Leonardo de Moura
d0242a3631 chore(library/init/meta/simp_tactic): cleanup 2017-07-05 12:14:26 -07:00
Leonardo de Moura
1bc9af53f2 fix(library/init/meta/simp_tactic): fixes #1724 2017-07-05 11:59:23 -07:00
Leonardo de Moura
bb9e3ddae2 feat(library/init/meta/interactive): rw [-h] ==> rw [← h]
@Armael: this change may affect your project.

The file `doc/changes.md` explains the motivation for the change.
2017-07-05 11:42:55 -07:00
Sebastian Ullrich
30f4b2f2dd refactor(library): list.taken/dropn ~> list.take/drop 2017-07-05 11:20:10 -07:00
Sebastian Ullrich
c8d6b40991 refactor(frontends/lean/builtin_exprs,library): suppose ~> assume : 2017-07-05 11:20:10 -07:00
Sebastian Ullrich
f024ccd75d refactor(frontends/lean/token_table,library): take ~> assume 2017-07-05 11:20:10 -07:00
Sebastian Ullrich
2ca44459ba feat(init/meta/interactive): add from synonym for exact 2017-07-05 11:20:10 -07:00
Sebastian Ullrich
ad97607307 fix(frontends/lean/tactic_notation): always use quote_scope for parsing interactive parameters
Replace now redundant `qexpr` parser with `parser.pexpr`
2017-07-04 12:20:38 -07:00
Sebastian Ullrich
c3d4c468e6 fix(init/meta/interactive): whnf in assume tactic 2017-07-04 12:20:38 -07:00
Leonardo de Moura
dd3616dd16 feat(library/init/meta/interactive): simp_all ==> simp * at *
cc @Kha
2017-07-04 11:57:16 -07:00
Leonardo de Moura
d0ab9d0cd1 feat(library/init/meta/interactive): simp * as shorthand for simp [*] 2017-07-04 11:57:16 -07:00
Leonardo de Moura
44c901bf11 fix(library/init/meta/interactive): make sure all input hypotheses are simplified before we clear the old ones
The new test exposes the bug.
The bug is similar to the one at `simp [h] at *` described at issue #1675
2017-07-03 21:58:55 -07:00
Leonardo de Moura
abef98c772 refactor(library/init/meta/simp_tactic): make sure dunfold tactics use name convention used at simp, dsimp, ... 2017-07-03 21:36:17 -07:00
Leonardo de Moura
b86847ec72 fix(library/init/logic): mark eq.substr with [elab_as_eliminator]
See issue #1718
2017-07-03 17:27:41 -07:00
Leonardo de Moura
e24f3341d4 feat(library/init/meta/interactive): simp without foo ==> simp [-foo]
This commit also adds "exception" validation.
A bad "exception" was being silently ignored.
We can also exclude hypotheses. Example: `simp [*, -h]`
2017-07-03 17:10:46 -07:00