Commit graph

4234 commits

Author SHA1 Message Date
Leonardo de Moura
e22eb3543c feat(library/tactic): add whnf tactic, closes #270 2014-10-28 23:18:49 -07:00
Leonardo de Moura
83e4c0fcec feat(frontends/lean): hide tactic "types"
it is not very useful to display the type of tactics (e.g., apply,
intros, ...)
2014-10-28 22:38:10 -07:00
Leonardo de Moura
eeb6c72508 feat(frontends/lean): modify begin-end semantics, closes #258 2014-10-28 22:15:38 -07:00
Leonardo de Moura
1c2bbcfebc feat(frontends/lean/info_manager): add separator -- when displaying PROOF_STATE info
This feature was implemented to address issue #259
2014-10-28 16:39:21 -07:00
Leonardo de Moura
186e598bf8 feat(library/tactic/goal): add option pp.compact_goals 2014-10-28 16:30:37 -07:00
Leonardo de Moura
a3801e84d4 fix(library/tactic/goal): avoid unnecessary line break when possible 2014-10-28 16:17:33 -07:00
Leonardo de Moura
ea739100b3 fix(library/unifier): broken optimization in the unifier
See new comments and tests for details.
2014-10-28 16:09:41 -07:00
Leonardo de Moura
777aa63660 fix(kernel/inductive): relax eliminator generation rules for empty types
This commit also removes the workaround false.rec_type. It is not needed anymore
2014-10-28 10:31:00 -07:00
Leonardo de Moura
60f32fa709 fix(frontends/lean): begin-end automatic tactic notation bug, fixes #262 2014-10-27 17:12:25 -07:00
Leonardo de Moura
78bc3ef7e4 feat(library/unifier): improve FailLocal/FailCircular failures in the unifier by using normalization
This improvements was marked as TODO, and was preventing us from
elaborating the example in the new test vector3.lean
2014-10-27 16:49:29 -07:00
Leonardo de Moura
bca2be56ec feat(library/normalize): add new flavors of normalize procedure 2014-10-27 16:25:30 -07:00
Leonardo de Moura
7516fcad97 feat(kernel/type_checker): add is_stuck method, and improve ensure_pi method, closes #261 2014-10-27 13:16:50 -07:00
Leonardo de Moura
2e5ad274a5 fix(frontends/lean/elaborator): remove invalid assertions
These assertions became invalid when we changed the behavior of undef
indentifiers at

8e6de93394
2014-10-27 10:31:09 -07:00
Leonardo de Moura
ee5a982c01 feat(shell/lean): add '--server-trace' flag, closes #264 2014-10-27 10:26:29 -07:00
Leonardo de Moura
d66e5a6c41 fix(frontends/lean/builtin_cmds): bug (name clashing) in 'check' command new meta-variable naming 2014-10-26 19:19:45 -07:00
Leonardo de Moura
81dc201bab fix(frontends/lean/elaborator): nested begin-end bug 2014-10-26 18:23:30 -07:00
Leonardo de Moura
a544d32fcf fix(frontends/lean/elaborator): missing information when displaying unsolved placeholders 2014-10-26 16:11:58 -07:00
Leonardo de Moura
cc6a96e8ba fix(frontends/lean): improve begin-end construct 2014-10-26 15:47:29 -07:00
Leonardo de Moura
08e8161243 feat(emacs/lean-syntax): add 'eassumption' highlight 2014-10-26 15:45:26 -07:00
Leonardo de Moura
fd60cf6a79 feat(library/tactic/exact_tactic): modify 'exact' tactic semantics, use higher-order unification
See new node.inj4 theorem, we need the extra power to be able to avoid type information at
    exact (assume e₁ e₂, e₁)
2014-10-26 10:27:33 -07:00
Leonardo de Moura
aed9a88b38 fix(frontends/lean/parser): save identifier info for undef local 2014-10-26 10:19:44 -07:00
Leonardo de Moura
8e6de93394 fix(frontends/lean/parser): add two kinds of no_undef_id behavior: to (global) constant; to local constant 2014-10-26 09:47:11 -07:00
Leonardo de Moura
50948be66b fix(emacs/lean-syntax): syntax highlight for composite names in declarations 2014-10-26 09:27:17 -07:00
Leonardo de Moura
707584376a fix(frontends/lean/inductive_cmd): include 'induction_on', 'cases_on', and 'rec_on' into .ilean index file 2014-10-25 17:56:22 -07:00
Leonardo de Moura
c7f6a6b94e feat(library/definitional/cases_on): automatically add 'cases_on' 2014-10-25 17:22:02 -07:00
Leonardo de Moura
c751bdd9e6 chore(library/definitional): remove dead code 2014-10-25 15:11:48 -07:00
Leonardo de Moura
fa1bf40d0f fix(library/definitional): make sure argument is an inductive datatype 2014-10-25 15:09:24 -07:00
Leonardo de Moura
cdcde661ef feat(library/definitional/induction_on): automatically add 'induction_on' 2014-10-25 13:37:04 -07:00
Leonardo de Moura
a7a06ab0f8 feat(library/definitional/rec_on): automatically generate rec_on function for inductive datatypes 2014-10-25 13:08:59 -07:00
Leonardo de Moura
7240a1a640 feat(kernel/inductive): add get_num_minor_premises and get_num_type_formers APIs 2014-10-25 11:17:29 -07:00
Leonardo de Moura
2bc034da2c feat(kernel/inductive): expose 'get_elim_name' API 2014-10-25 10:47:12 -07:00
Leonardo de Moura
9e69a95b26 feat(kernel/inductive): add API for retrieving the number of indices in an inductive datatype 2014-10-25 10:42:05 -07:00
Leonardo de Moura
c30c0fa3b8 fix(kernel/metavar): avoid crash due to stack overflow, closes #253 2014-10-25 00:20:59 -07:00
Leonardo de Moura
096c67b2e5 fix(library/unifier): occurs-check bug 2014-10-25 00:16:02 -07:00
Leonardo de Moura
5830da9e2d fix(frontends/lean/tokens): typo 2014-10-24 14:44:59 -07:00
Leonardo de Moura
aaad9633fb fix(library/tactic/expr_to_tactic): memory leak 2014-10-24 14:40:36 -07:00
Leonardo de Moura
7a033ac07e feat(frontends/lean): add 'print axioms' command, close #251 2014-10-24 14:35:03 -07:00
Leonardo de Moura
db25f933b0 feat(frontends/lean): use nice names for meta-variables when executing check c and c is a constant 2014-10-24 08:23:26 -07:00
Leonardo de Moura
79d0347721 feat(library/tactic): add generalize tactic, closes #34
Remark: the intros tactic has been added in a different commit: 7d0100a340
2014-10-23 22:40:15 -07:00
Leonardo de Moura
b83b065d00 feat(library/tactic/apply_tactic): modify heuristic for adding arguments to apply tactic. 2014-10-23 22:36:32 -07:00
Leonardo de Moura
f9aa1a1b84 refactor(library/tactic/goal): remove unnecessary parameter 2014-10-23 21:22:52 -07:00
Leonardo de Moura
ab4c292872 fix(build): do not disable unicode chars on Windows 2014-10-23 20:58:23 -07:00
Leonardo de Moura
f027acb5cb fix(frontends/lean): missing type info in expressions nested in tactics 2014-10-23 18:31:05 -07:00
Leonardo de Moura
a6571c3273 feat(frontends/lean): add 'print definition' command 2014-10-23 14:54:15 -07:00
Soonho Kong
04b4e36701 doc(emacs/README.md): fix typo
[skip ci]
2014-10-23 14:32:36 -07:00
Leonardo de Moura
22ae42d3af fix(frontends/lean/info_manager): use fresh formatter displaying each info object
The formatter may cache results.
2014-10-23 14:29:17 -07:00
Leonardo de Moura
20ab59c740 fix(frontends/lean/pp): avoid unnecessary parentheses when pretty printing delimited notation 2014-10-23 14:14:08 -07:00
Leonardo de Moura
43cfd5c26a fix(library/tactic): add missing file 2014-10-23 14:04:12 -07:00
Leonardo de Moura
212ae0b61c feat(frontends/lean): automatically add 'info' tactic in begin-end blocks
Actually, the tactic is only added when Lean is in collect-info mode.
2014-10-23 13:30:04 -07:00
Leonardo de Moura
e750c9b67a feat(frontends/lean): add 'info' tactic for producing PROOF_STATE info for emacs mode 2014-10-23 13:18:30 -07:00
Leonardo de Moura
40235c6af0 fix(kernel/type_checker): propagate 'memoize' flag to default_converter 2014-10-23 13:15:53 -07:00
Leonardo de Moura
8e3ac023bb feat(library/reducible): expose 'memoize' flag 2014-10-23 13:09:59 -07:00
Leonardo de Moura
cadc9b3ff3 feat(frontends/lean/info_manager): add proof_state info 2014-10-23 10:40:07 -07:00
Leonardo de Moura
38a9aa2a98 feat(frontends/lean): automatically open 'tactic' namespace (if it is not already open) in 'by' and 'begin-end' expressions 2014-10-23 10:26:19 -07:00
Leonardo de Moura
00f9a10e82 refactor(library/tactic/unfold_tactic): use new 'tactic.expr' to implement 'unfold' tactic
This change also enabled us to remove hacks used in the tests modified
by this commit.
2014-10-23 10:26:19 -07:00
Leonardo de Moura
2c330e704e fix(frontends/lean/elaborator): error localization for 'expr_to_tactic' failures 2014-10-23 10:26:19 -07:00
Leonardo de Moura
6fcba192b2 refactor(library/tactic): move 'unfold' tactic to separate module 2014-10-23 10:26:19 -07:00
Leonardo de Moura
96d7d9c8d9 feat(library/tactic/elaborate): do not invoke unifier if no constraints were generated during elaboration 2014-10-23 10:26:19 -07:00
Leonardo de Moura
f3fdc70400 refactor(library/tactic): add auxiliary module 'library/tactic/elaborate' 2014-10-23 10:26:11 -07:00
Leonardo de Moura
3aec70b92c feat(library/tactic): elaborate 'exact' tactic argument at tactic execution time 2014-10-22 22:13:37 -07:00
Leonardo de Moura
c50227ea6e feat(library/tactic): change apply tactic semantics: goals are not reversed; and dependent arguments are not included
This commit also adds the tactic rapply that corresponds to the previous
semantics we have been using.
2014-10-22 18:11:09 -07:00
Leonardo de Moura
60132912a4 refactor(library/tactic): remove unnecessary hack
It is not needed anymore.
We had to use this hack when we had tactic_macro_definition_cell.
2014-10-22 17:41:19 -07:00
Leonardo de Moura
7c62446023 refactor(frontends/lean): remove dead code 2014-10-22 17:39:06 -07:00
Leonardo de Moura
eb2b59ce4f refactor(frontends/lean): remove unnecessary files 2014-10-22 17:33:16 -07:00
Leonardo de Moura
e95c7c5f70 refactor(library/tactic/rename_tactic): use new 'tactic.expr' to implement 'intro/intros' tactic
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-10-22 17:29:50 -07:00
Leonardo de Moura
9a316092d1 refactor(library/tactic/rename_tactic): use new 'tactic.expr' to implement rename tactic 2014-10-22 17:29:50 -07:00
Leonardo de Moura
5e15ac0c92 feat(library/tactic): add new approach for embedding non-elaborated expressions into tactics 2014-10-22 17:29:50 -07:00
Leonardo de Moura
7c617955d0 refactor(library/tactic): move 'exact' tactic to separate module 2014-10-22 17:29:44 -07:00
Leonardo de Moura
323715e951 refactor(library/tactic): move 'tracing' tactics to separate module 2014-10-22 14:12:45 -07:00
Soonho Kong
ef60e6abd2 fix(shell/lean.cpp): use temp ios 2014-10-21 17:23:02 -07:00
Leonardo de Moura
33f18b9454 fix(kernel/converter): remove buggy eta-reduction and rely only on eta-expansion
The bug is exposed by new unit test
2014-10-21 16:54:25 -07:00
Leonardo de Moura
6b89080b1a feat(frontends/lean): do not allow user to define notation using tokens ! and @, closes #248 2014-10-21 16:28:36 -07:00
Leonardo de Moura
e24225fabf feat(frontends/lean): validate infixl/infixr/postfix/prefix declarations against reserved notations 2014-10-21 15:39:47 -07:00
Leonardo de Moura
1896e6e273 feat(frontends/lean): allow 'reserve' inside namespaces 2014-10-21 15:39:47 -07:00
Leonardo de Moura
bb953b80aa feat(frontends/lean): reserve notation, closes #95 2014-10-21 15:39:47 -07:00
Soonho Kong
ba9d0a2b7f fix(shell/CMakeLists.txt): merge into a single lean.js file 2014-10-21 16:18:12 -04:00
Soonho Kong
ec43ad51ca feat(shell/lean.cpp): use trust_lvl=10000, flycheck for EMSCRIPTEN 2014-10-21 00:43:26 -07:00
Leonardo de Moura
2f62a5e887 fix(frontends/lean/info_manager): disable notation pretty printer when displaying OVERLOAD information
We need that otherwise the Lean emacs mode will display useless overload
information such as:

            [+] int.add : ℤ → ℤ → ℤ
            overloaded with #1 + #0, #1 + #0

Note that this only became an issue after we implemented the new pretty printer
2014-10-20 22:06:33 -07:00
Leonardo de Moura
92acd9affc chore(emacs): do not highlight arbitrary types 2014-10-20 19:17:02 -07:00
Leonardo de Moura
815dc9b63d chore(library/tactic/expr_to_tactic): remove dead code 2014-10-20 18:59:57 -07:00
Leonardo de Moura
8a44dfc1df fix(frontends/lean/pp): bug in pretty printer notation match procedure 2014-10-20 18:58:27 -07:00
Leonardo de Moura
40fb66bf07 feat(frontends/lean): change default precedence to 1 2014-10-20 18:40:55 -07:00
Leonardo de Moura
e2fa981e89 fix(frontends/lean/pp): avoid parentheses around atomic notation 2014-10-20 18:08:13 -07:00
Leonardo de Moura
53a64ac767 refactor(library/tactic): move intros_tactic initialization to intros_tactic module 2014-10-20 17:47:52 -07:00
Leonardo de Moura
3c4419ff23 refactor(library/tactic): move rename_tactic to separate module 2014-10-20 17:41:40 -07:00
Leonardo de Moura
ac9397816f refactor(library/tactic): move apply_tactic initialization to apply_tactic module 2014-10-20 17:32:32 -07:00
Leonardo de Moura
e68007a727 fix(frontends/lean/builtin_tactics): adjust tactics precedence 2014-10-20 17:10:16 -07:00
Leonardo de Moura
9b8f60b739 feat(frontends/lean/builtin_exprs): tolerate dangling ',' in begin-end block
This is useful when debugging proofs.
2014-10-20 15:59:49 -07:00
Leonardo de Moura
a3aca96cb9 fix(frontends/lean/builtin_exprs): error position 2014-10-20 15:56:58 -07:00
Leonardo de Moura
fd40999909 feat(frontends/lean): uniform unsolved goals "error" position 2014-10-20 15:52:06 -07:00
Leonardo de Moura
7d0100a340 feat(library/tactic): add 'intros' tactic 2014-10-20 15:26:16 -07:00
Leonardo de Moura
5cba7244ce fix(library/tactic/expr_to_tactic): argument evaluation order is not part of the standard 2014-10-20 15:16:38 -07:00
Leonardo de Moura
33c4715f4c fix(frontends/lean/pp): suppress unnecessary '[annotation]' marks 2014-10-20 11:16:21 -07:00
Leonardo de Moura
f0cc17af87 fix(frontends/lean/elaborator): missing type information when ! operator (aka consume_args) is used 2014-10-20 08:31:36 -07:00
Leonardo de Moura
a1006073d4 feat(frontends/lean/notation_cmd): do not allow user to define new tokes containing '(', ')', ',' or change their precedence 2014-10-19 13:39:06 -07:00
Leonardo de Moura
469368f090 refactor(frontends/lean/scanner): move basic UTF8 procedures to separate module 2014-10-19 13:29:15 -07:00
Leonardo de Moura
4d4bc0551f feat(frontends/lean/pp): minimize number of spaces when pretty printing notation 2014-10-19 13:08:15 -07:00
Leonardo de Moura
ed1afe26bd feat(frontends/lean/pp): support scopedexpr notation in the pretty printer 2014-10-19 12:50:40 -07:00
Leonardo de Moura
f63d47fef3 feat(frontends/lean/pp): support foldl/foldr notation in the pretty printer 2014-10-19 11:16:24 -07:00
Leonardo de Moura
100b3abf1d fix(frontends/lean/pp): bug in notation matching procedure 2014-10-19 10:48:41 -07:00
Leonardo de Moura
d7cc7cbd8c refactor(frontends/lean/pp): remove 'reverse' hack 2014-10-19 09:56:18 -07:00
Leonardo de Moura
eef1cc4ac2 fix(frontends/lean/pp): implicit arguments in notation 2014-10-19 09:04:43 -07:00
Leonardo de Moura
555d26aa61 feat(frontends/lean/pp): take notation declarations into account when pretty printing
TODO: support foldl/foldr and binders
2014-10-19 08:41:29 -07:00
Leonardo de Moura
8cfb3ae687 fix(library/module): bug in import_module 2014-10-18 21:03:22 -07:00
Leonardo de Moura
6a31a79265 refactor(frontends/lean/inductive_cmd): move auxiliary method to expr.h 2014-10-18 15:11:26 -07:00
Leonardo de Moura
eb79af98ba feat(frontends/lean/parse_config): add get_notation_entries auxiliary function for returning the list of notation declarations that start with a given head symbol
This API is need to take notation declarations into account when pretty
printing expressions.
2014-10-18 11:49:27 -07:00
Leonardo de Moura
f17e67efcb feat(frontends/lean/parse_table): add get_head_index auxiliary function for indexing notation declarations 2014-10-18 10:55:39 -07:00
Leonardo de Moura
f76c5bbde9 fix(init): initialization problem 2014-10-18 09:01:24 -07:00
Leonardo de Moura
2369388629 refactor(kernel/instantiate): cleanup beta-reduce 2014-10-17 20:19:51 -07:00
Leonardo de Moura
1ce3b83d79 fix(kernel/metavar): compilation error in some compilers 2014-10-17 17:22:25 -07:00
Leonardo de Moura
6285c3a217 perf(util/list): use memory pool for list cells 2014-10-17 17:08:39 -07:00
Leonardo de Moura
58aff5b4af perf(kernel/metavar): used thread local cache for instantiate_metavars 2014-10-17 17:08:35 -07:00
Leonardo de Moura
6d64da2981 perf(kernel/expr_eq_fn): use thread local cache, and avoid memory allocation/deallocation 2014-10-17 16:44:20 -07:00
Leonardo de Moura
7cc3dd0b4d chore(kernel/replace_fn): "name" constant 2014-10-17 14:20:35 -07:00
Leonardo de Moura
b6afbcb7f5 perf(kernel/replace_fn): use 'recursive' replace_fn for "small" terms 2014-10-17 14:15:09 -07:00
Leonardo de Moura
c21c8c582f feat(util/buffer): expose capacity method 2014-10-17 14:05:36 -07:00
Leonardo de Moura
10b880ce3b perf(kernel/metavar): improve occurs_expr and occurs performance 2014-10-17 14:05:22 -07:00
Leonardo de Moura
50e4c6f252 feat(util/rb_tree): add find_if method 2014-10-17 12:53:43 -07:00
Leonardo de Moura
d2cbd25985 refactor(kernel): replace_visitor doesn't need to be in the kernel anymore 2014-10-17 10:23:35 -07:00
Leonardo de Moura
14ebbda8cb perf(kernel/metavar): minor improvement 2014-10-16 21:43:54 -07:00
Leonardo de Moura
8974b52f7b perf(library/unifier): avoid unnecessary wasteful computation 2014-10-16 17:16:49 -07:00
Leonardo de Moura
fe484b26f3 refactor(kernel/expr): remove dead code 2014-10-16 13:45:36 -07:00
Leonardo de Moura
3b6b23c921 refactor(kernel/expr): remove silly overloads 2014-10-16 13:37:55 -07:00
Leonardo de Moura
c4f02bd16a refactor(kernel/expr): remove dead code 2014-10-16 13:09:26 -07:00
Leonardo de Moura
97a7dae12a refactor(kernel/expr): remove code duplication 2014-10-16 12:48:49 -07:00
Leonardo de Moura
28128e0330 fix(frontends/lean): EXTRA_TYPE info 2014-10-16 12:25:18 -07:00
Leonardo de Moura
8907dd5b91 refactor(frontends/lean): minimize the use of 'set_tag' 2014-10-15 13:17:09 -07:00
Leonardo de Moura
814778abb1 refactor(kernel/expr): tag expressions at "creation" time 2014-10-15 13:12:09 -07:00
Leonardo de Moura
d960c1994e refactor(library/tactic/apply_tactic): reuse type_checker object 2014-10-15 09:28:01 -07:00
Leonardo de Moura
bbe4017790 refactor(library/tactic/apply_tactic): remove dead code 2014-10-15 09:15:11 -07:00
Leonardo de Moura
b94d121580 refactor(library): move flycheck "helper" classes to separate module 2014-10-15 09:08:04 -07:00
Soonho Kong
9a6e18ad2a fix(style): remove "using namespace emscripten" 2014-10-14 21:09:33 -07:00
Soonho Kong
4143716311 fix(emacs/lean-util): fix lean-path-list to only include existing dirs
Fix #246
2014-10-14 20:48:56 -07:00
Soonho Kong
1915674b4d feat(CMakeLists.txt): support emscripten 2014-10-14 18:59:15 -07:00
Soonho Kong
e75c9fe9fc feat(shell/lean.cpp): expose functions to javascript side
lean_init, lean_import_module, lean_process_file
2014-10-14 18:59:15 -07:00
Soonho Kong
e99463980a feat(util/lean_path.cpp): use '/library' as LEAN_PATH for emscripten 2014-10-14 18:59:15 -07:00
Leonardo de Moura
e6606ef2ac feat(library/tactic): add 'rename' hypothesis tactic 2014-10-14 18:19:34 -07:00
Leonardo de Moura
fc01edee4d fix(frontends/lean/elaborator): perform translation using "user-level" names 2014-10-14 17:53:24 -07:00
Leonardo de Moura
90dba868e3 feat(library/tactic/proof_state): apply substitutions when pretty printing state 2014-10-14 17:37:20 -07:00
Leonardo de Moura
58c9421bab refactor(library/tactic): elaborate expressions nested in tactics with respect to current goal, save postponed constraints (e.g., flex-flex constraints) closes #44, fixes #70 2014-10-14 17:18:40 -07:00
Soonho Kong
0f5d88517d chore(library/rewriter): remove lean-0.1 files 2014-10-14 16:03:34 -07:00
Leonardo de Moura
5ff200c516 chore(library/simplifier): delete old simplifier
This was the simplifier used in Lean 0.1.
2014-10-14 15:56:09 -07:00
Leonardo de Moura
de7c850782 feat(kernel/converter): relax is_def_eq test for local constants and meta-variables 2014-10-14 15:31:57 -07:00
Leonardo de Moura
940092a975 fix(kernel/constraint): bug in operator<< 2014-10-14 15:22:03 -07:00
Leonardo de Moura
a30232b99a fix(library/module): race condition on m_imported 2014-10-14 15:19:50 -07:00
Soonho Kong
343a9a690e feat(emacs/lean-type): add lean-show-type-add-to-kill-ring option
If a customization option 'lean-show-type-add-to-kill-ring' is non-nil
and a user runs 'lean-show-type' by explicitly typing 'C-c C-t',
lean-mode saves the displayed type information message into kill-ring
, which can be pasted by yank (C-y) command.

Close #245
2014-10-14 09:27:25 -07:00
Leonardo de Moura
7231aa0d73 fix(library/module): allow multiple calls to import_modules with the same modules
The idea is to store a set of already imported files.
This feature is useful when using the import_modules API directly (e.g.,
from javascript).
2014-10-14 08:13:41 -07:00
Leonardo de Moura
d75a9c840c fix(frontends/lean/parser): segfault when ending scope without opening, fixes #244 2014-10-13 21:08:36 -07:00
Leonardo de Moura
b7c1b348d1 feat(frontends/lean/inductive_cmd): don't force user to repeat argument declarations in every datatype in a mutually recursive datatype declaration 2014-10-13 20:53:09 -07:00
Leonardo de Moura
9edf780a00 feat(frontends/lean): elaborate inductive datatypes and introduction rules as a single elaboration problem 2014-10-13 18:35:11 -07:00
Leonardo de Moura
2431de542f refactor(frontends/lean/parser): add missing 'const' 2014-10-13 13:07:42 -07:00
Leonardo de Moura
7d0db4cc60 feat(library/kernel_serializer): compress binder modifier annotations when saving .olean file 2014-10-13 10:14:56 -07:00
Leonardo de Moura
bc70e7244d feat(frontends/lean): add option '-X': discard all proofs after theorems are checked
This option is useful for generating compact .olean files for web demos
2014-10-13 10:05:38 -07:00
Leonardo de Moura
698dc0472d fix(frontends/lean/decl_cmds): error messages 2014-10-13 07:17:33 -07:00
Leonardo de Moura
ab90a350b3 fix(emacs/lean-syntax): syntax highlight for declarations with explicit universes 2014-10-13 06:52:36 -07:00
Leonardo de Moura
a26618e0f2 feat(frontends/lean): add '[]' notation for marking arguments where class-instance resolution should be applied 2014-10-12 13:06:00 -07:00
Leonardo de Moura
549f24335e feat(frontends/lean): do not allow coercion definition in sections 2014-10-11 18:41:17 -07:00
Leonardo de Moura
78b8a67015 refactor(library/scoped_ext): sections are just "nameless" namespaces 2014-10-11 17:36:46 -07:00
Leonardo de Moura
158682219f feat(frontends/lean): allow parameters only in contexts 2014-10-11 17:13:56 -07:00
Leonardo de Moura
f984b51291 feat(frontends/lean/notation_cmd): remove the cleanup notation hack 2014-10-11 16:40:26 -07:00
Leonardo de Moura
334a4c84d1 refactor(frontends/lean): do not expose unnecessary functions 2014-10-11 16:40:26 -07:00
Leonardo de Moura
33ad41b93e refactor(frontends/lean): adjust function names to reflect how parameters/variables behave 2014-10-11 15:33:31 -07:00
Leonardo de Moura
ca632cca13 feat(frontends/lean): add 'universe variable' command
We can declare variables anywhere. So, we must also be able do declare
"universe" variables anywhere. Here is a minimal example that requires
this feature

```
-- We want A and B to be in the same universe
universe variable l
variable A : Type.{l}
variable B : Type.{l}
definition tst := A = B
```

The following doesn't work because A and B are in different universes
```
variable A : Type
variable B : Type
definition tst := A = B
```

The following works, but tst is not universe polymorphic, since l is
one *fixed* global universe
```
universe l
variable A : Type.{l}
variable B : Type.{l}
definition tst := A = B
```
2014-10-11 14:22:33 -07:00
Leonardo de Moura
6a40f80612 fix(emacs/lean-syntax): glitch on syntax highlight 2014-10-11 10:56:28 -07:00
Leonardo de Moura
1cc8007b9a refactor(frontends/lean): rename parser methods is_section* to is_local* 2014-10-11 10:25:39 -07:00
Leonardo de Moura
b0f8d86f26 feat(frontends/lean/parser): reject ambiguous parameter declaration, closes #242 2014-10-10 18:08:03 -07:00
Leonardo de Moura
5e6ff3eef3 fix(frontends/lean/elaborator): bug when reporting error position 2014-10-10 17:31:12 -07:00
Leonardo de Moura
f0523a3465 feat(frontends/lean): namespaces also define scope for variables 2014-10-10 16:21:30 -07:00
Leonardo de Moura
0641ee33ce feat(frontends/lean): allow variables anywhere 2014-10-10 16:16:19 -07:00
Leonardo de Moura
4010767c20 feat(shell): add options --cpp and --discard 2014-10-10 15:55:08 -07:00
Leonardo de Moura
3d65b1c25c fix(frontends/lean/elaborator): incorrect type information being reports in lean-mode, fixes #241 2014-10-10 15:41:55 -07:00
Leonardo de Moura
d61e6fdd89 refactor(frontends/lean/util): add auxiliary function 2014-10-10 15:21:08 -07:00
Leonardo de Moura
235b8975d2 feat(kernel/inductive): K-like reduction in the kernel
Given (H_1 : a = a), we have that
      eq.rec H_2 H_1
reduces to H_2

This is not exclusive to equality.
It applies to any inductive datatype in Prop, containing only one
constructor with zero "arguments" (we say they are nullary).

BTW, the restriction to only one constructor is not needed, but it is
does not buy much to support multiple nullary constructors since Prop is
proof irrelevant.
2014-10-10 14:37:45 -07:00
Leonardo de Moura
5a71542aeb feat(kernel/inductive): track when K-like reduction can be used 2014-10-10 08:50:24 -07:00
Leonardo de Moura
402a351937 feat(frontends/lean): add 'universes' command 2014-10-10 08:45:59 -07:00
Leonardo de Moura
9ba59c6b25 feat(library/universe): improve support for universe level constraints in the unifier 2014-10-09 20:28:39 -07:00
Leonardo de Moura
052bc6ff20 fix(frontends/lean/elaborator): better specific universe detection 2014-10-09 14:43:07 -07:00
Floris van Doorn
1612070350 feat(lean-input.el): add some new notation 2014-10-08 23:14:44 -07:00
Leonardo de Moura
8947bf4347 feat(frontends/lean): display type of binders, closes #238 2014-10-08 22:54:10 -07:00
Leonardo de Moura
25fd370c51 fix(frontends/lean): bug when using nested sections and parameters
see tests/lean/run/section4.lean
2014-10-08 22:23:20 -07:00
Leonardo de Moura
f7bbe09db2 feat(frontends/lean): add helper function mk_section_local_ref 2014-10-08 22:23:20 -07:00
Leonardo de Moura
d445857f56 fix(frontends/lean): change how "as-is" expressions are handled
Implicit arguments are consumed.
2014-10-08 22:23:20 -07:00
Leonardo de Moura
86410d392b feat(util/list_fn): generalize map_filter template 2014-10-08 22:23:20 -07:00
Leonardo de Moura
0651496bf6 refactor(frontends/lean/notation_cmd): remove unnecessary uses of add_local_expr 2014-10-08 22:23:20 -07:00
Leonardo de Moura
57c85221fe fix(frontends/lean): collect used universe levels after elaboration in the check command 2014-10-08 22:23:19 -07:00
Leonardo de Moura
eab9321a3b fix(frontends/lean): make all variables/parameters visible for 'variables' command 2014-10-08 22:23:19 -07:00
Leonardo de Moura
93e0599a0f feat(kernel/level): add missing normalization rule 2014-10-08 22:23:19 -07:00
Soonho Kong
24227f0e51 feat(emacs/lean-settings): enable linja '--keep-going' option
Fix #234
2014-10-08 13:12:16 -07:00
Soonho Kong
b6d475c3ac fix(emacs/lean-project): use better prompt message for lean-project-create 2014-10-08 13:04:31 -07:00
Soonho Kong
d542771ba1 doc(emacs/README.md): add 'Unicode' subsection in 'Known Issues' section 2014-10-08 10:43:58 -07:00
Soonho Kong
8c0f01ac34 doc(emacs/README.md): do package-refresh-contents only once
Close #233
2014-10-08 10:41:52 -07:00
Leonardo de Moura
3b23bec25b feat(frontends/lean): variables/parameters and check commands have access to all section variables/parameters, closes #231 2014-10-08 08:40:55 -07:00
Leonardo de Moura
5b9bd279af chore(frontends/lean/parser): minor cleanup 2014-10-08 08:40:55 -07:00
Leonardo de Moura
744cee8dd8 feat(frontends/lean): force 'classes' to be declared before instances are declared, closes #228 2014-10-07 18:02:15 -07:00
Leonardo de Moura
d8572e249d feat(frontends/lean/builtin_cmds): add 'print classes' command 2014-10-07 17:30:57 -07:00
Leonardo de Moura
c31c026f46 feat(frontends/lean/class): accept only inductive datatypes (and records) as classes 2014-10-07 17:30:57 -07:00
Leonardo de Moura
8fa171cb92 refactor(library/unifier): allow general 'unify' procedure to take an initial substitution as argument 2014-10-07 17:30:57 -07:00
Soonho Kong
826166c257 feat(CMakeLists.txt): use bin/package_version if needed
1) When git sha1 is available:

    Lean (version 0.2.0, commit 4a119a0424, Release)

2) When git sha1 is not available, but there is bin/package_version file

    Lean (version 0.2.0, package 0.2.0~ubuntu1~12.04, Release)

3) Git sha1 is not available, bin/package_version does not exist.

    Lean (version 0.2.0, Release)

Close #229
2014-10-07 16:58:44 -07:00
Leonardo de Moura
92c424936a refactor(kernel/macro_definition_cell): improve macro get_type API 2014-10-07 16:38:31 -07:00
Leonardo de Moura
16041e4948 fix(frontends/lean/elaborator): 'as-is' expressions
The elaborator should not introduce implicit arguments on terms marked
as 'as-is'.
2014-10-07 16:38:31 -07:00
Soonho Kong
78e9854bae fix(emacs): support tabs in a file
Fix #226
2014-10-07 14:42:35 -07:00
Soonho Kong
e40ef9f6c5 feat(util/lean_path.cpp): add "exe_path/../lib/lean" to LEAN_PATH
Related issue: #223
2014-10-07 13:38:23 -07:00
Soonho Kong
d5abaf6446 feat(CMakeLists.txt): install lean library to LIBRARY_DIR (default: lib/lean) 2014-10-07 12:30:39 -07:00
Soonho Kong
013cd5640e fix(CMakeLists.txt): rename EMACS_LIB to EMACS_LISP_DIR (default: share/eamcs/site-lisp/lean) 2014-10-07 12:30:39 -07:00
Soonho Kong
103cf57a46 chore(CMakeLists.txt): standard_lib target generates TAGS for library 2014-10-07 12:30:39 -07:00
Soonho Kong
2cf6cf19c0 feat(src): add LEAN_VERSION_PATCH 2014-10-07 12:30:38 -07:00
Soonho Kong
900c7c41a1 fix(shell/lean.cpp): print git commit in version string only when it's available 2014-10-07 12:30:38 -07:00
Leonardo de Moura
531de7990d refactor(frontends/lean/tactic_hint): simplify tactic_hints 2014-10-07 11:34:58 -07:00
Leonardo de Moura
90ece4dd1b feat(frontends/lean): remove tactic hints for specific classes
The idea is to separate class-instance resolution and tactic framework
as two independent engines.
2014-10-07 09:44:01 -07:00
Leonardo de Moura
dc0e6861b7 fix(emacs/lean-mode): wrong pp highlighting, fixes #225 2014-10-07 02:32:59 -07:00
Soonho Kong
39645390ff chore(util/*): add cstddef header before including gmp.h/mpfr.h
Reference: https://gcc.gnu.org/gcc-4.9/porting_to.html

------

Header <cstddef> changes

The <cstddef> header was updated for C++11 support and this breaks some
libraries which misuse macros meant for internal use by GCC only. For
instance with GMP versions up to 5.1.3, you may see:

/usr/include/c++/4.9.0/cstddef:51:11: error: ‘::max_align_t’ has not been declared
   using ::max_align_t;
           ^
Another possible error is:

someheader.h:99:13: error: ‘ptrdiff_t’ does not name a type

A workaround until libraries get updated is to include <cstddef> or
<stddef.h> before any headers from that library.
2014-10-07 02:36:57 -04:00
Soonho Kong
286aae933c chore(CMakeLists.txt): add EMACS_LIB option to specify installation path for emacs stuff 2014-10-06 11:20:13 -07:00
Leonardo de Moura
dc92f67588 feat(frontends/lean/server): CLEAR_CACHE forces buffer to be reprocessed 2014-10-06 08:42:20 -07:00
Leonardo de Moura
16562adb87 feat(frontends/lean): add 'coercions' and 'instances' to 'print' command, closes #71 2014-10-05 18:50:48 -07:00
Leonardo de Moura
1306d08399 feat(emacs/lean-input): add shortcuts for subscripts 2014-10-05 13:34:05 -07:00
Leonardo de Moura
60d8369688 fix(library/unifier): missing justification when updating choice constraints
The bug was not producing incorrect results, but really bad error
messages.
See: empty.lean.expected.out
2014-10-04 10:40:53 -07:00
Leonardo de Moura
a9741c5c30 chore(frontends/lean/placeholder_elaborator): indent code 2014-10-04 10:36:10 -07:00
Leonardo de Moura
0a288aec40 chore(frontends/lean/proof_qed_elaborator): remove obsolete comment
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-10-04 09:19:33 -07:00
Leonardo de Moura
64f6601fe3 fix(frontends/lean/proof_qed_elaborator): information about synthesized variables in a proof-qed block was being lost 2014-10-04 09:15:42 -07:00
Leonardo de Moura
bf01cfeec5 fix(frontends/lean): avoid superfluous local references of the form @-1 (@ f),
This kind of term also confuses the elaborator
2014-10-04 07:55:32 -07:00
Leonardo de Moura
e71d4548de fix(frontends/lean): universe levels associated with section variables should not be fixed in the section 2014-10-04 07:13:19 -07:00
Leonardo de Moura
b9e7fecb1f fix(frontends/lean/elaborator): style 2014-10-03 16:26:28 -07:00
Leonardo de Moura
a1bb6d6017 refactor(frontends/lean/elaborator): expose elaborator class 2014-10-03 16:10:36 -07:00
Leonardo de Moura
dccf8a3a75 chore(frontends/lean/elaborator): fix field name 2014-10-03 15:34:23 -07:00
Leonardo de Moura
938e12baa1 feat(frontends/lean/notation_cmd): allow local numeric notation 2014-10-03 13:55:57 -07:00
Leonardo de Moura
dbb7f834af refactor(frontends/lean/parser_config): merge notation_ext and mpz_notation_ext 2014-10-03 13:55:57 -07:00
Leonardo de Moura
73eca1ef44 feat(frontends/lean/notation_cmd): notation defined in context overrides existing ones 2014-10-03 13:55:57 -07:00
Soonho Kong
7ea9c32ec8 feat(emacs/lean-server): send SYNC command when visiting a modified buffer
Close #201
2014-10-03 10:11:21 -07:00
Soonho Kong
b78043ae24 feat(emacs/lean-mode): add 'clean-cache' to the menu
Related issue: #75
2014-10-03 10:11:21 -07:00
Soonho Kong
fffb4e6019 feat(emacs/lean-server): delete cache file (.clean) after visit/load
fix #75
2014-10-03 10:11:21 -07:00
Soonho Kong
e255b02fca fix(emacs/lean-changes): visit file before process any changes
This solves many instances of the modified buffer problem.
2014-10-03 10:11:21 -07:00
Leonardo de Moura
c0725d1934 refactor(frontends/lean): remove 'including' expressions 2014-10-03 09:09:27 -07:00
Leonardo de Moura
01d4644026 fix(frontends/lean): bug in include/omit commands: in the end of section/context, the configuration must be restored 2014-10-03 08:52:35 -07:00
Leonardo de Moura
284f300440 feat(frontends/lean): add 'include' and 'omit' commands, closes #184 2014-10-03 07:23:24 -07:00
Leonardo de Moura
6950b4aa9b fix(frontends/lean/decl_cmds): do not allow section parameters/variables to shadow existing parameters/variables 2014-10-02 18:29:41 -07:00
Leonardo de Moura
d5cad765a0 feat(frontends/lean): enforce new semantics for section 'variables'
The library file logic/core/connectives uses the new feature.
2014-10-02 17:55:34 -07:00
Leonardo de Moura
f006d93794 feat(frontends/lean): section variables occur after section parameters 2014-10-02 17:55:34 -07:00
Leonardo de Moura
0a13e7863a feat(frontends/lean): enforce rule section parameters cannot depend on section variables 2014-10-02 17:55:34 -07:00
Leonardo de Moura
bf081ed431 refactor(kernel): rename var_decl to constant_assumption
Motivation: it matches the notation used to declare it.
2014-10-02 17:55:34 -07:00
Leonardo de Moura
4946f55290 refactor(frontends/lean): constant/axiom are top-level commands, parameter/variable/hypothesis/conjecture are section/context-level commands
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-10-02 17:55:34 -07:00
Soonho Kong
91f789c3db feat(emacs/lean-cmd): add SYNC command 2014-10-02 17:30:03 -07:00
Soonho Kong
5e551db9be chore(CMakeLists.txt): use $PYTHON_EXECUTABLE instead of "python" 2014-10-02 17:25:13 -07:00
Leonardo de Moura
f78d831de3 refactor(frontends/lean): remove hardcoded Type', and define it using notation 2014-10-02 14:29:51 -07:00
Leonardo de Moura
4cb54ac825 feat(frontends/lean/elaborator): more strict test for bad universe solution 2014-10-02 14:29:51 -07:00
Leonardo de Moura
98e66586e9 feat(frontends/lean/elaborator): elaborator rejects 'Type' if the universe is explicit 2014-10-02 14:29:51 -07:00
Leonardo de Moura
db9671d7c3 fix(frontends/lean/decl_cmds): remove assertion that does not hold anymore 2014-10-02 09:19:40 -07:00
Leonardo de Moura
9a75298892 feat(emacs): highlight Type' 2014-10-02 08:04:00 -07:00
Leonardo de Moura
5bd8e9d141 fix(frontends/lean/decl_cmds): allow private transparent definitions
Example:
section
  universe l
  private definition T := Type.{max 1 l}
  ...
end
2014-10-02 07:56:01 -07:00
Leonardo de Moura
153e3927ac feat(frontends/lean/elaborator): modify '!' semantics: it stops consuming arguments as soon it finds an argument that does not occur in the rest of the type. 2014-10-01 18:50:17 -07:00
Leonardo de Moura
ead827d6b7 feat(frontends/lean): add ! operator the "dual" of @, closes #220 2014-10-01 17:13:41 -07:00
Soonho Kong
72beb438e6 fix(emacs/lean-server): merge server-trace-mode to debug-mode 2014-10-01 14:38:23 -07:00
Leonardo de Moura
c46ec6a548 fix(frontends/lean): missing type information for INFO, fixes #218 2014-10-01 14:29:07 -07:00
Leonardo de Moura
f863d82e69 fix(frontends/lean/pp): pp was not taking into account new namespace name resolution rules, fixes #216 2014-10-01 11:24:45 -07:00
Leonardo de Moura
966366e18e feat(kernel/inductive): relaxed rules for defining datatypes with explicit universes, closes #217 2014-10-01 10:56:05 -07:00
Leonardo de Moura
263b081e69 fix(frontends/lean/inductive_cmd): temporary aliases must take explicit universes into account, fixes #215 2014-10-01 10:24:44 -07:00
Leonardo de Moura
71077f5c89 feat(frontends/lean/parser): allow _ at level expressions 2014-10-01 10:24:44 -07:00
Soonho Kong
3775d07d5f fix(emacs/lean-company): use lean-grab-hname for findp auto-completion
fix #214
2014-10-01 09:53:48 -07:00
Leonardo de Moura
2730e5163e feat(frontends/lean): allow 'sorry' implicit argument to access the whole context, and avoid cryptic error message
See new test for explanation.
2014-09-30 18:04:04 -07:00
Soonho Kong
89a929e9cd feat(emacs/lean-syntax): add more word constituents to syntax table 2014-09-30 15:41:18 -07:00
Soonho Kong
9024cb23fd fix(emacs/lean-util): fix lean-grab-id 2014-09-30 15:41:16 -07:00
Soonho Kong
d5e77c05cb fix(emacs/lean-flycheck): fix error/warning pattern to work on windows 2014-09-30 15:40:57 -07:00
Soonho Kong
41acc10d49 feat(emacs/lean-flycheck): detect and use flycheck error buffer width
Detect the width of flycheck error list buffer and set pp.width when
calling flycheck. It uses the same heuristic that `split-window-sensibly`
function is using.

A user can also set `lean-flycheck-msg-width` custom variable to enforce
a certain width.

Close #205.
2014-09-30 05:54:46 -07:00
Leonardo de Moura
486839881c feat(*): use environment fingerprint to detect when the cache cannot be used because the configuration changed, closes #75
We are not taking into the account the options object yet.
2014-09-29 18:30:00 -07:00
Leonardo de Moura
19dec32844 feat(library): add environment fingerprint 2014-09-29 18:30:00 -07:00
Leonardo de Moura
530997638a feat(library/definition_cache): store the hashcode of direct dependencies
Actually we store the has code of their types.
2014-09-29 18:30:00 -07:00
Soonho Kong
b538b3e0bf fix(emacs/lean-company): handle singleton candidate case
If we have a singleton auto-complete candidate (e.g. proof_irrel) and it
does not matched with input prefix (e.g. foo), we add the input
prefix (foo) as an extra candidate to prevent the
candidate (proof_irrel) from being automatically selected and completed.
2014-09-29 17:06:01 -07:00
Leonardo de Moura
113879a7dd feat(frontends/lean/server): sort exact matches by size in FINDP 2014-09-29 16:44:55 -07:00
Leonardo de Moura
334977b8bd fix(frontends/lean/info_manager): crash when accessing INFO in the end of the file 2014-09-29 16:44:55 -07:00
Leonardo de Moura
a0c37b231f feat(kernel/expr): add hash_bi function that takes binder information into account 2014-09-29 16:44:55 -07:00
Soonho Kong
7ab8b8acb7 fix(emacs/lean-company): respect lean syntax to extract findp prefix
close #207
2014-09-29 16:00:00 -07:00
Leonardo de Moura
0d6d746d98 feat(frontends/lean): check modification time of imported files
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-29 15:17:27 -07:00
Soonho Kong
6c2e576dff fix(emacs/lean-mode): trigger eri-indent only at the beginning of line 2014-09-29 12:53:22 -07:00
Leonardo de Moura
1a1e9a2340 feat(build): add 'CONSERVE_MEMORY' cmake option
When CONSERVE_MEMORY=ON and gcc is being used, we provide additional
command line options that will minimize the amount of memory used by gcc
when compiling Lean.
This is an attempt to fix the "out-of-memory" failures when building
Lean at Travis.
2014-09-29 12:44:29 -07:00
Leonardo de Moura
6630ed8165 fix(frontends/lean/decl_cmds): warning message when compiling with clang++ 2014-09-29 12:34:00 -07:00
Soonho Kong
f7ab2f7903 feat(emacs/lean-company): add auto-completion for option names 2014-09-29 12:32:46 -07:00
Soonho Kong
51a0d154d1 fix(emacs/lean-company): always allow typing for FIND_P 2014-09-29 12:32:46 -07:00
Soonho Kong
106399179f fix(emacs/lean-syntax): use word-boundary instead of symbol-boundary 2014-09-29 12:32:46 -07:00
Leonardo de Moura
21be308884 feat(frontends/lean/inductive_cmd): infer implicit argument annotation after elaboration, allow user to disable it by using '()' annotation, closes #210 2014-09-29 11:11:17 -07:00
Leonardo de Moura
9c55bbb871 feat(frontends/lean/elaborator): report an error when Type becomes a Prop after elaboration, closes #208 2014-09-29 08:18:10 -07:00
Leonardo de Moura
fbbd1d25cd chore(frontends/lean/decl_cmds): disable incorrect warning message produced by gcc 2014-09-28 12:32:47 -07:00
Leonardo de Moura
397395bbc9 feat(frontends/lean): allow user to associate priorities to class-instances, closes #180 2014-09-28 12:20:42 -07:00
Leonardo de Moura
9f6a8827e0 refactor(*): use name_map 2014-09-28 10:23:11 -07:00
Leonardo de Moura
33fe409dc6 chore(frontends/lean/placeholder_elaborator): cleanup 2014-09-27 22:24:36 -07:00
Leonardo de Moura
22e47430b5 feat(library/unifier): add 'on-demand' choice constraints, they are processed as soon as their type does not contain meta-variables anymore 2014-09-27 21:50:39 -07:00
Leonardo de Moura
e40f8ffe57 fix(util/sexpr/option_declarations): default value in help message, fixes #212 2014-09-27 10:12:59 -07:00
Leonardo de Moura
8e7aac1eb4 fix(frontends/lean): add 'eval' command 2014-09-26 20:16:03 -07:00
Leonardo de Moura
23960da532 feat(emacs/lean-input): shortcut for long arrow 2014-09-26 17:50:33 -07:00
Leonardo de Moura
69f50adb2e fix(frontends/lean/server): must save the starting environment/options when reprocessing file, fixes #209 2014-09-26 15:36:47 -07:00
Leonardo de Moura
a3e38dc8a0 feat(frontends/lean): allow users to define "numeral notation" 2014-09-26 14:55:23 -07:00
Leonardo de Moura
9928390605 fix(library/match): memory leak that only happens with compiling with clang++ 2014-09-26 10:24:38 -07:00
Leonardo de Moura
6bf905aea8 fix(frontends/lean/pp): do not invoke type checker on expressions
containing free variables.

This could happened when the pretty printer was used from Lua to print
nested subterms
2014-09-26 09:38:36 -07:00
Leonardo de Moura
8143b51c7e feat(build): add 'CROSS_COMPILE' cmake option
When CROSS_COMPILE=ON, the Lean standard library will not be compiled.
2014-09-26 09:26:40 -07:00
Leonardo de Moura
480bc639ea feat(build): add IGNORE_SORRY cmake option
It allows us to perform nightly builds and avoid distracting warning
messages on CDASH.
2014-09-26 08:55:54 -07:00
Leonardo de Moura
f05bb9daeb fix(util/memory): warning when compiling with clang++ 2014-09-26 08:42:47 -07:00
Soonho Kong
4b60499f7d fix(emacs/lean-company): take out '@' from prefix for findp
fix #207
2014-09-26 08:53:48 +02:00
Leonardo de Moura
d02ab15c88 fix(frontends/lean/proof_qed_elaborator): must also create
metavar_closure before solving nested proof_qed

The bug was exposed by the new policy for handling class-instance
resolution. In the new policy, we reject partial solutions.
The bug fixed in this commit was being masked by a partial solution that
was being "completed" later.
2014-09-25 20:07:51 -07:00
Leonardo de Moura
c775da16ec feat(frontends/lean/elaborator): discard partial solution during
class-instance resolution, use only tactic_hints associated with
classes, enforce is_strict
2014-09-25 19:46:08 -07:00
Leonardo de Moura
318fec43a4 feat(frontends/lean/elaborator): use tactic_hints for unsolved placeholders 2014-09-25 17:54:10 -07:00
Leonardo de Moura
bb1c6d44ac fix(frontends/lean/elaborator): missing register_meta 2014-09-25 17:52:36 -07:00
Leonardo de Moura
bcb30f6232 fix(frontends/lean/placeholder_elaborator): missing 'return' 2014-09-25 15:00:06 -07:00
Leonardo de Moura
03f71c73dc perf(kernel/instantiate): cache result of instantiate_type_univ_params
and instantiate_value_univ_params
2014-09-25 13:24:43 -07:00
Leonardo de Moura
23ddacad19 perf(frontends/lean/class): improve is_ext_class procedure 2014-09-25 12:26:09 -07:00
Leonardo de Moura
28796593e3 fix(kernel/type_checker): bug in new is_opaque method 2014-09-25 12:24:14 -07:00
Leonardo de Moura
1d92097781 refactor(kernel/declaration): return reference to type/value/name 2014-09-25 12:17:04 -07:00
Leonardo de Moura
d4236e40b4 feat(kernel/type_checker): expose is_opaque 2014-09-25 11:19:54 -07:00
Leonardo de Moura
8747f12118 refactor(frontends/lean/elaborator): remove unnecessary
set_local_context_for method
2014-09-25 10:21:31 -07:00
Leonardo de Moura
b8eb65aac2 perf(frontends/lean/placeholder_elaborator): reuse local_context, this
is possible now because local_context is a mainly "functional object"
2014-09-25 10:11:41 -07:00
Leonardo de Moura
2e2d2d21f1 refactor(local_context): local_context::scope auxiliary object is not
needed anymore
2014-09-25 09:59:27 -07:00
Leonardo de Moura
cd87539de5 fix(library/unifier): bug in the new next_delta_unfold_case_split 2014-09-25 09:56:32 -07:00
Leonardo de Moura
09162e5fea refactor(frontends/lean/local_context): remove name_generator from local_context 2014-09-25 09:44:34 -07:00
Leonardo de Moura
354c456639 refactor(frontends/lean/local_context): move mvar2meta mapping to elaborator 2014-09-25 09:31:03 -07:00
Leonardo de Moura
fce1113b80 refactor(frontends/lean/coercion_elaborator): simplify
coercion_elaborator interface
2014-09-25 08:48:31 -07:00
Leonardo de Moura
a61b95a87e refactor(frontends/lean/proof_qed_elaborator): simplify
proof_qed_elaborator interface
2014-09-25 08:38:02 -07:00
Leonardo de Moura
18cfce60b9 refactor(frontends/lean/local_context): simplify local_context representation 2014-09-25 08:13:27 -07:00
Leonardo de Moura
0488ee4ee2 perf(library/unifier): process delta expansion case split lazily 2014-09-24 19:16:12 -07:00
Leonardo de Moura
d4c0c01e0b fix(build): add missing file 2014-09-24 12:54:17 -07:00
Leonardo de Moura
516c0c73b9 refactor(*): remove dependency to thread_local C++11 keyword, the
current compilers have several bugs associated with it

We use the simpler __thread (gcc and clang) and
__declspec(thread) (visual studio).
2014-09-24 12:51:04 -07:00
Leonardo de Moura
ca1b8ca80f refactor(util/memory_pool): simplify memory_pool, it is not a template anymore 2014-09-24 10:48:32 -07:00
Leonardo de Moura
41433a4002 refactor(util/rb_tree): remove optimization that creates problems for
some compilers
2014-09-24 10:33:25 -07:00
Leonardo de Moura
9b61b18eaa perf(kernel/replace_visitor): use more expensive/precise cache
It does not use pointer equality, but structural equality
2014-09-24 10:12:29 -07:00
Leonardo de Moura
5489e46ce5 refactor(util/numerics): explicit initialization/finalization 2014-09-24 10:12:29 -07:00
Leonardo de Moura
4205368718 fix(util/sexpr): missing explicit initialization/finalization 2014-09-24 10:12:29 -07:00
Leonardo de Moura
7e84d5df3d refactor(util): explicit initialization/finalization 2014-09-24 10:12:29 -07:00
Leonardo de Moura
8466115665 fix(frontends/lean/class): missing explicit initialization/finalization 2014-09-24 10:12:29 -07:00
Leonardo de Moura
dbe1763b1a refactor(frontends/lean/server): explicit initialization/finalization 2014-09-24 10:12:29 -07:00
Leonardo de Moura
358074ae3d refactor(kernel/record): remove kernel extension for records, we will
implement it outside of the kernel on top of the inductive datatypes
2014-09-24 10:12:28 -07:00
Leonardo de Moura
da481c3274 refactor(kernel): explicit initialization/finalization
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-24 10:12:28 -07:00
Leonardo de Moura
4dd7abb14e refactor(library): explicit initialization/finalization 2014-09-23 10:45:14 -07:00
Leonardo de Moura
27ff42d2e0 refactor(library): remove dead files 2014-09-23 10:28:20 -07:00
Leonardo de Moura
83b22823a6 refactor(library/tactic): explicit initialization/finalization 2014-09-23 10:06:15 -07:00
Leonardo de Moura
29d6bff785 refactor(frontends/lean): explicit initialization/finalization 2014-09-23 10:00:36 -07:00
Leonardo de Moura
79cfb32ec7 refactor(util): explicit initialization/finalization 2014-09-23 08:13:33 -07:00
Leonardo de Moura
4437a65d0b refactor(frontends/lean/builtin_cmds): explicit token initialization 2014-09-22 19:22:53 -07:00
Leonardo de Moura
531046626a refactor(*): explicit initialization/finalization for environment extensions 2014-09-22 17:30:29 -07:00
Leonardo de Moura
b6781711b1 refactor(*): explicit initialization/finalization for serialization
modules, expression annotations, and tactics
2014-09-22 15:26:41 -07:00
Leonardo de Moura
b1ee888aae refactor(*): start move to explicit initialization/finalization,
explicitly initialize/finalize options

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-22 10:41:07 -07:00
Leonardo de Moura
648f209cfe fix(util/memory): redefine the non-throwing versions of the new
operator.

In some platforms, the following operator new is used

   void* operator new(std::size_t sz, std::nothrow_t const &)

Since, it was not defined by memory.cpp, a crash would happen whenever
our delete was invoked.

   void  operator delete(void * ptr) throw() { return lean::free(ptr); }

Our delete assumes the memory was allocated with our new at memory.cpp

   void* operator new(std::size_t sz)
2014-09-21 10:54:41 -07:00
Leonardo de Moura
10a4148adb fix(tests): make sure tests can be executed on Windows msys2 shell 2014-09-20 15:51:24 -07:00
Leonardo de Moura
704e203cd7 feat(util/lean_path): support LEAN_PATH that uses ':' instead of ';' on Windows 2014-09-20 15:24:20 -07:00
Leonardo de Moura
8867f47dd6 feat(build): build standard library when building on Windows 2014-09-20 10:52:59 -07:00
Leonardo de Moura
e3ac1f66e0 feat(util/lean_path): normalize path in function dirname 2014-09-20 10:52:58 -07:00
Soonho Kong
ee4255eb3d fix(emacs/lean-type): disable eldoc at flycheck error/warning
fix #204
2014-09-20 10:20:47 -07:00
Soonho Kong
3e4755db25 fix(emacs/lean-tags): support windows 2014-09-20 10:06:42 -07:00
Soonho Kong
af4e18dd44 fix(emacs/lean-flycheck): support windows
In windows, we need to first call python interpreter to call linja.
2014-09-20 10:06:42 -07:00
Leonardo de Moura
8fe7465ade fix(frontends/lean/pp): when formatting a coercion to function-class
that contains implicit arguments
2014-09-20 09:56:46 -07:00
Leonardo de Moura
fd5daa8fda feat(frontends/lean): use coercions to function-class and sort-class in
function arguments, closes #203
2014-09-20 09:00:10 -07:00
Leonardo de Moura
e430dc8bab feat(frontends/lean): add 'irreducible' as syntax sugar for 'reducible [off]' 2014-09-19 15:54:32 -07:00
Leonardo de Moura
4e2377ddfc refactor(frontends/lean): replace '[protected]' modifier with 'protected definition' and 'protected theorem', '[protected]' is not a hint.
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-19 15:54:32 -07:00
Leonardo de Moura
5d8c7fbdf1 refactor(frontends/lean): replace '[private]' modifier with 'private
definition' and 'private theorem', '[private]' is not a hint.
2014-09-19 15:54:32 -07:00
Leonardo de Moura
97b1998def refactor(frontends/lean): replace '[opaque]' modifier with 'opaque
definition', '[opaque]' is not a hint, but a kind of definition
2014-09-19 15:54:32 -07:00
Leonardo de Moura
08ccd58eb6 feat(frontends/lean): add 'reducible' modifier for controlling which
definitions are unfolded during elaboration

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-19 15:54:32 -07:00
Leonardo de Moura
baf4c01de8 feat(frontends/lean): definitions are opaque by default 2014-09-19 15:54:32 -07:00
Leonardo de Moura
48dbd13eef feat(frontends/lean): allow transient classes/instances, i.e.,
classes/instances that are not saved in .olean files
2014-09-19 15:54:32 -07:00
Leonardo de Moura
93c2c30310 feat(frontends/lean): allow transient coercions, i.e., coercions that
are not saved in .olean files
2014-09-19 15:54:32 -07:00
Leonardo de Moura
cbafa0dbf9 feat(library/scoped_ext): allow extensions to mark whether an entry is
persistent or not
2014-09-19 15:54:32 -07:00
Soonho Kong
5b9b814fd1 fix(shell/lean.cpp): use binary mode to open cache file 2014-09-19 09:36:23 -07:00
Leonardo de Moura
a3e43c2173 refactor(util/thread_script_state): remove 'enable_script_state_recycling' hack 2014-09-19 08:14:50 -07:00
Leonardo de Moura
49d5af473d refactor(kernel): remove support for proof irrelevant classes
Motivation: we can use Prop
2014-09-19 07:32:07 -07:00
Leonardo de Moura
87592cdb43 refactor(library): remove dead code 2014-09-18 22:45:53 -07:00
Leonardo de Moura
2bde3f55d5 feat(shell): include build type when printing version 2014-09-18 22:40:05 -07:00
Leonardo de Moura
dd31ed60b0 refactor(library): remove unnecessary file hott_kernel, HoTT and
standard library have been merged
2014-09-18 20:30:37 -07:00
Leonardo de Moura
b53b1825ae fix(frontends/lean/info_manager): get_closest_env_opts 2014-09-18 17:03:59 -07:00
Leonardo de Moura
9e29602934 fix(frontends/lean/info_manager): make sure env_info is not lost when
starting parser in the middle of the 'file'
2014-09-18 16:51:59 -07:00
Leonardo de Moura
970ad72bc3 fix(frontends/lean/pp): protect pretty printer from exceptions 2014-09-18 16:21:20 -07:00
Leonardo de Moura
b3e05a2fe9 refactor(frontends/lean/scanner): remove dependency to seekg and unget
methods

It is not safe to use seekg for textual files. Here is a fragment from a
C++ manual:

seekg() and seekp()

This pair of functions serve respectively to change the position of stream pointers get and put. Both functions are overloaded with two different prototypes:

     seekg ( pos_type position );
     seekp ( pos_type position );

Using this prototype the stream pointer is changed to an absolute position from the beginning of the file. The type required is the same as that returned by functions tellg and tellp.

      seekg ( off_type offset, seekdir direction );
      seekp ( off_type offset, seekdir direction );

Using this prototype, an offset from a concrete point determined by
parameter direction can be specified. It can be:

          ios::beg	offset specified from the beginning of the stream
          ios::cur	offset specified from the current position of the stream pointer
          ios::end	offset specified from the end of the stream

The values of both stream pointers get and put are counted in different
ways for text files than for binary files, since in text mode files some
modifications to the appearance of some special characters can
occur. For that reason it is advisable to use only the first prototype
of seekg and seekp with files opened in text mode and always use
non-modified values returned by tellg or tellp. With binary files, you
can freely use all the implementations for these functions. They should
not have any unexpected behavior.
2014-09-18 15:24:48 -07:00
Leonardo de Moura
243f80231a chore(kernel): fix style and lua bindings 2014-09-17 18:30:28 -07:00
Leonardo de Moura
ea1bae0143 refactor(kernel/converter): replace extra_opaque_set with predicate
It gives us more flexibility.
2014-09-17 17:05:13 -07:00
Leonardo de Moura
1fbb554a16 feat(library/module): provide predicate module::is_definition 2014-09-17 16:32:00 -07:00
Leonardo de Moura
9733401c20 fix(frontends/lean/tactic_hint): failure when compiling lean terms into
tactics: mismatch on the number of universe parameters
2014-09-17 15:23:10 -07:00
Leonardo de Moura
8b76deb971 fix(util/thread_script_state): style 2014-09-17 15:23:10 -07:00
Leonardo de Moura
19148af7ae feat(build): do not display WARNING message when tcmalloc is not found 2014-09-17 15:23:10 -07:00
Leonardo de Moura
26918022d8 feat(build): use Release when compilation mode is not specified 2014-09-17 15:23:10 -07:00
Leonardo de Moura
e3e1668f27 fix(util/thread_script_state): disable script_state recycling at finalization time
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-17 09:57:17 -07:00
Leonardo de Moura
a72a11db8e fix(util/script_state_manager): crash when compiling with msys2 stack
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-17 08:39:06 -07:00
Leonardo de Moura
aa5abefaff fix(util/thread_script_state): make sure system does not crash during
finalization
2014-09-17 08:25:21 -07:00
Soonho Kong
9161a6a210 fix(emacs/lean-type): change where to trigger eldoc
Previously, eldoc is triggered regardless of current position.
Now, it is triggered:

 - *NOT* looking-at whitespace or
 - looking-back end-parens such as ')', '}', ']', etc
2014-09-17 00:24:30 -07:00
Leonardo de Moura
9a2f1ba423 fix(util): compilation problems when using msys2
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-16 21:29:51 -07:00
Leonardo de Moura
f03f0aa8b9 fix(util/thread): MULTI_THREAD=OFF mode 2014-09-16 20:44:43 -07:00
Leonardo de Moura
2b0623c0a1 fix(frontends/lean): assertion violations 2014-09-16 18:59:51 -07:00
Leonardo de Moura
78ad24a697 feat(frontends/lean/server): add SYNC command, closes #199 2014-09-16 18:42:34 -07:00
Leonardo de Moura
e3e2370a38 feat(frontends/lean): split 'opaque_hint' command into 'opaque' and 'transparent'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-16 18:03:40 -07:00
Leonardo de Moura
4b51d50ad4 fix(frontends/lean/elaborator): coercion overloading 2014-09-16 15:12:20 -07:00
Leonardo de Moura
dffe9a6f17 fix(frontends/lean/elaborator): more robust support for coercions to
function-class that contains implicit arguments
2014-09-16 13:08:34 -07:00
Leonardo de Moura
d0d23eb525 fix(frontends/lean/inductive_cmd): improve name resolution in inductive
command

The new test demonstrates the problem being fixed by this commit
2014-09-16 09:48:51 -07:00
Soonho Kong
2a8ddf055b fix(emacs/lean-option): fix lean-get-options 2014-09-15 17:44:24 -07:00
Soonho Kong
aa9fe958a9 feat(emacs/lean-debug): add lean-debug minor-mode
close #177
2014-09-15 16:50:35 -07:00
Leonardo de Moura
af2c3b1815 fix(frontends/lean/info_manager): bug in save_environment_options,
server was displaying old results
2014-09-15 16:05:17 -07:00
Leonardo de Moura
93e83baa1b fix(frontends/lean/parser): commit_upto invocation after 'import' 2014-09-15 16:05:17 -07:00
Leonardo de Moura
feb4993f9c fix(frontends/lean/server): '[anonymous]' entry being displayed by FINDP
This could happen when there is a declaration (e.g., nat) whose type is
equal to an active namespace.
2014-09-15 16:05:17 -07:00
Soonho Kong
18e6481ce3 test(emacs/lean-option-test): add lean-test-update-string-alist-default 2014-09-15 13:04:53 -07:00
Soonho Kong
b650793b33 feat(lean-option): handle default pp.width option value 2014-09-15 13:04:53 -07:00
Soonho Kong
254d861970 feat(bin/linja): pass -D config option to lean
Close #196
2014-09-15 13:04:13 -07:00
Soonho Kong
2bdc415a34 fix(emacs/lean-option): handle lean-option-string when it's nil 2014-09-15 11:26:53 -07:00
Soonho Kong
11ff7b5d33 feat(lean-mode): enable mmm-parse-when-idle
Related issue: #74
2014-09-15 10:23:38 -07:00
Soonho Kong
f94e28ce39 fix(emacs/lean-mode): disable flycheck-lua inside of lean-mode
Related issue: #74
2014-09-15 10:23:31 -07:00
Soonho Kong
c3d39938ac test(emacs): add lean-option-test 2014-09-15 09:48:33 -07:00
Soonho Kong
4bbfe4ec79 feat(emacs/lean-tags): add lean-global-search
close #170
2014-09-15 09:48:33 -07:00
Soonho Kong
ff6862f587 fix(emacs/lean-mode): pass lean-options to lean-execute
Related issue: #196
2014-09-15 09:48:26 -07:00
Soonho Kong
75ab5e07d6 feat(emacs/lean-option): save lean-options to lean-global-option-alist 2014-09-15 09:46:06 -07:00
Soonho Kong
f25f9a8fab fix(emacs/lean-mmm-lua): add 'insert' for mmm-insert-region (C-c % l)
Related issue: #74, https://github.com/flycheck/flycheck/issues/349, https://github.com/purcell/mmm-mode/issues/32
2014-09-15 00:03:21 -07:00
Soonho Kong
1527efb108 fix(emacs/lean-mode): run company-lean--check-prefix before auto-complete
fix #191
2014-09-14 23:15:24 -07:00
Soonho Kong
27b20c5585 fix(emacs/lean-company): fix auto-complete behavior after tab
fix #192
2014-09-14 23:15:24 -07:00
Soonho Kong
81ecbb4c94 fix(emacs/lean-company): import auto complete bug
fix #189
2014-09-14 23:15:24 -07:00
Soonho Kong
d424cdd336 feat(emacs/lean-company): add custom-variable lean-company-type-foreground
Close #190
2014-09-14 23:15:24 -07:00
Soonho Kong
87ad568ae6 fix(emacs/CMakeLists.txt): add all *.el files when install 2014-09-14 23:15:24 -07:00
Soonho Kong
50213fc664 fix(emacs/Makefile): add missing Makefile 2014-09-14 23:14:42 -07:00
Soonho Kong
df588d6ba0 fix(lean-flycheck): make column optional when detecting error/messages
fix #194
2014-09-14 23:14:42 -07:00
Leonardo de Moura
d47412d201 fix(frontends/lean/parser): error line numbers for lua code, fixes #194 2014-09-14 21:03:09 -07:00
Leonardo de Moura
841658ec37 feat(library/error_handling): generate valid line and column information
when in flycheck mode
2014-09-14 20:15:22 -07:00
Leonardo de Moura
edcbe6fe10 feat(frontends/lean): allow multiple coercions from class A to B, closes #187
See new tests (for examples)
tests/lean/run/coe10.lean
tests/lean/run/coe11.lean
tests/lean/run/coe9.lean

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-14 12:59:43 -07:00
Leonardo de Moura
1b6d4460e9 chore(library/coercion): cleanup 2014-09-14 12:59:43 -07:00
Soonho Kong
765d9b032f feat(src/cmake/modules/CleanOlean.cmake): add CleanOlean.cmake
Instead of using 'find -delete', use CMAKE's FILE GLOB_RECURSE and FILE
REMOVE to implement clean-olean.

Related issue: #166
2014-09-14 01:40:21 -07:00
Soonho Kong
2d29d6d319 feat(emacs/lean-company): auto-completion for import
Close #126
2014-09-14 00:00:25 -07:00
Soonho Kong
bf9ff192ca chore(emacs/README.md): add 'f' as a required package for lean-mode 2014-09-13 23:35:38 -07:00
Leonardo de Moura
d647954f93 feat(frontends/lean/elaborator): constraints associated with 'proof-qed'
blocks are solved independently, closes #82
2014-09-13 10:21:10 -07:00
Leonardo de Moura
8c8c9d1c4a feat(frontends/lean/elaborator): cleanup and remove unnecessary code 2014-09-12 17:55:27 -07:00
Leonardo de Moura
0c50517058 refactor(frontends/lean/elaborator): do not save/restore cache 2014-09-12 17:39:11 -07:00
Leonardo de Moura
6db46e0505 fix(frontends/lean/server): std::unordered_map::insert does replace
existing entry, fixes #188
2014-09-12 16:50:06 -07:00
Leonardo de Moura
b7023ce1d8 fix(frontends/lean/placeholder_elaborator): do not truncate stream of
solutions during class-instance resolution, closes #183

For example, in theorem inverse_unique at category.lean, implicit
arguments are synthesized for inverse_compose. The first solution H' is
not good, and produces a type incorrect solution
2014-09-12 16:12:23 -07:00
Leonardo de Moura
b482f27543 fix(util/lazy_list): bug in filter operation 2014-09-12 16:12:23 -07:00
Leonardo de Moura
b7dcb8f833 fix(frontends/lean/elaborator): remove annotation left-over 2014-09-12 16:12:23 -07:00
Soonho Kong
563cfa73ec feat(emacs/lean-changes): handle before/after-revert 2014-09-12 14:25:08 -07:00
Soonho Kong
27ae03878c refactor(emacs/lean-server): rename flush-changed-lines to server-flush-changed-lines 2014-09-12 14:25:08 -07:00
Soonho Kong
c034c54f50 refactor(emacs/debug): rename lean-server-debug to lean-debug 2014-09-12 14:25:08 -07:00
Leonardo de Moura
029acbd1df feat(library/coercion): better support for coercions to function-class. closes #185 2014-09-12 13:17:20 -07:00
Leonardo de Moura
62585f1c56 fix(library/coercion): remove spurious '\n' 2014-09-12 13:08:47 -07:00
Leonardo de Moura
a2e36e97f2 fix(frontends/lean/builtin_cmds): allow coercion command inside section, fixes #186 2014-09-12 12:13:29 -07:00
Leonardo de Moura
010ecebfea feat(frontends/lean): add proof-qed expression
Remark: we still have to add support to it in the elaborator.
Right now, it is just an embellished parenthesis.
2014-09-11 18:14:49 -07:00
Leonardo de Moura
7ffe73b8ca fix(frontends/lean): name clash inside section, fixes #181 2014-09-11 16:37:23 -07:00
Leonardo de Moura
85f7132efe feat(frontends/lean/placeholder_elaborator): perform class-instance resolution in a completely independent unifier object, it also triggers the resolution when expected type does not contain metavariables, closes #175, closes #173, closes #68 2014-09-11 14:49:35 -07:00
Leonardo de Moura
03902d4b45 refactor(library/unifier): add option m_discard too unifier, if m_discard == false, then unsolved flex-flex constraints are returned, the unifier also does not apply "last resource" techniques that may miss many solutions. 2014-09-11 14:49:35 -07:00
Leonardo de Moura
935ba35292 feat(library/unifier): keep normalization result when processing universe level unification constraints 2014-09-11 14:49:35 -07:00
Leonardo de Moura
c7c35becb2 feat(library/io_state): add default constructor to io_state 2014-09-11 14:49:35 -07:00
Leonardo de Moura
80fd14b39e refactor(frontends/lean): replace collect_metavars with metavar_closure helper class 2014-09-11 14:49:35 -07:00
Soonho Kong
b31edb2cee fix(emacs/lean-company): pass dummy continuation for WAIT 2014-09-11 13:46:07 -07:00
Soonho Kong
0b507777f9 fix(emacs/lean-company): repaint background in the candidate only when required 2014-09-11 13:44:54 -07:00
Soonho Kong
389fe02597 fix(emacs/lean-server): handle modified buffer only when process start 2014-09-11 12:40:10 -07:00
Soonho Kong
733c0e4a77 chore(emacs/lean-server): make trace-mode and debug-mode non-local vars 2014-09-11 12:34:23 -07:00
Soonho Kong
89f38b3945 test(emacs/features): add ecukes template 2014-09-11 12:33:49 -07:00
Soonho Kong
2ba43f1432 refactor(emacs): move tests in *.el files to 'test' directory 2014-09-11 12:29:32 -07:00
Soonho Kong
45b7327d63 doc(emacs/README.md): add contribution section 2014-09-11 12:29:00 -07:00
Soonho Kong
c879b2ce6d chore(emacs/Cask): add ert-runner, ecukes 2014-09-11 11:12:05 -07:00
Soonho Kong
4b556a41ed feat(emacs/lean-server): async task queue holds type of cmds as well 2014-09-11 04:09:21 -07:00
Soonho Kong
565402f3d6 feat(lean-server): handle signals (error/quit) in continuations
Related with #158
2014-09-11 04:07:50 -07:00
Soonho Kong
5b28480809 chore(emacs/lean-server): send signal info to lean-server-trace 2014-09-11 04:04:20 -07:00
Soonho Kong
92f8a22ea1 fix(emacs/lean-company): send dummy continuation when send wait 2014-09-11 04:03:23 -07:00
Leonardo de Moura
1e5ba9bd75 refactor(frontends/lean/elaborator): move coercion_elaborator to its own module 2014-09-10 16:42:49 -07:00
Leonardo de Moura
6bc41f8dde refactor(frontends/lean/elaborator): move placeholder_elaborator to its own module 2014-09-10 16:42:49 -07:00
Leonardo de Moura
9ce356e515 refactor(frontends/lean/local_context): do not use references in the local context 2014-09-10 16:42:49 -07:00
Soonho Kong
63c0510a05 feat(emacs/lean-tags): detect and support multiple TAGS
Close #170
2014-09-10 16:38:36 -07:00
Soonho Kong
1ea8b66a39 fix(emacs/lean-company): enable auto-complete when prefix length >= 1
[skip ci]
2014-09-10 16:21:44 -07:00
Soonho Kong
1c5497e632 feat(emacs/lean-project): add lean-project-create to imenu
Related with #170
2014-09-10 15:19:11 -07:00
Soonho Kong
b05ca1db0f fix(emacs/lean-tags): handle exceptions from find-tag 2014-09-10 14:14:42 -07:00
Soonho Kong
b51e8dd1b9 fix(emacs/lean-server): respect order of messages in check-buffer-and-partition 2014-09-10 14:14:42 -07:00
Soonho Kong
7c4debd1d1 feat(emacs/lean-server): handle modified buffer when send VISIT cmd
Close #159
2014-09-10 14:14:42 -07:00
Leonardo de Moura
669b1bff45 refactor(frontends/lean/elaborator): rename choice_elaborator to choice_iterator and move to separate module 2014-09-10 11:20:16 -07:00
Leonardo de Moura
e128610711 chore(tests): use option -t 100000 to speedup tests 2014-09-10 11:20:16 -07:00
Leonardo de Moura
4a4de27a6c refactor(frontends/lean/elaborator): move local_context to separate file 2014-09-10 11:20:16 -07:00
Leonardo de Moura
4ea322febc chore(frontends/lean/elaborator): minor cleanup 2014-09-10 11:20:16 -07:00
Soonho Kong
cab1811927 feat(emacs/lean-server): print out signal event to debug buffer 2014-09-10 09:07:16 -07:00
Leonardo de Moura
b82092a123 fix(frontends/lean/parser): segmentation fault after REPLACE, fixes #172 2014-09-10 08:39:39 -07:00
Soonho Kong
8fd938e142 fix(util/lean_path.cpp): get_exe_location follows symbolic link in OSX
Previously, we had different behaviors on Linux and OSX when
get_exe_location finds a location of executable:

 - Linux: follow symbolic link
 - OSX: not follow symbolic link
2014-09-10 07:41:14 -07:00
Leonardo de Moura
570879b55f feat(frontends/lean): add declaration to namespace without opening it, closes #161 2014-09-09 18:02:14 -07:00
Leonardo de Moura
e856a268a2 fix(frontends/lean): OVERLOAD info for overloaded notation, fixes #132 2014-09-09 17:44:19 -07:00
Leonardo de Moura
c92a9b8808 fix(frontends/lean/class): take whnf into account in add_instance 2014-09-09 16:09:05 -07:00
Leonardo de Moura
38058450d4 fix(frontends/lean/elaborator): whnf may produce assertion violation if term contains free variables 2014-09-09 16:09:05 -07:00
Soonho Kong
27fa0d0ae3 doc(emacs/README.md): update required/optional packages 2014-09-09 15:11:58 -07:00
Soonho Kong
60d14b50ab feat(emacs/lean-require): check lean-mode dependencies in initialization
Close #91
2014-09-09 15:11:57 -07:00
Soonho Kong
961dccf279 feat(emacs/Cask): add Cask file
Close #92
2014-09-09 15:11:57 -07:00
Leonardo de Moura
47e02342bb feat(frontends/lean/elaborator): use whnf in class-instance resolution, closes #160 2014-09-09 15:04:44 -07:00
Leonardo de Moura
bd1bc336fb feat(library/coercion): add simple trick for defining coercions to function-class in a convenient way, closes #31 2014-09-09 14:36:36 -07:00
Leonardo de Moura
abdd784729 feat(shell): start 'lean --server' with 'pp.beta = true' 2014-09-09 14:13:35 -07:00
Leonardo de Moura
2d94584816 feat(frontends/lean/pp): add 'pp.beta' option, closes #154 2014-09-09 14:10:20 -07:00
Leonardo de Moura
65000fa653 feat(library/coercion): rename class to 'coercions' 2014-09-09 14:03:45 -07:00
Soonho Kong
ba6dc59d5f fix(emacs/lean-server): missing 'rx' at the beginning of regex 2014-09-09 13:47:09 -07:00
Soonho Kong
70dcc2e122 fix(emacs): use looking-at instead of char-after 2014-09-09 13:22:58 -07:00
Soonho Kong
85bd112a37 fix(emacs/lean-company): color problem when showing auto-complete candidates 2014-09-09 13:22:58 -07:00
Soonho Kong
c26f39b86e feat(emacs/lean-company): "c-u TAB" asks filter for FINDG 2014-09-09 13:22:58 -07:00
Leonardo de Moura
ee196bbf1a fix(frontends/lean/pp): pretty printing coercions to functions, fixes #151 2014-09-09 12:49:32 -07:00
Leonardo de Moura
d8caa294b5 fix(frontends/lean/parser): configuration options defined in a context are transient, fixes #162
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-09 11:02:54 -07:00
Leonardo de Moura
0505be2aca feat(frontends/lean/server): unifier maximum number of steps error in FINDG, closes #155
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-09 10:36:41 -07:00
Leonardo de Moura
53292d8297 feat(frontends/lean/server): add timebound to WAIT command, closes #156
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-09 10:28:47 -07:00
Leonardo de Moura
187661aa6a feat(library/unifier): consider whnf case-split on flex-rigid constraints whenever the rhs contains a local constant that is not in the lhs 2014-09-09 09:27:26 -07:00
Leonardo de Moura
a5698a55ec fix(library/unifier): catch type error when checking is_def_eq of type incorrect expressions 2014-09-09 09:27:26 -07:00
Leonardo de Moura
fd85d4702e refactor(library/unifier): move all_local outside of the class 2014-09-09 09:27:26 -07:00
Leonardo de Moura
ebde1bcfad feat(library/unifier): option 'unifier.computation true' will force elaborator to always consider an extra case-split when the right-hand-side of a flex-rigid constraint is not in weak-head-normal-form 2014-09-09 09:27:26 -07:00
Leonardo de Moura
d9afb3ca96 fix(frontends/lean/elaborator): missing constraint 2014-09-09 09:27:26 -07:00
Leonardo de Moura
4088cdc139 chore(frontend/lean/pp_options): use consistent name convention for pp option names 2014-09-09 09:27:26 -07:00
Soonho Kong
b460c02017 feat(emacs/lean-mode): add imenu support
Close #97
2014-09-09 09:04:31 -07:00
Soonho Kong
4eb8a9b192 feat(emacs/lean-flycheck): "real" .clean file instead of "flycheck_real.clean"
Fix #140
2014-09-08 23:49:02 -07:00
Soonho Kong
a9be084b1c feat(emacs/lean-settings): add lean-flycheck-pp-width and lean-flycheck-max-messages-to-display 2014-09-08 18:44:22 -07:00
Soonho Kong
3682ca32d2 feat(emacs/lean-company): call FINDG if cursor is at "_" 2014-09-08 16:04:20 -07:00
Soonho Kong
4f604544c4 feat(emacs/lean-cmd): add WAIT command 2014-09-08 16:04:19 -07:00
Soonho Kong
c88bfc0c02 chore(frontends/lean/server.cpp): add BEGIN/END for WAIT command 2014-09-08 16:04:19 -07:00
Soonho Kong
bc640510aa feat(emacs/lean-cmd): add FINDG cmd 2014-09-08 16:04:19 -07:00
Soonho Kong
0ac1ec1de3 feat(emacs/lean-settings): add lean-show-only-type-in-parens
Fix #135
2014-09-08 11:39:40 -07:00
Soonho Kong
a40894a712 fix(emacs/lean-tags): pass lean-flycheck-checker-options properly
Fix #153
2014-09-08 11:27:04 -07:00
Soonho Kong
c365f6b9ab fix(emacs/lean-company): only activate auto-completion when TAB is pressed 2014-09-08 10:52:22 -07:00
Soonho Kong
6c483467dd feat(emacs/lean-company): replace ?M in AC candidate with M and colorize
close #149
2014-09-08 09:47:51 -07:00
Leonardo de Moura
11addbb594 fix(frontend/lean/server): auto completion doesn't use prefix, fixes #147 2014-09-08 08:04:04 -07:00
Leonardo de Moura
b4793df653 feat(frontends/lean): rename '[fact]' to '[visible]'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-08 07:47:42 -07:00
Leonardo de Moura
cbdfb0dcdc feat(frontends/lean/elaborator): (Pi/forall) intro in class inference, closes #77 2014-09-07 19:59:34 -07:00
Leonardo de Moura
2631979f5c fix(library/scoped_ext): section/context should not affect namespace 2014-09-07 19:59:34 -07:00
Soonho Kong
5c89e70a23 fix(emacs/lean-server): use process-query-on-exit-flag to kill
lean-server automatically on exit

To fix a problem mentioned in #147
2014-09-07 22:29:09 -04:00
Leonardo de Moura
da701eb6de fix(frontends/lean/elaborator): bug in recent change 2014-09-07 19:08:31 -07:00
Soonho Kong
fc2fbc41bb chore(emacs/lean-info): fix a bug passing a wrong argument 2014-09-07 18:44:11 -07:00
Leonardo de Moura
fea516af24 feat(frontends/lean/elaborator): allow Pi/forall local instances 2014-09-07 18:16:33 -07:00
Leonardo de Moura
c378a58cc2 feat(frontends/lean): add [class] modifier for inductive datatypes as a shortcut for 'class' command. 2014-09-07 18:16:33 -07:00
Soonho Kong
ba35ca5300 feat(emacs/lean-company): add company-lean--need-autocomplete
This one partially addresses #150.
2014-09-07 17:32:06 -07:00
Leonardo de Moura
3310eb3dfc feat(frontends/lean): remove restriction on implict arguments, add new test that demonstrates the new feature
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-07 12:29:32 -07:00
Soonho Kong
6b5e67e063 fix(emacs/lean-info): fix eldoc-error at end of buffer 2014-09-07 11:40:28 -07:00
Leonardo de Moura
6d2df80a17 feat(frontends/lean/server): use '?a' instead of '?M_i' for implicit arguments when displaying FINDP and FINDG matches
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-07 09:36:03 -07:00
Leonardo de Moura
1bc31d7df0 feat(frontends/lean/server): instantiate implicit arguments with metavariables when generating FINDP and FINDG output 2014-09-06 13:17:26 -07:00
Leonardo de Moura
87d7391d7a fix(frontends/lean/server): do not fail if file does not exist in 'VISIT file'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-06 12:34:20 -07:00
Leonardo de Moura
5549295c47 fix(frontends/lean/inductive_cmd): bug when elaborating inductive tyoe parameters
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-06 11:38:32 -07:00
Leonardo de Moura
bbff564a1c feat(frontends/lean): persistent notation in sections
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-06 11:14:20 -07:00
Leonardo de Moura
d6491399b9 fix(emacs/lean-syntax): weird syntax-hightlight problem" 2014-09-06 10:49:16 -07:00
Soonho Kong
6b5831d894 feat(emacs/lean-info): show extra-type info for expr in parens
Close #135
2014-09-06 09:26:11 -07:00
Soonho Kong
d793b09c0f feat(emacs/lean-cmd): extend info to have column-number 2014-09-06 09:26:11 -07:00
Leonardo de Moura
3bbbd43b03 chore(emacs): minor adjustments to synthax hightlight and input mode
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-06 08:32:05 -07:00
Soonho Kong
303b86e165 refactor(emacs/lean-flycheck): clean up unused code 2014-09-05 23:08:19 -07:00
Soonho Kong
0476591992 fix(emacs/lean-company): override company--window-width
Override 'company--window-width' to be 0.95 * window-body-width.
This partially solves the problem of issue #137.
2014-09-05 23:08:19 -07:00
Soonho Kong
bd17d07ebc fix(emacs/lean-server): limit the number of NAY retries
Also, only retry when there is no continuation other than the current
one.
2014-09-05 23:08:19 -07:00
Leonardo de Moura
bdb91f6783 feat(frontends/lean/server): give preference to prefix matches
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-05 21:57:35 -07:00
Leonardo de Moura
629feb77ef feat(frontends/lean/server): ingore keywords and commands in FINDP
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-05 20:59:14 -07:00
Leonardo de Moura
b5f595c432 fix(frontends/lean/inductive_cmd): bugs when declarating inductive datatypes in sections, fixes #141, fixes #142
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-05 19:17:09 -07:00
Soonho Kong
e4a687c5ea fix(emacs/lean-tags): use the same linja option for tags-gen and flycheck 2014-09-05 19:11:49 -07:00
Leonardo de Moura
8610330cc4 chore(emacs/lean-syntax): highlight 'import/section/end/namespace/open' arguments
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-05 18:38:41 -07:00
Leonardo de Moura
d48dbccb00 fix(shell): allow multiple spaces after -D option
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-05 18:07:54 -07:00
Leonardo de Moura
a8361f128f feat(frontends/lean/server): sort fuzzy matches by number of errors
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-05 18:03:04 -07:00
Leonardo de Moura
f1436d78ca feat(frontends/lean/server): using fuzzy matching 2014-09-05 18:01:18 -07:00
Leonardo de Moura
a31a25798c feat(util): add fuzzy string search procedure 2014-09-05 18:01:09 -07:00
Soonho Kong
f958e534bd feat(emacs/lean-settings): pass 'pp.width' to lean via linja
Close #28
2014-09-05 16:35:01 -07:00
Soonho Kong
50f16ad591 feat(emacs/lean-flycheck): delete flycheck temporaries after check
Close #140
2014-09-05 16:09:45 -07:00
Soonho Kong
a1e00bb216 refactor(emacs/lean-server): restructure async queue handling routine 2014-09-05 16:09:45 -07:00
Soonho Kong
a72df90022 feat(emacs/lean-server): add debug-mode, trace-mode 2014-09-05 15:33:59 -07:00
Soonho Kong
70ac5ec15e feat(emacs/README.md): add instruction for unicode font 2014-09-05 15:33:59 -07:00
Soonho Kong
e77966932d feat(emacs/lean-server): scroll debug buffer 2014-09-05 15:33:59 -07:00
Soonho Kong
db60a56056 feat(emacs/lean-company): truncate string if it's longer than 90% of window-width
Also add "..." in the end

Close #137
2014-09-05 08:49:05 -07:00
Soonho Kong
3b574ef31d feat(emacs/lean-server): kill the server before emacs exit
Close #138
2014-09-05 07:49:19 -07:00
Soonho Kong
37e514e114 feat(emacs/lean-tags): block emacs until ltags finishes 2014-09-05 06:59:02 -07:00
Soonho Kong
fc364566bf feat(emacs/lean-company): truncate type info in auto-complete
Close #137
2014-09-05 06:59:02 -07:00
Soonho Kong
64bae94d3a fix(emacs/lean-company): enable auto-complete if prefix has '.' or '_' 2014-09-05 06:59:02 -07:00
Soonho Kong
3ba4e553fe refactor(emacs/lean-server): clean up 2014-09-05 06:59:01 -07:00
Leonardo de Moura
898021c1b8 fix(frontends/lean/server): cleanup info in modified line 2014-09-05 01:36:17 -07:00
Leonardo de Moura
613c035ff8 fix(frontends/lean): missing pre_info for type incorrect declarations
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-05 01:12:08 -07:00
Leonardo de Moura
5fa1c0a5fb feat(frontends/lean/server): take current namespace into account when processing FINDP command
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-05 00:40:34 -07:00
Leonardo de Moura
6632a50015 refactor(library): add namespaces 'or', 'and' and 'iff'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 21:25:21 -07:00
Leonardo de Moura
364bba2129 feat(frontends/lean/inductive_cmd): prefix introduction rules with the name of the inductive datatype
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 17:26:36 -07:00
Soonho Kong
0652198eca feat(emacs/lean-server): add sync/async send-cmd 2014-09-04 16:32:08 -07:00
Soonho Kong
cc89cd051a feat(emacs/lean-company): add lean-company 2014-09-04 16:32:07 -07:00
Soonho Kong
e7f6228001 feat(emacs): use lean-server-send-cmd-async 2014-09-04 16:32:07 -07:00
Soonho Kong
677f4af801 feat(emacs/lean-server): add debug print 2014-09-04 16:32:07 -07:00
Soonho Kong
2fa8c1c709 chore(emacs/lean-info): fix indentation 2014-09-04 16:32:07 -07:00
Soonho Kong
cae2ab7dfb feat(emacs/lean-cmd): add FINDP cmd 2014-09-04 16:32:07 -07:00
Leonardo de Moura
8743394627 refactor(kernel/inductive): replace recursor name, use '.rec' instead of '_rec'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 15:04:57 -07:00
Leonardo de Moura
ffc871ea8c feat(frontends/lean/server): only display 'EXTRA_TYPE' info when the column number is provided to the 'INFO' command, closes #133
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 14:02:53 -07:00
Leonardo de Moura
37c36e8b4e feat(shell): add -D command line option for setting configuration options, closes #130
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 13:33:00 -07:00
Leonardo de Moura
d75a4739e4 refactor(util/name): move string_to_name to name module 2014-09-04 13:09:42 -07:00
Leonardo de Moura
b5b68613b1 feat(shell): remove '--server' command line option when compiling with -DMULTI_THREAD=OFF
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 12:43:14 -07:00
Leonardo de Moura
de8a71bc5b perf(frontends/lean): do not create extra_info annotation when we are not collecting info
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 11:25:41 -07:00
Leonardo de Moura
d76218e9d1 fix(frontends/lean/elaborator): bug when elaborating expressions with multiple annotations
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 11:23:58 -07:00
Leonardo de Moura
9876d07094 chore(frontends/lean): use consistent filename convention
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 09:59:24 -07:00
Leonardo de Moura
b94ec07b29 feat(frontends/lean): associate type information with left '('
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 09:56:27 -07:00
Leonardo de Moura
c532dcfaac feat(library/declaration_index): add 'a|abbreviation-name|declaration-name' entries in .ilean files 2014-09-04 09:30:25 -07:00
Leonardo de Moura
d3ec5ccac1 refactor(library/declaration_index): store declarations in a map
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-04 07:42:18 -07:00
Leonardo de Moura
f9a90b9920 feat(frontends/lean): add 'export' command
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 18:37:01 -07:00
Leonardo de Moura
5e18e6609c feat(frontends/lean): add 'as' clause to 'open' command
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 17:37:02 -07:00
Leonardo de Moura
e51c4ad2e9 feat(frontends/lean): rename 'using' command to 'open'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 16:00:38 -07:00
Leonardo de Moura
6a6f6ed439 feat(emacs/lean-syntax): add syntax-highlight for declaration modifiers
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 15:26:21 -07:00
Leonardo de Moura
e14814d4bf feat(frontends/lean): add '[protected]' modifier
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 15:01:13 -07:00
Leonardo de Moura
5a203d1c75 feat(frontends/lean): add '?' for inspecting the type of any expression, it produces a EXTRA_TYPE info entry
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 11:54:42 -07:00
Leonardo de Moura
9702a66a29 feat(frontends/lean/server): use alias (if available) in FINDG command output
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 11:54:42 -07:00
Soonho Kong
327e3a58bf fix(emacs/lean-info): print stale when info is available
fix #127
2014-09-03 10:28:37 -07:00
Soonho Kong
25a48be470 feat(emacs/lean-info): improve coercion display
close #124
2014-09-03 10:12:18 -07:00
Soonho Kong
fdc20800ca chore(emacs/lean-server): clean up debugging message 2014-09-03 10:12:17 -07:00
Leonardo de Moura
ef1912eddf feat(frontends/lean): improve COERCION info
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 09:34:13 -07:00
Leonardo de Moura
8c3d839968 feat(frontends/lean/server): add FINDG command (find declarations that can be used to fill a placeholder)
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 08:57:57 -07:00
Leonardo de Moura
060093cbab refactor(library): add type_util module, and move get_expect_num_args to it
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-03 08:40:03 -07:00
Soonho Kong
e802883b03 feat(emacs/lean-option): show the current value of an option
close #125
2014-09-03 08:09:41 -07:00
Soonho Kong
975841e53b feat(emacs): use lexical scope for lean-info and lean-server 2014-09-03 00:54:42 -07:00
Soonho Kong
b25288545e feat(emacs/lean-info): add coercion and stale in type info
Close #124
2014-09-03 00:50:31 -07:00
Soonho Kong
88410bf278 feat(emacs/lean-server): support SHOW and VALID
Implement lean-server-show and lean-server-valid functions.

Close #116
2014-09-03 00:50:31 -07:00
Soonho Kong
72e1dfa296 feat(emacs): implement non-blocking communication
The key idea is to pass a continuation function when we call
lean-server-send-cmd function. The passed continuation function is
called by lean-server-event-handler. Until the buffer is ready, the
event handler will be called in interval (lean-server-retry-time, 0.1
sec by default). When we have 'NAY' for INFO command, it will re-send
INFO commands to lean-server until we have one without 'NAY'.

Close #123
2014-09-03 00:50:31 -07:00
Soonho Kong
53390faebc chore(emacs/lean-mode): remove lean-tab function 2014-09-03 00:50:31 -07:00
Leonardo de Moura
36674eb8d9 feat(frontends/lean/server): add NAY and STALE status to --BEGININFO
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-02 19:04:01 -07:00
Leonardo de Moura
974a0a4217 feat(frontends/lean/elaborator): generate COERCION info
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-02 18:39:06 -07:00
Leonardo de Moura
24fc89ff70 refactor(frontends/lean/server): move option display_value to option_declarations
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-02 17:42:21 -07:00
Leonardo de Moura
b8c34eceed feat(frontends/lean/server): display current option value instead of default value
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-02 17:29:49 -07:00
Leonardo de Moura
40cd50b1ca fix(frontends/lean/pp): add necessary '@' when pp.implicit is true, otherwise produced output will not even type check
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-02 17:11:26 -07:00
Leonardo de Moura
fc0f12101c fix(frontends/lean/pp): bug when pretty printing arrows
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-02 15:55:14 -07:00
Soonho Kong
78437331c2 fix(emacs/lean-syntax.el): highlight "parameter (" properly
fix #122
2014-09-02 15:09:49 -07:00
Leonardo de Moura
0f9478d91e feat(frontends/lean): add 'class' command back
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-02 15:04:23 -07:00
Soonho Kong
b05aeb112b fix(emacs/lean-mode): Bind TAB with lean-tab-indent-or-compliete 2014-09-02 17:02:35 -04:00
Leonardo de Moura
bbdb13172e feat(frontends/lean/server): add 'FINDP' command
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-02 12:59:48 -07:00
Soonho Kong
b4a80f83af feat(emacs/lean-server): accept "BEGININFO .*" pattern 2014-09-02 10:37:03 -07:00
Soonho Kong
cec2f8e466 feat(emacs/lean-mmm-lua.el): add mmm-mode to syntax-highlight lua code
in lean-mode

Close #74
2014-09-02 10:37:03 -07:00
Soonho Kong
a08ad99dba feat(emacs/lean-cmd): add lean-clear-cache
Close #99
2014-09-01 22:58:52 -07:00
Leonardo de Moura
87926b774f fix(frontends/lean/info_manager): user provided options override saved options, fixes #119
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-09-01 18:44:43 -07:00
Soonho Kong
50465a2d06 feat(emacs/lean-option): provide candidates and validation for lean-set-option
Close #106
2014-09-01 18:31:12 -07:00