Commit graph

2417 commits

Author SHA1 Message Date
Sebastian Ullrich
87c5ba9f52 Revert "fix(library/definitional/equations): add more equation validation to avoid obscure error message"
This reverts commit a3bc1b0cd5.
2016-07-09 10:19:23 -07:00
Sebastian Ullrich
f2200fab65 feat(frontends/lean/pp): add option to hide binder types 2016-06-02 11:28:00 -07:00
Leonardo de Moura
226f8bafeb fix(library/tactic/rewrite_tactic): do not allow projections to be unfolded
fixes #1032

This is just a workaround. A better fix has been implemented in the
lean3 branch.
2016-03-28 13:02:57 -07:00
Leonardo de Moura
a07ad6df62 fix(library/tmp_type_context): fixes #1033
This is just a workaround.
tmp_type_context is dead code in lean3.
2016-03-28 09:38:22 -07:00
Leonardo de Moura
6f74f65220 fix(library/type_context): instantiate was not replacing all assigned metavars 2016-03-23 13:37:33 -07:00
Daniel Selsam
8f0a0d2b32 feat(library/export, doc/export_format): remove support for mutually inductive types 2016-03-10 20:22:47 -08:00
Leonardo de Moura
d4f0ce0eab fix(library/local_context): typo 2016-03-09 13:59:21 -08:00
Leonardo de Moura
d54a67cf2e fix(library): compilation warnings on OSX 2016-03-03 10:02:00 -08:00
Leonardo de Moura
6f766dd33e chore(library/blast): cleanup 2016-03-03 10:01:50 -08:00
Leonardo de Moura
5194df5e97 feat(library/local_context): encode order using a tree instead of a list
Motivations:
- It will be faster to delete local declarations.
- It is faster to find all local declarations that were created after a
give local declaration.
2016-03-01 16:23:51 -08:00
Leonardo de Moura
2a4b3b75bd refactor(library/blast/state): simplify blast state 2016-03-01 14:27:58 -08:00
Leonardo de Moura
16dc021736 fix(library/proof_irrel_expr_manager): add missing Let case 2016-03-01 14:27:37 -08:00
Leonardo de Moura
4e67a35179 feat(library/blast/blast): add missing Let case, and comment to indicate
performance problem
2016-03-01 13:47:43 -08:00
Daniel Selsam
c23528b5d8 feat(library/blast/blast): use defeq_simplifier to normalize 2016-03-01 13:44:33 -08:00
Daniel Selsam
20e7ff39cc feat(library/proof_irrel_expr_manager): eq and hash modulo proof irrelevance 2016-03-01 13:44:33 -08:00
Daniel Selsam
a9c6bce7cc feat(library/defeq_simplifier): some generic normalization 2016-03-01 13:43:50 -08:00
Leonardo de Moura
2982db6f80 feat(library/local_context): add new local context type 2016-03-01 13:40:37 -08:00
Leonardo de Moura
f3648e2ac8 refactor(library/blast/blast): remove old hack 2016-03-01 12:24:24 -08:00
Leonardo de Moura
56d7fc4c23 refactor(*): cleanup replace_visitor subclasses, and make sure let-expressions are handled 2016-02-29 16:55:19 -08:00
Leonardo de Moura
3c878ecd01 feat(kernel): add let-expressions to the kernel
The frontend is still using the old "let-expression macros".
We will use the new let-expressions to implement the new tactic framework.
2016-02-29 16:40:17 -08:00
Leonardo de Moura
f54963bc3e refactor(library/tactic/expr_to_tactic): remove 'by_plus' support 2016-02-29 13:50:05 -08:00
Leonardo de Moura
2b1d734544 feat(kernel/expr): remove 'contextual' flag from binder_info 2016-02-29 12:41:43 -08:00
Leonardo de Moura
2fd5347901 refactor(library/blast): ppb is not necessary anymore 2016-02-26 15:51:46 -08:00
Leonardo de Moura
eee74ef1b4 refactor(frontends/lean/pp): use abstract_type_context instead of type_checker 2016-02-26 15:35:29 -08:00
Leonardo de Moura
7d61f640f6 refactor(*): add abstract_type_context class 2016-02-26 14:17:34 -08:00
Leonardo de Moura
5a4dd3f237 feat(library/reducible): remove [quasireducible] annotation 2016-02-25 17:42:44 -08:00
Leonardo de Moura
146edde5b3 feat(library/class): mark instances as quasireducible by default
quasireducible are also known as lazyreducible.

There is a lot of work to be done.
We still need to revise blast, and add a normalizer for type class
instances. This commit worksaround that by eagerly unfolding
quasireducible.
2016-02-25 12:11:29 -08:00
Leonardo de Moura
1924b2884c refactor(library/tactic): remove 'append' and 'interleave' tacticals
Preparation for major refactoring in the tactic framework.
2016-02-24 16:02:16 -08:00
Leonardo de Moura
494b88e103 fix(library/blast/forward/ematch): must used the right type_context 2016-02-23 13:32:34 -08:00
Leonardo de Moura
96f391dda2 feat(library/definitional/projection,frontends/lean/structure_cmd): creating inductive predicates using structure command 2016-02-22 16:09:44 -08:00
Leonardo de Moura
49661a043d feat(library/definitional/equations): improve detection of infeasible cases in the definitional package 2016-02-22 14:16:24 -08:00
Floris van Doorn
4e2cc66061 style(*): rename is_hprop/is_hset to is_prop/is_set 2016-02-22 11:15:38 -08:00
Daniel Selsam
859a3d35ea feat(library/defeq_simplifier): no need to reverse args 2016-02-22 11:01:36 -08:00
Daniel Selsam
d521063dfb feat(library/defeq_simplifier): new simplifier that uses only definitional equalities 2016-02-22 11:01:36 -08:00
Daniel Selsam
bb4b8da582 feat(library/unification_hint): basic handling of user-supplied unification hints 2016-02-12 11:48:51 -08:00
Leonardo de Moura
632d4fae36 chore(library): rename local_context to old_local_context 2016-02-11 18:15:16 -08:00
Leonardo de Moura
74192b0cb8 chore(library): remove dead code 2016-02-11 18:08:44 -08:00
Leonardo de Moura
c9e9fee76a refactor(*): remove name_generator and use simpler mk_fresh_name 2016-02-11 18:05:57 -08:00
Leonardo de Moura
f67181baf3 chore(*): remove support for Lua 2016-02-11 17:17:55 -08:00
Daniel Selsam
3de4ec1a6c fix(library/blast/imp_extension): do not use the name 'assert'
Closes #994
2016-02-10 14:11:17 -08:00
Daniel Selsam
f06cdff2a1 fix(library/blast/simplifier/ceqv): fix error in is_permutation 2016-02-07 14:06:28 -08:00
Leonardo de Moura
668758c44e fix(library/blast/blast): compilation warning on OSX 2016-02-05 13:02:02 -08:00
Leonardo de Moura
04eaf184a9 feat(frontends/lean,library/unifier): checkpoints at have-expressions
@avigad, @fpvandoorn, @rlewis1988, @dselsam

This commit modifies how have-expressions are elaborated.
Now, to process

     have H : <type>, from <proof>,
     <rest>

we first process the constraints in <type> and <proof> simultaneously.
After all these constraints are solved, the elaborator performs
a Prolog-like cut, and process the constraints in <rest>.

So, all overloads, type classes and coercions in <type> and <proof> are solved
before we start processing <rest>. Moreover, while processing <rest>, we
cannot backtrack to <type> and <proof> anymore.

I fixed all affected proofs in the standard and HoTT libraries in
previous commits pushed today and yesterday. I think most affected proofs were not using a good
style and/or were easy to fix. Here is a common pattern that does not
work anymore.

   structure has_scalar [class] (F V : Type) :=
   (smul : F → V → V)

   infixl ` • `:73 := has_scalar.smul

   proposition smul_zero (a : R) : a • (0 : M) = 0 :=
   have a • 0 + a • 0 = a • 0 + 0, by rewrite [-smul_left_distrib, *add_zero],
   !add.left_cancel this

The `have` doesn't work because Lean can't figure out the type of 0 before
it starts processing `!add.left_cancel this`. This is easy to fix, we just have to
annotate one of the `0`s in the `have`:

   proposition smul_zero (a : R) : a • (0 : M) = 0 :=
   have a • (0:M) + a • 0 = a • 0 + 0, by rewrite [-smul_left_distrib, *add_zero],
   !add.left_cancel this

BTW, all tactics are still being executed after all constraints are solved.
We may change that in the future. I didn't want to execute
the tactics at <proof> before <rest> because of universe
meta-variables. In Lean, unassigned universe meta-variables become
parameters. Moreover, we perform this conversion *before*
we start processing tactics. Reason: universe meta-variables
create many problems for tactics such as `rewrite`, `blast` and `simp`.

Finally, we can recover the previous behavior using the option

         set_option parser.checkpoint_have false
2016-02-04 19:01:19 -08:00
Leonardo de Moura
774fa01b1a chore(library/pp_options): reduce pp default limits 2016-02-04 14:55:21 -08:00
Leonardo de Moura
42fbc63bb6 fix(library/tc_multigraph): avoid name collisions
@avigad, @fpvandoorn, @rlewis1988, @dselsam

I changed how transitive instances are named.
The motivation is to avoid a naming collision problem found by Daniel.
Before this commit, we were getting an error on the following file
tests/lean/run/collision_bug.lean.

Now, transitive instances contain the prefix "_trans_".
It makes it clear this is an internal definition and it should not be used
by users.

This change also demonstrates (again) how the `rewrite` tactic is
fragile. The problem is that the matching procedure used by it has
very little support for solving matching constraints that involving type
class instances. Eventually, we will need to reimplement `rewrite`
using the new unification procedure used in blast.

In the meantime, the workaround is to use `krewrite` (as usual).
2016-02-04 13:15:42 -08:00
Leonardo de Moura
9d88db3941 perf(library/type_context): add cache for minimizing the access to is_opaque and environment::find 2016-02-02 19:47:58 -08:00
Leonardo de Moura
701d6b5016 perf(library/blast/forward/pattern): simplify is_higher_order test 2016-02-02 18:56:48 -08:00
Leonardo de Moura
a7b3dcbc09 perf(library/blast/state): do not add hypotheses that are Pi-expressions into discrimination trees 2016-02-02 18:50:23 -08:00
Leonardo de Moura
c55b10af1b perf(library/type_context): move check_system to strategic places 2016-02-02 16:12:53 -08:00
Leonardo de Moura
b508cf813c perf(library/type_context): small optimization 2016-02-02 15:36:53 -08:00