Commit graph

685 commits

Author SHA1 Message Date
Leonardo de Moura
2aa64034df fix(tests/lean): adjust tests to reflect changes in the elaboration process 2015-06-26 17:18:30 -07:00
Floris van Doorn
9ef1ae0848 fix(tests): update tests to reflect the change of notation from \~ to ~ 2015-06-25 22:55:05 -04:00
Leonardo de Moura
1b414d36e7 refactor(library/init): define prod as an inductive datatype
Motivation: prod is used internally in the definitional package.
If we define prod as a structure, then Lean will tag pr1 and pr2 as
projections. This creates problems when we add special support for
projections in the elaborator. The heuristics avoid some case-splits
that are currently performed, and without them some files break.
2015-06-25 17:59:06 -07:00
Floris van Doorn
fa1979c128 feat(datatypes): let the type of unit be the lowest non-Prop universe
The definitional package (brec_on and cases_on) now use poly_unit instead of unit

closes #698
2015-06-25 17:33:46 -07:00
Leonardo de Moura
a4c0699e81 feat(library/tactic/constructor_tactic): restore 'constructor' tactic old semantics, add 'fconstructor' tactic
See issue #676

Add new test demonstrating why it is useful to have the old semantics
for 'constructor'
2015-06-17 23:48:54 -07:00
Leonardo de Moura
bf71d9f342 fix(library/tactic/rewrite_tactic): fixes #682 2015-06-17 18:49:02 -07:00
Leonardo de Moura
ce8f2a1674 feat(library/class): allow any constant to be marked as a class
closes #679
2015-06-17 16:26:45 -07:00
Leonardo de Moura
0ae24faae3 feat(library/tactic/constructor_tactic): use 'fapply' in 'constructor' tactic
closes #676
2015-06-16 12:03:31 -07:00
Leonardo de Moura
8aa634378e fix(tests/lean): adjust tests to reflect changes in the standard library 2015-06-10 17:00:47 -07:00
Leonardo de Moura
4b91cfccff feat(frontends/lean/builtin_exprs): make notation ( e : T ) builtin
In the previous approach, the following (definitionally equal) term was being generated

       (fun (A : Type) (a : A), a) T e
2015-06-10 14:52:59 -07:00
Leonardo de Moura
cff7b7474a test(tests/lean/run): add examples showing how to prove (using tactics) that direct_subterm relation is well-founded
see issue #347
2015-06-09 16:17:29 -07:00
Leonardo de Moura
1bffb89126 fix(library/algebra/function): lean was failing to infer that injective is a decidable predicate for finite types with decidable equality
This is an issue reported by Haitao.
2015-06-09 15:30:58 -07:00
Leonardo de Moura
2663c9ab9f test(tests/lean/run): add test/example
add test/example that defines count_vars using tactics and recursors.

see #662 for original definition, and e3a0e62859 for the fix that
allows us to use recursive equations.
The recursive equations are compiled into recursors.
2015-06-09 14:50:15 -07:00
Leonardo de Moura
e3a0e62859 fix(library/unifier): try to generate approximate solution for flex-flex constraints before discarding them
fixes #662
2015-06-09 14:36:31 -07:00
Leonardo de Moura
d6a483fe84 feat(library): add idx_metavar module 2015-06-08 16:02:37 -07:00
Leonardo de Moura
1cbace9df6 feat(library/tactic/congruence_tactic): add congruence lemma generator
The generated congruence theorems ignore arguments that are subsingleton types.
2015-06-05 22:00:10 -07:00
Leonardo de Moura
7db84c7036 refactor(library/data): replace 'fin' with Haitao's 'less_than'
The commit also fixes vector to use the new definition.
2015-06-05 10:33:19 -07:00
Floris van Doorn
7f5caab694 feat(nat): redefine le and lt in the standard library 2015-06-04 20:14:13 -04:00
Jeremy Avigad
df69bb4cfc feat(library/*): add theorems from Haitao on sets and functions, clean up 2015-06-04 11:55:25 -07:00
Leonardo de Moura
68688ecdf6 fix(library/tactic/subst_tactic): in the standard mode, use dependent elimination in the subst tactic (when needed)
Before this commit, the subst tactic was producing an type incorrect
result when dependent elimination was needed (see new test for an example).
2015-06-03 17:36:04 -07:00
Leonardo de Moura
0fbc944cdd feat(frontends/lean): add '[rewrite]' attribute 2015-06-01 17:58:24 -07:00
Leonardo de Moura
ca110012d8 feat(library/tactic): automate "generalize-intro-induction/cases" idiom
closes #645
2015-05-30 21:57:28 -07:00
Leonardo de Moura
6f6848968d feat(frontends/lean/coercion_elaborator): "coercion lifting" for backtracking case
closes #252
2015-05-30 16:44:26 -07:00
Leonardo de Moura
85409a59d3 feat(library/tactic/rewrite_tactic): add xrewrite and krewrite tactic variants
closes #511
2015-05-27 16:32:43 -07:00
Leonardo de Moura
dc6411b903 feat(library/inductive_unifier_plugin): restrict rule that was generating non-terminating behavior
see issue #632
2015-05-27 14:41:12 -07:00
Leonardo de Moura
a4e72e5262 test(tests/lean/run): add missing test 2015-05-25 17:02:23 -07:00
Leonardo de Moura
ab58e538a4 feat(frontends/lean/elaborator): hide auxiliary 'match' hypothesis during elaboration 2015-05-25 15:24:56 -07:00
Leonardo de Moura
f13ca3cd9a feat(library/tactic/contradiction_tactic): handle (h1 : p) and (h2 : not p) hypotheses in the contradiction tactic 2015-05-25 10:29:51 -07:00
Leonardo de Moura
88975927e6 fix(library/tactic/relation_tactics): beta-reduce goal before trying to extract head symbol 2015-05-24 18:56:35 -07:00
Leonardo de Moura
004ea80e65 fix(library/tactic/rewrite_tactic): apply beta reduction when selecting patterns 2015-05-24 18:44:30 -07:00
Jeremy Avigad
8bebd104ff refactor(library/*): remove 'Module:' lines 2015-05-23 20:52:23 +10:00
Jeremy Avigad
db7bdce451 refactor(logic/funext.lean, algebra/function.lean): delete logic/funext, merge into algebra/function 2015-05-23 16:16:36 +10:00
Leonardo de Moura
2d22bb8ea2 feat(frontends/lean/builtin_cmds): do not unfold proofs in the eval command
In the future, we should probably add an option for unfolding proofs.
2015-05-20 19:14:57 -07:00
Leonardo de Moura
76c3757db7 feat(frontends/lean/elaborator): use custom normalizers for detecting whether there are coercions from/to a given type
closes #547
2015-05-20 16:12:12 -07:00
Leonardo de Moura
af3f0088f4 feat(frontends/lean): add 'override' (notation) command 2015-05-20 11:42:16 -07:00
Leonardo de Moura
8ce992b077 feat(frontends/lean/builtin_exprs): allow 'obtain' to be used in tactic mode 2015-05-19 16:26:02 -07:00
Leonardo de Moura
78ee055de8 feat(library/tactic): add induction tactic with support for user defined recursors
closes #483
closes #492
2015-05-19 13:27:17 -07:00
Floris van Doorn
1c77122fd0 fix(tests): update tests because [unfold-c] attribute has been added to some definitions 2015-05-18 15:59:55 -07:00
Leonardo de Moura
19361f0196 feat(library/unifier): do not fire type class resolution as last resort when type contains metavariables
see discussion at #604
2015-05-18 15:45:23 -07:00
Leonardo de Moura
c61c049152 feat(library/user_recursors): generalize acceptable use-defined recursors
see issue #492
2015-05-18 14:21:10 -07:00
Leonardo de Moura
d4da381e1a feat(tests/lean/run/tut_104): add extra test 2015-05-14 18:34:48 -07:00
Leonardo de Moura
84faef5d5d feat(library/tactic/rewrite_tactic): rewrite tactic with 'iff' lemmas 2015-05-14 18:27:13 -07:00
Leonardo de Moura
7f8afcf04b fix(frontends/lean/builtin_exprs): bug in 'using' expressions 2015-05-14 17:17:48 -07:00
Sebastian Ullrich
77c20e99ff feat(library/tactic/inversion_tactic): consistent orientation of generated equalities
Generated equalities in proof irrelevant environments were inverted
compared with the documentation and the proof relevant case, which
resulted in newly generated local vars replacing equivalent old ones
instead of the other way around.
2015-05-14 23:32:54 +02:00
Leonardo de Moura
cbcaf5a48e fix(frontends/lean/scanner): block comments
fixes #600
2015-05-13 22:14:28 -07:00
Leonardo de Moura
3d8586088b fix(frontends/lean/elaborator): problem with 'calc' proofs discussed at issue #592 2015-05-11 13:22:39 -07:00
Leonardo de Moura
c5fb3ec6d0 fix(library/definitional/equations): fixes #541
This commit allows recursive applications to have less or more arguments
than the equation left-hand-side.
We add two tests
   - 541a.lean  recursive call with more arguments
   - 542b.lean  recursive call with less arguments
2015-05-10 20:37:44 -07:00
Leonardo de Moura
9812cfe906 test(tests/lean/run): add example for constructive choice 2015-05-09 12:02:52 -07:00
Leonardo de Moura
4e35afedcc feat(frontends/lean): rename 'wait' to 'reveal'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2015-05-08 20:54:16 -07:00
Leonardo de Moura
f8e2f68ce0 feat(frontends/lean): add 'wait' command
This commit also fixes several problems with -j option (parallel
compilation). The .olean files were not missing data when -j was used

see issue #576
2015-05-08 20:05:21 -07:00