Leonardo de Moura
56dba5b98a
fix(frontends/lean/elaborator): fixes #1930
...
@kha the following idiom is not safe
```
while (is_pi(t)) {
t = whnf(binding_body(t));
}
```
`whnf(e)` assumes that `e` does not have dangling deBruijn variables.
We should use (the more expensive):
```
while (is_pi(t)) {
t = whnf(instantiate(binding_body(t), locals.push_local_from_binding(t)));
}
```
BTW, this problem is not related to the assertion violation at #1930
I just stumbled on it when fixing the violation.
2018-02-19 08:51:26 -08:00
Nuno Lopes
7b45d28e77
chore(unicode): use utf8 chars directly in strings
2018-02-13 10:42:08 -08:00
Nuno Lopes
c43ebd8bf7
fix(msvc): remove another \uXX char that was causing an infinite loop
2018-02-13 10:42:08 -08:00
Nuno Lopes
977e11f9be
fix(warnings): fix warnings on VS. its now /W2 clean
2018-02-13 10:42:08 -08:00
Sebastian Ullrich
affe3463ab
fix(frontends/lean/elaborator): fix assertion error: accidental mutation of a variable
2018-02-08 14:07:08 +01:00
Sebastian Ullrich
5736fda1ee
chore(frontends/lean/elaborator): do not name mvars from { .. } catchall
...
We already use the same names for the field mvars, which can be confusing during debugging
2018-02-08 14:04:33 +01:00
Nuno Lopes
c1a768b7a7
fix(msvc): further work on MSVC port
...
only 7 files left
2018-02-06 10:11:10 -08:00
Sebastian Ullrich
4d5bd6d03c
fix(frontends/lean/elaborator): fix build
2018-02-02 20:53:24 +01:00
Sebastian Ullrich
703d12d594
feat(frontends/lean/elaborator): do not execute tactics after error recovery
2018-02-02 08:58:53 -08:00
Sebastian Ullrich
b3262d53b4
feat(frontends/lean/elaborator): structure notation: fall back to inferring superclasses
2018-02-02 08:58:53 -08:00
Sebastian Ullrich
86e231e6c9
feat(frontends/lean/structure_cmd): make superclass fields inst implicit
2018-02-02 08:58:53 -08:00
Sebastian Ullrich
9f25cf665e
feat(frontends/lean/elaborator): structure instance notation: allow implicit fields
2018-02-02 08:58:53 -08:00
Sebastian Ullrich
6eeb90c8fb
chore(frontends/lean/elaborator): remove confusing assign_mvar method
2018-02-02 08:58:53 -08:00
Sebastian Ullrich
040748419f
refactor(frontends/lean/elaborator): refactor and document structure instance notation code
2018-02-02 08:58:53 -08:00
Sebastian Ullrich
6ab13a433d
chore(library/type_context): should not have an implicit constructor, copy constructor, or assignment operator
2018-02-02 08:58:53 -08:00
Sebastian Ullrich
3f497b8d8e
fix(library/constructions/projection): out_params should always be implicit in projections
2018-02-02 08:58:52 -08:00
Sebastian Ullrich
33936cc4ad
feat(frontends/lean/decl_cmds): save ident infos after attribute cmd
2018-02-02 08:58:52 -08:00
Sebastian Ullrich
be61ab4213
chore(frontends/lean/pp): document binding power intricacies
2018-02-02 08:58:52 -08:00
Sebastian Ullrich
e427068081
fix(frontends/lean/pp): missing parentheses around notation
2018-02-02 08:58:52 -08:00
Sebastian Ullrich
9f60fd5492
feat(frontends/lean/elaborator): ignore more sorry-containing type mismatch messages
2018-02-02 08:58:52 -08:00
Sebastian Ullrich
2f2540dc3b
fix(frontends/lean/definition_cmds): hide kernel exceptions triggered by error recovery
...
They are never helpful compared to the original error
2018-02-02 08:58:52 -08:00
Sebastian Ullrich
c600bca747
feat(frontends/lean/definition_cmds): hide scary kernel exception on duplicate declaration
2018-02-02 08:58:52 -08:00
Sebastian Ullrich
009cff6f79
feat(frontends/lean/elaborator): prefer taking subobjects from structure notation sources as a whole
...
This guarantees definitional equality on the field as witnessed by the test
2018-02-02 08:58:52 -08:00
Leonardo de Moura
b063edb6c7
chore(frontends/lean/elaborator): remove dead code
2018-02-02 08:49:10 -08:00
Leonardo de Moura
ec1a490a15
chore(*): annotate candidates for thread local cache reset
2018-02-01 14:59:37 -08:00
Leonardo de Moura
3fa487c153
fix(frontends/lean/decl_util): as-is annotation was leaking into elaborated terms
...
@kha This commit fixes the repro you sent me. Could you please check
whether it also fixes the original file?
2018-01-30 12:48:48 -08:00
Leonardo de Moura
97ed299ce4
chore(frontends/lean/util): remove dead function
2018-01-30 12:48:48 -08:00
Leonardo de Moura
fa6697ffa8
feat(frontends/lean/pp): add option pp.annotations for debugging purposes
2018-01-30 12:48:48 -08:00
Leonardo de Moura
1e626e382f
chore(frontends/smt2): remove SMT2 frontend
2018-01-24 15:21:52 -08:00
Leonardo de Moura
0ad5497462
refactor(library/io): make io easier to extend and use
2018-01-23 15:03:31 -08:00
Sebastian Ullrich
e8c057f1de
refactor(library/module_mgr): simplify module loading code
2018-01-23 11:14:18 -08:00
Leonardo de Moura
9eb22cd548
feat(library/constructions/injective): automatically generate auxiliary lemma *.inj_eq for constructors
...
We are going to use these lemmas in the simplifier.
2018-01-12 16:41:12 -08:00
Leonardo de Moura
c5df94ed17
feat(library/tactic): add support for auto params at simp tactic
2018-01-11 16:47:22 -08:00
Leonardo de Moura
60be2bf2aa
feat(frontends/lean/builtin_cmds): use type_context to implement #reduce command
2018-01-09 16:42:52 -08:00
Leonardo de Moura
0c5c1a27c6
refactor(frontends/lean, library/equations_compiler): move smart unfolding auxiliary function generation to equations_compiler module
2018-01-09 16:27:36 -08:00
Leonardo de Moura
a55b641651
chore(library/type_context): add mk_smart_unfolding_name_for
2018-01-09 16:19:59 -08:00
Leonardo de Moura
6ab792733d
feat(library/type_context): smart unfolding
...
closes #1794
2018-01-09 15:09:08 -08:00
Leonardo de Moura
e0bdb10ab4
fix(library/type_context): clenaup whnf_head_pred
...
The code had a few leftovers from the old `whnf_pred` method.
We don't use `whnf_pred` anymore.
2018-01-08 11:31:03 -08:00
Leonardo de Moura
587540f11b
feat(frontends/lean): add abbreviation command
...
This command is not just a cosmetic feature.
We need it to defined `id_rhs` before the tactic framework is defined.
We want `id_rhs` to be used in all definitions generated by the equation
compiler. Right now, it is only used in definitions defined after the
tactic framework.
2018-01-05 15:40:59 -08:00
Leonardo de Moura
e9650d835d
chore(library/type_context): cleanup metavar method names
...
This commit also fixes some corner case bugs at is_def_eq
2018-01-03 13:49:42 -08:00
Leonardo de Moura
8621be6335
fix(frontends/lean): closes #1898
2018-01-02 12:33:00 -08:00
Sebastian Ullrich
a36376a6cf
fix(frontends/lean/builtin_cmds): #eval: set message caption
2017-12-22 11:04:46 +01:00
Leonardo de Moura
8b835f9ab6
fix(frontends/lean): fixes #1890
...
It fixes the issue by propagating the correct information to the
equation compiler.
The fix may be a little bit hackish, but it is comapatible with
the approach we are already using: store `m_is_meta` flag in the equation
macro.
Disclaimer: we may still have other instances of this bug, since
the information may still be propagated incorrectly in other places.
I will not refactor this code right now nor accept any PR that
changes the current design. I am busy in other parts of the code
base and do not have time to do the context switch required for
implementing this kind of change and/or review the PR and make sure I'm
happy with it.
2017-12-17 09:42:06 -08:00
Leonardo de Moura
f0352d31a1
feat(library/type_context, library): inout ==> out modifier in type class declarations
...
@kha: I decided to implement this change before I start the
type_context modifications. The change did not affect the corelib and
test suite much. The only annoying problem is that `out` cannot be
used to name locals anymore.
2017-12-15 14:46:47 -08:00
Leonardo de Moura
7106bcf7a5
chore(frontends/lean/inductive_cmds): remove app_builder dependency
2017-12-15 11:35:34 -08:00
Leonardo de Moura
6c44dd1b7f
feat(frontends/lean): add hide command
...
cc: @kha
2017-12-13 11:53:21 -08:00
Leonardo de Moura
ef784ce7b8
fix(library/tactic/simp_lemmas): auto_params when adding simp lemmas
2017-12-09 09:47:39 -08:00
Leonardo de Moura
51a87212fa
chore(frontends/lean/inductive_cmds): remove copy&paste code
2017-12-04 15:56:04 -08:00
Sebastian Ullrich
450ca5834c
fix(frontends/lean/parser): fix debug build
2017-11-30 17:47:49 +01:00
Sebastian Ullrich
7c63b2f046
fix(frontends/lean/parser): unicode pattern aliases
2017-11-27 12:43:15 +01:00