Commit graph

67 commits

Author SHA1 Message Date
Leonardo de Moura
c0e6314f14 fix(library/init/meta,library/tactic/elaborate): bad error position when to_expr is used outside of interactive mode 2017-02-09 18:44:50 -08:00
Leonardo de Moura
5e397795cf fix(library/init/meta): focus tactic
This commit also add the interactive tactic 'focus'
2017-02-09 10:02:19 -08:00
Leonardo de Moura
a28d6a94fd feat(library/init/meta): add any_goals tactic 2017-02-06 16:23:29 -08:00
Leonardo de Moura
ae06844f57 chore(library/init/meta): remove unnecessarily '| failed' annotations
tactic and smt_tactic are instaces of monad_fail
2017-02-05 20:12:42 -08:00
Leonardo de Moura
797b26f402 fix(frontends/lean/tactic_notation): trace messages in nested blocks were not being displayed in the correct place 2017-02-05 18:20:10 -08:00
Leonardo de Moura
30a1876fc8 feat(library/init/meta): add add_aux_decl and abstract tactics 2017-02-05 16:00:47 -08:00
Gabriel Ebner
95068e4e79 feat(library/sorry): make sorry a macro 2017-02-05 14:01:03 +01:00
Leonardo de Moura
2640d3085b fix(library/init/meta/interactive): name resolution problems in parametric sections 2017-02-03 14:04:59 -08:00
Leonardo de Moura
bb9a0c79f4 feat(frontends/lean/builtin_exprs): better syntax for quoted terms with type ascription 2017-02-01 12:49:38 -08:00
Leonardo de Moura
b1d097e63a feat(library/init/meta): add 'delta' tactic for applying delta reduction
closes #1331
2017-01-26 19:04:07 -08:00
Leonardo de Moura
778d5382f6 refactor(library/init/meta/simp_tactic): use default field values at simplify_config 2017-01-23 10:22:48 -08:00
Leonardo de Moura
4b11afcb46 feat(library/init/meta/interactive): add doc strings 2017-01-22 16:41:27 -08:00
Leonardo de Moura
3516773644 chore(library/init): minor fixes 2017-01-22 14:20:48 -08:00
Leonardo de Moura
ac1db6a199 feat(library/init/meta/interactive): add some doc strings 2017-01-22 12:45:39 -08:00
Leonardo de Moura
b913ba3336 feat(library/init/meta): add type information for the arguments of the smt tactics: ematch_using and add_lemmas 2017-01-22 12:12:31 -08:00
Leonardo de Moura
a61cf4d08b feat(library/init/meta/interactive): show type information for simp, dsimp arguments 2017-01-22 12:05:51 -08:00
Leonardo de Moura
cce88c6190 refactor(frontends/lean): interactive tactic support
After this commit, new interactice tactic classes can be added without
writing C++ code (see example: tests/lean/run/my_tac_class.lean).

The tactic_evaluator was simplified, and all the complexity has been
moved to tactic_notation, and lean code.

We can now inspect the intermediate states produced by the rewrite
tactic.

The function (@scope_trace _ line col thunk) can be used to position trace
messages produced by thunk. If line/col are not provided (i.e., we
just write (scope_trace thunk)), then line/col are filled with the
position of this term by the elaborator.

We can visualize the intermediate tactic states inside nested blocks
such as (try { ... })

The new infrastructure can be used to implement custom tactic_state
pretty printers.
2017-01-21 22:38:47 -08:00
Leonardo de Moura
7a6b9e193c feat(library/vm, frontends/lean/info_manager): add thread safe vm_obj wrapper, and use it to store arbitrary vm thunks in the info_manager 2017-01-21 22:38:33 -08:00
Leonardo de Moura
4de71cadfa feat(library/init/meta): expose additional app_builder tactics 2017-01-20 20:27:07 -08:00
Leonardo de Moura
b1c1d2dfa4 feat(library/init/meta): improve dsimp tactic notation 2017-01-09 17:31:35 -08:00
Leonardo de Moura
0c4c41ae54 feat(library/init/meta): produce nicer error message for overloaded simp/ematch lemma 2017-01-07 14:13:46 -08:00
Leonardo de Moura
13a11b4374 feat(library/init/meta/interactive): add get_eqn_lemmas_for tactic, allow user to provide definition name as an argument to simp 2017-01-06 11:45:09 -08:00
Leonardo de Moura
7ba889b5cf feat(frontends/lean/tactic_notation): try/repeat for smt_tactic in interactive mode 2017-01-05 18:31:57 -08:00
Leonardo de Moura
384e8bc795 refactor(library/init/meta/smt): move ematch stuff to new file, and remove priority from hinst_lemma 2017-01-04 17:23:06 -08:00
Leonardo de Moura
3a62ca0581 refactor(library/init/meta): move smt tactics to library/init/meta/smt, and add interactive definitions 2017-01-04 09:36:50 -08:00
Scott Morrison
548ca37c47 fix(library/init/meta/interactive): correcting a typo in a comment 2017-01-01 09:34:32 -08:00
Leonardo de Moura
5d825483c4 refactor(library/init/meta/interactive): tactic.interactive.types ==> interactive.types
Motivation: we will use auto-quotation for other tactic monads
2016-12-30 18:06:41 -08:00
Leonardo de Moura
b86494f0d4 feat(library/tactic): add destruct tactic that is similar to cases, but does not use revert/intro/clear
This tactic is useful for building more complex tactics using ematch and
cc because it does not invalidate cc_state nor ematch_state.
2016-12-30 17:05:24 -08:00
Leonardo de Moura
cc6d4a6ef8 chore(library/init/meta/interactive): typo 2016-12-30 09:04:27 -08:00
Leonardo de Moura
d573704657 feat(library/init/meta): add ac_refl tactic
It is basically cc without taking the hypotheses into account.
2016-12-29 19:22:40 -08:00
Leonardo de Moura
b65c774f5b chore(library/init/meta): opened_namespaces ==> open_namespaces 2016-12-18 23:55:45 -08:00
Leonardo de Moura
d41c403442 feat(library/init/meta/simp_tactic, library/init/meta/interactive): add simp_using_hs 2016-12-17 12:54:04 -08:00
Leonardo de Moura
9f6e71b374 feat(library/tactic): add "approximate" parameter to apply_core and rewrite_core
If this parameter is set to true, then approximate unification is
used.

closes #1208
2016-12-10 10:24:05 -08:00
Jeremy Avigad
0950b7a49f feat(library/init/meta/interactive): allow cases on an arbitrary expression 2016-12-10 09:54:03 -08:00
Jeremy Avigad
1dd91c6e6a feat(library/init/meta/interactive): add fapply 2016-12-10 09:53:53 -08:00
Jeremy Avigad
1ba55e5cda feat(library/init/meta/interactive): allow metavariable in change tactic 2016-12-10 09:53:36 -08:00
Leonardo de Moura
692701c5ef feat(library/init/meta): use cheap "reflexivity" after simp and rewrite
The idea is to make sure lean doesn't timeout (at reflexivity) when we apply simp or
rewrite in goals such as

    (x y : nat) |- x + y + 10000000000 = x + y + 200000000000000

This commit also addresses an issue raised at #1218
2016-12-08 14:41:26 -08:00
Leonardo de Moura
25639f0b72 feat(library/init/meta): add 'pose' tactic 2016-11-24 13:48:16 -08:00
Leonardo de Moura
0554fd5997 fix(frontends/lean): name resolution at tactic execution time
This commit also adds a new tactic: tactic.resolve_name

closes #1201
2016-11-24 10:55:39 -08:00
Leonardo de Moura
a4f491a3ad feat(library/init/meta/interactive): add rename tactic to interactive mode 2016-11-24 09:54:55 -08:00
Leonardo de Moura
3b09865684 feat(library/init/meta/simp_tactic): add tactics for validating simp lemmas 2016-11-23 17:43:55 -08:00
Leonardo de Moura
11ef0b14fd feat(library/data): add decidable_eq instances for bitvec and tuple 2016-11-23 11:09:24 -08:00
Leonardo de Moura
edaf03ae98 feat(library/init): add more lemmas and define ordered_ring 2016-11-22 20:50:21 -08:00
Leonardo de Moura
88b2af3b65 feat(library/init/meta/interactive): add 'exfalso' 2016-11-21 11:41:11 -08:00
Leonardo de Moura
1e14e27cd0 feat(library/init/meta/interactive): add try/solve1 tactics to interactive mode 2016-11-18 16:17:37 -08:00
Leonardo de Moura
6b466114a4 fix(library/init/meta/interactive): resolve name at interactive unfold tactics 2016-11-18 16:14:03 -08:00
Leonardo de Moura
bfae8f347b feat(library/init/meta/interactive): cases tactic takes arbitrary expressions 2016-11-18 12:51:53 -08:00
Leonardo de Moura
e5d69fef35 fix(library/init/meta/interactive): bug at mk_simp_set 2016-11-16 17:42:16 -08:00
Leonardo de Moura
40fca8efd4 feat(frontends/lean): add tactic.save_type_info, preserve pos info at translate 2016-11-10 11:51:05 -08:00
Leonardo de Moura
205d524409 refactor(library/tactic/simplify): delete old simplifier 2016-10-19 14:03:14 -07:00