Commit graph

72 commits

Author SHA1 Message Date
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
Leonardo de Moura
9ef3ebbd5b refactor(*): delete HoTT support 2016-09-27 16:33:39 -07:00
Leonardo de Moura
a1d36b6c4d chore(library): remove legacy_type_context 2016-09-19 21:31:21 -07:00
Leonardo de Moura
9f1a576e98 chore(frontends/lean): remove dead code from parser 2016-09-19 17:04:59 -07:00
Leonardo de Moura
d43764b6fb refactor(library/tactic/defeq_simplifier): move defeq_simp_lemmas to library
This commit also renames them to "rfl_lemmas".
Reason: these lemmas will be used at type_context::is_def_eq and type_context::whnf
2016-09-12 10:36:11 -07:00
Leonardo de Moura
932d14241b chore(kernel): remove support for mutually inductive datatypes from the kernel 2016-09-10 17:39:17 -07:00
Leonardo de Moura
0afef31be6 feat(library/tactic/defeq_simplifier): reimplement defeq simp lemma cache 2016-09-02 09:10:09 -07:00
Leonardo de Moura
a93eada058 feat(library/type_context): improved (and simplified) cache management for type_context 2016-08-23 17:56:58 -07:00
Leonardo de Moura
803c956d18 feat(util/sexpr/option_declarations): allow options to be registered after initialization 2016-08-19 16:58:30 -07:00
Sebastian Ullrich
60fa25b665 refactor(library/attribute_manager): remove weakly-typed API
Also reduces number of attribute name literals
2016-08-19 15:02:34 -07:00
Sebastian Ullrich
ca8be3857c feat(library/user_attribute): add user-defined attributes and make attribute_manager environment-aware 2016-08-18 12:56:44 -07:00
Sebastian Ullrich
e548a6311e chore(frontends/lean/print_cmd): change attribute output to new syntax 2016-08-16 13:49:03 -07:00
Sebastian Ullrich
cb6a6b642e refactor(library/attribute_manager): remove attribute tokens and use name for attribute names 2016-08-16 13:49:03 -07:00
Sebastian Ullrich
34e00cd5a2 refactor(library/attribute_manger): simplify: make every attribute prioritizable 2016-08-16 13:49:02 -07:00
Sebastian Ullrich
b27ba6288d feat(frontends/lean/print_cmd): implement 'print attributes' 2016-08-12 15:36:12 -07:00
Leonardo de Moura
f5c35f8d76 chore(*): fix compilation warnings 2016-08-10 18:03:13 -07:00
Leonardo de Moura
1dd93b34ad chore(frontends/lean/print_cmd): compilation error on g++ 8.2 2016-08-05 17:22:16 -07:00
Sebastian Ullrich
15595c0061 refactor(library/attribute_manager): delegate parameter parsing and printing to attribute class 2016-08-05 17:16:04 -07:00
Daniel Selsam
70a1e53ba8 feat(simplifier/simp_lemmas): take arbitrary list of attributes and cache 2016-08-03 18:04:28 -07:00
Leonardo de Moura
0169989411 chore(library/class): remove transitive instance support
Conflicts:
	src/frontends/lean/structure_cmd.cpp
	src/library/class.cpp
	src/library/class.h
2016-07-29 23:32:10 -07:00
Sebastian Ullrich
5247b426a8 fix(library/reducible): use class hierarchy to fix reducibility attributes 2016-07-29 23:44:22 -04:00
Sebastian Ullrich
c4edad0372 feat(frontends/lean, library): remove attribute and metaclass scoping
All data is now part of either a global, permanent scope or a local,
temporary one
2016-07-29 23:44:21 -04:00
Sebastian Ullrich
463e4a2cf3 refactor(library/reducible): replace ext with attribute_manager 2016-07-29 18:51:23 -04:00
Sebastian Ullrich
661fafc940 refactor(frontends/lean): replace different attribute classes with single scoped_ext 2016-07-29 18:51:23 -04:00
Leonardo de Moura
a64d1a77ea refactor(library, frontends/lean): remove old coercion management module 2016-07-29 13:51:26 -07:00
Daniel Selsam
1b7f70dde9 feat(simplifier): expose simp_lemmas data structure 2016-07-29 10:44:44 -07:00