Gabriel Ebner
ce44566c7d
fix(frontends/lean/parser): do not skip command tokens after error recovery
2017-05-23 11:14:31 -07:00
Gabriel Ebner
47629e9da3
feat(frontends/lean): make most parser_errors recoverable
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
6b956ad658
fix(frontends/lean): prevent endless loops
2017-05-23 11:14:30 -07:00
Gabriel Ebner
345cd1bc2a
feat(frontends/lean/parser): error recovery in interactive tactics
2017-05-23 11:14:30 -07:00
Gabriel Ebner
8c80cb8fe9
feat(frontends/lean/equations_validator): report errors instead of
...
exceptions
2017-05-23 11:14:30 -07:00
Gabriel Ebner
00ac867ddf
feat(frontends/lean/elaborator,library/sorry): suppress error message that mention synthetic sorrys
2017-05-23 11:14:30 -07:00
Gabriel Ebner
1468461c47
feat(frontends/lean): recover from many parser errors
2017-05-23 11:14:30 -07:00
Sebastian Ullrich
84997bf4de
refactor(init/meta/expr): unify expr and pexpr
2017-05-17 10:38:12 -07:00
Sebastian Ullrich
8c0394b294
refactor(library,frontends/lean): separate expr and pexpr macros
2017-05-09 16:02:41 -07:00
Sebastian Ullrich
2825c5fbcc
feat(frontends/lean/elaborator): elaborate ``(e) to type reflected e` if possible and add coercion reflected -> expr
2017-05-09 16:02:41 -07:00
Gabriel Ebner
d79909a1b8
refactor(util/lean_path): support leanpkg.path files
2017-05-01 14:11:38 -07:00
Gabriel Ebner
baa4c48f1f
refactor(util/lean_path): explicitly pass around search path
2017-05-01 14:11:38 -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
Gabriel Ebner
489b3304bd
fix(frontends/lean/parser): allow enabling profiler via set_option
2017-04-23 11:22:50 -07:00
Gabriel Ebner
9424e6fa24
refactor(frontends/lean/definition_cmds): make profiling threshold configurable
2017-04-23 11:22:41 -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
Sebastian Ullrich
669c4130b1
fix(frontends/lean/builtin_expr): no field notation after @/@@
2017-03-31 09:40:49 -07:00
Sebastian Ullrich
3c8e176fb0
fix(frontends/lean/interactive): fix info on new field notation
2017-03-31 09:40:49 -07:00
Sebastian Ullrich
add8836ab2
fix(frontends/lean/{elaborator,parser}): use position of '.' for field notation position
...
Note that flycheck will still highlight the entire word...
2017-03-31 09:40:49 -07:00
Sebastian Ullrich
b92af074c0
feat(kernel/pos_info_provider): add save_pos_info
...
Allows the elaborator to contribute new info locations
2017-03-31 09:40:48 -07:00
Leonardo de Moura
ad859817b1
feat(frontends/lean): allow local decls to shadow namespaces
2017-03-29 16:09:45 -07:00
Leonardo de Moura
71685e4dd6
feat(frontends/lean): add support for t.<id> and t.<idx> when t is a composite term
...
Replace `^.` with `.` in the stdlib
2017-03-28 17:47:49 -07:00
Leonardo de Moura
87932f1c56
feat(frontends/lean): change notation for inaccessible patterns
...
The following are accepted
.(t)
._
We don't accept .t anymore because it will conflict with the field
access notation.
2017-03-28 16:09:15 -07:00
Leonardo de Moura
6183c7676e
feat(frontends/lean): use . for field access
2017-03-28 15:29:54 -07:00
Leonardo de Moura
07c29c0779
chore(library/abstract_parser,frontends/lean/parser): remove dead code
2017-03-28 11:51:50 -07:00
Sebastian Ullrich
e63c1d3347
refactor(frontends/lean/info_manager): use pos_info
2017-03-27 14:01:19 -07:00
Gabriel Ebner
318910f99b
refactor(frontends/lean/parser): store snapshots in a lazy async list
2017-03-27 14:00:53 -07:00
Gabriel Ebner
2c7b6fc48f
fix(frontends/lean/parser): only show sorry warning once per import
2017-03-24 09:19:17 +01:00
Gabriel Ebner
7442aa0752
fix(frontends/lean/parser): better task description
2017-03-24 07:22:28 +01:00
Gabriel Ebner
a6f7f31e85
refactor(shell,emacs): handle different checking modes in server
2017-03-23 09:07:09 +01:00
Gabriel Ebner
c7ca21625c
feat(util/log_tree): annotate nodes with detail levels
2017-03-23 09:03:43 +01:00
Gabriel Ebner
98f86ccabd
chore(frontends/lean/parser): remove obsolete option
2017-03-23 09:01:00 +01:00
Gabriel Ebner
26ba9c23a7
refactor(util/task): add eager execution
2017-03-23 08:57:56 +01:00
Gabriel Ebner
5f872912e0
refactor(shell/lean): set exit status 1 iff at least one error was reported
2017-03-23 08:57:56 +01:00
Gabriel Ebner
595cbb8fe9
refactor(*): task<T>, log_tree, cancellation_token
2017-03-23 08:57:52 +01:00
Leonardo de Moura
e6c5ba29d6
fix(library/message_builder): remove unnecessary field
...
see #1473
2017-03-22 08:23:29 -07:00
Sebastian Ullrich
f9854be13f
feat(frontends/lean/parser): save id info for non-overloaded constants
2017-03-22 07:35:14 -07:00
Leonardo de Moura
fdadada3a9
fix(frontends/lean): fixes #1468
...
@kha I had to add yet another hack to fix this issue.
In notation declarations, names are resolved at notation declaration time.
So, users do not expect them to be resolved again at tactic execution time.
I addressed this problem by wrapping constants occurring in notation
declarations with a "frozen_name" annotation. This transformation is
only performed if m_in_quote is true.
Then resolve_names_fn at elaborator.cpp will not try to resolve the
names again.
This change broke two other modules. `-` notation for inverting
equations at `rw`, and `calc` expressions inside quotes.
The broke for the same reason. They were not expecting the constants
to be wrapped with an annotation.
2017-03-18 13:48:21 -07:00
Sebastian Ullrich
e0856284b0
feat(frontends/lean,emacs): tactic info before elaboration, fix many edge cases
2017-03-17 18:20:44 -07:00
Sebastian Ullrich
421a6d6f01
feat(frontends/lean/interactive,emacs): highlight current tactic parameter
2017-03-17 18:20:44 -07:00
Sebastian Ullrich
0792bc13db
feat(frontends/lean/elaborator,init/meta/interactive): relax expr pattern elaboration and use it to implement a tactic signature pretty printer
2017-03-17 18:20:44 -07:00
Leonardo de Moura
23935ee390
feat(frontends/lean): allow auto_param notation in structure declarations
...
See #1422
TODO: take the auto_param into account in the `{ ... }` notation.
2017-03-08 15:41:30 -08:00
Sebastian Ullrich
5d68938a9c
feat(frontends/lean): expr literals ```(...)
2017-03-05 08:37:16 -08:00
Leonardo de Moura
1fa1312c57
chore(CMakeLists,frontends/lean): add SAVE_SNAPSHOT=OFF SAVE_INFO=OFF compilation options
2017-02-28 12:09:19 -08:00
Sebastian Ullrich
dfe1874365
refactor(frontends/lean/{parser,util}): extract quote functions
...
Also fixes ``f when f is private
2017-02-23 01:52:13 +01:00
Sebastian Ullrich
1c7ca3f20a
feat(frontends/lean/parser): ignore implicit arguments in expr patterns
2017-02-23 01:52:13 +01:00
Sebastian Ullrich
908a7bd9f3
feat(frontends/lean/parser): expr patterns
2017-02-23 01:52:13 +01:00
Sebastian Ullrich
b9424975b3
refactor(init/meta): replace dynamically-checked quotes where possible
2017-02-17 19:59:57 -08:00