Commit graph

1321 commits

Author SHA1 Message Date
Jeremy Avigad
e1c024d4d9 fix(library/init/meta/simp_tactic): fix relabeling of hypotheses in simp_intro_aux 2017-06-04 13:23:26 -07:00
Jeremy Avigad
4160f23847 fix(library/init/meta/interactive): fix printing of description string for locations 2017-06-04 13:23:26 -07:00
Jeremy Avigad
1fa7c2285e fix(library/init/meta/smt/interactive): adapt to wildcards in locations 2017-06-04 13:23:26 -07:00
Jeremy Avigad
649118c99a fix(library/init/meta/interactive): remove sorry in dunfold_occs 2017-06-04 13:23:26 -07:00
Jared Roesch
998f90b849 feat(library/init/meta/interactive): add support for location wildcards
This allows users to now use  to apply a tactic in all hypotheses as well as the goal, we add support for all
interactive tactics using location: rewrite, simp, dsimp, unfold, and delta including each tactics many variants.
2017-06-04 13:23:26 -07:00
Leonardo de Moura
a1dc121eee feat(library/init/meta/environment): add environment.fingerprint API 2017-06-02 16:52:40 -07:00
Leonardo de Moura
c59543bde8 feat(library/init/meta/tactic): add sleep tactic for debugging purposes
We are going to use it to simulate the issue described at issue #1601
2017-06-02 15:38:08 -07:00
Leonardo de Moura
92a72b238b feat(library/tactic): add tactic::ref
They can be used to store user state in the tactic_state object.

@Armael @jroesch: The new file tests/lean/run/tactic_ref.lean contains a few examples.
2017-06-02 15:19:03 -07:00
Leonardo de Moura
ca5439c698 feat(frontends/lean/tactic_notation): add support for tac ; [tac_1, ..., tac_n] notation in interactive tactic mode
closes #1634

This commit also changes the semantic of `tactic.focus [tac_1, ..., tac_n]`.
It now fails if the number of goals is not `n`.
Before it would only fail if there were more tactics than goals.

@Armael: See tests/lean/run/handthen.lean for examples of the new notation.
2017-06-02 11:38:04 -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
81e97de463 feat(library/init/meta/interactive): allow metavars in the show_goal tactic 2017-06-01 19:46:38 -07:00
Leonardo de Moura
18467bd302 feat(library/init/meta/interactive): add show_goal tactic for structuring proofs in interactive tactic mode 2017-06-01 18:36:50 -07:00
Leonardo de Moura
5446df1609 feat(library/init/meta/interactive): add interactive done tactic 2017-06-01 17:28:52 -07:00
Leonardo de Moura
00aef04b81 feat(library/init/meta/rec_util): add mk_constructors_fresh_names
@Armael @jroesch this commit implements the
`mk_constructors_fresh_names` tactic.
The new test file has a few examples.
2017-06-01 17:04:21 -07:00
Leonardo de Moura
190d792225 feat(library/init/meta/tactic): add default parameter value 2017-06-01 16:24:36 -07:00
Mario Carneiro
d82b8ed59e feat(init/data/int,init/data/nat,init/algebra): more algebra theorems 2017-06-01 15:15:40 -07:00
Gabriel Ebner
f049a3f01e refactor(library/init/meta/has_reflect): get rid of unchecked_cast 2017-06-01 10:59:09 +02:00
Gabriel Ebner
04f9eb0b4f refactor(library/init/meta/expr): pure Lean implementation of reflected 2017-06-01 10:17:51 +02:00
Leonardo de Moura
8b0cca57d1 fix(library/noncomputable): fixes #1631
This commit fixes issue #1631. However, it is not a perfect solution.
This commit improves the predicate that checks whether a definition is
noncomputable or not. This predicate was implemented before we had
a code generator.
We should refactor the code and use the code generator to check
whether a definition is noncomputable or not. Otherwise, we will
keep finding mismatches between the predicate at noncomputable.cpp
and what the code generator implements.
2017-05-31 23:16:37 -07:00
Leonardo de Moura
42eeb445d4 fix(library): make sure `(t) does not evaluate t
See #1631
2017-05-31 22:03:15 -07:00
Leonardo de Moura
d8fa93b4a2 feat(library/init/meta/tactic): add dependent parameters for empty introv 2017-05-31 15:10:07 -07:00
Leonardo de Moura
293ab6a032 fix(library/init/data/nat/bitwise): broken lemma 2017-05-31 15:08:03 -07:00
Mario Carneiro
41b928a546 feat(init/data/nat/bitwise): properties of bitwise ops 2017-05-31 14:18:44 -07:00
Mario Carneiro
18b622d709 chore(init/data/nat): modify bitwise defs 2017-05-31 14:18:44 -07:00
Leonardo de Moura
1c6e70d170 feat(library/init/meta): introv tactic
@Armael: this commit implements the `introv` tactic.
The implementation uses an auxiliary `intros_dep` that introduces new
hypotheses with forward dependencies.

The `tactic.introv` tactic implemented at library/init/meta/tactic.lean
is the main implementation, but it is not nice for interactive use since
users would have to write
```
tactic.introv [`h1, `h2]
```
To make it more conveninent to use, we define another
```
meta def introv (ns : parse ident_*) : tactic unit :=
tactic.introv ns >> return ()
```
This one is in the namespace `tactic.interactive`, and
uses parser extensions. The argument `parse ident_*` instructs
the parser to parse 0 or more identifiers and create a term
of type `list name` containing these identifiers.
2017-05-31 14:09:25 -07:00
Leonardo de Moura
71ef240817 feat(library/init/meta/interactive): add nary existsi
@Armael, this commit implements the nary existsi.
We can now write
a) existsi t
b) existsi [t_1, t_2, t_3]
2017-05-31 13:41:25 -07:00
Sebastian Ullrich
9fa31b2858 fix(init/meta/interactive): handle pure in parser signature descs 2017-05-31 16:05:02 +02:00
Leonardo de Moura
72134a7bbd feat(library/equations_compiler/wf_rec): provide recursive equations to rel_tac
rel_tac is a tactic used for synthesizing a well founded relation.
The default implementation just uses type class resolution.
More sophisticated strategies may need to access the set of recursive
equations. This commit addresses this need.
2017-05-30 16:55:37 -07:00
Leonardo de Moura
cbca84a8ea chore(library/init/data/nat/bitwise): fix copyright date 2017-05-30 13:05:37 -07:00
Mario Carneiro
860e2d904d feat(init/data/nat): bitwise operations 2017-05-30 12:47:44 -07:00
Mario Carneiro
e92fba8eda feat(init/data/ordering): ordering.swap 2017-05-30 14:22:49 +02:00
Gabriel Ebner
ddab6260aa fix(library/init/meta/tactic): measure tactic creation time 2017-05-29 14:57:08 +02:00
Mario Carneiro
9c29206386 feat(init/meta/injection_tactic): injections tactic
Runs injection repeatedly on the LC and subgoals
2017-05-27 06:15:47 -04:00
Mario Carneiro
6e88119f55 feat(init/meta/injection_tactic): better injection tactic
(1) The lhs and rhs will be reduced to whnf before getting the constructor apps
(2) If the lhs and rhs are distinct constructors, it discharges the goal by contradiction
(3) The interactive injection tactic will try to close the goal by assumption if successful
2017-05-27 04:59:40 -04:00
Mario Carneiro
f5aa07953b chore(init/logic): slightly more efficient decidability of iff, xor 2017-05-27 04:16:25 -04:00
Mario Carneiro
2251de503d feat(init/relator): some new base theorems for transfer tactic 2017-05-27 04:16:25 -04:00
Mario Carneiro
961d0cd6ed feat(init/data/list): list mem lemmas for map, join, bind 2017-05-27 04:16:24 -04:00
Mario Carneiro
0b4cecfc87 refactor(init/core): write std.priority.max in hex 2017-05-27 04:16:23 -04:00
Mario Carneiro
57837c2b3e fix(init/meta/tactic): let by_cases handle elimination to Type 2017-05-27 04:14:06 -04:00
Mario Carneiro
558efb33c1 feat(init/data/option): option.get 2017-05-27 04:14:05 -04:00
Mario Carneiro
6ebbe40437 chore(init/category/monad): proof optimization 2017-05-27 04:14:04 -04:00
Mario Carneiro
a0503f964c feat(init/algebra, init/data/int): more ring theorems 2017-05-27 04:14:04 -04:00
Mario Carneiro
b827df8b49 refactor(init/logic): remove "contrapos" (which is a duplicate of "mt") 2017-05-27 04:14:03 -04:00
Mario Carneiro
39e7e5cba8 feat(data/vector): more vector operations 2017-05-27 04:14:02 -04:00
Mario Carneiro
07f4055dc0 feat(init/data/int): some more basic int theorems 2017-05-27 04:14:02 -04:00
Mario Carneiro
d85c3fa74e feat(init/category/alternative): a monadic "give me a proof" assert operator 2017-05-27 04:14:01 -04:00
Mario Carneiro
0d977f46e6 feat(init/data/quot): show that quot is the quotient by the generated equivalence 2017-05-27 04:14:00 -04:00
Mario Carneiro
b28ff94780 feat(init/data/option_t): option_t is a monad transformer 2017-05-27 04:14:00 -04:00
Mario Carneiro
52e41ecd1d feat(init/data/subtype): add subtype.eta 2017-05-27 04:13:59 -04:00
Mario Carneiro
20e630ad19 refactor(init/funext): shorten proof 2017-05-27 04:13:59 -04:00