Leonardo de Moura
e8bd267a00
fet(frontends/lean): allow coercions to sort-class in the types of variable and definitions
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-06 21:54:16 -07:00
Leonardo de Moura
67363c893e
chore(frontends/lean/elaborator): remove dead code
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-06 21:41:19 -07:00
Leonardo de Moura
48b28ad75c
fix(library/unifier): missing test in flex_rigid
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-06 21:36:23 -07:00
Leonardo de Moura
dcf7cf00ff
fix(*): bugs in the type checker, inductive datatypes, and unifier
...
The bugs were indentified when performing the tiny change in the file
tests/lean/run/group.lean
2014-07-06 18:44:56 -07:00
Leonardo de Moura
9a13bef4f3
fix(frontends/lean): fix (and simplify) parameter universe inference
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-06 16:56:54 -07:00
Leonardo de Moura
9be1a4ab46
fix(library/module): module index assignment
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 23:32:18 -07:00
Leonardo de Moura
29981322b9
fix(kernel/type_checker): missing check
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 21:50:32 -07:00
Leonardo de Moura
b3de4bb061
fix(frontends/lean/decl_cmds): modifiers should be after universe parameters
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 21:49:32 -07:00
Leonardo de Moura
55894f01e3
feat(frontends/lean): add 'opaque_hint' command
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 18:58:20 -07:00
Leonardo de Moura
32a605e793
fix(frontends/lean/builtin_cmds): allow 'check' command to unfold the current module opaque definitions
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 17:39:49 -07:00
Leonardo de Moura
59755289e4
feat(library/unifier): case split on constraints of the form (f ...) =?= (f ...), where f can be unfolded, and there are metavariables in the arguments
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 15:52:40 -07:00
Leonardo de Moura
fc4df6a430
feat(kernel/expr): add O(1) predicates has_expr_metavar and has_univ_metavar
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 13:11:30 -07:00
Leonardo de Moura
e366aadad0
refactor(library/converter): expose is_opaque predicate in the converter interface
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 12:05:23 -07:00
Leonardo de Moura
8aa217ea76
chore(library/unifier): update comments
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 11:06:13 -07:00
Leonardo de Moura
72bce91c18
refactor(library/unifier): move inductive datatype support to inductive_unifier_plugin
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 11:00:35 -07:00
Leonardo de Moura
e445515f2b
refactor(kernel): move standard and hott kernel instantiations to library
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 10:31:27 -07:00
Leonardo de Moura
ab929d7201
refactor(library/unifier): store the unifier_plugin in the environment
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 10:25:58 -07:00
Leonardo de Moura
a52c9f4e2b
feat(library/unifier): add option 'unifier.unfold_opaque', remove option 'unifier.use_exceptions' (the user should not be able to change this)
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 09:43:16 -07:00
Leonardo de Moura
efabd2280c
feat(library/unifier): allow unifier to unfold opaque definitions of the current module
...
It is not clear whether this is a good idea or not. In some cases, it seems to do more harm than good.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 00:46:03 -07:00
Leonardo de Moura
ac1585fd1a
feat(library/unifier): divide constraints in clear groups
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-05 00:04:38 -07:00
Leonardo de Moura
f242971b55
feat(library/unifier): delay constraints where the lhs or rhs are of the form (?m ... (intro ...))
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 23:36:31 -07:00
Leonardo de Moura
1e40525a0c
fix(library/unifier): simple bug
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 21:15:32 -07:00
Leonardo de Moura
4af474010a
fix(frontends/lean/elaborator): unintended use of local instances
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 18:49:05 -07:00
Leonardo de Moura
99fb6431a6
fix(frontends/lean/elaborator): support for local instances
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 18:38:08 -07:00
Leonardo de Moura
6ea7bb3ea4
feat(frontends/lean/builtin_exprs): add 'including' expression
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 18:37:09 -07:00
Leonardo de Moura
8ab0b5bee3
feat(frontends/lean/elaborator): use local declarations as class instances
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 18:18:25 -07:00
Leonardo de Moura
00e1a7db23
feat(frontends/lean/elaborator): add class instance elaboration
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 15:45:50 -07:00
Leonardo de Moura
079672f6f9
feat(frontends/lean): add 'class' and 'instances' infrastructure
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 14:28:09 -07:00
Leonardo de Moura
f1884ee5f9
chore(frontends/lean): remove dead code
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 13:22:32 -07:00
Leonardo de Moura
d7cb1952ae
feat(kernel): simplify choice_fn, and make its interface closer to the unifier_plugin interface
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 12:47:33 -07:00
Leonardo de Moura
b94ce412ae
fix(library/unifier): non-termination
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 10:32:01 -07:00
Leonardo de Moura
e0501104e2
feat(library/tactic): add 'fixpoint' tactic
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-04 01:30:28 -07:00
Leonardo de Moura
7fb2b0f6d8
feat(kernel): add method 'may_reduce_later' to normalizer_extension, and improve unifier
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 22:31:05 -07:00
Leonardo de Moura
ce282a549a
feat(frontends/lean): add 'prefix' notation declaration command
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 21:37:56 -07:00
Leonardo de Moura
110b622b83
feat(library/unifier): add support for unification constraints of the form "(elim ... (?m ...)) =?= t", where elim is an eliminator
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 20:41:51 -07:00
Leonardo de Moura
c854ad3d65
refactor(library/unifier): add is_def_eq alias
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 18:01:59 -07:00
Leonardo de Moura
b5f63e78ca
feat(frontends/lean/notation_cmd): reuse existing precedence to increase compatibility with existing notation
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 17:23:29 -07:00
Leonardo de Moura
fa1857e6a9
fix(frontends/lean/notation_cmd): fix default, add 'prev' action
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 16:44:44 -07:00
Leonardo de Moura
aba4534acb
feat(library/unifier): 'forget' justifications after finding a solution, the justifications are only needed inside the unifier (for implementing nonchronological backtracking)
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 14:14:07 -07:00
Leonardo de Moura
a009225435
feat(kernel/metavar): expose destructive assign
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 14:07:47 -07:00
Leonardo de Moura
b49902807c
refactor(kernel/metavar): separate substitution from their justifications
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 14:01:22 -07:00
Leonardo de Moura
abbd054b51
feat(library/tactic): add eassumption tactic, and remove redundant 'subgoals' from apply tactic
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 13:04:46 -07:00
Leonardo de Moura
079592c446
feat(library/unifier): eagerly apply substitution to improve quick failure
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 12:58:30 -07:00
Leonardo de Moura
db0ef64c04
feat(util/lazy_list_fn): handle the 'is_nil' case more efficiently
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 11:29:04 -07:00
Leonardo de Moura
c9cfb844f1
feat(library/unifier): add 'quick' failure
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 11:28:21 -07:00
Leonardo de Moura
dd96bb151b
refactor(library/unifier): reduce the number unify procedure 'flavors'
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 11:15:43 -07:00
Leonardo de Moura
d63ccbcf94
fix(library/unifier): missing case
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 10:51:59 -07:00
Leonardo de Moura
0ff145e59b
feat(library/tactic): add apply tactic
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 09:20:01 -07:00
Leonardo de Moura
c9994ca00c
feat(library/unifier): when projecting give preference to most recent locals
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 09:01:29 -07:00
Leonardo de Moura
e3ab0a1d10
feat(frontends/lean): improve error messages when users forget to import 'tactic'
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 08:33:29 -07:00
Leonardo de Moura
6b8b5f3dd8
feat(library/tactic): expose more builtin tactics, cleanup expr_to_tactic procedure
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-03 08:06:28 -07:00
Leonardo de Moura
a7d660f875
feat(frontends/lean): add command for customizing the behavior of proof-qed blocks: we can automatically register tactics to be automatically applied before each component
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 20:45:10 -07:00
Leonardo de Moura
5527955ba8
feat(frontends/lean): add 'proof-qed' notation
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 19:30:48 -07:00
Leonardo de Moura
138267b53a
feat(frontends/lean/elaborator) add trick for improving error messages when mixing tactics, elaboration and exact tactic
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 18:58:32 -07:00
Leonardo de Moura
c3abf81382
chore(emacs): update emacs mode
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 18:37:53 -07:00
Leonardo de Moura
60c637fb9d
feat(library/tactic): add 'exact' tactic
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 18:37:32 -07:00
Leonardo de Moura
37b5b7c4c2
feat(library/tactic): rename 'exact' to 'assumption', 'exact' is a different tactic
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 18:10:42 -07:00
Leonardo de Moura
04b2a620f8
fix(frontends/lean/elaborator): instantiate metavariables before displaying error message
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 18:07:11 -07:00
Leonardo de Moura
3809a3cc2c
chore(frontends/lean): code cleanup
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 17:32:13 -07:00
Leonardo de Moura
181a739a5e
feat(frontends/lean/elaborator): report unassigned metavariables as goals
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 16:26:06 -07:00
Leonardo de Moura
6a6ebd5c2d
refactor(kernel/metavar): add method instantiate as alias for instantiate_metavars_wo_jst
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 15:39:25 -07:00
Leonardo de Moura
d46ade94a7
refactor(frontends/lean): remove unnecessary code
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 14:47:41 -07:00
Leonardo de Moura
3e1bb96935
feat(library/tactic/goal): propagate tag (for position information) from goal to subgoal
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 14:47:18 -07:00
Leonardo de Moura
ee531ec0e2
feat(frontends/parser): improve error message when an apply tactic refers a local constant that is not marked as [fact]
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 14:09:01 -07:00
Leonardo de Moura
0f27856e4a
feat(library/tactic): new apply tactic
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 13:14:50 -07:00
Leonardo de Moura
cc3fb0c51f
feat(util/name_generator): allow name generator to be created without providing any argument in the Lua API
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 12:39:41 -07:00
Leonardo de Moura
6ab46396d8
feat(library/tactic): expose 'trace' tactic
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 10:52:45 -07:00
Leonardo de Moura
e1d909455c
refactor(library/tactic): add namespace 'tactic', improve expr_to_tactic failure error message
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 10:45:09 -07:00
Leonardo de Moura
a66a08c89e
feat(frontends/lean): parse strings as expressions of type 'string.string'
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 10:00:55 -07:00
Leonardo de Moura
8b8881deae
fix(util/hash): relax pre-condition
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 09:56:50 -07:00
Leonardo de Moura
f464775af6
fix(frontends/lean/parser): bug when parsing identifiers
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 08:36:25 -07:00
Leonardo de Moura
0198dfc7c5
feat(frontends/lean): parse numerals as expressions of type 'num.num'
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 08:09:33 -07:00
Leonardo de Moura
7593ee1468
refactor(library/standard): remove parameter from 'tactic' inductive type
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-02 08:09:24 -07:00
Leonardo de Moura
b2b76b078f
feat(frontends/lean): remove build_tactic_cmds, and use expressions for representing tactics
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-01 20:43:53 -07:00
Leonardo de Moura
cbac21ec7f
feat(library/tactic): add trick for 'embedding' tactics inside Lean expressions
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-01 19:05:22 -07:00
Leonardo de Moura
2df92b0701
refactor(library/tactic): simplify proof_state
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-01 18:02:17 -07:00
Leonardo de Moura
7abe2e7242
fix(frontends/lean/token_table): precedence for '@'
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-01 17:06:09 -07:00
Leonardo de Moura
5b69f88664
feat(frontends/lean/notation_cmd): make the notation for setting precedence uniform
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-01 16:55:41 -07:00
Leonardo de Moura
ec3743dede
fix(frontends/lean/parser): avoid nontermination
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-01 16:46:58 -07:00
Leonardo de Moura
8cdf44b87b
feat(frontends/lean/notation_cmd): allow 'max' to use as a precedence level
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-01 16:46:32 -07:00
Leonardo de Moura
4cb5f97038
refactor(library/tactic): simplify tactic framework, no more proof builders
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-07-01 16:11:19 -07:00
Leonardo de Moura
ad12abcdb4
fix(library/unifier): bug in process_eq_constraint
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-30 18:22:05 -07:00
Leonardo de Moura
abe12b0631
fix(shell/lean): only save .olean file if there are no errors
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-30 18:04:18 -07:00
Leonardo de Moura
c84218e24a
chore(frontends/lean/inductive_cmd): cleanup
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-30 17:16:10 -07:00
Leonardo de Moura
3e299a1d5a
refactor(frontends/lean/parser): move parser Lua bindings to a separate file
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-30 17:00:10 -07:00
Leonardo de Moura
bccc3df1aa
chore(frontends/lean): reduce code duplication
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-30 16:52:20 -07:00
Leonardo de Moura
e3f9b21c30
fix(kernel/inductive): bug in inductive datatype computational rule, we *must* first instantiate universe variables, *and then* the arguments
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-30 14:15:16 -07:00
Leonardo de Moura
6e6f778ecf
fix(kernel/converter): missing case for local constants
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-30 12:57:25 -07:00
Leonardo de Moura
cb000eda13
refactor(kernel): store binder_infor in local constants
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-30 11:37:46 -07:00
Leonardo de Moura
c2ab31113f
refactor(library/tactic): remove cex_builder and 'precision' for proof_state's
...
These two features make sense for solvers, but not in a general purpose tactic framework for building proofs like the one in Lean.
In most cases, we cannot build a counterexample anyway. These two features should be added in a custom framework for combining preprocessing techniques like in Z3.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-30 08:48:07 -07:00
Leonardo de Moura
8d584e54da
feat(frontends/lean): add exact_apply
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-30 00:51:11 -07:00
Leonardo de Moura
ccdb96775f
feat(frontends/lean/parser): allow 'assume'/'take'/'fun' as notation for apply tactic
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-29 23:00:41 -07:00
Leonardo de Moura
33cb9382aa
feat(frontends/lean): add beta-reduction tactic command
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-29 19:41:54 -07:00
Leonardo de Moura
360e9b9486
feat(library/tactic): add apply tactic
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-29 18:33:53 -07:00
Leonardo de Moura
6645fdeae0
feat(frontends/lean): add repeat tactic command, refactor tactic sequence notation
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-29 12:24:13 -07:00
Leonardo de Moura
a8f9594046
refactor(kernel/instantiate): rename instantiate_params to instantiate_univ_params
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-29 12:09:55 -07:00
Leonardo de Moura
2510d5722a
feat(frontends/lean): add unfold tactic command
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-29 12:05:45 -07:00
Leonardo de Moura
937d7b2813
fix(library/tactic): unfold tactic
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-29 12:04:58 -07:00
Leonardo de Moura
6d09d82a7c
feat(frontends/lean): add notation for orelse tactic, add show and now tactics
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-29 11:39:18 -07:00
Leonardo de Moura
a1bbb09de4
feat(frontends/lean): add notation for then tactic
...
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-29 11:24:56 -07:00