Leonardo de Moura
4694f47ea4
refactor(frontends/lean/decl_attributes): move decl_attributes to a separate module
2015-06-12 13:38:57 -07:00
Leonardo de Moura
25cbc5c154
fix(kernel/expr): remove 'cast_binder_info'
...
We should put it back when we decide to implement it.
We also fix the bogus comment at src/frontends/lean/parser.cpp.
see issue #667
2015-06-11 18:11:22 -07:00
Leonardo de Moura
8b7dc4e03a
feat(frontends/lean): apply eta-reduction in postprocessing step
...
Perhaps, we should add an option to disable this new feature.
Remark: this commit makes commit 46d418a
redundant.
I'm keeping 46d418a
because we may retract this commit in the future.
2015-06-10 16:29:30 -07:00
Leonardo de Moura
f64784378a
fix(frontends/lean/pp): make pp_have more robust
...
We should not assume the argument of a have_annotation is a lambda.
2015-06-10 16:26:20 -07:00
Leonardo de Moura
ca43f6e62e
refactor(frontends/lean): add postprocess procedure and cleanup
2015-06-10 15:19:35 -07:00
Leonardo de Moura
4b91cfccff
feat(frontends/lean/builtin_exprs): make notation ( e : T )
builtin
...
In the previous approach, the following (definitionally equal) term was being generated
(fun (A : Type) (a : A), a) T e
2015-06-10 14:52:59 -07:00
Leonardo de Moura
f7dd85a935
chore(*): fix 'breif' typos
2015-06-08 16:54:55 -07:00
Leonardo de Moura
d0d3f9bb41
refactor(kernel,library,frontends/lean): add helper functions, and cleanup collect_locals
2015-06-05 17:29:36 -07:00
Leonardo de Moura
c76d92284f
feat(library/pp_options): add 'pp.all' option
2015-06-05 08:41:46 -07:00
Leonardo de Moura
134740182d
fix(frontends/lean): fixes #652
2015-06-03 21:53:51 -07:00
Leonardo de Moura
0fbc944cdd
feat(frontends/lean): add '[rewrite]' attribute
2015-06-01 17:58:24 -07:00
Leonardo de Moura
d547698a56
refactor(library,library/tactic): move class_instance_synth to library
...
This module will be needed by the simplifier
2015-06-01 16:30:40 -07:00
Leonardo de Moura
b6fde68012
feat(frontends/lean/decl_cmds): avoid funny names when displaying error messages for "examples"
2015-06-01 15:35:28 -07:00
Leonardo de Moura
55608c9b9f
fix(frontends/lean/pp): bug in pp arrow
2015-05-31 17:21:37 -07:00
Leonardo de Moura
ca110012d8
feat(library/tactic): automate "generalize-intro-induction/cases" idiom
...
closes #645
2015-05-30 21:57:28 -07:00
Leonardo de Moura
e5a82ef516
feat(frontends/lean): add option for disabling "coercion lifting"
2015-05-30 17:07:42 -07:00
Leonardo de Moura
6f6848968d
feat(frontends/lean/coercion_elaborator): "coercion lifting" for backtracking case
...
closes #252
2015-05-30 16:44:26 -07:00
Leonardo de Moura
ea9c810fca
feat(frontends/lean/coercion_elaborator): implement "coercion lifting"
...
closes #644
2015-05-30 14:45:14 -07:00
Leonardo de Moura
6d2f37857d
feat(frontends/lean/builtin_cmds): add 'print [reducible]', 'print [irreducible]' and 'print [quasireducible]' commands
2015-05-29 16:47:29 -07:00
Leonardo de Moura
7a0e198147
feat(kernel,frontends/lean/builtin_cmds): allow kernel extensions to report their builtin constants
2015-05-29 16:28:16 -07:00
Leonardo de Moura
f48cdccd20
fix(frontends/lean/pp): abbreviation with parameters
...
closes #639
2015-05-29 15:13:31 -07:00
Leonardo de Moura
a071012346
fix(frontends/lean/pp,library/head_map): handle 'as_atomic' annotation
...
This commit fixes local notation that contains parameters
see issue #639
2015-05-29 14:51:28 -07:00
Leonardo de Moura
e6099583ad
feat(frontends/lean/builtin_cmds): expand abbreviations in the 'check' command
...
see issue #639
2015-05-29 14:51:07 -07:00
Leonardo de Moura
3b7b268e40
fix(frontends/lean/pp): fixes #634
...
trying again...
2015-05-29 14:07:38 -07:00
Leonardo de Moura
7f12401ea7
fix(frontends/lean/elaborator): save type information for 'obtain' declarations
2015-05-29 10:16:12 -07:00
Leonardo de Moura
7342f342a9
fix(frontends/lean/pp): fixes #634
2015-05-28 19:43:49 -07:00
Leonardo de Moura
85409a59d3
feat(library/tactic/rewrite_tactic): add xrewrite and krewrite tactic variants
...
closes #511
2015-05-27 16:32:43 -07:00
Leonardo de Moura
7d73f4f091
refactor(library,frontends/lean): simplify the creation of custom normalizers
2015-05-27 15:33:20 -07:00
Leonardo de Moura
47e5633498
feat(frontends/lean/calc_proof_elaborator): avoid unnecessary unfolding in the calc tactic
2015-05-27 12:07:39 -07:00
Leonardo de Moura
ea43f3ea80
fix(frontends/lean/builtin_cmds): fixes #630
2015-05-26 22:19:42 -07:00
Leonardo de Moura
4d1b711247
feat(frontends/lean/elaborator): better error localization when running out of stack space and/or memory in begin-end tactic mode.
2015-05-26 20:09:15 -07:00
Leonardo de Moura
0502f46f9b
fix(frontends/lean/scanner): another bug related to issue #626
2015-05-26 13:39:42 -07:00
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