Leonardo de Moura
28b8020995
fix(library/type_context): bug in the unifier
...
One of the approximations used was generating type incorrect terms.
2018-01-30 12:48:48 -08:00
Leonardo de Moura
39f1cc0bab
test(tests/lean/run): add new tests exposing bug in the unifier
...
This commit also documents the problem at type_context.cpp, and
describes a potential solution.
2018-01-30 12:48:48 -08:00
Gabriel Ebner
aac833c8d4
test(tests/lean/run): test for mk_inj_eq
2018-01-28 09:10:26 -08:00
Leonardo de Moura
77ae133baa
fix(library/type_context): preprocess_class
...
@kha This commit fixes the bug we discussed on slack.
I had to repair one of the tests. The broken test made me
realize that if we use the unbundled approach to define something like
`is_semiring`
```
class is_semiring (α : Type) (plus : α → α → α) (mul : α → α → α) (zero : out_param α) (one : out_param α) :=
...
```
Then, to retrieve a `is_semiring` instance, we need to know `α`, `plus`
and `mul`. This is problematic because we may be in a context where one
of them cannot be inferred. This would force user to manually provide
the missing (input) parameter. We are not considering the unbundled
approach for complex algebraic structures such as `semiring`, `ring` and
`field`, but I wanted to document this limitation here since we may face
it in other type classes.
I think it is a bad idea to add back `inout_param` and have both:
`inout_param` and `out_param`. The previous `inout_param` created
many instabilities and hard to diagnose failures.
2018-01-24 17:30:04 -08:00
Leonardo de Moura
d4e1a4a50a
chore(library/system/io): tactic.run_io ==> tactic.unsafe_run_io
2018-01-24 10:32:32 -08:00
Leonardo de Moura
0d83a74b26
fix(library/io,tests/lean): io monad command line arguments, and tests
2018-01-23 15:24:41 -08:00
Leonardo de Moura
0ad5497462
refactor(library/io): make io easier to extend and use
2018-01-23 15:03:31 -08:00
matt rice
1538615e8c
feat(util): allow some math alphanum symbol latin letter variations
...
Add the Script, Double-struck, and Fractur blocks from,
https://unicode.org/charts/PDF/U1D400.pdf
to is_letter_like() so they may be bound to variables.
2018-01-23 11:20:05 -08:00
Leonardo de Moura
368f17d0b1
feat(library/tactic/simplify): add simp!
2018-01-16 17:29:24 -08:00
Leonardo de Moura
c195d7c2a1
feat(library/tactic/simp_tactic): improve mk_simp_attr
...
- An new simp attribute may depend on other existing attributes
- Add `[norm]` simp attribute. It is an extension of the default `[simp]` attribute.
It should be used to add extra rules for normalizing goals.
These extra rules are used to produce normal forms and/or reduce the
number of constants used in a goal. Here is an example coming from a
discussion with @kha. When working with monads, we may want to
eliminate `<$>` by using the lemma `f <$> x = x >>= pure ∘ f`.
This lemma is in the `[norm]` simp set, but it is not in `[simp]`
2018-01-16 16:47:30 -08:00
Leonardo de Moura
6635f6c8c1
chore(library/init/coe): document why @[reducible] annotation is needed
2018-01-16 11:31:43 -08: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
9eb22cd548
feat(library/constructions/injective): automatically generate auxiliary lemma *.inj_eq for constructors
...
We are going to use these lemmas in the simplifier.
2018-01-12 16:41:12 -08:00
Leonardo de Moura
58fce78282
feat(library/init/meta/interactive): add interactive tactic subst_vars
2018-01-12 14:37:11 -08:00
Leonardo de Moura
5bad6d5372
feat(library/init/meta/tactic): subst supports heterogeneous equalities that are actually homogeneous
2018-01-12 14:32:49 -08:00
Leonardo de Moura
1437d7209a
feat(library/tactic/simplify): add support for generalized inductive datatypes
2018-01-12 11:51:49 -08:00
Leonardo de Moura
c5df94ed17
feat(library/tactic): add support for auto params at simp tactic
2018-01-11 16:47:22 -08:00
Leonardo de Moura
c2bd8626d7
fix(library/type_context): put back same_head_symbol heuristic
...
The timeout at qed_perf_bug test demonstrates why it is useful.
2018-01-09 15:31:33 -08:00
Leonardo de Moura
96792cd9aa
chore(tests/lean): fix tests
2018-01-09 15:09:32 -08:00
Leonardo de Moura
43d7bac49b
feat(library/init/meta): add support for new unify at rw tactic
2018-01-04 13:05:55 -08:00
Leonardo de Moura
040722c7e7
feat(library/init/meta): add unify config option to apply_cfg
...
This commit also fixes a problem in the `apply` tactic error messages.
2018-01-04 12:51:59 -08:00
Leonardo de Moura
d0dfb3f9f9
fix(library/tactic/simp_lemmas): closes #1863
2017-12-20 15:12:02 -08:00
Leonardo de Moura
c6ddc51c2b
fix(library/app_builder): typo at mk_congr
...
closes #1893
2017-12-20 13:13:55 -08:00
Leonardo de Moura
a2dc2b6549
fix(util): null_output_channel
...
On OSX, Lean was often crashing when using trace messages.
I identified a problem in the thread finalization process.
In OSX, the `silent_ios_helper` at `library/trace.cpp` was being
finalized after the `null_streambuf` at `util/null_ostream.cpp`.
There was also a memory corruption problem also related to
`null_streambuf`.
This commit fixes this problem by using the following recipe
for creating null output stream buffers in C++.
https://stackoverflow.com/questions/11826554/standard-no-op-output-stream
2017-12-20 11:50:41 -08:00
Leonardo de Moura
91ff183b3e
chore(library): remove out notation for out_param
2017-12-15 15:47:58 -08:00
Leonardo de Moura
f0352d31a1
feat(library/type_context, library): inout ==> out modifier in type class declarations
...
@kha: I decided to implement this change before I start the
type_context modifications. The change did not affect the corelib and
test suite much. The only annoying problem is that `out` cannot be
used to name locals anymore.
2017-12-15 14:46:47 -08:00
Leonardo de Moura
0492e49a3f
fix(library/type_context): fixes #1888
2017-12-15 08:49:45 -08:00
Leonardo de Moura
6c44dd1b7f
feat(frontends/lean): add hide command
...
cc: @kha
2017-12-13 11:53:21 -08:00
Leonardo de Moura
056a7db7b3
test(tests/lean/run): heap interface experiments
...
They expose limitations in the elaborator.
2017-12-12 18:19:30 -08:00
Leonardo de Moura
533ddc0279
fix(library/init/meta/interactive): remove buggy generalizing param from with_cases
2017-12-11 16:27:04 -08:00
Leonardo de Moura
5217ae735d
feat(library/init/meta/interactive): do not make tag longer when constructor/apply create a single subgoal
2017-12-11 16:27:03 -08:00
Leonardo de Moura
f0231f17bc
feat(library/init/meta): propagate tags in constructor-like tactics
2017-12-11 16:27:03 -08:00
Leonardo de Moura
e23db3970a
feat(library/init/meta/tactic): apply tactic return parameter name associated with new metavars
2017-12-10 12:11:58 -08:00
Leonardo de Moura
8577fe6984
fix(library/init/meta/interactive): induction ... generalizing ... bug
2017-12-10 08:57:25 -08:00
Leonardo de Moura
24d5a1592d
fix(library/init): add simp lemmas for auto_param and opt_param
2017-12-09 09:59:00 -08:00
Leonardo de Moura
ef784ce7b8
fix(library/tactic/simp_lemmas): auto_params when adding simp lemmas
2017-12-09 09:47:39 -08:00
Leonardo de Moura
9fff5ff710
chore(tests/lean/run): fix tests
2017-12-06 16:04:24 -08:00
Leonardo de Moura
a056e87350
fix(library/init/meta/injection_tactic): add support for ginductive datatypes
2017-12-06 09:39:20 -08:00
Leonardo de Moura
9dd382f649
chore(tests/lean): fix tests
2017-12-05 15:36:58 -08:00
Leonardo de Moura
458958b9fc
feat(kernel/inductive): use ih to name induction hypothesis (instead of ih_1) when there is only one
2017-12-05 13:50:24 -08:00
Leonardo de Moura
6d96741010
feat(library): provide names for constructor arguments
...
Motivation: `cases` and `induction` tactics use these names when the
user does not provide them.
2017-12-04 16:25:16 -08:00
Leonardo de Moura
c943576e5a
feat(library/init): add funext tactic
2017-12-04 14:54:39 -08:00
Leonardo de Moura
53c9737c70
feat(library/init): new repeat tactic
2017-12-04 12:55:53 -08:00
Leonardo de Moura
b7322e28c1
feat(library): do not using simp lemmas for sorting arguments of AC operators by default
2017-12-03 15:03:58 -08:00
Sebastian Ullrich
0ca9eb16c1
fix(library/type_context): preprocess_class: always solve universe mvars in inout
2017-11-29 17:21:02 -08:00
Leonardo de Moura
960832045f
fix(library/type_context): failure condition
2017-11-29 14:35:58 -08:00
Sebastian Ullrich
18cf63e37f
fix(frontends/lean/elaborator): avoid assertion error on delayed abstraction in structure notation
2017-11-24 21:27:55 +01:00
Leonardo de Moura
47994fe14e
chore(library): remove id_locked
2017-11-22 16:29:04 -08:00
Leonardo de Moura
64f575a2d5
perf(library/equations_compiler): performance problem for definitions that produce many equational lemmas
...
The new test and comment at src/library/equations_compiler/util.cpp
explains the issue.
2017-11-22 16:16:11 -08:00
Leonardo de Moura
dd9d8e9552
chore(library/equations_compiler): improve comments
2017-11-22 14:55:40 -08:00