Sebastian Ullrich
1c389cb925
chore(init/meta/interactive): hide rw ASCII notation in syntax description
2017-07-06 14:03:08 +02:00
Jeremy Avigad
5fd113f50f
feat(library/init/logic): add simp rule for 'true implies p'
2017-07-05 14:26:04 -07:00
Leonardo de Moura
70ade81a30
feat(library/init/meta/interactive): allow user to set configuration options at unfold_projs
...
See issue #1725
2017-07-05 13:00:43 -07:00
Leonardo de Moura
9645e7588e
chore(library/init/data): recent changes
2017-07-05 12:44:56 -07:00
Mario Carneiro
b557d9012d
refactor(init/data/nat/gcd): swap args in gcd.induction
...
to match swapped induction arg of gcd
2017-07-05 12:37:54 -07:00
Mario Carneiro
a1cfce88d5
feat(init/data/list): filter theorems, non-meta qsort
2017-07-05 12:37:54 -07:00
Mario Carneiro
8920d55f8d
feat(init/logic): decidability of partial functions
2017-07-05 12:37:54 -07:00
Mario Carneiro
35ed9e9301
feat(init/data/ordering): ordering.or_else, string lex order
2017-07-05 12:37:54 -07:00
Mario Carneiro
90fc8b1d45
feat(init/logic): mark dif_pos and dif_neg as @[simp]
...
This is needed for simplifying `dite` after a case split
2017-07-05 12:37:54 -07:00
Mario Carneiro
387c7d46b4
refactor(init/data/fin/basic): shorten fin dec eq proof
2017-07-05 12:37:54 -07:00
Mario Carneiro
42d26a3954
feat(init/data/array): array theorems
2017-07-05 12:37:54 -07:00
Mario Carneiro
1ca6aba076
feat(data/buffer): decidable_eq instance
2017-07-05 12:37:54 -07:00
Mario Carneiro
9fc04ae812
feat(init/data/option/instances): = none of is_none
2017-07-05 12:37:54 -07:00
Mario Carneiro
0172c17447
feat(init/data/bool/lemmas): theorems about to_bool and bool coercion
2017-07-05 12:37:54 -07:00
Mario Carneiro
e2a3331c7c
refactor(init/data/option/instances): option_map
2017-07-05 12:37:54 -07:00
Mario Carneiro
803af7cd63
feat(library/data/stream): more stream theorems
2017-07-05 12:37:53 -07:00
Mario Carneiro
1e2157e210
fix(init/meta/constructor_tactic): constructor tac uses whnf
2017-07-05 12:37:53 -07:00
Leonardo de Moura
d0242a3631
chore(library/init/meta/simp_tactic): cleanup
2017-07-05 12:14:26 -07:00
Leonardo de Moura
1bc9af53f2
fix(library/init/meta/simp_tactic): fixes #1724
2017-07-05 11:59:23 -07:00
Leonardo de Moura
bb9e3ddae2
feat(library/init/meta/interactive): rw [-h] ==> rw [← h]
...
@Armael: this change may affect your project.
The file `doc/changes.md` explains the motivation for the change.
2017-07-05 11:42:55 -07:00
Sebastian Ullrich
30f4b2f2dd
refactor(library): list.taken/dropn ~> list.take/drop
2017-07-05 11:20:10 -07:00
Sebastian Ullrich
c8d6b40991
refactor(frontends/lean/builtin_exprs,library): suppose ~> assume :
2017-07-05 11:20:10 -07:00
Sebastian Ullrich
f024ccd75d
refactor(frontends/lean/token_table,library): take ~> assume
2017-07-05 11:20:10 -07:00
Sebastian Ullrich
2ca44459ba
feat(init/meta/interactive): add from synonym for exact
2017-07-05 11:20:10 -07:00
Sebastian Ullrich
ad97607307
fix(frontends/lean/tactic_notation): always use quote_scope for parsing interactive parameters
...
Replace now redundant `qexpr` parser with `parser.pexpr`
2017-07-04 12:20:38 -07:00
Sebastian Ullrich
c3d4c468e6
fix(init/meta/interactive): whnf in assume tactic
2017-07-04 12:20:38 -07:00
Leonardo de Moura
dd3616dd16
feat(library/init/meta/interactive): simp_all ==> simp * at *
...
cc @Kha
2017-07-04 11:57:16 -07:00
Leonardo de Moura
d0ab9d0cd1
feat(library/init/meta/interactive): simp * as shorthand for simp [*]
2017-07-04 11:57:16 -07:00
Leonardo de Moura
44c901bf11
fix(library/init/meta/interactive): make sure all input hypotheses are simplified before we clear the old ones
...
The new test exposes the bug.
The bug is similar to the one at `simp [h] at *` described at issue #1675
2017-07-03 21:58:55 -07:00
Leonardo de Moura
abef98c772
refactor(library/init/meta/simp_tactic): make sure dunfold tactics use name convention used at simp, dsimp, ...
2017-07-03 21:36:17 -07:00
Leonardo de Moura
b86847ec72
fix(library/init/logic): mark eq.substr with [elab_as_eliminator]
...
See issue #1718
2017-07-03 17:27:41 -07:00
Leonardo de Moura
e24f3341d4
feat(library/init/meta/interactive): simp without foo ==> simp [-foo]
...
This commit also adds "exception" validation.
A bad "exception" was being silently ignored.
We can also exclude hypotheses. Example: `simp [*, -h]`
2017-07-03 17:10:46 -07:00
Leonardo de Moura
76799db032
feat(library/init/meta/interactive): simph ==> simp [*]
...
This modification was suggested by @kha.
TODO:
- Use `simp [-f]` instead of `simp without f`
- Allow users to remove hypothesis from `*`. Example: `simp [*, -h]`
for simplify using all hypotheses but `h`.
2017-07-03 15:14:47 -07:00
Leonardo de Moura
69ed291aab
refactor(library/init/meta/simp_tactic): tactic.simp_at => tactic.simp_hyp
2017-07-03 14:07:18 -07:00
Leonardo de Moura
34c212fa53
refactor(library/init/meta/simp_tactic): cleanup simp_intros mess
2017-07-03 13:46:16 -07:00
Leonardo de Moura
6b3e28d30b
feat(library/init/meta/simp_tactic): add option for reducing [reducible] definitions at dsimp, and to_unfold : list name similar to the one in the simp tactic
...
This complete addresses the two pending items at 16711fcdba
2017-07-03 13:28:46 -07:00
Leonardo de Moura
9a41f0f899
fix(library/init/meta/tactic): by_cases tactic
...
Before this commit, the `by_cases p` tactic would synthesize
`inst : decidable p` type class resolution, and then use the
`cases` tactic (dependent elimination). This would create
problems since occurrences of `inst` would be replaced with
`decidable.is_true h` in one branch, and `decidable.is_false h` in the
other. Where `h`s (we have two of them, one for each branch) are
fresh hypotheses introduced by the `cases` tactic.
For example, assume we have the term in our goal.
`@ite p inst A a b`
This term would become
`@ite p (decidable.is_true h) A a b` (in the first branch where `h : p`)
and
`@ite p (decidable.is_false h) A a b` (in the second where `h : not p`)
Now, suppose we try to executed the following tactic in the first branch
`rw [if_pos h]`
it will fail since `if_pos h` is actually `@if_pos p inst h`, and
we will not be able to unify
`@ite p (decidable.is_true h) A a b =?= @ite p inst ?A ?a ?b`
This commit workarounds this problem by applying cases on
`@decidable.em p inst : p or not p` instead of `inst : decidable p`.
Thus, the term `inst` is not replaced with `decidable.is_true h` and
`decidable.is_false h`.
The new test `tests/lean/run/simp_dif.lean` demonstrates the problem above.
2017-07-02 21:34:10 -07:00
Leonardo de Moura
16711fcdba
feat(library/tactic/dsimplify): new configuration options for dsimp
...
TODO for `dsimp`:
- Add an option for reducing [reducible] definitions
- Add (to_unfold : list name) similar to the one in the `simp` tactic
2017-07-02 18:26:03 -07:00
Leonardo de Moura
df091f5c34
feat(library/init/meta/interactive): simp and unfold can unfold projection applications
...
@Armael: we finally can write `simp [proj]` to unfold the `proj`
projection application.
Remark: we still need to add similar support for `dsimp`.
2017-07-02 16:28:04 -07:00
Leonardo de Moura
76eed7cb41
chore(library/init/meta): add to_unfold parameter to simplify, and remove redundant simp* tactics
...
Remark: the `to_unfold` has not been implemented yet.
2017-07-02 15:26:06 -07:00
Leonardo de Moura
d44f0bfb9e
chore(library/init/meta/simp_tactic): fix typo
2017-07-02 11:53:00 -07:00
Leonardo de Moura
70b27fb2d3
feat(library/init/meta/interactive): unfold is now based on the simp framework
...
See issue #1694 .
There is an orthogonal issue. `simp` (and consequently `unfold`) cannot be used to
reduce projections (e.g., `has_add.add`). This issue has been
previously raised by @Armael, but it was not addressed yet.
2017-07-02 11:30:48 -07:00
Leonardo de Moura
7b802392ed
fix(library/init/meta/simp_tactic): simp_all should fail if nothing was simplified
2017-07-01 21:06:07 -07:00
Leonardo de Moura
01003b79cc
fix(library/init/meta/interactive): simp [...] at *
...
closes #1675
After this commit, the following example works as expected.
```
example (p : nat → Prop) (a b : nat) : a = 0 ∧ b = 0 → p (a + b) → p 0 :=
begin
intros h₁ h₂,
simp [h₁] at *,
/- produces the state
(p : nat → Prop) (a b : nat)
h₁ : true
h₂ : p 0
|- p 0
-/
assumption
end
```
as expected.
Remark: the original issue raised by issue #1675 is actually solved by the
`simp_all` tactic.
2017-07-01 20:50:46 -07:00
Leonardo de Moura
3422c8816e
feat(library/init/meta/simp_tactic): improved simp_all tactic
...
It now performs self simplification, and the performance is slightly
better. As described at issue #1675 , only non dependent propositions
are considered.
@Armael: this tactic may be useful for you
2017-07-01 20:26:29 -07:00
Leonardo de Moura
d73facb8bc
feat(library/init/meta/expr): add expr.has_local_in
2017-07-01 20:23:37 -07:00
Leonardo de Moura
4604d7fd5a
feat(library/init/meta): allow users to specify tactic for discharging subgoals in the simp tactic family
...
@dselsam @Armael: this feature may be useful for you.
The doc/changes.md describes many other new features.
2017-07-01 15:35:33 -07:00
Leonardo de Moura
7c35fae9e3
refactor(library/init/meta/simp_tactic): merge simplify_core and simplify
2017-07-01 14:13:49 -07:00
Leonardo de Moura
799f0711d6
refactor(library/init/meta/simp_tactic): cleanup simp_lemmas.rewrite_core and simp_lemmas.drewrite_core
2017-07-01 13:04:26 -07:00
Leonardo de Moura
cf70df8a59
refactor(library/init/meta/simp_tactic): default_max_steps should not be in the top level
2017-07-01 12:57:00 -07:00