Commit graph

3538 commits

Author SHA1 Message Date
Leonardo de Moura
7557a9e000 feat(shell/server,frontends/lean): add "hole_commands" server command
The new command returns the list of registered/applicable hole
commands.
2017-06-14 22:16:34 -07:00
Leonardo de Moura
55c8627f2c feat(frontends/lean): {! ... !} takes a list of pre-terms 2017-06-13 22:19:17 -07:00
Leonardo de Moura
dac6eec556 feat(library/tactic): add hole_command bookkeeping 2017-06-13 21:12:29 -07:00
Leonardo de Moura
bb2c39b471 feat(frontends/lean): add hole notation {! ... !}
Holes {! ... !} are elaborated using `sorry`.
We report an error if their value is fixed by typing and/or
elaboration rules.

We store the tactic_state and the optional attribute in the
info_manager. The idea is to allow users to execute commands with
respect to the stored tactic state and optional attribute.
The optional attribute is a pre term.

We are planning to add commands such as:
- Check type of the given argument.
- Reduce the given argument.
- Synthesize the hole automatically, where the given argument encodes
hint to the synthesizer.
- Use the given argument to fill the hole.
2017-06-13 18:53:05 -07:00
Johannes Hölzl
89136339ff fix(library/init/meta): error message mentions now solve1 instead of focus 2017-06-12 20:42:48 -07:00
Johannes Hölzl
8d438e1012 feat(library/init/meta): add coinduction method 2017-06-12 20:42:48 -07:00
Johannes Hölzl
652cbee425 feat(library/init/meta): support nesting for coinductive predicates 2017-06-12 20:42:48 -07:00
Johannes Hölzl
1352d4a5b3 feat(src/frontents/lean): support for coinduction command in frontend 2017-06-12 20:42:48 -07:00
Johannes Hölzl
4d01a6548e feat(library/init/meta): support mutual coinductive predicates 2017-06-12 20:42:48 -07:00
Johannes Hölzl
23f12a22a2 feat(library/init/meta): add command to construct coinductive predicates 2017-06-12 20:42:48 -07:00
Leonardo de Moura
9d5b69ad5c fix(library/compiler/preprocess): compile_lemma => compile_irrelevant
We can also ignore functions that return types at compile_lemma (now
called compile_irrelevant).

fixes #1658
2017-06-12 20:33:31 -07:00
Leonardo de Moura
d7e3bd794e fix(library/equations_compiler): fixes #1663 2017-06-12 19:45:01 -07:00
Gabriel Ebner
dc81915da6 refactor(library): unify char.to_string and char.has_to_string 2017-06-12 16:32:35 +02:00
Daniel Selsam
8f875c92ba fix(inductive_compiler/nested.cpp): fixes #1657 2017-06-09 20:06:50 +02:00
Sebastian Ullrich
1bab73e10c fix(init/meta/interactive_base): fix sformat! macro 2017-06-08 16:22:50 +02:00
Gabriel Ebner
4b05c645bb fix(library/constructions/injective): use same transparency setting as no_confusion 2017-06-08 10:17:21 +02:00
Leonardo de Moura
17f8231d59 feat(library/tactic/cases_tactic): add support for injective functions in the cases tactic
This feature is needed when we declare an inductive predicate/type
which is indexed by a mutual and/or nested inductive datatype.

See tests/lean/run/term_pred.lean for an example.

@Armael: this commit should fix the issue with the `cases` tactic that
you reported today.
2017-06-07 19:50:01 -07:00
Leonardo de Moura
0b04376676 refactor(library/init/data/string/basic): mark string implementation as private
See issue #1175

BTW, we may have to revise this decision in the future when we decide to
populate the string library with lemmas.
It is inconvenient to prove the lemmas at string/basic.lean since the
tactic framework has not been defined yet.
Anyway, I think it is worth to keep the private for now, and make sure
nobody relies on its implementation.
2017-06-07 18:00:24 -07:00
Leonardo de Moura
2a51fc4458 fix(frontends/lean): anonymous constructor and structure instances for private structures 2017-06-07 17:51:23 -07:00
Leonardo de Moura
4eefc41b6e refactor(*): wrap string in a structure
We want to make sure string users do not depend on the string
implementation. This is the first step.

We need this refactoring *now* to make sure it will not be
super painful to address issue #1175
2017-06-07 17:30:49 -07:00
Mario Carneiro
c13472a8b8 feat(init/meta/interactive): change-with tactic
Conflicts:

	library/init/meta/interactive.lean
2017-06-07 10:33:14 -07:00
Sebastian Ullrich
dd91630a83 feat(frontends/lean/user_notation): more error checking 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
3f717c586e feat(init/meta/interactive): declare format! and sformat! macros and start putting them to use 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
56995348d3 hack(frontends/lean/parser): allow input to be substituted and use it to implement interpolating format macro 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
c49f6f7873 refactor(frontends/lean/user_notation): use parser instead of tactic monad 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
20ab8feeae feat(init/meta/lean/parser): pexpr parser that does not use quoted mode 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
18063fa9ba feat(frontends/lean): user-defined notation parsers 2017-06-07 10:09:38 -07:00
Sebastian Ullrich
283d8ade1a fix(library/quote): use opaque macro for elaborated expr quotations 2017-06-07 10:00:17 -07:00
Leonardo de Moura
82db0f874a fix(kernel/type_checker,library/type_context): add support for macros that cannot be expanded
Fixes #1650
2017-06-07 08:25:21 -07:00
Sebastian Ullrich
a72687661b fix(util/stackinfo): avoid and guard against negative overflow in g_stack_threshold computation 2017-06-07 13:22:11 +02:00
Leonardo de Moura
748eb856c3 fix(frontends/lean): fixes #1649
This issue is yet another reason for refactoring how parameters are
represented in Lean.
2017-06-06 21:33:24 -07:00
Leonardo de Moura
f5ec29ab1a feat(library/init/meta/interactive): add add_interactive command.
@Armael: the new file `tests/lean/run/add_interactive.lean` contains a
small example. Note that we don't have auto quotation for commands yet.
So, I have to use the backtick in the example.

@Kha: this is a good candidate for the future command parser extensions.
2017-06-05 16:43:15 -07:00
Leonardo de Moura
f2ee88aecf test(tests/lean/run/simp_rfl_proof_issue): add simp refl proof test 2017-06-05 15:36:26 -07:00
Leonardo de Moura
cd624dda75 fix(library/tactic/exact_tactic): make sure exact/refine tactics check for cycles when assigning metavariables
fixes #1638
2017-06-04 15:10:42 -07:00
Jeremy Avigad
4592210e10 fix(tests/lean/*): fix and expand tests 2017-06-04 13:23:26 -07:00
Jeremy Avigad
650870fd0e fix(tests/lean/interactive/*): fix tests 2017-06-04 13:23:26 -07:00
Jeremy Avigad
4f2cd6d2c7 fix(tests/lean/run/simp_options): move test 2017-06-04 13:23:26 -07:00
Jeremy Avigad
7fe0fff91d feat(library/init/meta/interactive): add 'only' option for simp, dimph, dimp_intros, and dsimp 2017-06-04 13:23:26 -07:00
Jeremy Avigad
862d23f6b6 fix(library/init/meta/interactive): disallow wildcard in rewrite 2017-06-04 13:23:26 -07:00
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
Jared Roesch
e63f202aed chore(tests/lean): add tests for rw and simp 2017-06-04 13:23:26 -07:00
Leonardo de Moura
e22ccb4d1f feat(library/tactic/tactic_state): improve error message for unify and is_def_eq tactics
closes #1639
2017-06-03 19:52:22 -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
d7ab5cd8a1 feat(frontends/lean/tactic_notation): allow show keyword to be used as syntax sugar for the show_goal tactic
@kha @gebner I added the `show_goal` tactic for selecting arbitrary
subgoals. This feature is similar to the one available in Isabelle.
This commit allows us to use the `show` keyword as syntax sugar for
`show_goal`. The test `show_goal.lean` has a small example.
What do you think?

@Armael: you can use `show` to structure your proofs in tactic mode.
See `tests/lean/run/show_goal.lean` for a small example.
2017-06-01 18:52:54 -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
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