Leonardo de Moura
6234c60aae
chore(*): disable test suite
2018-04-10 12:56:55 -07:00
Leonardo de Moura
bcaa0b2ad3
refactor(library/typed_expr): do not use macros for implementing typed_expr
...
Remark: in Lean4, we will not have macro_defs.
2018-04-09 15:16:46 -07:00
Sebastian Ullrich
3d692c53b5
chore(tests/lean/struct_class): make test less prone to breakage
2018-04-04 13:04:38 +02:00
Leonardo de Moura
d387103aa2
fix(library/init/core): closes #1951
...
- Add has_pow type class
- Make `^` notation right associative
2018-03-29 16:25:47 -07:00
Leonardo de Moura
6e0bf8473b
test(tests/lean/1952b): another test for issue #1952
...
This is an example used in one of the comments.
2018-03-29 16:01:26 -07:00
Leonardo de Moura
66e7873c22
fix(library/type_context): elim_delayed_abstraction must check whether metavariable is already assigned
...
fixes #1952
2018-03-29 15:53:17 -07:00
Sebastian Ullrich
3fefe94757
refactor(library/init/core,library/init/unit): make unit an abbreviation of punit.{0}
2018-03-27 10:33:04 -07:00
Leonardo de Moura
efa9d7e110
perf(library/type_context): performance issue when proving equation lemmas
2018-03-26 12:57:19 -07:00
Sebastian Ullrich
80d68a7605
chore(tests/lean/leanpkg/test_single): ignore empty lines around warning
2018-03-20 15:14:45 -07:00
Sebastian Ullrich
7daf6a2133
refactor(init/category): change _functor classes into new _adapter classes, add docs
2018-03-20 14:58:37 -07:00
Sebastian Ullrich
70167def6f
refactor(init/category/state): replace monad_state_lift with Haskell's MonadState
...
* does not leak information about the inner monad via out_param
* can be derived from an inner `monad_state` instance
2018-03-20 14:58:37 -07:00
Sebastian Ullrich
3adc5113cb
feat(init/category/state): make zoom work linearly
2018-03-20 14:58:36 -07:00
Sebastian Ullrich
da5c8e21df
chore(init/category/cont): move to test
2018-03-20 14:58:36 -07:00
Sebastian Ullrich
e6f5ce1303
doc(init/category/reader): add docs and test
2018-03-20 14:58:36 -07:00
Sebastian Ullrich
e044030cd2
doc(init/category/cont): add docs and test
2018-03-20 14:58:36 -07:00
Sebastian Ullrich
c104d5d34b
doc(init/category/state): add docs and tests
2018-03-20 14:58:36 -07:00
Sebastian Ullrich
b372dd94d3
feat(init/category/transformers): add monad_run class
2018-03-20 14:58:36 -07:00
Sebastian Ullrich
69cfdbd290
refactor(init/category): make all monad transformers structures, replace monad classes with has_monad_lift_t wrappers
2018-03-20 14:58:36 -07:00
Sebastian Ullrich
c36393066e
feat(init/category): introduce monad_functor and implement it for reader, state, and except
2018-03-20 14:58:36 -07:00
Sebastian Ullrich
788e8695eb
refactor(init/category/state): replace modify/put (returning unit) with modify'/put' (returning punit)
2018-03-20 14:58:35 -07:00
Sebastian Ullrich
940aca1ec3
refactor(init/category/lawful): unbundle lawful classes
2018-03-20 14:58:35 -07:00
Sebastian Ullrich
159b45c74f
refactor(init/category/state): introduce monad_state
...
* rename `read/write` to `get/put`, as in Haskell
* define `state` as `state_t id`
2018-03-20 14:58:35 -07:00
Sebastian Ullrich
1c6861528b
refactor(init/category): move monad laws into separate type classes defined after the tactic framework
2018-03-20 14:58:35 -07:00
Sebastian Ullrich
63382cf7e3
chore(init/category/transformers): move monad_transformer, monad_lift out of monad namespace, make universe polymorphic
2018-03-20 14:58:35 -07:00
Leonardo de Moura
169cd87dbe
feat(library/system/io): add io.run_tactic
...
@nunoplopes @aqjune
I had to add a new primitive to allow you to execute a tactic from the
`main` function. The `main` function is in the `io` monad. The new
primitive has type:
```
meta constant io.run_tactic {α : Type} (a : tactic α) : io α
```
I also added a new test that shows how to use it.
The test displays all declarations that have the `nat` prefix.
cc @kha
2018-03-07 12:15:26 -08:00
Leonardo de Moura
832d2358f1
test(tests/lean/run/1942): closes #1942
...
It seems the assertion violation has been fixed by recent changes.
2018-03-06 17:43:08 -08:00
Leonardo de Moura
2889482fe9
fix(library/init/meta/interactive): fixes #1943
2018-03-06 17:36:18 -08:00
Leonardo de Moura
d569533bf5
chore(tests/lean/try_for_heap): disable expensive test
2018-03-05 17:55:01 -08:00
Leonardo de Moura
0492f254b7
chore(library/data/dlist): remove rsimp dependency
...
Reason: `rsimp` is based on the smt framework. The smt framework
has to be reimplemented. Moreover, the smt framework is currently
not using the new cache infrastructure and we pay a substantial
performance penalty.
2018-03-05 17:09:08 -08:00
Sebastian Ullrich
d6d44a1994
fix(frontends/lean/pp): fix #1922
...
Fixes #1922
2018-03-02 13:02:48 -08:00
Sebastian Ullrich
1abf8738fc
feat(frontends/lean/structure_cmd): allow implicitness infer annotation and parameters in field declaration
2018-02-28 12:49:22 +01: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
Sebastian Ullrich
5279f92dae
fix(library/tactic/simp_lemmas): avoid rewrite failure with more robust code
...
The old code assumed `emetas` to be descendingly ordered by tmp idx, which is
not true for rfl lemmas.
2018-02-27 10:59:51 -08:00
Leonardo de Moura
a962efdcd1
fix(library/tactic/cases_tactic): fixes #1836
2018-02-26 15:32:03 -08:00
Leonardo de Moura
421f2c2ae2
fix(library/tactic/subst_tactic): subst was creating type incorrect motive when using dependent elimination
...
This commit fix a bug reported at comment
https://github.com/leanprover/lean/issues/1827#issuecomment-368258713
Remark: the original problem reported at issue #1827 has nothing to do
with this bug.
2018-02-26 14:02:10 -08:00
Leonardo de Moura
b9a131d5c2
chore(tests/lean/revert_frozen_dep): fix test
2018-02-23 12:43:06 -08:00
Leonardo de Moura
21812768b0
fix(library/init/meta/interactive): fixes #1889
2018-02-23 12:39:11 -08:00
Leonardo de Moura
6c3d90e20e
fix(library/type_context): type_context was not checking if to_revert dependencies were frozen
2018-02-23 11:59:18 -08:00
Leonardo de Moura
24e7a5a339
feat(library/tactic): add frozen_local_instances tactic for retrieving list of frozen local instances
2018-02-23 11:39:38 -08:00
Leonardo de Moura
db4fcac40c
feat(library): add tactic unfreeze_local_instances
2018-02-23 11:12:05 -08:00
Leonardo de Moura
46ed0ad677
refactor(library/congr_lemma): remove mk_rel_iff_congr_lemma and mk_rel_eq_congr_lemma
2018-02-21 15:04:20 -08:00
Leonardo de Moura
c176faed32
feat(kernel/inductive): make sure constructor types do not contain local constants nor metavariables
2018-02-21 15:04:19 -08:00
Leonardo de Moura
56dba5b98a
fix(frontends/lean/elaborator): fixes #1930
...
@kha the following idiom is not safe
```
while (is_pi(t)) {
t = whnf(binding_body(t));
}
```
`whnf(e)` assumes that `e` does not have dangling deBruijn variables.
We should use (the more expensive):
```
while (is_pi(t)) {
t = whnf(instantiate(binding_body(t), locals.push_local_from_binding(t)));
}
```
BTW, this problem is not related to the assertion violation at #1930
I just stumbled on it when fixing the violation.
2018-02-19 08:51:26 -08:00
Leonardo de Moura
e023b1001a
fix(library/system/random): bug at rand_nat
2018-02-16 11:20:43 -08:00
Leonardo de Moura
96fab5172f
perf(library/compiler): apply lambda lifting after erase trivial structures
...
cc @kha
2018-02-15 16:55:27 -08:00
Leonardo de Moura
1c9648a12d
chore(library): remove dead constants
2018-02-15 16:17:43 -08:00
Leonardo de Moura
ac13f8b0f9
feat(library/system/io): add random number generator support in the io monad
...
@aqjune @nunoplopes: See new tests at tests/lean/run/random.lean
We have two actions in `io`. By default, `io` uses the C++
random number generator, but we can force it to use a `std_gen` with
the action `set_rand_gen`.
def rand (lo : nat := std_range.1) (hi : nat := std_range.2) : io nat
def set_rand_gen : std_gen → io unit
2018-02-15 16:12:08 -08:00
Leonardo de Moura
f786d21b0f
feat(library/system): basic support for random numbers
...
@aqjune @nunoplopes: This commit adds basic support for random numbers.
It defines a random number generator interface, and an basic
implementation based on the Haskell one.
We can add more implementations in the future if neeeded.
The new test program has a few examples.
BTW, this is a pure Lean implementation.
If we need more performance we can provide an implementation
using C++.
2018-02-15 14:36:28 -08:00
Leonardo de Moura
96e02613fc
fix(library/compiler/simp_inductive): erase trivial structure bug
2018-02-11 11:43:05 -08:00
Leonardo de Moura
30cfcc0fa6
fix(library/compiler/inliner): missing reduction
2018-02-11 09:28:42 -08:00