Commit graph

1123 commits

Author SHA1 Message Date
Leonardo de Moura
368f17d0b1 feat(library/tactic/simplify): add simp! 2018-01-16 17:29:24 -08:00
Leonardo de Moura
cebde17bec feat(library/tactic/simplify): simp reduces c a_1 ... a_n = c b_1 ... b_n into a_1 = b_1 /\ ... /\ a_n = b_n 2018-01-12 18:18:56 -08:00
Leonardo de Moura
4bd314f7bd feat(library/tactic/simplify): simp reduces c_1 ... = c_2 ... to false 2018-01-12 11:30:45 -08:00
Leonardo de Moura
6eae78da01 chore(library/data/rbtree/insert): provide meaningful names to ins.induction minor premises
We use them with `case` tactic.
2017-12-13 14:44:48 -08:00
Leonardo de Moura
533ddc0279 fix(library/init/meta/interactive): remove buggy generalizing param from with_cases 2017-12-11 16:27:04 -08:00
Leonardo de Moura
53961b12cb chore(library/data/rbtree/insert): use new case tactic to cleanup proofs 2017-12-11 16:27:03 -08:00
Leonardo de Moura
8bda71af6f feat(library/init/meta/interactive): new case tactic with support for with_cases and tagging 2017-12-11 16:27:03 -08:00
Leonardo de Moura
d44996e034 feat(library/init/meta): propagate tag information 2017-12-10 19:15:41 -08:00
Leonardo de Moura
103598bbe0 chore(library/data/rbtree/insert): use weak_trichotomous as an eliminator 2017-12-07 17:40:52 -08:00
Leonardo de Moura
c5ed881c59 chore(library/data/rbtree/insert): reduce number of cases using custom elimination principle for balance1/balance2 2017-12-06 15:57:44 -08:00
Leonardo de Moura
5ddab48b1e chore(library/data/rbtree/basic): cleanup 2017-12-06 13:25:07 -08:00
Leonardo de Moura
1ad5a978a1 chore(library/data/rbtree/insert): cleanup 2017-12-06 10:45:58 -08:00
Leonardo de Moura
e00c0de12e chore(library/data/rbtree, changes.md): cleanup 2017-12-06 09:55:06 -08:00
Leonardo de Moura
03eda2ecc0 feat(library/init/meta/interactive): add cases_matching p tactic 2017-12-05 18:17:44 -08:00
Leonardo de Moura
bc89ebc19c feat(kernel/inductive): improve how induction hypotheses are named
See doc/changes.md
2017-12-05 15:58:09 -08:00
Leonardo de Moura
a2f55e5d7b feat(library/tactic/induction_tactic): new name generator for induction and cases tactics 2017-12-05 14:57:36 -08:00
Leonardo de Moura
458958b9fc feat(kernel/inductive): use ih to name induction hypothesis (instead of ih_1) when there is only one 2017-12-05 13:50:24 -08:00
Leonardo de Moura
0c5ecf6441 feat(library/init/meta/interactive): add iterate n { t } 2017-12-05 12:52:18 -08:00
Leonardo de Moura
52d939b885 chore(library/data/rbtree): use cases h : t to avoid generalize 2017-12-05 12:32:51 -08:00
Leonardo de Moura
54004d4972 fix(library/tactic/cases_tactic): try to clear input hypothesis when performing dependent elimination
The `induction h` tactic tries to clear hypothesis `h` after it is
applied. But, before this commit, `cases h` would only try to clear `h`
when performing non-dependent elimination. This was problematic when
writing tactic scripts for automating proofs.
2017-12-05 11:03:46 -08:00
Leonardo de Moura
6d96741010 feat(library): provide names for constructor arguments
Motivation: `cases` and `induction` tactics use these names when the
user does not provide them.
2017-12-04 16:25:16 -08:00
Leonardo de Moura
c943576e5a feat(library/init): add funext tactic 2017-12-04 14:54:39 -08:00
Leonardo de Moura
db46f01315 chore(library/init): replace iterate applications with repeat when appropriate 2017-12-04 13:04:46 -08:00
Leonardo de Moura
75aa94b34c refactor(library): rename repeat ==> iterate
Reason: we will implement a new `repeat` tactic.
2017-12-04 12:34:59 -08:00
Leonardo de Moura
7b97e82fb3 chore(library): remove unnecessary repeat applications 2017-12-04 12:16:11 -08:00
Leonardo de Moura
b7322e28c1 feat(library): do not using simp lemmas for sorting arguments of AC operators by default 2017-12-03 15:03:58 -08:00
Leonardo de Moura
0a1d2908aa feat(library/data/rbtree/main): rbtrees are balanced 2017-11-22 08:02:13 -08:00
Leonardo de Moura
b95b260706 fix(library/data/rbtree): insert 2017-11-22 07:52:18 -08:00
Leonardo de Moura
96f8ecbdcb feat(library/data/rbmap): add find_insert lemmas for rbmap 2017-11-21 14:29:04 -08:00
Leonardo de Moura
f8fb92e431 feat(library/data/rbtree/insert): finish find_insert_of_not_eqv lemmas 2017-11-21 13:16:19 -08:00
Leonardo de Moura
b3e429a1b8 chore(library/data/rbtree/insert): reduce proofs size 2017-11-21 10:37:10 -08:00
Leonardo de Moura
ae0f5642d3 feat(library/data/rbtree): find_insert_of_not_eqv lemmas
Remark: the balance2 case (dual of balance1) is still missing.
2017-11-20 21:27:19 -08:00
Leonardo de Moura
02545cb941 feat(library/data/rbmap): find_insert lemmas 2017-11-20 12:14:05 -08:00
Leonardo de Moura
319faca00a feat(library/data/rbtree): add mem_exact predicate and find_insert lemmas 2017-11-20 11:52:36 -08:00
Leonardo de Moura
1033836953 feat(library/data/rbmap): add rbmap lemmas 2017-11-19 19:49:36 -08:00
Leonardo de Moura
902c1219b0 feat(library/data/rbtree): more find lemmas 2017-11-19 19:49:36 -08:00
Leonardo de Moura
50797c1d05 feat(library/data/rbtree): add specialized lemmas (for strict total orders) 2017-11-18 16:36:58 -08:00
Leonardo de Moura
320b33f305 feat(library/data/rbtree): add find and define contains using it 2017-11-18 16:06:16 -08:00
Leonardo de Moura
8ffff9e48b feat(library/data/rbtree): cleanup and add min max 2017-11-18 12:22:10 -08:00
Leonardo de Moura
effa90e884 refactor(library/init/data/rbtree): rbtree does not need (decidable_rel lt) parameter 2017-11-17 22:59:50 -08:00
Leonardo de Moura
dec5b7c806 feat(library/data/rbtree/lemmas): add mem_insert_of_incomp 2017-11-17 17:21:03 -08:00
Leonardo de Moura
52d6adc19c chore(library): use new structure update notation in the core lib 2017-11-17 16:57:54 -08:00
Leonardo de Moura
65368a0c85 refactor(library): rbtree lemmas do not need to be in init folder 2017-11-17 16:14:28 -08:00
Leonardo de Moura
e96026651b feat(library/init): add d_array type
@kha I added the `d_array` type that we discussed today.
However, the VM implemantion is still using persistent arrays.
If we remove the persistent array support, then code using
hash_map will only be efficient if the hash_map is used linearly.
This is not the case in the reader module because we are planning
to support backtracking.

On the other hand, it is awkward we currently don't have a vanilla
array implementation in the VM. I suspect this will be a problem in
the future.

So, I see the following possibilities:

1- We implement a map data-structure using red-black trees in Lean.
We use this new data-structure to implement all maps in the new reader and
macro expander.

2- We implement a very simple map as a list of pairs.
Then, we replace it in the VM with an efficient implementation.
The VM implementation may use our internal red-black trees.
We may also use a persistent hash table implemented in C++,
but it would be awkward to ask the user to provide a hash function in the reference
implementation (i.e., the one using list of pairs), but not use it
anywhere :)
In contrast, if we use the red-black tree implementation we
would have to ask the user to provide a total order.
It is overkill for the list of pair reference implementation because
we just need an equality test, but, at least, the comparison function
will be used in the implementation.

3- Add types `d_parray` (dependent persistent array) and
`parray` (persistent array). In Lean, they would just wrap the
`d_array` and `array` types. In the VM, `d_array` and `array` would
be implemented using vanilla arrays and `d_parray` and `parray` would
be implemented using persistent arrays. Then, we could have
`d_hash_map`, `hash_map`, `d_phash_map` and `phash_map`. Argh, so many
versions :(
We would use `phash_map` to implement our reader and macro expander.

4- Add a `(persistent : bool := ff)` parameter to `d_array` and
`array` types. The disadvantage of this approach is that it has
a performance impact. The VM implementation would have to check
the `persisent` flag at runtime. The value of this flag is known
at compilation time, but we currently don't have a mechanism
for specializing native builtin C++ implementations for VM functions.
2017-11-06 14:56:11 -08:00
Leonardo de Moura
d25ee51b43 refactor(library): move lazy_list back to core library 2017-08-16 14:08:46 -07:00
Leonardo de Moura
dc68cc7445 refactor(library): move stream back to the core library 2017-08-16 13:45:36 -07:00
Leonardo de Moura
19ee270c60 refactor(library): remove vector and bitvec from init
Reason: vector in in init folder was introducing an overload (`::`) for
all Lean users. The workaround (use `local infix ::`) was
counterintuitive.

We currently have no special support for bitvectors in the code
generator. Thus, there is no need to have vector and bitvec in the init
folder right now. Moreover, the new parser and elaborator (issue #1674) should
provide better ways of managing overloaded symbols.
2017-08-16 13:40:50 -07:00
Mario Carneiro
fb2447468b chore(init/category/combinators): remove monad.for
and variations, in favor of monad.map and variations
2017-07-26 11:52:11 +01:00
Mario Carneiro
cc81118892 refactor(init/data): move out some nat lemmas 2017-07-26 11:52:10 +01:00
Mario Carneiro
74aeb250ec refactor(*): move out stdlib 2017-07-26 11:52:10 +01:00