Leonardo de Moura
6334ff24eb
fix(frontends/lean/tactic_notation): erase position information quoted terms occurring inside `[...]
...
See new test for understanding the problem.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2017-02-09 19:06:56 -08:00
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
add5266df7
fix(frontends/lean, library/tactic): error position in auto quoted terms
...
This commit also gets rid of the redundant "elaborator failed" error
message.
2017-02-09 18:03:04 -08:00
Leonardo de Moura
898894ffaa
feat(frontends/lean/parser): syntax sugar for auto_param gadget
2017-02-09 16:06:55 -08:00
Leonardo de Moura
c8bbb34e2a
feat(frontends/lean): add auto_param gadget
2017-02-09 15:49:10 -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
e4b3dee526
feat(library/simplify): use custom matcher in the simplifier, and remove hack from type_context
...
@joehendrix This commit is implementing the matcher that postpones
implicit arguments. The lemma get_data_mk_byte can be proved without
using any hacks in the type_context unifier.
I also added the trace class: simplify.implicit_failure
If we use the command
set_option trace.simplify.implicit_failure true
Then, the simplifier will generate a diagnostic message every time it
succeeds in the explicit part, but fails in the implicit one.
Please feel free to suggest a better name to his option.
BTW, we can now easily extend the matcher with additional features.
I'm wondering if we will eventually want to write some of these
extensions in Lean.
2017-02-08 22:24:13 -08:00
Leonardo de Moura
f5e0fc4876
fix(frontends/lean/elaborator): '{}' inside quotations
2017-02-08 17:50:17 -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
c5dc8e651a
chore(library/init/meta): cleanup
2017-02-08 15:33:25 -08:00
Leonardo de Moura
7df64e6e7b
feat(library/data): add lazy_list
2017-02-08 12:01:46 -08:00
Leonardo de Moura
2c0a5a5120
fix(library/compiler/erase_irrelevant): remove broken io monad optimization
...
It doesn't work when combined with inlining and common-subexpression-elimination
2017-02-07 21:24:31 -08:00
Leonardo de Moura
a8c91aa6fc
fix(library/compiler/preprocess): expand eq.cases_on
...
The code generator was failing to erase eq.cases_on.
2017-02-07 21:19:01 -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
a28d6a94fd
feat(library/init/meta): add any_goals tactic
2017-02-06 16:23:29 -08:00
Gabriel Ebner
572c9a0de0
chore(tests/lean): fix tests after error-recovery
2017-02-06 15:15:47 +01:00
Gabriel Ebner
7946b15511
feat(frontends/lean/elaborator): recover from most errors using sorry
2017-02-06 15:15:44 +01:00
Gabriel Ebner
98f41d9b15
feat(interactive/test_single): colorized diff
2017-02-06 15:08:45 +01:00
Leonardo de Moura
55aa2023f4
feat(frontends/lean): add support for monad_fail type class in 'do' blocks
2017-02-05 20:09:08 -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
30a1876fc8
feat(library/init/meta): add add_aux_decl and abstract tactics
2017-02-05 16:00:47 -08:00
Leonardo de Moura
323db5a530
feat(frontends/lean/pp): pretty print structure instances and field projections
2017-02-05 14:01:53 -08:00
Gabriel Ebner
6910f3f2b9
feat(frontends/lean/print_cmd): show sorry macro as axiom
2017-02-05 14:01:08 +01:00
Gabriel Ebner
95068e4e79
feat(library/sorry): make sorry a macro
2017-02-05 14:01:03 +01:00
Gabriel Ebner
252931a470
feat(tests/lean/test_single): show unified diffs with color
2017-02-05 13:44:21 +01:00
Leonardo de Moura
84188c5aa1
feat(frontends/lean/elaborator): add pattern validator in the elaborator
...
@johoelzl We now produce a better message for your example:
inductive R : ℕ → Prop
| pos : ∀p n, R (p + n)
lemma R_id : ∀n, R n → R n
| (.p + .n) (R.pos p n) := R.pos p n
The new error is:
file.lean:5:2: error: invalid function application in pattern, it cannot be reduced to a constructor (possible solution, mark term as inaccessible using '.( )')
.p + .n
2017-02-04 19:00:20 -08:00
Leonardo de Moura
9869ed1026
feat(library/equations_compiler/util): make sure "inaccessible annotations" do not leak into the type of automatically generated equational lemmas
2017-02-04 17:19:42 -08:00
Leonardo de Moura
dbb36f5412
feat(library/type_context): improve offset trick in the unifier
2017-02-04 17:15:05 -08:00
Leonardo de Moura
6d9c9b3f9a
feat(library/type_context): avoid auxiliary definitions introduced by the equation compiler from being used in the type class resolution procedure
...
This can only happen in meta definitions, but the user may be confused
by this behavior.
2017-02-04 15:56:54 -08:00
Leonardo de Moura
e4a27a2328
chore(tests/lean/interactive): fix test output
2017-02-04 15:53:01 -08:00
Leonardo de Moura
45eb64add0
chore(tests/lean/run/listex3): we don't need the unit trick anymore
2017-02-04 13:55:51 -08:00
Leonardo de Moura
9e42f7ea30
test(tests/lean/run): add test for meta recursive definition wo recursive equation
2017-02-04 13:53:12 -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
ab94e71e37
feat(library/type_context): do not fail on universe constraints of the form ?u =?= max ?u v
...
We solve them by creating a fresh metavariable ?w
?u := max ?w v
Remark: this is a precise solution.
2017-02-02 22:30:30 -08:00
Leonardo de Moura
b2968f450c
fix(frontends/lean/elaborator): use expected type when elaborating application for the form (c^.fn a)
...
For example, the following definition did not work before this commit:
protected meta def map {α β} (f : α → β) : lazy_tactic α → lazy_tactic β
| t s := (t s)^.for (λ ⟨a, new_s⟩, (f a, new_s))
2017-02-02 19:56:50 -08:00
Leonardo de Moura
9bee8ce36d
fix(frontends/lean/elaborator): thunk gadget should not be considered in patterns
...
The new test demonstrates the problem.
2017-02-02 17:28:03 -08:00
Johannes Hölzl
3be8deb2d2
fix(library/tactic/generalize_tactic): instantiate mvars before calling kabstract
2017-02-01 18:48:10 -08:00
Leonardo de Moura
a9821f6437
fix(library/type_context): bug in revert method
...
We should not assume that the arguments at to_revert are sorted by idx.
This commit fixes the bug reported at:
https://groups.google.com/forum/#!topic/lean-user/x4Zwpou3le0
2017-02-01 10:51:24 -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
7cc31835e4
refactor(library/init/meta/fun_info): cleanup fun_info API
2017-01-31 18:01:54 -08:00
Leonardo de Moura
49a0d13c50
feat(library/init/coe): add coercion from A to (option A)
...
A little hack is used to make sure type class resolution will not enter
in an infinite loop.
2017-01-31 17:45:41 -08:00
Leonardo de Moura
920e845b84
refactor(library/init/meta/congr_lemma): cleanup congr_lemma API
2017-01-31 16:46:13 -08:00
Leonardo de Moura
2874a783e0
test(tests/lean/run/defaul_param3): more tests for default param values
2017-01-31 15:28:06 -08:00
Leonardo de Moura
be6ca7c244
feat(frontends/lean): allow default parameter values in constant decls
2017-01-31 15:19:47 -08:00
Leonardo de Moura
3a4ef00f66
feat(frontends/lean): allow constructor parameters to be declared before ':'
2017-01-31 15:11:39 -08:00
Leonardo de Moura
d315e424ff
feat(library/congr_lemma, library/fun_info): make sure opt_param gadget do not confuse the simplifier, fun_info, congr_lemma, etc
...
A definition such as
def f (a : nat) (b : nat := a) (c : nat := a) :=
a + b + c
should *not* be treated as a dependent function.
2017-01-30 20:23:45 -08:00
Leonardo de Moura
d3db3661af
refactor(library/init/core): simpler has_sep type class with out_param
2017-01-30 18:54:56 -08:00
Leonardo de Moura
04a8518104
refactor(library/init/core): simpler has_insert type class with out_param
2017-01-30 18:50:21 -08:00