Commit graph

97 commits

Author SHA1 Message Date
Leonardo de Moura
0888dee25e chore(*): meta ==> unsafe 2019-03-15 15:04:40 -07:00
Leonardo de Moura
e0bb21ba0b chore(library): remove noncomputable module 2018-10-22 09:39:03 -07:00
Leonardo de Moura
130b419371 chore(frontends/lean): remove break_at_pos support
We have already removed auto-completion support.
This change allowed me to remove another old_type_checker dependency.
2018-09-07 08:34:19 -07:00
Leonardo de Moura
58e91559d0 feat(*): use new inductive datatype module 2018-09-06 18:09:22 -07:00
Leonardo de Moura
afb9584a63 feat(kernel): store at inductive_val whether the type is reflexive or not 2018-09-05 14:46:03 -07:00
Leonardo de Moura
78f4edaf57 chore(frontends/lean): remove info_manager and interactive modules 2018-09-04 17:22:16 -07:00
Leonardo de Moura
1dfcea58f9 chore(*): remove some references to old inductive datatype module 2018-09-04 10:45:17 -07:00
Leonardo de Moura
dd03747d22 chore(kernel): univ_param vs lparam, level_param_names ==> names, and other inconsistencies 2018-09-03 13:05:42 -07:00
Leonardo de Moura
7928dbb239 chore(kernel): get_constructor ==> get_cnstr 2018-09-03 12:30:49 -07:00
Leonardo de Moura
5e6d3511f4 chore(frontends/lean/print_cmd): display rule info 2018-09-03 12:27:25 -07:00
Leonardo de Moura
517923d362 feat(kernel/inductive): generate recursors in the new inductive datatype module 2018-08-31 17:47:22 -07:00
Leonardo de Moura
b79794e601 feat(frontends/lean/print_cmd): add basic support for testing new inductive datatype module 2018-08-29 09:36:47 -07:00
Leonardo de Moura
05a6d8a791 chore(library/tactic): remove destruct_tactic, generalize_tactic and fun_info_tactics 2018-08-23 14:47:51 -07:00
Leonardo de Moura
88c8c560a9 chore(library/equations_compiler): do not generate equation lemmas 2018-08-23 14:04:37 -07:00
Leonardo de Moura
82095cc018 refactor(kernel): split declaration into declaration and constant_info
This is just another step towards the design described at commit 16598391a07d4a
2018-08-22 17:53:11 -07:00
Leonardo de Moura
9d35d31529 refactor(kernel): merge constant_assumption and axiom 2018-08-01 09:57:47 -07:00
Leonardo de Moura
ec1aa2553c refactor(kernel/declaration): implement definition/constant/axiom/theorem using runtime/object
TODO: inductive, constructor, recursor
2018-06-25 10:05:45 -07:00
Leonardo de Moura
e9f843ddf6 refactor(kernel/expr): remove mlocal_* functions
The constructors `mvar` and `fvar` have different memory layouts.
2018-06-22 14:25:31 -07:00
Leonardo de Moura
1a18bb265d chore(frontends/lean): remove a few old_type_checker occurrences 2018-06-14 14:05:04 -07:00
Leonardo de Moura
c0e1d05199 chore(kernel): type_checker ==> old_type_checker 2018-06-06 16:10:40 -07:00
Leonardo de Moura
ac0352b584 refactor(kernel): remove quotitent normalizer extension
The `quot` type is now implemented in the kernel.
We will do the same thing for inductives.
We will not support normalizer extensions anymore in Lean4.
It doesn't make sense since we settled with 2 extensions: quotients and
inductives. Moreover, any new extension would require substantial
changes (e.g., code generator).
The normalizer_extension feature was useful when we were experimenting
with different kernel flavors.
2018-06-01 10:52:17 -07:00
Leonardo de Moura
3c1ccc9b74 refactor(kernel): use m_meta instead of m_trusted 2018-05-31 11:18:00 -07:00
Leonardo de Moura
d3272ca1c5 refactor(frontends/lean,library/tactic/kabstract): remove add_key_equivalence command
This command was never used in the Lean3 corelib and mathlib.
It is safe to assume it is not needed.
2018-05-30 14:10:03 -07:00
Leonardo de Moura
75c63ec921 refactor(*): list<name> ==> obj_list<name> 2018-05-23 15:48:43 -07:00
Leonardo de Moura
0556412f8d refactor(*): add runtime folder
@kha The runtime folder includes what is needed to link a
standalone Lean program. It is still contains some unnecessary files.
We will be able to remove them after we release Lean4.
2018-05-14 14:23:56 -07:00
Leonardo de Moura
ce0467638e chore(*): remove unification hints 2018-04-10 16:29:04 -07:00
Leonardo de Moura
bdea7d420d chore(*): type_context ==> type_context_old 2018-03-05 12:38:24 -08:00
Gabriel Ebner
d610709a53 fix(frontends/lean/print_cmd): report error on unknown identifier 2017-07-06 19:58:30 +02:00
Leonardo de Moura
95c7c697a6 refactor(library/tactic/simp_lemmas): simp set generation should not be affected by transparency setting 2017-07-01 12:54:37 -07:00
Leonardo de Moura
bf0d785888 feat(library/messages, frontends/lean): optional end position for messages
We need this information to be able to fix issues with the transient
message boxes feature (#1667).
2017-06-15 10:47:58 -07:00
Gabriel Ebner
1468461c47 feat(frontends/lean): recover from many parser errors 2017-05-23 11:14:30 -07:00
Sebastian Ullrich
e9a6c544af refactor(frontends/lean/{elaborator,structure_cmd}): compile structure inheritance to nested fields 2017-04-24 19:35:15 +02:00
Sebastian Ullrich
a54514fead feat(frontends/lean/print_cmd): complete identifiers after #print 2017-04-23 11:26:31 -07:00
Sebastian Ullrich
e63c1d3347 refactor(frontends/lean/info_manager): use pos_info 2017-03-27 14:01:19 -07:00
Leonardo de Moura
9d3c0497cb chore(frontends/lean): rename transient commands
See issue #1432
2017-03-09 18:41:19 -08:00
Sebastian Ullrich
d402b2a467 feat(frontends/lean/print_cmd): add to info_manager when not overloaded 2017-02-17 15:41:58 +01:00
Gabriel Ebner
7946b15511 feat(frontends/lean/elaborator): recover from most errors using sorry 2017-02-06 15:15:44 +01:00
Gabriel Ebner
6910f3f2b9 feat(frontends/lean/print_cmd): show sorry macro as axiom 2017-02-05 14:01:08 +01: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
Gabriel Ebner
b5ac381a5e chore(frontends/lean/print_cmd): update print command to keyword changes 2017-01-12 12:04:37 -08:00
Gabriel Ebner
7d6e71aa59 fix(frontend/lean/print_cmd): make print work with incorrect proofs 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
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
476684a284 refactor(library,library/tactic/defeq_simplifier): use simp_lemmas in the defeq_simplifier 2016-10-08 22:15:27 -07:00
Leonardo de Moura
a796bda14e refactor(library/tactic): use new simp_lemmas module in the simplifier 2016-10-08 21:54:34 -07:00
Leonardo de Moura
3fbdb71f3e feat(library/tactic/simplifier): remove simp_extensions 2016-10-06 20:50:23 -07:00
Leonardo de Moura
d747fcb17c refactor(library/tactic/simp_lemmas): new caching mechanism 2016-10-06 20:20:01 -07:00
Leonardo de Moura
1e93c2c235 refactor(library/rfl_lemmas): simplify 2016-10-06 16:49:20 -07:00