Commit graph

333 commits

Author SHA1 Message Date
Sebastian Ullrich
2bfdcc9069 chore(tests/lean/interactive/info_tactic): make independent of stdlib tactics 2017-07-07 11:22:12 +02:00
Sebastian Ullrich
99a87a9d01 chore(tests/lean/interactive/complete_field): remove. Not supported with new field notation anyway. 2017-07-07 11:22:10 +02:00
Gabriel Ebner
f55d10bb50 chore(tests/lean/interactive): fix tests 2017-07-06 16:32:50 +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
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
Leonardo de Moura
b68fe0d645 chore(tests/lean/interactive): fix test 2017-07-04 11:57:16 -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
Leonardo de Moura
76799db032 feat(library/init/meta/interactive): simph ==> simp [*]
This modification was suggested by @kha.

TODO:
- Use `simp [-f]` instead of `simp without f`
- Allow users to remove hypothesis from `*`. Example: `simp [*, -h]`
  for simplify using all hypotheses but `h`.
2017-07-03 15:14:47 -07:00
Leonardo de Moura
16711fcdba feat(library/tactic/dsimplify): new configuration options for dsimp
TODO for `dsimp`:
- Add an option for reducing [reducible] definitions
- Add (to_unfold : list name) similar to the one in the `simp` tactic
2017-07-02 18:26:03 -07:00
Leonardo de Moura
0b36e014e6 chore(tests/lean): fix tests 2017-07-01 21:12:29 -07:00
Leonardo de Moura
4604d7fd5a feat(library/init/meta): allow users to specify tactic for discharging subgoals in the simp tactic family
@dselsam @Armael: this feature may be useful for you.
The doc/changes.md describes many other new features.
2017-07-01 15:35:33 -07:00
Leonardo de Moura
2f2694a343 chore(tests/lean/interactive/info_tactic): fix test output 2017-07-01 13:11:07 -07:00
Leonardo de Moura
b05c4e09ed feat(library/init/meta): add memoize field to simp_config and dsimp_config
We use `memoize := ff` when implementing `conv.interactive.for` and
`conv.interactive.find`.
2017-07-01 10:37:09 -07:00
Leonardo de Moura
f7fe2a775c feat(library/init/meta/rewrite_tactic): improve rewrite tactic
`rewrite` tactic improvements
- Add support for `auto_param` and `opt_param`
- Order new goals using the same strategies available for `apply`
- Allow user to set configuration object in interactive mode.

@Armael This commit should address the issue you raised about the order
of new goals in the `rewrite` tactic.
See new test tests/lean/run/rw1.lean for examples.
2017-06-30 12:03:27 -07:00
Leonardo de Moura
fe51bebab3 refactor(library/init/meta/converter): new conv monad implementation 2017-06-29 16:37:22 -07:00
Mario Carneiro
47c3c0ba84 fix(tests/*): fix tests 2017-06-22 08:24:19 -07:00
Leonardo de Moura
51a28828d6 chore(tests/lean/interactive/info_tactic): fix test 2017-06-21 17:03:24 -07:00
Mario Carneiro
e6f3c5cc22 fix(tests/lean/interactive/mk_input): strip \r from input files (win) 2017-06-21 08:53:11 +02:00
Leonardo de Moura
2866607319 chore(tests): fix tests 2017-06-18 18:33:38 -07:00
Leonardo de Moura
fe774a25cf chore(tests/lean/interactive): fix tests 2017-06-15 10:56:09 -07:00
Leonardo de Moura
5cb96c7fa3 feat(frontends/lean): add option for pretty printing metavars, sorry and delayed abstractions as holes
This option is false by default, but true when executing hole commands
2017-06-15 10:24:26 -07:00
Gabriel Ebner
028c31779d fix(frontends/lean/interactive): revert hole end column
I have tested this change in both emacs and vscode, and replacements
work correctly.

This reverts commit 6c2a144950.
2017-06-15 17:01:10 +02:00
Leonardo de Moura
6c2a144950 fix(frontends/lean/interactive): hole end column 2017-06-15 07:36:11 -07:00
Leonardo de Moura
ba25d4876e feat(frontends/lean/info_manager): multi-line holes 2017-06-15 07:23:06 -07:00
Gabriel Ebner
a001e85d82 fix(frontends/lean/builtin_exprs): set hole position after final token 2017-06-15 11:35:43 +02:00
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
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
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
4160f23847 fix(library/init/meta/interactive): fix printing of description string for locations 2017-06-04 13:23:26 -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
d10a799b79 chore(tests/lean/interactive/complete_field): fix test 2017-05-27 10:18:44 -07:00
Gabriel Ebner
95300224aa fix(frontends/lean/builtin_cmds): suppress unhelpful #check output 2017-05-23 11:14:31 -07:00
Gabriel Ebner
183bf63e26 fix(frontends/lean/parser): pass error-recovery flag from parser to elaborator 2017-05-23 11:14:31 -07:00
Gabriel Ebner
166c07e1fe fix(frontends/lean/elaborator): do not leak _elab_u names 2017-05-23 11:14:31 -07:00
Gabriel Ebner
d27a0eff15 chore(tests): fix tests 2017-05-23 11:14:31 -07:00
Gabriel Ebner
99754188e6 feat(library/compiler/eta_expansion): also eta-expand expressions containing sorry 2017-05-23 11:14:31 -07:00
Gabriel Ebner
af63d4036b chore(tests): update tests 2017-05-23 11:14:31 -07:00
Gabriel Ebner
89ad117be3 chore(tests): update tests with changes to error recovery 2017-05-23 11:14:30 -07:00
Gabriel Ebner
54114fd7bd fix(frontends/lean/tactic_notation): do not clamp errors to the end of {} blocks 2017-05-23 07:28:34 +02:00
Leonardo de Moura
7d2ec25e81 fix(tests/lean/interactive/complete_field): fix tests 2017-05-16 14:50:15 -07:00
Leonardo de Moura
74550fbebc feat(library/init/core): add notation for out_param 2017-05-01 13:52:17 -07:00
Leonardo de Moura
5cef84709f refactor(library): avoid auxiliary definitions such as add/mul/le/etc
See Section "Other goodies" at
https://github.com/leanprover/lean/wiki/Refactoring-structures

This commit also improves the support for projections in the
unifier/matcher.

Now, we consider the extra case-split for projections.
Given a projection `proj`, and the constraint `proj s =?= proj t`, we need to try first `s =?= t` and if it fails, then try to reduce.
This is needed in the standard library because we now have constraints such as:
```
@has_le.le ?A ?s ?a ?b  =?=  @has_le.le nat nat.has_add x y
```
If we reduce the right hand side, we get the unsolvable constraint
```
@has_le.le ?A ?s ?a ?b  =?=  nat.le x y
```
Before this change, the constraint was `@le ?A ?s ?a ?b  =?=  @le nat nat.has_add x y`, and we already perform a case-split in this case.
Moreover, projections were eagerly reduced whenever possible.
The extra case-split generates a performance problem in several tests. For example `fib 8 = 34` was timing out.
I worked around this issue by performing the case-split only when the constraint contains meta-variables.
There are also minor issues. Example. `<` is notation for `has_lt.lt`, but `>` is for `gt`.
2017-05-01 08:52:19 -07:00
Gabriel Ebner
a7d58008ac fix(frontends/lean/parser): show exception message in import errors 2017-04-27 16:04:18 -07:00
Sebastian Ullrich
e9a6c544af refactor(frontends/lean/{elaborator,structure_cmd}): compile structure inheritance to nested fields 2017-04-24 19:35:15 +02:00
Sebastian Ullrich
6ab0a008f9 feat(frontends/lean/{builtin_cmds,interactive}): complete namespace/section after end 2017-04-23 11:26:31 -07:00
Sebastian Ullrich
a54514fead feat(frontends/lean/print_cmd): complete identifiers after #print 2017-04-23 11:26:31 -07:00
Sebastian Ullrich
5b17c3cbd9 fix(frontends/lean/interactive): fall back to elaborator info when not an interactive tactic
Fixes #1530
2017-04-23 11:26:31 -07:00
Gabriel Ebner
01a7efc007 fix(library/module_mgr): do not crash on missing imports
Fixes #1506.
2017-04-04 19:56:33 +02:00