Commit graph

67 commits

Author SHA1 Message Date
Sebastian Ullrich
763097dbd2 refactor(library): revise the monadic hierarchy 2017-03-09 20:30:03 -08:00
Leonardo de Moura
9d3c0497cb chore(frontends/lean): rename transient commands
See issue #1432
2017-03-09 18:41:19 -08:00
Leonardo de Moura
51958df84b chore(frontends/lean/token_table): remove dead keywords 2017-03-07 14:00:49 -08:00
Leonardo de Moura
156e5603d6 feat(library/init/category/combinators): put list combinators in the namespace list
In this way we can use them with the ^. notation
2017-03-05 21:30:30 -08:00
Sebastian Ullrich
ddfdca2e57 chore(init/meta): replace some uses of to_expr `(...) with ``(...) 2017-03-05 08:37:16 -08:00
Sebastian Ullrich
69741061b0 refactor(init/meta): drop obsolete X.to_expr functions 2017-02-21 11:06:39 -08:00
Sebastian Ullrich
a053175714 refactor(init/meta,library/vm): use structure for position information 2017-02-21 11:06:39 -08:00
Leonardo de Moura
50f4a28fc3 feat(library/init/meta/smt/interactive): rsimp for smt_tactic 2017-02-19 13:31:03 -08:00
Leonardo de Moura
296d4b0f09 refactor(library/tactic, library/init/meta): simplify_config => simp_config 2017-02-19 13:10:36 -08:00
Leonardo de Moura
0d22410e2e feat(library/tactic): add zeta option, refactor simplify config option, allow users to change simplify_config in interactive mode 2017-02-19 12:11:22 -08:00
Leonardo de Moura
0a99910c52 feat(library/init/meta): add exception set to rsimp attributes, use iff lemmas 2017-02-18 19:43:21 -08:00
Leonardo de Moura
bed3e6c2fd feat(library/tactic/smt): add get_config and use it to implement slift
smt_tactic.slift was losing the configuration.
2017-02-18 17:52:45 -08:00
Sebastian Ullrich
b9424975b3 refactor(init/meta): replace dynamically-checked quotes where possible 2017-02-17 19:59:57 -08:00
Leonardo de Moura
a9122a2c0a chore(library/init/meta): use general when 2017-02-17 19:51:40 -08:00
Leonardo de Moura
a4f43d36a6 feat(library/init/meta/smt): add rsimp 2017-02-17 19:40:38 -08:00
Leonardo de Moura
d3c340a30c feat(library/init/meta): improve induction tactic interface
It uses .rec recursor when it is not specified
2017-02-17 10:58:51 -08:00
Sebastian Ullrich
84f3e2a492 refacotr(init/meta/interactive): clean up parameter gadgets 2017-02-17 15:41:58 +01: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
54deb6362d feat(library/init/meta): add helper tactics 2017-02-16 20:49:55 -08:00
Gabriel Ebner
1d301b7813 feat(init/meta/smt/congruence_closure): add has_to_tactic_format instance 2017-02-15 13:38:30 -08: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
c37634c815 feat(library/init): add helper functions and instances 2017-02-13 14:53:32 -08:00
Leonardo de Moura
73b1e927ff chore(tests/lean): fix tests 2017-02-11 18:37:15 -08:00
Leonardo de Moura
41d3d42dee feat(library/init/meta): add helper tactics 2017-02-11 18:30:38 -08:00
Johannes Hölzl
d7af5515d2 feat(src/library/tactic): tactic.induction_core returns for each new goal the list of introduced hypotheses and substitutions for dependent hypotheses
Also add to_obj(buffer<vm_obj>) to construct a vm-list of vm objects.
2017-02-10 16:07:33 -08:00
Leonardo de Moura
32e6442d0a feat(frontends/lean): no global universes in the frontend 2017-02-08 17:23:04 -08:00
Leonardo de Moura
54f7bf9391 fix(frontends/lean, library/tactic): remove redundant error messages, and fix position of error messages
Summary:

We minimize the number of "'sorry' used warning messages".  We also
re-target the error to the main declaration. Example: foo._main ==> foo
We do not report for auxiliary declarations such as "_example" and
"foo.equations._eqn_1"

Get rid of the redundant error message "error : failed" for tactics.
We added "silent failures" in the tactic framework.

We do not store line/col information for tactics nested in notation
declarations.  Before this commit, we would have tactics such
as (tactic.save_info line col) nested inside of notation declarations.
2017-02-07 20:25:28 -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
8b662d19ac feat(library/init/category/monad_fail): add monad_fail type class 2017-02-05 18:46:29 -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
aff5a2dd37 fix(library/init/meta): bug introduced 9bee8ce36d 2017-02-03 17:01:46 -08: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
6e7929252f feat(frontends/lean, library/init): add 'thunk' gadget
We can now write
   trace "hello" t
instead of
   trace "hello" (fun _, t)
2017-01-31 18:41:59 -08:00
Leonardo de Moura
258fb522d3 feat(library/tactic/smt): add generation heuristic to control matching loops 2017-01-24 22:46:45 -08:00
Leonardo de Moura
ac6bfce01c feat(library/tactic/smt/congruence_closure): improve propagation for beta reduction in the congruence closure module 2017-01-24 12:09:37 -08:00
Leonardo de Moura
6d12de6339 refactor(library/init/meta/smt): use default value for config structures 2017-01-23 14:18:06 -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
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
694e6f47dc fix(library/init/meta/smt/ematch,library/tactic/simp_lemmas): trick for adding equations of a definition to a simp/hinst lemma set
Before this commit, if we declared an equational lemma using 'def',
then it would not be correctly added to the simp/hinst lemma set.
The new test exposes the problem.
2017-01-18 02:05:04 -08:00
Leonardo de Moura
6ebc23eca4 feat(library/init/meta/smt/smt_tactic): add smt_tactic.induction
Non-interactive version.
2017-01-13 16:49:54 -08:00
Leonardo de Moura
05d86e49ca feat(library/init/meta/smt): add intros variants for smt_tactic 2017-01-13 16:13:37 -08:00
Leonardo de Moura
69fd35f068 feat(library/init/meta/smt): add helper tactics and doc-strings 2017-01-13 11:21:20 -08:00
Leonardo de Moura
6f4bcbab20 feat(library/init/meta/smt/ematch): convenient way of marking all equational lemmas of a giving definition as ematch lemmas 2017-01-13 10:35:09 -08:00
Gabriel Ebner
b8f1b16cfe chore(init/meta/smt/congruence_closure): remove unnecessary line 2017-01-10 09:07:37 -08:00
Leonardo de Moura
a43b856086 feat(library/init/meta/smt): add simp tactics to smt_tactic
We can simplify the target without affecting the smt state
2017-01-09 19:19:48 -08:00
Leonardo de Moura
5050e40aec feat(library/init/meta/smt): add slift smt tactic 2017-01-09 19:07:54 -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
5e3f26ec95 feat(library/tactic/smt/congruence_closure): propagate not_exists 2017-01-06 14:00:36 -08:00