Commit graph

1053 commits

Author SHA1 Message Date
Gabriel Ebner
a93528df24 fix(leanpkg): read carriage-return as whitespace 2017-06-29 14:25:59 +02:00
Daniel Selsam
8ccdf350de fix(data/hash_map.lean): rm unused argument to contains_iff 2017-06-26 12:43:36 -07:00
Mario Carneiro
09af93186a fix(frontends/lean/elaborator): @applications don't make thunks 2017-06-22 08:24:11 -07:00
Sebastian Ullrich
0a48809469 refactor(frontends/lean/tactic_notation): rename note/define tactics to have/let 2017-06-22 08:03:23 -07:00
Mario Carneiro
9f31096892 refactor(init/meta/interactive): rename pose -> define 2017-06-22 08:03:23 -07:00
Mario Carneiro
b775a01fba refactor(init/meta/interactive): merge assert -> note 2017-06-22 08:03:23 -07:00
Leonardo de Moura
b8fa7f5311 fix(library): expr, level, hash_map, rb_map has_repr instances should be has_to_string since they do not produce results that can be parsed by Lean
See #1664
2017-06-18 18:33:27 -07:00
Leonardo de Moura
dc1a1c8540 refactor(library): has_to_string ==> has_repr
See issue #1664

This is just the first step to implement proposal described at issue #1664.
2017-06-18 18:29:19 -07:00
Leonardo de Moura
4eefc41b6e refactor(*): wrap string in a structure
We want to make sure string users do not depend on the string
implementation. This is the first step.

We need this refactoring *now* to make sure it will not be
super painful to address issue #1175
2017-06-07 17:30:49 -07:00
Sebastian Ullrich
3f717c586e feat(init/meta/interactive): declare format! and sformat! macros and start putting them to use 2017-06-07 10:09:38 -07:00
Mario Carneiro
860e2d904d feat(init/data/nat): bitwise operations 2017-05-30 12:47:44 -07:00
Johannes Hölzl
ab6797b74c feat(leanpkg): support (deterministic) timeout value in leanpkg.toml 2017-05-29 06:52:38 +02:00
Mario Carneiro
92d76c22a5 feat(data/pnat): positive natural numbers 2017-05-28 02:32:23 -04:00
Mario Carneiro
6e88119f55 feat(init/meta/injection_tactic): better injection tactic
(1) The lhs and rhs will be reduced to whnf before getting the constructor apps
(2) If the lhs and rhs are distinct constructors, it discharges the goal by contradiction
(3) The interactive injection tactic will try to close the goal by assumption if successful
2017-05-27 04:59:40 -04:00
Mario Carneiro
57837c2b3e fix(init/meta/tactic): let by_cases handle elimination to Type 2017-05-27 04:14:06 -04:00
Mario Carneiro
b827df8b49 refactor(init/logic): remove "contrapos" (which is a duplicate of "mt") 2017-05-27 04:14:03 -04:00
Mario Carneiro
39e7e5cba8 feat(data/vector): more vector operations 2017-05-27 04:14:02 -04:00
Leonardo de Moura
cba0eef101 fix(library/data, library/init/data/array): adjust hash_map PR 2017-05-16 14:46:43 -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
5d89a93fce feat(library/data/hash_map): verified hash_map 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
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