Commit graph

2771 commits

Author SHA1 Message Date
Gabriel Ebner
4b22e2309c refactor(system/io): use spawn_args structure in all process functions 2017-05-04 16:41:11 -07:00
Gabriel Ebner
f0d22ed3e5 feat(library/process,system/io): set environment variables for spawned processes 2017-05-04 16:41:11 -07:00
Gabriel Ebner
c4aef89296 feat(system/io): add finally combinator 2017-05-04 16:41:11 -07:00
Gabriel Ebner
1b8533130b feat(system/io): add function to get environment variables 2017-05-04 16:41:11 -07:00
Daniel Selsam
d727abeefc chore(library/inductive_compiler/nested.cpp): prove all theorems in C++ 2017-05-04 16:34:32 -07:00
Sebastian Ullrich
d0c2c73b35 refactor(init/meta,tools): rename now tactic to done
It was pointed out that Coq already uses `now` for a different kind of tactic.
And `done` is more descriptive anyway.
2017-05-03 11:18:31 +02:00
Leonardo de Moura
73b4e42485 chore(frontends/lean,library): fix character pretty printer 2017-05-02 13:17:22 -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
Leonardo de Moura
55fee26b36 feat(library/class): add attribute for tracking symbols occurring in instances of type classes
For more information see:
https://github.com/leanprover/lean/wiki/Refactoring-structures
The new attribute [algebra] implements the [algebraic_class] described
in the page above.
2017-05-01 18:02:30 -07:00
Gabriel Ebner
ed9e7d9066 feat(leanpkg): make add command more awesome 2017-05-01 14:11:39 -07:00
Gabriel Ebner
c744efe2f5 feat(leanpkg): add package manager 2017-05-01 14:11:38 -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
c46ffbde4c feat(library/init/data/char): character class predicates 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
ba5eccdca8 refactor(library/init/core): rename out_param => inout_param
It is really input/output.
2017-05-01 14:01:41 -07:00
Leonardo de Moura
74550fbebc feat(library/init/core): add notation for out_param 2017-05-01 13:52:17 -07:00
Leonardo de Moura
949ed3ac5c feat(library/init/category/applicative): add has_seq type classes 2017-05-01 12:57:05 -07:00
Leonardo de Moura
f6b47ea5c7 feat(library/init/category): add has_map type class, delete fmap 2017-05-01 10:13:02 -07:00
Leonardo de Moura
66a1fec94e feat(library/init/category): add has_orelse type class 2017-05-01 09:58:27 -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
701b51a882 chore(library/tools/mini_crush/default): increase timeout 2017-04-30 16:27:55 -07:00
Leonardo de Moura
fc9a8ed3be fix(library/init/meta/smt): fail tactic result type 2017-04-30 14:39:51 -07:00
Sebastian Ullrich
0ca6e2c96f refactor(library/{type_context,compiler/preprocess},frontends/lean/elaborator): use opaque, general type class instead of special app elaboration for eval_expr 2017-04-27 16:04:59 -07:00
Sebastian Ullrich
4479eebaf0 feat(init/meta/{environment,pexpr}): expose some structure APIs 2017-04-27 16:04:41 -07:00
Leonardo de Moura
f4ebd38ce3 feat(frontends/lean/builtin_exprs): improve infix paren notation
After this commit, `(+)` is notation for (add) instead of `(fun x y, add x y)`.
This change is relevant when defining type class instances such as

```lean
instance semigroup_to_is_associative [semigroup α] : is_associative α (*) :=
⟨mul_assoc⟩
```
2017-04-27 12:33:33 -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
08e094139d feat(library/init/meta): add by_contradiction and by_cases to tactic.interactive 2017-04-26 12:54:52 -07:00
Johannes Hölzl
b27100ec5a fix(library/init/meta/transfer): add check if target contains (universe) meta variables (see #1535) 2017-04-25 17:46:48 -07:00
Leonardo de Moura
cdafd4b791 chore(library): cleanup proofs 2017-04-25 17:23:42 -07:00
Sebastian Ullrich
e9a6c544af refactor(frontends/lean/{elaborator,structure_cmd}): compile structure inheritance to nested fields 2017-04-24 19:35:15 +02:00
Mario Carneiro
7ef4428124 add new interactive tactics skip, ginduction, exacts 2017-04-23 11:48:33 -07:00
Mario Carneiro
5e8572b407 add set.Union and set.univ 2017-04-23 11:37:27 -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
e7603df514 feat(library/init/algebra): add type classes for algebraic normalizer 2017-04-18 15:47:38 -07:00
Sebastian Ullrich
b3884d5f42 refactor(init/meta/interactive,frontends/lean/token_table): introduce generalizing keyword in Lean 2017-04-16 15:11:49 -07:00
Leonardo de Moura
f6556ecdcc fix(library/init): missing has_sizeof instances for subtype, char and string 2017-04-15 23:31:14 -07:00
Leonardo de Moura
210b7c8fb7 fix(library/tactic): fixes #1513
Implement rename tactic in Lean using revert/intro
2017-04-15 11:34:24 -07:00
Leonardo de Moura
e40dbffba9 chore(library): add auxiliary lemmas for hoare state monad experiment 2017-04-12 18:01:59 -07:00
Sebastian Ullrich
8ea2bc08cb feat(init/meta/interactive): add generalizing parameter to induction 2017-04-11 17:07:28 -07:00
Sebastian Ullrich
4483e53de0 feat(init/util): tactic.trace-like trace_val function
Calling it `trace` and removing the old `trace` function does bad things with overloading
2017-04-11 17:07:28 -07:00
Sebastian Ullrich
70a2c402ac feat(init/meta/interactive): Isabelle-like case tactic 2017-04-11 17:07:28 -07:00
Sebastian Ullrich
c8c8c27654 feat(init/meta): add has_to_format instances and prefer direct has_to_tactic_format implementations 2017-04-11 17:07:28 -07:00
Sebastian Ullrich
026c5ee509 fix(library/init/meta/expr,library/vm/vm_expr): fix macro args 2017-04-11 17:07:28 -07:00
Gabriel Ebner
66cd4c57cf feat(library/system/io): alternative instance for io 2017-04-11 16:42:17 -07:00
Gabriel Ebner
cefc26d9cb refactor(library/system/process): add exit status and working directory 2017-04-11 16:42:17 -07:00
Gabriel Ebner
e2fa363423 feat(library/system/io,shell/lean): add --run switch 2017-04-11 16:41:30 -07:00
Leonardo de Moura
6c68aeee01 feat(library/system/io): add io.iterate primitive 2017-03-31 11:34:09 -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
35eba0107e chore(library/init/algebra/ring): use . notation 2017-03-28 18:49:35 -07:00