Commit graph

326 commits

Author SHA1 Message Date
Leonardo de Moura
77d3a788e8 refactor(init): init/category ==> init.control 2018-04-27 08:33:08 -07:00
Leonardo de Moura
0af913c99f refactor(library/init/data/string): define decidable_eq string instance earlier 2018-04-27 08:16:14 -07:00
Leonardo de Moura
9e9a0d103f feat(library/vm/vm_string): add fast string.iterator.remaining 2018-04-26 18:03:41 -07:00
Leonardo de Moura
3091ca3441 feat(library/init/data/char): use bool instead of Prop for basic char predicates 2018-04-26 13:46:59 -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
Leonardo de Moura
cd4f196842 chore(library/init/data/option/basic): dead code 2018-04-25 17:19:11 -07:00
Leonardo de Moura
51e0987af2 feat(library/init/data/rbtree): add rbtree.seteq 2018-04-25 16:13:38 -07:00
Leonardo de Moura
50328d62e1 feat(library/init/data): add uint16 and make sure uint* - uses wraparound semantics like most programming languages 2018-04-20 18:27:13 -07:00
Leonardo de Moura
1ad1080f11 refactor(library): keep only basic nat theorems
All theorems are proved without using the tactic framework.
Thus, we can define `fin/uint32/uint64` types and their operations
before we define the tactic framework.
2018-04-11 16:47:54 -07:00
Leonardo de Moura
75f91df707 chore(library/init/data/fin/ops): remove unnecessary ops 2018-04-10 16:41:18 -07:00
Leonardo de Moura
ce0467638e chore(*): remove unification hints 2018-04-10 16:29:04 -07:00
Leonardo de Moura
0bcf5c8f5d chore(*): remove algebra 2018-04-10 15:53:14 -07:00
Leonardo de Moura
7aaac31e35 chore(library/init/data/nat): remove dependency 2018-04-10 15:48:13 -07:00
Leonardo de Moura
b0e49535fa chore(*): remove transfer and coinductive predicates 2018-04-10 13:38:18 -07:00
Leonardo de Moura
c03d351744 chore(library/init/data/int): keep only definitions 2018-04-10 13:29:06 -07:00
Leonardo de Moura
a023128738 chore(*): reduce corelib 2018-04-10 13:11:40 -07:00
Leonardo de Moura
a2f0bf7c1b chore(*): disable SMT tactic framework and backward chaining 2018-04-10 12:05:51 -07:00
Sebastian Ullrich
8f55ec4c50 fix(init/core): remove out_param from has_pow
With the current elaboration scheme, out_params and coercions do not mix well,
as evidenced by the following example by @digama:

```
variables {α : Type*} [group α]
def gpow : α → ℤ → α := sorry
instance group.has_pow : has_pow α ℤ := ⟨gpow⟩

example (a : α) : a ^ 0 = 1 := sorry -- failed to synth ⊢ has_pow α ℕ
example (a : α) : a ^ (0:ℕ) = 1 := sorry -- ok, coerces
example (a : α) : a ^ (0:ℤ) = 1 := sorry -- ok
```

The issue is that
* we first try to solve `has_pow ?α ?β`, which is postponed
* then infer `?α = nat` from `a`
* then at some point call `elaborator::synthesize()` and default `β` to `nat`
* then try to solve `has_pow nat nat`, which fails at `int =?= nat`
2018-04-04 13:05:59 +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
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
Sebastian Ullrich
0f7a8907c7 fix(init/data/default): add missing files 2018-03-22 00:15:56 +01:00
Sebastian Ullrich
23884d2863 refactor(init/data/option_t): move to init/category and adapt style 2018-03-20 14:58:36 -07:00
Sebastian Ullrich
bcbe5ec9f4 refactor(init/category/functor): merge has_map into functor 2018-03-20 14:58:36 -07:00
Sebastian Ullrich
97496509d7 feat(init/data/option_t): add has_monad_lift instance 2018-03-20 14:58:36 -07:00
Sebastian Ullrich
afe3078b4b chore(init/category): final touches 2018-03-20 14:58:36 -07:00
Sebastian Ullrich
f4c2499063 chore(init/category/transformers): remove now-unused monad_transformer class, rename to lift.lean 2018-03-20 14:58:36 -07:00
Sebastian Ullrich
940aca1ec3 refactor(init/category/lawful): unbundle lawful classes 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
Sebastian Ullrich
3d63169b44 feat(init): some simp lemmas 2018-03-01 16:07:52 +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
Leonardo de Moura
7762dc381a feat(library/type_context): use context_cache interface 2018-02-21 15:04:20 -08:00
Leonardo de Moura
da032ccc3b feat(library/init/data/nat/lemmas): add lemma for termination proofs 2018-02-21 10:37:07 -08:00
Leonardo de Moura
bddc84664c chore(library/init/data/nat): remove pow.lean 2018-02-20 13:50:23 -08:00
Leonardo de Moura
ddfbaa6c8d fix(library/init/data/nat/basic): missing lemma 2018-02-15 14:36:28 -08:00
Leonardo de Moura
f048da4c98 refactor(library/init/data): replace char.zero_lt_d800 proof
See issue https://github.com/leanprover/tc/issues/8

cc @dselsam
2018-02-15 14:36:28 -08:00
Sebastian Ullrich
0fe561d063 feat(init/function): comp_app simp lemma 2018-02-02 08:58:52 -08:00
Leonardo de Moura
c132f555a9 fix(library/init/data/list/instances): decidable_bex
The previous `decidable_bex` was using a nasty hack.
First, it was relying on a bug in the local_context object that was
fixed at commit 6060b75e6. Note that, the type class resolution
will be even more restrictive after we implement the fix described at a75b0d8ee.
Second, it was built using tactics that are meant for constructing
proof irrelevant code (e.g., `simp`).
2018-02-01 18:30:52 -08:00
Mario Carneiro
316d67c3be fix(library/init/data/setoid): fix redundant parameter
`setoid.refl` has two instances of `setoid A` in it
2018-01-28 15:49:35 -08:00
Mario Carneiro
147436bfb8 fix(init/data/nat/lemmas): generalize nat.iterate to (Sort u) 2018-01-16 11:37:33 -08:00
Sebastian Ullrich
c64284a377 perf(init/data/string/ops): make string.split linear 2018-01-15 10:51:27 +01:00
Sebastian Ullrich
ff346f875b feat(init/data/string/ops): add string.split 2018-01-15 09:58:19 +01:00
Leonardo de Moura
cebde17bec feat(library/tactic/simplify): simp reduces c a_1 ... a_n = c b_1 ... b_n into a_1 = b_1 /\ ... /\ a_n = b_n 2018-01-12 18:18:56 -08:00
Leonardo de Moura
4bd314f7bd feat(library/tactic/simplify): simp reduces c_1 ... = c_2 ... to false 2018-01-12 11:30:45 -08:00
Leonardo de Moura
26da50ab0e feat(library/vm/vm_string): efficient iterator.extract
@kha I've added

   iterator.extract : iterator -> iterator -> option string

It returns `none` if the iterators are "incompatible".
If this function is inconvenient to use, we can change it and return the
empty string in these cases.

Given iterators `it1` and `it2`, if they are sharing the same string
object in memory, then the cost is O(pos(it2) - pos(it1)).
If not, we have an extra O(N) step where we check whether the strings
being iterated by it1 and it2 are equal (`N` is the size of the strings).
In most applications, I believe the iterators will share the string
object.

I didn't test the code much. BTW, I found an unrelated bug at
vm_string.cpp. So, I'm not very confident this code is rock solid.
2018-01-10 13:27:28 -08:00
Leonardo de Moura
6ab792733d feat(library/type_context): smart unfolding
closes #1794
2018-01-09 15:09:08 -08:00
Leonardo de Moura
746134d11c feat(library/init/meta/interactive): add goal tagging support for by_cases
This commit also incorporates changes suggested at commit 84a1911949dec94.
2017-12-13 15:17:13 -08:00
Mario Carneiro
17f77367cd chore(library/init/data/fin/ops): revert 107ad36259. 2017-12-12 10:53:12 -08:00
Sean Leather
107ad36259 feat(library/init/data/fin/ops): fin.succ.inj 2017-12-12 04:23:01 -05: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