Commit graph

3561 commits

Author SHA1 Message Date
Leonardo de Moura
b9dee04fdb feat(library/tactic/simplify): add single_pass simplifier option (default is false) 2017-06-21 16:41:54 -07:00
Leonardo de Moura
9fcb3ae4b5 feat(library/tactic/simplify): store proof for refl lemmas and use them in simp
Before this commit, simp would not silently apply refl-lemmas, and use
reflexivity. This strategy produces compact proofs but may generate
performance problems. For example, the new test timeouts without this
commit.

I believe a similar performance problem is affecting the Certigrad
project developed by @dselsam.
2017-06-21 16:21:11 -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
eef4d95410 feat(frontends/lean/inductive_cmds): closes #1655 2017-06-20 16:25:18 -07:00
Leonardo de Moura
5a07b3b27c test(tests/lean/run/1688): add test for PR #1688 2017-06-20 12:36:31 -07:00
Leonardo de Moura
b25291c5c9 fix(library/tactic/simplify): fixes #1685 2017-06-20 12:27:46 -07:00
Leonardo de Moura
ce3387b246 fix(library/tactic/change_tactic): fixes #1686 2017-06-20 12:05:21 -07:00
Leonardo de Moura
3c306d0a7b fix(library/equations_compiler/elim_match): forward dependency checking
See comment at #1594

This commit is not fixing the issue, but a problem described in one of
the comments.
2017-06-20 11:29:23 -07:00
Leonardo de Moura
c7e68e57cf fix(frontends/lean/structure_cmd): fixes #1681
@kha I'm not sure if this is the right fix. I just avoided the loop that adds
`mk_expr_placeholder` if the function is not a projection.
I didn't spend time investigating why we need `mk_proj_app`.
I know the library doesn't compile if we don't use it, and just use
```
    return mk_app(copy_tag(ref, mk_constant(S_name + fname)), e);
```
:)
2017-06-19 16:22:38 -07:00
Leonardo de Moura
ddb6b38d88 fix(frontends/lean/elaborator): fixes #1682
@kha Could you please double check whether this is right fix?
2017-06-19 16:04:24 -07:00
Leonardo de Moura
0f64b6088c chore(frontends/lean): remove then have ... notation
This notation was a leftover from Lean 0.1.
2017-06-19 14:20:52 -07:00
Sebastian Ullrich
018ebdd115 feat(frontends/lean/user_command): add user-defined commands 2017-06-19 11:27:12 -07:00
Sebastian Ullrich
95b317fa64 refactor(frontends/lean): do not hard code commands accepting attributes & modifiers 2017-06-19 11:09:26 -07:00
Leonardo de Moura
2866607319 chore(tests): fix tests 2017-06-18 18:33:38 -07:00
Leonardo de Moura
b8fa7f5311 fix(library): expr, level, hash_map, rb_map has_repr instances should be has_to_string since they do not produce results that can be parsed by Lean
See #1664
2017-06-18 18:33:27 -07:00
Leonardo de Moura
dc1a1c8540 refactor(library): has_to_string ==> has_repr
See issue #1664

This is just the first step to implement proposal described at issue #1664.
2017-06-18 18:29:19 -07:00
Leonardo de Moura
c33fd8b0fd fix(frontends/lean/elaborator): fixes #1669 2017-06-18 16:14:48 -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
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