Commit graph

55 commits

Author SHA1 Message Date
Leonardo de Moura
2be87ecd92 chore(library/init): Bool.tt => Bool.true and Bool.ff => Bool.false 2019-03-21 15:06:44 -07:00
Leonardo de Moura
2ea0baeb99 chore(library): use lowercase in imports 2019-03-21 15:06:44 -07:00
Sebastian Ullrich
beda5f5f43 chore(library): capitalize types and namespaces 2019-03-21 15:06:43 -07:00
Sebastian Ullrich
b939162168 chore(library): switch from snake_case to camelCase 2019-03-21 15:06:43 -07:00
Leonardo de Moura
efe64cb2d3 feat(library/init/data/list/basic): tail recursive length 2019-02-08 16:51:44 -08:00
Leonardo de Moura
4734e55f6d feat(library/init/data): tail recursive append 2019-02-08 16:35:20 -08:00
Sebastian Ullrich
cf1aa13a2c feat(library/init/lean/elaborator): to_pexpr: translate match nodes to pre_equations pexpr
Building a proper `equations` pexpr in Lean is not feasible right now because we
need global+local name resolution, [pattern] attribute retrieval, ... to
reimplement `patexpr_to_pattern`. The `pre_equations` will instead be converted
by the old elaborator using this function (TBD).

With this change, `to_pexpr` can now translate every basic definition body in
`core.lean`.
2018-12-05 12:57:41 +01:00
Leonardo de Moura
effccf9a6d chore(library/init): mark a few combinators with [specialize] 2018-10-15 13:47:26 -07:00
Leonardo de Moura
5ae63ea1f2 chore(library/init/data/list/basic): remove unnecessary workaround 2018-09-07 17:10:23 -07:00
Leonardo de Moura
71dd8653bc feat(library/init/core): decidable_eq is a proper class
We need this to take advantage of the new indexing structure we are
going to add to improve performance.
2018-09-07 16:38:11 -07:00
Sebastian Ullrich
d4105e1e16 chore(library/init/lean/parser/basic): avoid nesting rbnode in trie
The new two-layer rbnode/list structure is a little faster
2018-09-05 10:37:03 -07:00
Leonardo de Moura
0a5d5b9036 fix(library/init/data/list/basic): list.lt 2018-06-21 09:16:58 -07:00
Leonardo de Moura
e9b4b811de chore(library/equations_compiler/util): disable generation of equational lemmas
@kha, `eqn_compiler.lemmas` is false by default.
I will keep them disabled until I remove the inductive compiler.
I'm building the new inductive datatype module (to replace the inductive
compiler), and the lemmas will fail to be proved in the next commits
until the transition is complete.
2018-06-12 13:03:25 -07:00
Leonardo de Moura
d5fe509c36 chore(*): remove end after each match-expression
`end` is not optional anymore
2018-05-04 11:30:06 -07:00
Leonardo de Moura
f2df67053f feat(library/init/data/dlist): add dlist back without tactic framework dependency 2018-05-02 12:36:31 -07:00
Leonardo de Moura
98a7aab3ac chore(library/init): remove propext micro module 2018-04-30 09:25:26 -07:00
Leonardo de Moura
9efd07d18c chore(library/init): move logic.lean => core.lean 2018-04-30 09:25:25 -07:00
Leonardo de Moura
e602ac873a feat(library/init): modify && and || precedence
The idea is to match the precedence used in regular programming
languages, where `x = y || x = z` is parsed as `(x = y) || (x = z)`.

This commit also adds `!x` as notation for `bnot x`
2018-04-26 13:40:57 -07:00
Sebastian Ullrich
cf8dd9e75e feat(fronteds/lean/builtin_exprs): do notation: use overloadable bind instead of has_bind.bind 2018-02-28 12:49:22 +01:00
Leonardo de Moura
bf8fa50481 feat(library/init/data/list/basic): add is_prefix_of and is_suffix_of 2017-12-11 16:27:03 -08:00
Leonardo de Moura
ddfcc2cb0b feat(library/init/data/list/basic): define decidable_eq (list A) instance manually
Motivation: make sure we can use it before we define the tactic `mk_dec_eq_instance`.
2017-12-11 16:27:03 -08:00
Leonardo de Moura
8e076da666 feat(library/init/data/list/basic): has_le and has_lt instances for lists 2017-11-13 21:52:12 -08:00
Leonardo de Moura
a39c0531cf feat(library/init/data): has_lt for string and list 2017-11-13 15:30:41 -08:00
Sebastian Ullrich
f255513fdc fix(frontends/lean/definition_cmds): apply attributes after declaring equational lemmas
Fixes `@[simp] def ...`
2017-09-01 13:36:53 +02:00
Mario Carneiro
26548c956c feat(init/meta/interactive): rw at *, rw at h1 h2 |- support
Now tactics supporting locations can also specify the goal among the locations by using the name `⊢` or `|-`. Also `rw at *` is implemented so that it will rewrite any hypotheses or the goal for which the whole sequence of rewrites succeeds. (This is different from `rw at h1 h2 ... hn |-`, which requires that all rewrites run to completion on each specified target.)
2017-07-28 16:47:02 +01:00
Leonardo de Moura
1ec65bed44 refactor(library/init): move bitvector to main repo
@digama0 I moved bitvec back to the main repo, and many nat lemmas.
I want these lemmas here for now. I will need some of them for future
decision procedures.
2017-07-26 13:35:38 +01:00
Mario Carneiro
4dc261393f refactor(init/data/list): move out advanced list defs 2017-07-26 11:52:11 +01:00
Mario Carneiro
813fda9ba5 refactor(init/data/{nat,list}): rename for consistency with stdlib 2017-07-26 11:52:10 +01:00
Mario Carneiro
cc81118892 refactor(init/data): move out some nat lemmas 2017-07-26 11:52:10 +01:00
Leonardo de Moura
4faae27069 perf(frontends/lean): add notation #[...]
The new notation should be use to input long sequences.
Closes #1755
2017-07-21 04:20:48 -07:00
Mario Carneiro
803af7cd63 feat(library/data/stream): more stream theorems 2017-07-05 12:37:53 -07:00
Sebastian Ullrich
30f4b2f2dd refactor(library): list.taken/dropn ~> list.take/drop 2017-07-05 11:20:10 -07:00
Johannes Hölzl
8d438e1012 feat(library/init/meta): add coinduction method 2017-06-12 20:42:48 -07:00
Leonardo de Moura
62c24f9bb5 chore(*): remove pos_num and num from stdlib 2017-05-25 18:24:16 -07:00
Leonardo de Moura
56dd09058f feat(library/init/data/list/basic): add auxiliary list functions 2017-05-24 14:34:54 -07:00
Mario Carneiro
6b28499e47 feat(init/data/list,data/list): new basic list operations from haskell 2017-05-16 14:38:43 -07:00
Mario Carneiro
19a919061f fix(library/data/hash_map): respond to review comments 2017-05-16 14:38:43 -07:00
Mario Carneiro
3b89739850 feat(library/data/list, library/data/array): theorems needed for new hash_map
Note that hash_map is moved to library_dev, where the more advanced theorems on lists are available
2017-05-16 14:38:43 -07:00
Leonardo de Moura
5cef84709f refactor(library): avoid auxiliary definitions such as add/mul/le/etc
See Section "Other goodies" at
https://github.com/leanprover/lean/wiki/Refactoring-structures

This commit also improves the support for projections in the
unifier/matcher.

Now, we consider the extra case-split for projections.
Given a projection `proj`, and the constraint `proj s =?= proj t`, we need to try first `s =?= t` and if it fails, then try to reduce.
This is needed in the standard library because we now have constraints such as:
```
@has_le.le ?A ?s ?a ?b  =?=  @has_le.le nat nat.has_add x y
```
If we reduce the right hand side, we get the unsolvable constraint
```
@has_le.le ?A ?s ?a ?b  =?=  nat.le x y
```
Before this change, the constraint was `@le ?A ?s ?a ?b  =?=  @le nat nat.has_add x y`, and we already perform a case-split in this case.
Moreover, projections were eagerly reduced whenever possible.
The extra case-split generates a performance problem in several tests. For example `fib 8 = 34` was timing out.
I worked around this issue by performing the case-split only when the constraint contains meta-variables.
There are also minor issues. Example. `<` is notation for `has_lt.lt`, but `>` is for `gt`.
2017-05-01 08:52:19 -07:00
Sebastian Ullrich
3ead6be9ca feat(init): add default value proofs to the monadic hierarchy 2017-03-27 13:42:08 -07:00
Leonardo de Moura
e0e3f51c44 feat(library/init): add unification hint for add/succ 2017-03-12 13:45:30 -07:00
Sebastian Ullrich
763097dbd2 refactor(library): revise the monadic hierarchy 2017-03-09 20:30:03 -08:00
Johannes Hölzl
b593d090f2 feat(library/init/data/list): add remove_all 2017-03-07 19:30:51 -08:00
Johannes Hölzl
1c30a593c1 feat(library/init/data/list): add enum 2017-03-07 19:30:51 -08:00
Johannes Hölzl
16aaa9b88e feat(library/init/data/list): add unzip 2017-03-07 19:30:51 -08:00
Leonardo de Moura
1ca5c78cf8 feat(library/tools/mini_crush): improve mini_crush 2017-02-19 18:33:12 -08:00
Leonardo de Moura
632c98aade feat(library/data/list): cleanup proofs 2017-02-17 19:42:57 -08:00
Sebastian Ullrich
d15591a2d8 feat(library,frontends/lean): expose parser to Lean and use for parsing tactic parameters 2017-02-17 13:45:56 +01:00
Leonardo de Moura
32e6442d0a feat(frontends/lean): no global universes in the frontend 2017-02-08 17:23:04 -08:00
Leonardo de Moura
04a8518104 refactor(library/init/core): simpler has_insert type class with out_param 2017-01-30 18:50:21 -08:00