Commit graph

1031 commits

Author SHA1 Message Date
Leonardo de Moura
a0a8103804 chore(frontends/lean): go back to 'c' as notation for characters
This suggestion has been discussed at Slack.
We have decided to use #"c" as notation because we wanted to allow `'`
in the beginning of identifiers like in SML and F*. In particular,
we wanted to allow users to use 'a 'b 'c for naming type parameters
like in SML. However, nobody used this notation. In the Lean standard
library, we are using greek letters for naming type parameters.
So, there is no real motivation for the ugly #"c" syntax.
2017-05-02 13:00:51 -07:00
Gabriel Ebner
fd6407eccb feat(library/data/buffer/parser): parser combinators for char_buffer 2017-05-01 14:11:38 -07:00
Gabriel Ebner
867c38e1ea feat(library/data/buffer,library/init/data/array): utility functions on buffers 2017-05-01 14:11:38 -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
Leonardo de Moura
cabb4350d9 feat(library): instances are not reducible by default anymore
Motivation: see "Other goodies" section at
https://github.com/leanprover/lean/wiki/Refactoring-structures

We had to add a new transparency mode: Instances at type_context.
In this mode, instances and reducible definitions are considered
transparent.

The new mode is used in the defeq_canonizer, code generator,
and sizeof lemma generation at inductive_compiler.

We also use the new mode in the unfold tactics.
2017-04-26 14:10:11 -07:00
Leonardo de Moura
cdafd4b791 chore(library): cleanup proofs 2017-04-25 17:23:42 -07:00
Jared Roesch
4704b68035 chore(*): remove smt2 bindings from standard libary 2017-04-23 11:32:11 -07:00
Joe Hendrix
17291b8a33 refactor(library/data/vector): allow tail to accept empty vector. 2017-04-23 11:22:09 -07:00
Leonardo de Moura
e40dbffba9 chore(library): add auxiliary lemmas for hoare state monad experiment 2017-04-12 18:01:59 -07:00
Leonardo de Moura
ad859817b1 feat(frontends/lean): allow local decls to shadow namespaces 2017-03-29 16:09:45 -07:00
Leonardo de Moura
71685e4dd6 feat(frontends/lean): add support for t.<id> and t.<idx> when t is a composite term
Replace `^.` with `.` in the stdlib
2017-03-28 17:47:49 -07:00
Leonardo de Moura
87932f1c56 feat(frontends/lean): change notation for inaccessible patterns
The following are accepted
 .(t)
 ._

We don't accept .t anymore because it will conflict with the field
access notation.
2017-03-28 16:09:15 -07:00
Leonardo de Moura
6183c7676e feat(frontends/lean): use . for field access 2017-03-28 15:29:54 -07:00
Leonardo de Moura
82748a61b7 feat(library/system/io): basic file system API 2017-03-23 16:30:16 -07:00
Leonardo de Moura
60dd85719c feat(library/system/io): system.io without axioms 2017-03-22 23:36:05 -07:00
Leonardo de Moura
8feacb27a6 feat(library/data): add buffer 2017-03-21 18:47:50 -07:00
Simon Hudon
58b9d0ae8e feat(library/data/bitvec): to_nat and of_nat cancel each other 2017-03-12 09:38:57 -07:00
Leonardo de Moura
3a4cd38ba9 chore(library/init): remove reducible annotations for id, const, etc, and move $ notation to core.lean 2017-03-11 11:34:16 -08:00
Jeremy Avigad
37f3e5cc69 refactor(library/data/dlist): change 'inv' to 'invariant' 2017-03-08 19:31:27 -08:00
Johannes Hölzl
d6eae3265c feat(library/data/dlist): setup transfer for dlist 2017-03-07 19:30:51 -08:00
Leonardo de Moura
425b5ffc11 chore(library/data/dlist): make local notation less cryptic 2017-03-06 18:09:32 -08:00
Leonardo de Moura
0d6d52004b feat(library/data/dlist): difference lists 2017-03-06 17:23:26 -08:00
Leonardo de Moura
59c0cbd2e4 chore(library): test new '^.' notation in the standard library, and cleanup definitions using it 2017-03-05 21:21:50 -08:00
Leonardo de Moura
525242561a fix(library/init/meta/tactic): use zeta reduction by default in the abstract tactic
Abstracting let-exprs may produce type errors.
In the future we may consider another strategy for `abstract`.
First, we try to abstract the `let`, then if it fails, we expand.
Not sure if this is a good idea.
2017-03-02 11:34:28 -08:00
Leonardo de Moura
d8371a4b0d feat(library/data/hash_map): avoid read' and write' operations that require an extra test 2017-03-01 22:06:48 -08:00
Leonardo de Moura
28938090c1 feat(library/data): add hash_map's 2017-02-27 23:17:10 -08:00
Leonardo de Moura
632c98aade feat(library/data/list): cleanup proofs 2017-02-17 19:42:57 -08: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
7df64e6e7b feat(library/data): add lazy_list 2017-02-08 12:01:46 -08:00
Leonardo de Moura
28cd022486 feat(library/data/vector): add to_list lemmas 2017-02-06 14:57:04 -08:00
Leonardo de Moura
f176c272b4 refactor(library/init/core): simpler has_mem type class with out_param 2017-01-30 18:43:05 -08:00
Gabriel Ebner
e839080834 feat(init/meta/async_tactic): add tactic to prove subgoals in a different task 2017-01-28 08:27:23 +01:00
Leonardo de Moura
93ba77f8da chore(library/data): rename tuple => vector 2017-01-26 22:11:10 -08:00
Leonardo de Moura
08a0924fe3 fix(library/data/bitvec): typo 2017-01-25 18:41:32 -08:00
Joe Hendrix
641ccbc846 chore(library/data): remove (list/tuple).firstn in favor of taken 2017-01-25 18:39:54 -08:00
Gabriel Ebner
03e09db70e refactor(library/data/bitvec,library/data/tuple): use automation 2017-01-21 09:48:35 +01:00
Leonardo de Moura
bbc99d4aa5 feat(library/data/tuple): make sure tuple.nil and tuple.cons can be used in patterns 2017-01-20 18:38:34 -08:00
Leonardo de Moura
97b98c58d0 refactor(library): move nat lemmas to library/init/data/nat/lemmas.lean 2017-01-17 17:42:13 -08:00
Joe Hendrix
767ac42dfe chore(library/data): remove redundent decidable_eq instances 2017-01-17 17:34:10 -08:00
Joe Hendrix
5bc5013f16 chore(library/data/bitvec): remove leftover code 2017-01-17 17:34:05 -08:00
Joe Hendrix
985c3697b9 chore(library/data/list): add back copyright notice 2017-01-17 17:33:59 -08:00
Joe Hendrix
8e2cf491e5 refactor(library/data/list): move theorems to separate modules per lean2 2017-01-17 17:33:45 -08:00
Joe Hendrix
3de9e722e1 feat(library/data/bitvec): additional definitions 2017-01-17 17:33:37 -08:00
Joe Hendrix
d52c3327ba feat(library/data/nat/sub): additional theorems 2017-01-17 17:33:32 -08:00
Joe Hendrix
f244c0e70a feat(library/data/bitvec): add bitvec version of tuple.append 2017-01-17 17:33:24 -08:00
Joe Hendrix
de92ea658a feat(library/data/tuple): add decidable_eq to tuple 2017-01-17 17:33:17 -08:00
Joe Hendrix
9781a0414c feat(library/data/list): add has_decidable_eq to list. 2017-01-17 17:33:09 -08:00
Joe Hendrix
18cbc22791 refactor(library/data/nat): migrate data.nat to lean2 structure 2017-01-17 17:24:37 -08:00
Jeremy Avigad
20edc93b17 fix(library/init/data/list/lemmas): fix theorem names, now nil_append and cons_append 2017-01-10 09:10:33 -08:00
Leonardo de Moura
85f88c4174 refactor(library/data/monad/transformers): move transformers to init 2016-12-31 11:37:13 -08:00