Commit graph

1618 commits

Author SHA1 Message Date
Leonardo de Moura
25e41b9b09 fix(frontends/lean/scanner): fixes #626 2015-05-26 11:33:38 -07:00
Leonardo de Moura
ab58e538a4 feat(frontends/lean/elaborator): hide auxiliary 'match' hypothesis during elaboration 2015-05-25 15:24:56 -07:00
Leonardo de Moura
24b35eefe6 chore(frontends/lean/elaborator): add assertion for sanity checking 2015-05-25 14:04:27 -07:00
Leonardo de Moura
b83b0c0017 fix(library/tactic/induction_tactic): fixes #619 2015-05-21 18:22:07 -07:00
Leonardo de Moura
f830bf54c2 refactor(*): clarify name_generator ownership 2015-05-21 14:32:36 -07:00
Leonardo de Moura
c2faa0fe98 refactor(library): rename equivalence_manager to relation_manager 2015-05-21 12:25:02 -07:00
Leonardo de Moura
89581cead7 fix(frontends/lean/parser): fixes #616 2015-05-20 23:33:41 -07:00
Leonardo de Moura
2d22bb8ea2 feat(frontends/lean/builtin_cmds): do not unfold proofs in the eval command
In the future, we should probably add an option for unfolding proofs.
2015-05-20 19:14:57 -07:00
Leonardo de Moura
d5da659be7 feat(frontends/lean/elaborator): include overload information in error messages 2015-05-20 17:21:27 -07:00
Leonardo de Moura
76c3757db7 feat(frontends/lean/elaborator): use custom normalizers for detecting whether there are coercions from/to a given type
closes #547
2015-05-20 16:12:12 -07:00
Leonardo de Moura
608984cd4c chore(frontends/lean/elaborator): cleanup ensure fun 2015-05-20 15:10:45 -07:00
Leonardo de Moura
af3f0088f4 feat(frontends/lean): add 'override' (notation) command 2015-05-20 11:42:16 -07:00
Leonardo de Moura
8ce992b077 feat(frontends/lean/builtin_exprs): allow 'obtain' to be used in tactic mode 2015-05-19 16:26:02 -07:00
Leonardo de Moura
c133d26505 feat(frontends/lean/builtin_exprs): change how 'show' is processed in tactics
Unresolved placeholders were not being reported
2015-05-19 16:23:50 -07:00
Leonardo de Moura
5f628d5080 feat(frontends/lean/builtin_exprs): allow 'calc' expressions to be used in tactic mode 2015-05-19 15:54:49 -07:00
Leonardo de Moura
3e87f09d78 feat(library/tactic/induction_tactic): add support for user-defined recursors that contain parameters that should be synthesized by type class resolution 2015-05-19 15:33:46 -07:00
Leonardo de Moura
937d6ac7b6 fix(frontends/lean/pp): print notation produces incorrect output
fixes #604
2015-05-19 09:57:13 -07:00
Leonardo de Moura
e1c2340db2 fix(frontends/lean): consistent behavior for protected declarations
see https://github.com/leanprover/lean/issues/604#issuecomment-103265608

closes #609
2015-05-18 22:35:18 -07:00
Leonardo de Moura
d8bd3c21b5 feat(frontends/lean/builtin_cmds): display "protected" for protected declarations in the print command 2015-05-18 17:19:34 -07:00
Leonardo de Moura
c53b96c8d3 feat(frontends/lean): print all options for overloaded identifier
closes #608
2015-05-18 17:14:17 -07:00
Leonardo de Moura
c61c049152 feat(library/user_recursors): generalize acceptable use-defined recursors
see issue #492
2015-05-18 14:21:10 -07:00
Leonardo de Moura
b1ece388a6 feat(frontends/lean,library/tactic/induction_tactic): improve induction tactic notation, expand induction tactic implementation 2015-05-18 09:25:07 -07:00
Leonardo de Moura
7f8afcf04b fix(frontends/lean/builtin_exprs): bug in 'using' expressions 2015-05-14 17:17:48 -07:00
Leonardo de Moura
cbcaf5a48e fix(frontends/lean/scanner): block comments
fixes #600
2015-05-13 22:14:28 -07:00
Leonardo de Moura
ed388b00f1 fix(frontends/lean/builtin_cmds): issue #597 2015-05-13 15:34:34 -07:00
Leonardo de Moura
11fbee269b fix(frontends/lean/parser): must save state of name_generator in parser snapshot
To provide typing and auto-completion information, we create a
background process by starting lean with the option --server.
In "server" mode, we create snapshots of the parser state.
The idea is to be able to quickly reprocess a file when the user makes a
modification. This commit fixes a bug in the snapshot operation.
It was not saving in the snapshots the unique name generator used by the parser.
By creating a fresh name generator, we may accidentally
assign the same internal name to two different constants.
This bug triggered the crash described in issue #593.

This commit fixes the test in the comment
https://github.com/leanprover/lean/issues/593#issuecomment-101768484

This commit also adds a smaller version of the problem to the test suite
2015-05-13 12:28:23 -07:00
Leonardo de Moura
2014a4a672 chore(script/gen_tokens_cpp): mark automatically generated global variables as static 2015-05-12 17:15:31 -07:00
Leonardo de Moura
358afcf42c fix(script/gen_tokens_cpp): automatically generated header 2015-05-12 17:11:27 -07:00
Leonardo de Moura
c60f11ab05 refactor(frontends/lean): add script for automatically generating tokens.h and tokens.cpp 2015-05-12 17:07:08 -07:00
Leonardo de Moura
f403ea984b feat(frontends/lean): add 'print [recursor]' command for debugging purposes 2015-05-12 15:48:24 -07:00
Leonardo de Moura
750f6d5a43 feat(library,frontends/lean): validate user defined recursors and add attribute to mark them
see issue #492

The user-defined recursors will also be used to implement the blast tactic
2015-05-12 15:48:01 -07:00
Leonardo de Moura
3d8586088b fix(frontends/lean/elaborator): problem with 'calc' proofs discussed at issue #592 2015-05-11 13:22:39 -07:00
Leonardo de Moura
299fd5c919 feat(frontends/lean/pp): pp inaccessible patterns 2015-05-10 11:08:02 -07:00
Leonardo de Moura
e9c8de7bdf feat(frontends/lean): remove unnecessary option 2015-05-09 11:49:55 -07:00
Leonardo de Moura
bd28396be0 feat(kernel): transparent theorems
closes #576
2015-05-09 11:42:29 -07:00
Leonardo de Moura
4e35afedcc feat(frontends/lean): rename 'wait' to 'reveal'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2015-05-08 20:54:16 -07:00
Leonardo de Moura
f8e2f68ce0 feat(frontends/lean): add 'wait' command
This commit also fixes several problems with -j option (parallel
compilation). The .olean files were not missing data when -j was used

see issue #576
2015-05-08 20:05:21 -07:00
Leonardo de Moura
e6566e5814 fix(frontends/lean/parser): incorrect error message 2015-05-08 18:13:44 -07:00
Leonardo de Moura
e59456c19f feat(frontends/lean): remove 'opaque' keyword
see issue #576
2015-05-08 16:45:13 -07:00
Leonardo de Moura
cf7e60e5a6 refactor(kernel): remove "opaque" field from kernel declarations
see issue #576
2015-05-08 16:06:16 -07:00
Leonardo de Moura
57ea660963 refactor(*): start process for eliminating of opaque definitions from the kernel
see issue #576
2015-05-08 16:06:04 -07:00
Leonardo de Moura
061e26157e fix(kernel,library): make sure macros check relevant arguments when kernel is performing full type checking 2015-05-08 12:41:23 -07:00
Leonardo de Moura
12bad8794b feat(frontends/lean/pp): use 'assert' instead of 'have ... [visible]' 2015-05-08 10:02:15 -07:00
Leonardo de Moura
0b57f7d00a refactor(library/tactic): refine interface between tactic and proof-term modes
Some constraints were being lost with the previous interface.
This is why we had a workaround in fintype.lean.

We can also remove some hacks we have used in the past.
2015-05-07 18:02:51 -07:00
Leonardo de Moura
f6a1d1c864 fix(frontends/lean/parser): fixes #584 2015-05-07 14:24:30 -07:00
Leonardo de Moura
aff9257c72 feat(frontends/lean): allow → to be used in calc proofs
see issue #586
2015-05-07 12:28:47 -07:00
Leonardo de Moura
b03266be70 feat(library/normalize,frontends/lean): rename '[unfold-m]' hint to '[constructor]', and allow it to be attached to constants
closes #587
2015-05-07 12:00:34 -07:00
Leonardo de Moura
5fdf140096 refactor(frontends/lean): simplify local_decls data-structure
This is the first step for fixing #584
2015-05-07 11:10:15 -07:00
Leonardo de Moura
e0b7017435 feat(frontends/lean): make sure the proof state bit "report errors" is
set in the beginning of each begin-end element

see discussion at #583
2015-05-07 09:43:39 -07:00
Leonardo de Moura
5798ac43de fix(frontends/lean/structure_cmd): 'structure' command must set unfold-c attribute for auxiliary recursors
fixes #582
2015-05-07 09:09:07 -07:00
Leonardo de Moura
171530d5cc fix(frontends/lean/notation_cmd): fixes #585 2015-05-07 08:36:37 -07:00
Leonardo de Moura
613281d622 fix(frontends/lean/builtin_exprs): bug in new 'obtain' expression 2015-05-06 10:01:24 -07:00
Leonardo de Moura
26c662accd feat(frontends/lean/builtin_exprs): improve new 'obtain' expression 2015-05-06 09:56:57 -07:00
Leonardo de Moura
4cdfc9ee84 feat(frontends/lean/pp): add pretty printing functions for debugging purposes 2015-05-06 07:50:56 -07:00
Leonardo de Moura
7cd444882c feat(frontends/lean): add 'begin+' and 'by+' that enter tactic mode with the whole context visible 2015-05-05 18:47:25 -07:00
Leonardo de Moura
616f49c2e4 feat(frontends/lean): improved 'obtains' expression 2015-05-05 18:30:16 -07:00
Leonardo de Moura
8aefcc182e feat(frontends/lean/parser): add 'parse_simple_binders' 2015-05-05 18:30:16 -07:00
Leonardo de Moura
6571c47353 feat(library/normalize): add '[unfold-m]' hint
See issue #496
2015-05-04 14:23:04 -07:00
Leonardo de Moura
87aaf373f4 fix(frontends/lean): fix '#' override notation on the left-hand-side of recursive equations (and match-expressions) 2015-05-03 21:08:09 -07:00
Leonardo de Moura
441f1f9fe2 feat(frontends/lean): import error message for "unknown" tactics when parsing 2015-05-02 18:57:58 -07:00
Leonardo de Moura
118189eaac fix(frontends/lean/elaborator): bug in translation function
This commit fixes the bug reported in the lean discussion list:
https://groups.google.com/forum/#!topic/lean-discuss/oyzgIqdMyNc
2015-05-02 18:05:07 -07:00
Leonardo de Moura
8c107d6936 fix(frontends/lean/builtin_cmds): bug in export command
Cause: we have two different tokes to represent declarations: [decls] and [declarations]

fixes #568
2015-05-02 16:01:25 -07:00
Leonardo de Moura
cd17618f4a refactor(library): replace 'calc_trans', 'calc_symm', 'calc_refl' and 'calc_subst' commands with attributes '[symm]', '[refl]', '[trans]' and '[subst]'
These attributes are used by the calc command.
They will also be used by tactics such as 'reflexivity', 'symmetry' and
'transitivity'.

See issue #500
2015-05-02 15:15:35 -07:00
Leonardo de Moura
ce5ef5a6cc feat(frontends/lean): improver parser for tactics of the form 'tac_name <expr> with <ids*>' 2015-05-01 13:06:11 -07:00
Leonardo de Moura
2d9c950144 feat(library/tactic/constructor_tactic): allow 'constructor' tactic without index
see issue #500
2015-04-30 21:15:07 -07:00
Leonardo de Moura
3233008039 feat(library/tactic): allow user to name generalized term in the 'generalize' tactic
closes #421
2015-04-30 11:57:40 -07:00
Leonardo de Moura
3912bc24c8 feat(frontends/lean): nicer syntax for 'intros' 'reverts' and 'clears' 2015-04-30 11:00:39 -07:00
Leonardo de Moura
d6d30f12c6 feat(frontends/lean): add "polymorphic" print command
closes #524
2015-04-29 16:17:33 -07:00
Leonardo de Moura
1a28a3c36f feat(frontends/lean): add 'print inductive' command 2015-04-29 15:22:10 -07:00
Leonardo de Moura
d2c7b5c319 feat(library/tactic): add 'let' tactic
closes #555
2015-04-28 17:24:43 -07:00
Leonardo de Moura
1be72f1faa feat(frontends/lean): parse argument of unary tactis with rbp=0, tokens may have a different precedence in expression and tactic modes 2015-04-28 13:43:05 -07:00
Leonardo de Moura
4283111198 fix(frontends/lean): missing files 2015-04-28 10:55:04 -07:00
Leonardo de Moura
a23118d357 feat(frontends/lean): add tactic_notation command
This addresses the first part of issue #461

We still need support for tactic definitions
2015-04-27 17:46:13 -07:00
Leonardo de Moura
bdef7aaf40 feat(frontends/lean/pp): add check_system at pretty printer 2015-04-27 14:21:53 -07:00
Leonardo de Moura
d41e055d1c feat(frontends/lean/migrate_cmd): catch memory error in the migrate command 2015-04-27 12:58:11 -07:00
Leonardo de Moura
9d01868361 feat(frontends/lean): use rewrite tactic to implement unfold (it has a unfold step)
closes #502
2015-04-24 17:23:12 -07:00
Leonardo de Moura
6134c8822a fix(frontends/lean/util): assertion violation
fixes #559
2015-04-24 15:09:23 -07:00
Leonardo de Moura
f723550d33 feat(frontends/lean/elaborator): decorates error message with free variables introduced by the left-hand-side of the equation
closes #528
2015-04-24 14:58:15 -07:00
Leonardo de Moura
8241863abe feat(kernel/hits): add two builtin HITs: type_quotient and trunc 2015-04-23 15:32:31 -07:00
Leonardo de Moura
2613e7c444 fix(frontends/lean): bug when handling identifiers in tactics
This bug was reported by Jeremy in the Lean Google group:
https://groups.google.com/forum/?utm_medium=email&utm_source=footer#!msg/lean-discuss/ZKJ8WPPEVJA/n05x6rPRzvMJ
2015-04-22 16:03:22 -07:00
Leonardo de Moura
cdf929d178 fix(frontends/lean/local_decls): missing '{}' around macro 2015-04-22 12:54:42 -07:00
Leonardo de Moura
a526cd92ac fix(frontends/lean): bug in pretty printer
this is related to issue #530
2015-04-22 12:44:08 -07:00
Leonardo de Moura
dc93603b4a feat(frontends/lean): parameter and variable binder type update
see issue #532
2015-04-22 12:28:11 -07:00
Leonardo de Moura
91f21c007a feat(frontends/lean): remove 'context' command 2015-04-22 11:32:02 -07:00
Leonardo de Moura
53653c3526 fix(frontends/lean): pretty printing in sections with parameters
fix #530
2015-04-21 22:44:09 -07:00
Leonardo de Moura
caf28f4053 fix(frontends/lean/decl_cmds): missing condition 2015-04-21 21:08:57 -07:00
Leonardo de Moura
22f6a95cc4 feat(frontends/lean): local notation override global one 2015-04-21 19:55:59 -07:00
Leonardo de Moura
fe9f4dd95f fix(frontends/lean): another bug in sections with parameters 2015-04-21 19:50:21 -07:00
Leonardo de Moura
3df99e514b fix(frontends/lean): problems with sections 2015-04-21 19:46:57 -07:00
Leonardo de Moura
52e9ad1a98 feat(frontends/lean): allow persistent notation declaration in sections (when they do not contain parameters)
see issue #554
2015-04-21 19:04:06 -07:00
Leonardo de Moura
bf8a7eb9b4 fix(library/scoped_ext): bug in local metadata in sections
The problem is described in issue #554
2015-04-21 18:56:28 -07:00
Leonardo de Moura
107763a506 fix(frontends/lean): better error message for 'proof ... qed' blocks containing unsolved placeholders 2015-04-20 15:50:37 -07:00
Leonardo de Moura
df05edf333 feat(frontends/lean): generate warning when 'exit' is used
closes #553
2015-04-20 14:45:39 -07:00
Leonardo de Moura
60e320fd79 feat(frontends/lean): protected constants and axioms
fixes #527
2015-04-19 17:45:58 -07:00
Leonardo de Moura
2bc13f6bfd feat(library/tactic/exact): enforce goal type during elaboration when executing 'exact' tactic
Remark: this was the behavior of the 'sexact' tactic.

This commit also adds the 'rexact' (relaxed exact) tactic which does not
enforce the goal type.

closes #495
2015-04-06 13:23:38 -07:00
Leonardo de Moura
754276a660 feat(frontends/lean): round parenthesis for [tactic1 | tactic2]
This commit also replaces the notation for divides
     `(` a `|` b `)`
with
      a `∣` b

The character `∣` is entered by typing \|

closes #516
2015-04-06 09:24:09 -07:00
Leonardo de Moura
969d17fd12 fix(frontends/lean/elaborator): class inference in tactic mode with trunc
closes #477
2015-04-05 17:47:14 -07:00
Leonardo de Moura
d731a4ab13 feat(library/normalize): add '[unfold-f]' hint
closes #497
2015-04-05 03:00:13 -07:00
Leonardo de Moura
d591c63840 feat(frontends/lean/decl_cmds): allow local coercions in contexts
closes #525
2015-04-04 15:25:07 -07:00
Leonardo de Moura
8c59f17605 feat(frontends/lean): 'using' expression without 'show' or 'have'
closes #536
2015-04-04 15:25:07 -07:00
Leonardo de Moura
4ec0e1b07c feat(frontends/lean): improve calc mode
Now, it automatically supports transitivity of the form
    (R a b) -> (b = c) -> R a c
    (a = b) -> (R b c) -> R a c

closes #507
2015-04-04 08:58:35 -07:00
Leonardo de Moura
1150b19598 perf(frontends/lean/elaborator): do not invoke recursive equation compiler when equations still contain metavariables 2015-04-02 23:37:33 -07:00
Leonardo de Moura
b960e123b1 feat(kernel): add experimental support for quotient types 2015-03-31 22:04:16 -07:00
Leonardo de Moura
4eb270a572 fix(frontends/lean/pp): extra space 2015-03-31 15:07:32 -07:00
Leonardo de Moura
26c914173c feat(frontends/lean): add --profile option 2015-03-31 11:53:55 -07:00
Leonardo de Moura
46777fdd1d fix(frontends/lean/migrate_cmd): bug when using migrate command with option --to_axiom 2015-03-30 16:22:06 -07:00
Leonardo de Moura
8c76419c60 fix(frontends/lean/decl_cmds): error localization problem for recursive equations 2015-03-30 13:30:29 -07:00
Leonardo de Moura
cb2a5eeb3c feat(frontends/lean/inductive_cmd): local notation in inductive decls 2015-03-30 02:14:26 -07:00
Leonardo de Moura
033f3b630d feat(frontends/lean/scanner): allow upper-case greek letters in identifiers but Pi and Sigma 2015-03-30 02:14:26 -07:00
Leonardo de Moura
75621df52b feat(frontends/lean): uniform notation for lists in tactics
closes #504
2015-03-27 17:54:48 -07:00
Leonardo de Moura
242f8ba048 feat(frontends/lean/elaborator): include number of unsolved goals
See #509
2015-03-27 14:54:41 -07:00
Leonardo de Moura
a1c1fcb2f0 fix(frontends/lean/pp): bug in pretty printer new feature 2015-03-25 21:16:21 -07:00
Leonardo de Moura
0c3fd7427e feat(frontends/lean): add syntax-sugar for fold
closes #503
2015-03-25 18:25:48 -07:00
Leonardo de Moura
f2b1752807 fix(frontends/lean/parser): add workaround for #461 2015-03-25 18:09:43 -07:00
Leonardo de Moura
49bc56ec07 feat(frontends/lean/pp): improve pretty printer for prefix and postfix notation
closes #491
2015-03-25 16:45:58 -07:00
Leonardo de Moura
a1f933886f fix(frontends/lean/structure_cmd): explicit universe levels for structures
closes #490
2015-03-25 16:10:30 -07:00
Leonardo de Moura
5f1d827b26 fix(frontends/lean/decl_cmds): assertion violation
closes #506
2015-03-25 13:46:23 -07:00
Leonardo de Moura
76157ba392 fix(frontends/lean/pp): abbreviations with too much arguments
closes #480
2015-03-23 12:16:25 -07:00
Leonardo de Moura
b5acbb2228 fix(frontends/lean/pp): missing parenthesis around abbreviations
fixes #476
2015-03-16 17:12:03 -07:00
Leonardo de Moura
9b577a7b3e feat(frontends/lean): add 'migrate' command 2015-03-14 21:48:00 -07:00
Leonardo de Moura
fc3a7bac59 feat(frontends/lean): improve error handling inside match-with expressions 2015-03-13 23:25:46 -07:00
Leonardo de Moura
bed0d6df6b fix(frontends/lean/elaborator): inaccessible over coercion 2015-03-13 23:04:45 -07:00
Leonardo de Moura
cfeb426cd7 fix(frontends/lean): pretty print numeral notation from algebra 2015-03-13 18:58:34 -07:00
Leonardo de Moura
9438366e37 feat(frontends/lean/builtin_exprs): better error synchronization for 'begin...end' blocks 2015-03-13 15:22:57 -07:00
Leonardo de Moura
b88b98ac22 feat(frontends/lean): try to add definition/theorem as axiom when it fails to be processed
The idea is to avoid a "tsunami" of error messages when a heavily used
theorem breaks in the beginning of the file
2015-03-13 14:47:21 -07:00
Leonardo de Moura
f5811d6092 feat(frontends/lean): hide subterms that do not contain metavariables
when generating "unresolved metavariables" error message

closes #473
2015-03-13 12:42:57 -07:00
Leonardo de Moura
7ca882d69a fix(frontends/lean/parse_rewrite_tactic): esimp error message position information 2015-03-12 17:05:41 -07:00
Leonardo de Moura
71ce207080 fix(frontends/lean/elaborator): potential memory access violation
Before this commit, the modified method would crash if caching in the
whnf procedure was disabled.
2015-03-11 15:54:50 -07:00
Leonardo de Moura
f966634910 feat(frontends/lean): nested dependent pattern matching 2015-03-06 19:18:08 -08:00
Leonardo de Moura
1490bdad49 feat(frontends/lean): add version of 'exact' tactic (sexact) that enforces goal type during term elaboration 2015-03-06 17:34:45 -08:00
Leonardo de Moura
bd8c4315f1 feat(frontends/lean): allow 'match-with' to be used in tactics without prefixing it with 'exact' 2015-03-06 15:49:31 -08:00
Leonardo de Moura
f24d9e84fe feat(frontends/lean): add option 'max_memory'
Default value is 512Mb
2015-03-06 13:56:20 -08:00
Leonardo de Moura
3b721fe675 feat(frontends/lean): add missing 'help' command 2015-03-06 13:56:20 -08:00
Leonardo de Moura
daf36803c4 fix(frontends/lean/builtin_exprs): bug in 'using' construct 2015-03-06 13:56:20 -08:00
Leonardo de Moura
368f9d347e refactor(frontends/lean): approach used to parse tactics
The previous approach was too fragile

TODO: we should add separate parsing tables for tactics
2015-03-05 18:11:21 -08:00
Leonardo de Moura
28487ede3b feat(frontends/lean/decl_cmds): allow 'empty' set of pattern matching equations 2015-03-05 14:37:29 -08:00
Leonardo de Moura
8e9ccf8b6f chore(frontends/lean): remove 'dead' tokens 2015-03-05 14:37:29 -08:00
Leonardo de Moura
b73a931c70 fix(frontends/lean/elaborator): missing case 'no-equation' annotation 2015-03-05 14:37:29 -08:00
Leonardo de Moura
e4060a5614 feat(frontends/lean): do not force user to type the function name in the left-hand-side of recursive equations 2015-03-05 12:08:36 -08:00
Leonardo de Moura
039afb4578 feat(frontends/lean): treat "proof t qed" as alias for "by exact t" 2015-03-05 11:12:39 -08:00
Leonardo de Moura
abd238aef0 feat(*): add [quasireducible] attribute 2015-03-04 22:12:49 -08:00
Leonardo de Moura
fa79b214b8 fix(frontends/lean): allow 'attribute <id> [priority ...]' 2015-03-03 16:17:32 -08:00
Leonardo de Moura
11aad4449b feat(frontends/lean): add '[semireducible]' attribute
This commit also renames the elements of reducible_status.
The idea is to use in the C++ implementation the same names used in the
Lean front-end.
2015-03-03 10:48:36 -08:00
Leonardo de Moura
8240d7adcd perf(frontends/lean/util): improve univ_metavars_to_params_fn
We moved to replace_visitor because it uses a more precise cache.
2015-03-02 18:25:00 -08:00
Leonardo de Moura
c81762970e fix(frontends/lean/elaborator): revert commit ededf4fc6c
The instantiate_all are needed. See issue #457
2015-03-02 13:00:54 -08:00
Leonardo de Moura
ededf4fc6c feat(frontends/lean): remove unnecessary instantiate_all's that were messing with error localization 2015-03-01 14:51:44 -08:00
Leonardo de Moura
c8ad5e9406 feat(frontends/lean/builtin_exprs): focus on have-tactic goal 2015-03-01 13:43:33 -08:00
Leonardo de Moura
c772d7bf84 fix(frontends/lean/elaborator): unassigned metavariable when using nested begin-end blocks
Closes #454
2015-02-28 09:03:56 -08:00
Leonardo de Moura
cf56935b01 feat(frontends/lean): improve support for user defined tactics 2015-02-27 16:58:25 -08:00
Leonardo de Moura
5b736a2268 feat(frontends/lean): add support for empty match-with expressions 2015-02-26 16:36:15 -08:00
Leonardo de Moura
68110faa4d feat(frontends/lean/inductive_cmd): allow '|' in inductive datatype declarations 2015-02-25 17:00:10 -08:00
Leonardo de Moura
5ca52d81ec feat(frontends/lean): ML-like notation for match and recursive equations 2015-02-25 16:20:44 -08:00
Leonardo de Moura
c04c610b7b feat(frontends/lean): add 'assert H : A, ...' as notation for 'have H [visible] : A, ...' 2015-02-25 14:30:42 -08:00
Leonardo de Moura
96b54a8007 feat(frontends/lean/builtin_exprs): add 'have' notation in 'begin-end' blocks
It is notation for the assert tactic.
2015-02-25 14:04:17 -08:00
Leonardo de Moura
909ebfc5f1 feat(frontends/lean/elaborator): try coercions after each overload
We try only the easy cases since the more general case is too expensive.

closes #444
2015-02-24 17:41:20 -08:00
Leonardo de Moura
34c36648bb fix(frontends/lean/decl_cmds): constants command
closes #445
2015-02-24 16:27:13 -08:00
Leonardo de Moura
4364b7f926 feat(frontends/lean): pp.beta is true by default
Remark: there is one exception (command: print definition). For this
command pp.beta is still false.
2015-02-24 12:27:53 -08:00
Leonardo de Moura
1ff6446a63 feat(frontends/lean): nested begin-end blocks 2015-02-24 11:59:27 -08:00
Leonardo de Moura
3197e6d403 feat(frontends/lean/parse_rewrite_tactic): improve rewrite tactic parser 2015-02-23 19:40:03 -08:00
Leonardo de Moura
7adecaf494 fix(frontends/lean/structure_cmd): include context/section parameteres/variables that are used in explicit structure parameters 2015-02-23 15:28:43 -08:00
Leonardo de Moura
923fed8612 fix(frontends/lean/structure_cmd): bug in alias generation in the structure command
This commit (and 75acb3bc66) closes #443
2015-02-23 15:17:05 -08:00
Leonardo de Moura
75acb3bc66 fix(frontends/lean/structure_cmd): internal name of parameter/variable was being erased 2015-02-23 15:01:27 -08:00
Leonardo de Moura
33e562a7ce fix(frontends/lean/structure_cmd): effect of "include" command in the structure command
closes #438
2015-02-19 22:44:51 -08:00
Leonardo de Moura
7fc216183e feat(library/tactic): produce better error message when a tactic fails
closes #348
2015-02-16 18:42:15 -08:00
Leonardo de Moura
4248ad644d fix(frontends/lean): priority expressions parser 2015-02-14 12:26:06 -08:00
Leonardo de Moura
c532a4a4b8 feat(frontends/lean/server): add option 'auto_completion.max_results'
Default value is 100
2015-02-13 12:58:11 -08:00
Leonardo de Moura
db71a29c81 feat(frontends/lean/parse_rewrite_tactic): improve esimp tactic 2015-02-13 12:22:17 -08:00
Leonardo de Moura
8ffadce4ab feat(frontends/lean): add "premise" and "premises" command
It is just an alternative notation for "variable" and "variables"

closes #429
2015-02-11 18:46:03 -08:00
Leonardo de Moura
30d20e8029 chore(frontends/lean/parser): remove dead code 2015-02-11 16:29:58 -08:00
Leonardo de Moura
04e92e1e96 feat(frontends/lean/parser): reject explicit universe levels in variables and parameters
This modification was motivated by issue #427
2015-02-11 16:25:06 -08:00
Leonardo de Moura
a35cce38b3 feat(frontends/lean): new semantics for "protected" declarations
closes #426
2015-02-11 14:09:25 -08:00
Leonardo de Moura
eceed03044 feat(frontends/lean): add "except" notation for "open" command, allow multiple metaclasses to be opened in a single "open" command 2015-02-11 11:02:59 -08:00
Leonardo de Moura
1832fb6f54 feat(*): uniform metaclass names, metaclass validation at 'open' command 2015-02-11 10:35:04 -08:00
Leonardo de Moura
9d1cd073c5 feat(frontends/lean): add 'print metaclasses' command 2015-02-11 10:13:20 -08:00
Leonardo de Moura
60fca7575c fix(frontends/lean/pp): bugs when pretty printing abbreviations 2015-02-10 19:06:09 -08:00
Leonardo de Moura
bd304e1911 chore(*): style 2015-02-10 18:31:17 -08:00
Leonardo de Moura
43f849bf95 feat(frontends/lean/pp): add support for abbreviations in the pretty printer
closes #365
2015-02-10 18:27:02 -08:00
Leonardo de Moura
565cd835af feat(frontends/lean): add 'abbreviation' command 2015-02-10 17:31:40 -08:00
Leonardo de Moura
014271da8b feat(frontends/lean): better error messages for ill-terminated declarations 2015-02-10 14:38:00 -08:00
Leonardo de Moura
666f697d24 fix(frontends/lean/builtin_exprs): 'using' expression should make local constant available for tactics 2015-02-08 17:27:22 -08:00
Leonardo de Moura
c04c0e8381 refactor(*): remove transparent_scope hack, replace [strict] with [all-transparent] annotation 2015-02-07 15:19:41 -08:00
Leonardo de Moura
1e8a975daa feat(frontends/lean): extend parser: rewrite "fold" step 2015-02-06 15:22:34 -08:00
Leonardo de Moura
5b25da8c43 feat(frontends/lean): add esimp tactic based on rewrite tactic
closes #358
2015-02-06 14:13:32 -08:00
Leonardo de Moura
bc95f09828 feat(frontends/lean/decl_cmds): allow user to specify unfold-c hint 2015-02-06 12:56:52 -08:00
Leonardo de Moura
2e626b29fb feat(library/tactic/rewrite_tactic): allow many constants to be provided in a single rewrite unfold step 2015-02-06 11:03:36 -08:00
Leonardo de Moura
56a46ae61e feat(frontends/lean/parse_tactic_location): make rewrite notation more uniform 2015-02-06 10:31:50 -08:00
Leonardo de Moura
38ab4e7b3a feat(frontends/lean/parse_rewrite_tactic): extend rewrite tactic parser
Add support for reduction steps.
2015-02-05 13:24:37 -08:00
Leonardo de Moura
5443609845 fix(frontends/lean/parse_rewrite_tactic): take namespaces into account when parsing constant to unfold 2015-02-05 12:41:11 -08:00
Leonardo de Moura
b6dd1269b9 feat(frontends/lean/builtin_exprs): make 'obtain' arguments visible by default 2015-02-05 10:38:45 -08:00
Leonardo de Moura
dfad24e3f5 feat(frontends/lean): polish rewrite tactic notation 2015-02-05 10:15:58 -08:00
Leonardo de Moura
15efadfbdc feat(frontends/lean/parse_rewrite_tactic): cleanup rewrite tactic notation
Make a rewrite command sequence explicit.
2015-02-04 20:16:24 -08:00
Leonardo de Moura
08dcc9e2fc feat(frontends/lean/parse_rewrite_tactic): polish rewrite tactic notation 2015-02-04 19:19:19 -08:00
Leonardo de Moura
599de0271b feat(frontends/lean/parse_tactic_location): validate occurrence index 2015-02-04 14:04:56 -08:00
Leonardo de Moura
8912c759dd fix(frontends/lean/parse_rewrite_tactic): corner case "rewrite ?(t)"
The token '?(' is used to represent inaccessible terms in recursive
equations. In the rewriter tactic, we want "rewrite ?(t)" to be parsed
as "? (t)".
2015-02-04 11:51:39 -08:00
Leonardo de Moura
991d29b7f6 fix(frontends/lean/parse_rewrite_tactic): bugs in rewrite tactic parser 2015-02-04 11:51:39 -08:00
Leonardo de Moura
b4dd2cc729 refactor(library/tactic/rewrite_tactic): more general rewrite step
The rule can be an arbitrary expression.
Allow user to provide a pattern that restricts the application of the rule.
2015-02-04 11:51:39 -08:00
Leonardo de Moura
461fd45efc feat(frontends/lean): allow a different location for each rewrite element 2015-02-04 11:51:39 -08:00
Leonardo de Moura
c845e44777 feat(frontends/lean): parse rewrite tactic 2015-02-04 11:51:39 -08:00
Leonardo de Moura
87bcec2e5e feat(frontends/lean): parse tactic location (i.e., scope of application) 2015-02-04 11:51:39 -08:00
Leonardo de Moura
0cea63651d fix(frontends/lean): store line/col information at snapshots, save snapshot before 'end' scope, and before "closing" open namespaces
closes #422
2015-02-04 10:40:36 -08:00