Commit graph

90 commits

Author SHA1 Message Date
Gabriel Ebner
95068e4e79 feat(library/sorry): make sorry a macro 2017-02-05 14:01:03 +01:00
Gabriel Ebner
98c2998a7b feat(frontends/lean/definition_cmds): make noncomputability check non-fatal 2017-02-05 13:42:52 +01:00
Leonardo de Moura
b28ed2453e feat(frontends/lean/definition_cmds): allow meta recursive definitions without recursive equations 2017-02-04 13:44:05 -08:00
Leonardo de Moura
01414cf21c feat(frontends/lean): add token class, and procedure for consuming the tokens 2017-02-03 18:11:06 -08:00
Leonardo de Moura
4d3ff955d3 feat(frontends/lean): nicer syntax for default parameter values
See #1340
2017-01-30 15:54:26 -08:00
Gabriel Ebner
5fdc737dfc feat(library/tactic): store name of current declaration in tactic_state 2017-01-28 08:27:19 +01:00
Leonardo de Moura
750d02c3ac feat(frontends/lean/definition_cmds): remove equations_result macro from elaborated theorems 2017-01-24 16:51:33 -08:00
Leonardo de Moura
75525a1120 fix(frontends/lean/definition_cmds): allow '.' after equations 2017-01-22 12:51:23 -08:00
Gabriel Ebner
a230c47178 feat(util/task_queue,emacs,*): highlight running tasks with different background color 2017-01-17 17:10:37 -08:00
Gabriel Ebner
1a6629ce3b feat(frontends/lean/parser): keep list of tasks that have to succeed 2017-01-17 15:31:17 -08:00
Leonardo de Moura
00c89f209c fix(frontends/lean/definition_cmds): fix #1299 2017-01-10 14:38:46 -08:00
Leonardo de Moura
db70c78704 feat(library/equations_compiler): make sure automatically generated equational lemmas use internal names 2017-01-06 11:40:34 -08:00
Leonardo de Moura
82f8eeb280 feat(frontends/lean/definition_cmds): generate equational lemmas for regular definitions that were elaborated without using the equation compiler 2017-01-05 18:02:14 -08:00
Gabriel Ebner
9435762643 fix(compiler/vm_compiler): only compile computable non-builtin definitions 2017-01-04 16:30:22 -08:00
Sebastian Ullrich
47e7df9b27 perf(frontends/lean/definition_cmds): skip definition elaboration during reparsing 2016-12-27 10:07:34 -08:00
Leonardo de Moura
7d1c48e673 fix(frontends/lean/definition_cmds): "elaboration time" for lemmas was not being reported when using profiler 2016-12-25 16:49:58 -08:00
Leonardo de Moura
f9ad1dbfc0 fix(frontends/lean/definition_cmds): bug at inline_new_defs
closes #1253
2016-12-15 20:32:06 -08:00
Gabriel Ebner
d89512b6fc fix(util/task_queue): fix undefined behavior with null references 2016-12-15 09:48:57 -08:00
Gabriel Ebner
8e0a5904d2 refactor(library/message_buffer): move info_manager out of scope_message_context 2016-12-12 08:23:15 -05:00
Leonardo de Moura
e01c7bfef5 chore(frontends/lean/definition_cmds): update comment 2016-12-08 10:35:32 -08:00
Leonardo de Moura
e13bac41c3 fix(frontends/lean): 'sorry' axiom auto generation 2016-12-08 10:31:52 -08:00
Leonardo de Moura
f96d35dc1c fix(library/aux_definition,frontends/lean/definition_cmds): unfold macros at trust level 0 2016-12-05 13:08:12 -08:00
Gabriel Ebner
df635b56af fix(frontends/lean/definition_cmds): correctly copy _refl_lemma attributes 2016-11-29 11:12:44 -08:00
Gabriel Ebner
e448e4e129 refactor(util/task_queue): merge module_task into task and cancel by position 2016-11-29 11:12:43 -08:00
Gabriel Ebner
aa03dc03b4 refactor(library/tactic/simp_lemmas): mark rfl-lemmas with a _refl_lemma attribute 2016-11-29 11:12:43 -08:00
Gabriel Ebner
56f895d6d8 feat(kernel/type_checker): option to disable delayed proof-checking 2016-11-29 11:12:43 -08:00
Leonardo de Moura
78608a37e9 fix(frontends/lean/definition_cmds): implicit universe theorem parameters bug
See discussion at #1178
2016-11-29 11:12:43 -08:00
Gabriel Ebner
385ea13688 feat(kernel/declaration,*): all theorems are delayed, and are revealed on delta-reduction 2016-11-29 11:12:43 -08:00
Gabriel Ebner
a8df381d20 feat(*): parallel compilation 2016-11-29 11:12:40 -08:00
Leonardo de Moura
002c62b49c feat(frontends/lean): basic leandoc tool 2016-11-27 14:31:31 -08:00
Leonardo de Moura
6978906a78 chore(frontends/lean): remove namespace documentation
We will add module level doc strings /-! -/
2016-11-27 11:57:03 -08:00
Leonardo de Moura
338a46c225 fix(library/documentation): do not store doc strings for namespaces and declarations in the same name_map 2016-11-26 09:41:07 -08:00
Leonardo de Moura
97dd2f34d5 feat(library,frontends/lean): add basic doc string support 2016-11-25 18:52:56 -08:00
Sebastian Ullrich
bbb06dec70 fix(frontends/lean): pass around info_manager at more locations 2016-11-08 08:37:41 -08:00
Leonardo de Moura
bb5033dc57 feat(util/timeit, frontends/lean/definition_cmds): add xtimeit 2016-11-07 17:01:19 -08:00
Leonardo de Moura
6173d95d18 feat(library/module,frontends/lean): store line/column number information 2016-11-02 16:55:21 -07:00
Leonardo de Moura
9b84db083d fix(frontends/lean): error localization bugs 2016-10-15 13:40:57 -07:00
Gabriel Ebner
a9bff2a7f0 fix(frontends/lean/definition_cmds): report timing messages 2016-10-13 18:49:10 -07:00
Gabriel Ebner
66be9c31db refactor(library/flycheck): use flycheck_message_stream instead of option 2016-10-13 18:49:10 -07:00
Gabriel Ebner
b05b514cc2 refactor(*): structured message objects 2016-10-13 18:49:10 -07:00
Leonardo de Moura
924b4d3bdc refactor(library, library/tactic): move simp_lemmas and eqn_lemmas to tactic folder
They were at src/library because we hoped we would be able to use them
in the type_context unifier. However, the plan did not work for several
reasons. We saved the partial implementation in the branch: https://github.com/leodemoura/lean/tree/type_context_with_refl_lemmas

Here are the problems:

1) We have to be able to rewrite even when the type context is already in tmp-mode.
   This is an issue because the tmp metavariables in the refl lemma clash with the ones created in the type context.

  Solution: implemented lift operation for idx metavariables, and custom
  match. This solution is not perfect since the lifting is extra overhead.

2) The term being "unfolded" may be stuck. Example:

      nat.add n (@one nat ?m)

  will not match the pattern

      nat.add ?x_0 (nat.succ ?x_1)

  because ?m is not assigned yet.
  We can assign it during the matching process because it is a regular metavariable and the matching is performed in
  tmp_mode.

  Possible workaround a) try to instanciate type class instances before we try the refl lemmas.
  This is a potential performance problem because the term can be arbitrarily big.
  The current heuristics we use to speed up the process do not work for the example above.

  Possible workaround b) allow regular metavariables be assigned by type class resolution even
  when we are in tmp-mode.

  We have not tried to implement any of these workarounds.

3) There are many more lazy-delta steps. Before this feature, when we unfold `nat.add a (succ ... (succ b) ...)`,
   we are done with delta-reduction. It is just iota and beta after that.
   However, with refl-lemmas, the term `nat.add a (succ ... (succ b) ...)` produces one lazy-delta step per succ.
   This produces nasty side-effects because of the
   The heuristic (f t =?= f s) ==> (t =?= s).

   Examples such as
       (fib 8) =?= 34
   will take a very long time because of this heuristic.

   Possible workaround: cache failures like we did in Lean2.
   However, failure are only easy to cache if there are no meta-variables.

4) The type context trace gets very confusing since we use is_def_eq for matching lhs while we are computing is_def_eq.
   Possible workaround: disable trace when trying refl_lemmas.

5) We must be able to temporarily disable the feature.
   Example: when proving a refl_lemma for a definition `f`, we may have
   to expand the nested definitions
   (e.g., for match-end blocks)

6) refl/simp lemmas were designed to rewrite elaborated terms.
   Using them during unification may produce a series of unexpected
   behaviors since terms usually contain many regular and universe meta-variables.

7) We need to define a notion of "refl stuck application".
   Right now, a metavar is stuck, a projection is stuck if the structure
   is stuck, a recursor is stuck is the major premise is stuck.
   An application (f ...) is refl-lemma stuck if f has refl-lemmas
   associated with it, AND metavariables occurring in arguments are
   preventing a refl-lemma from being applied.
2016-10-12 14:36:00 -07:00
Leonardo de Moura
50aca35ce3 fix(frontends/lean/definition_cmds): do not generate code for examples 2016-10-09 19:27:07 -07:00
Leonardo de Moura
ebd912d243 feat(library/eqn_lemmas): add map function name => equational lemmas 2016-10-09 11:48:55 -07:00
Leonardo de Moura
e8497f3b7e fix(frontends/lean/definition_cmds): typo 2016-10-09 11:42:30 -07:00
Daniel Selsam
7cdec2c8f3 chore(frontents/lean/definition_cmds): improve error message 2016-10-08 22:22:23 -07:00
Leonardo de Moura
cc3150ea79 fix(frontends/lean/definition_cmds): make sure theorem/lemma type does not contain metavariables before we try to elaborate its proof 2016-10-07 11:10:01 -07:00
Leonardo de Moura
e473d7cefc feat(frontends/lean/definition_cmds): make sure copied lemma is a rfl lemma if source is a rfl lemma
The idea is to allow the defeq simplifier to use the copied lemma.
2016-10-06 15:49:38 -07:00
Leonardo de Moura
c745519e50 feat(frontends/lean/definition_cmds): generate equation lemmas for top-level definitions 2016-10-06 15:30:43 -07:00
Gabriel Ebner
d0ab6065c3 fix(frontends/lean): type check examples 2016-09-27 14:39:55 -07:00
Leonardo de Moura
03e4fd1038 feat(frontends/lean,library): cleanup instance cmd, and use 'meta instance' 2016-09-24 12:33:25 -07:00