Commit graph

13402 commits

Author SHA1 Message Date
Leonardo de Moura
dbeafaaeed chore(library/compiler/util): remove dead code 2018-02-02 08:34:14 -08:00
Leonardo de Moura
a6a1f7d874 chore(library/type_context): remove dead code from type_context 2018-02-02 08:30:01 -08:00
Leonardo de Moura
ffc04fd7df fix(library/tactic/smt): add temporary hack to workaround revert-all issue 2018-02-01 19:25:16 -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
Leonardo de Moura
8c9cee3efc doc(tmp/fresh_name): document impact of new mk_fresh_name design on thread local caches 2018-02-01 18:06:19 -08:00
Leonardo de Moura
a75b0d8eeb doc(library/local_context): document bug in the m_instance_fingerprint management 2018-02-01 18:03:46 -08:00
Leonardo de Moura
6060b75e62 fix(library/local_context): propagate m_instance_fingerprint 2018-02-01 17:46:31 -08:00
Leonardo de Moura
50a43da17c doc(tmp/fresh_name): plan for fixing mk_fresh_name
@kha If you have time, could you please take a look and send feedback.
I may be forgetting other problems and issues related with `mk_fresh_name`.
2018-02-01 16:19:25 -08:00
Leonardo de Moura
ec1a490a15 chore(*): annotate candidates for thread local cache reset 2018-02-01 14:59:37 -08:00
Leonardo de Moura
73b97084f7 chore(library/tactic): ac_manager ==> ac_manager_old
We will build the new one in `library/`
2018-02-01 12:39:43 -08:00
Leonardo de Moura
77767d5cb0 doc(library/tactic/ac_tactics): document another problem with ac_tactics module 2018-02-01 12:20:41 -08:00
Gabriel Ebner
6da6c143e6 fix(CMakeLists): emscripten build 2018-02-01 15:12:43 +01:00
Sebastian Ullrich
7644de75d8 chore(doc/make/msys2): link generic build instructions 2018-02-01 10:46:12 +01:00
Sean Leather
ddfd52b863 fix(doc/make/index.md): link typo 2018-02-01 09:53:26 +01:00
Leonardo de Moura
e6a98ffe9c feat(library/type_context): improve unifier first-order approximation
@kha We can now solve unification constraints of the form

         ?m unit =?= itactic

I'm not very confident this new extension will improve usuability
instead of creating new counter-intuitive behavior.
At least, in the process of implementing it, I fixed two bugs,
and removed a nasty hack that was being used in the unifier.
Thus, even if we disable this feature in the future, some good came out
of it.

Although, the new extension locally increases the number of constraints
that can be solved, it may prevent terms that could be elaborated before
from being elaborated. I am not too concerned at this point because
I could not construct a natural example. I encountered one case, but it
was due to a problem that I fixed in the previous commit.
I reconstruct it here for the record. Suppose we have a constraint

         ?m_1 ?m_2 =?= itactic

Without the fix from the previous commit, `itactic` would unfold too
`id_rhs Type (tactic unit)`, and the constrain would be solved as

         ?m_1 := (id_rhs Type)
         ?m_2 := (tactic unit)

It succeeds locally, but the elaboration fails later when it tries to
synthesize the type class `has_bind (id_rhs Type)`.
The previous fixes the problem by making sure `itactic` is unfolded to
`tactic unit` as expected. `id_rhs` is an auxiliary definition
used to implement smart unfolding. That being said, the user could in
principle define `itactic` as `@id Type (tactic unit)`, and the constraint

         ?m_1 ?m_2 =?= itactic

will be solved as

         ?m_1 := (@id Type)
         ?m_2 := (tactic unit)

which is not the solution we want.
2018-01-30 15:42:17 -08:00
Leonardo de Moura
8c1665aca0 fix(library/type_context): unfold_definition should remove auxiliary id_rhs marker even when smart unfolding is not used 2018-01-30 15:31:04 -08:00
Leonardo de Moura
815327fc93 fix(library/equations_compiler): bug at pull_nested_rec
closes #1917
2018-01-30 13:49:47 -08:00
Leonardo de Moura
105c838692 chore(library/type_context): remove hack from unifier
This commit removes a hack that forced first-order unification
to be used to solve unification constraints of the form

             ?m a =?= f ?x

during elaboration. The hack force first-order unification
even when `?m a` is a higher order pattern and a precise solution
exists.
Moreover, the example that motivated that hack is not applicable
anymore since the type class `has_mem` is now defined as:
```
class has_mem (α : out_param $ Type u) (γ : Type v) := (mem : α → γ → Prop)
```
instead of
```
class has_mem (α : Type u) (γ : Type u → Type v) := (mem : α → γ α → Prop)
```

cc @kha
2018-01-30 12:48:48 -08:00
Leonardo de Moura
3fa487c153 fix(frontends/lean/decl_util): as-is annotation was leaking into elaborated terms
@kha This commit fixes the repro you sent me. Could you please check
whether it also fixes the original file?
2018-01-30 12:48:48 -08:00
Leonardo de Moura
97ed299ce4 chore(frontends/lean/util): remove dead function 2018-01-30 12:48:48 -08:00
Leonardo de Moura
fa6697ffa8 feat(frontends/lean/pp): add option pp.annotations for debugging purposes 2018-01-30 12:48:48 -08:00
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
Leonardo de Moura
aa1473a6c8 refactor(library/type_context): add process_assignment_fo_approx 2018-01-30 12:48:48 -08:00
Sebastian Ullrich
0f16448bae chore(src/CMakeLists): expose LEAN_IGNORE_OLEAN_VERSION as cmake option CHECK_OLEAN_VERSION 2018-01-30 10:40:07 +01: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
Gabriel Ebner
aac833c8d4 test(tests/lean/run): test for mk_inj_eq 2018-01-28 09:10:26 -08:00
Leonardo de Moura
9331945e8b fix(library/init/meta/interactive): alternative fix for issue at #1913
We also document the problem to make sure we don't spend time again
trying to understand the workaround. This is an instance of a bigger
problem that should be addressed later.
2018-01-28 09:07:11 -08:00
Leonardo de Moura
1c61129d40 feat(library/init/meta/tactic): expose approx at unify and is_def_eq tactics 2018-01-25 22:27:18 -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
b5e2e8ed92 doc(library/module): document the persistent set_option discussion
cc @kha
2018-01-24 17:12:40 -08:00
Leonardo de Moura
adae5b9fa1 chore(library/mpq_macro): delete mpq_macro 2018-01-24 15:24:28 -08:00
Leonardo de Moura
1e626e382f chore(frontends/smt2): remove SMT2 frontend 2018-01-24 15:21:52 -08:00
Leonardo de Moura
2ae080a6d2 doc(library): comment code that need to be refactored for AC matching and algebraic normalizer 2018-01-24 15:09:11 -08:00
Leonardo de Moura
5182b5a081 chore(library/tactic): remove unnecessary dependency 2018-01-24 13:35:47 -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
Leonardo de Moura
cee73e8309 chore(util/lp): remove lp module
It has been moved to Z3.
2018-01-23 12:18:30 -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
Sebastian Ullrich
19f8bfd9eb chore(doc/make): add platform-generic build instructions 2018-01-23 11:14:18 -08:00
Sebastian Ullrich
3a1ede2d73 refactor(leanpkg/config_vars): replace with core lib 2018-01-23 11:14:18 -08:00
Sebastian Ullrich
5c6d15c43d chore(CMakeLists): clean-olean: clean leanpkg as well 2018-01-23 11:14:18 -08:00
Sebastian Ullrich
18c2e3739a feat(library/module_mgr): save .olean files of non-dirty .lean files in server mode
Note, currently there is no way for a dirty file to become non-dirty again
2018-01-23 11:14:18 -08:00
Sebastian Ullrich
67fc899d0d feat(shell/server): sync: default "content" to file content
This mostly simplifies debugging and testing
2018-01-23 11:14:18 -08:00
Sebastian Ullrich
e8c057f1de refactor(library/module_mgr): simplify module loading code 2018-01-23 11:14:18 -08:00
Sebastian Ullrich
1ee945a31f fix(library): store and validate Lean version of .olean files
Fixes #1770
2018-01-23 11:14:18 -08:00
Leonardo de Moura
eef29f6a31 fix(build): cmake_policy(SET CMP0054 NEW) is only available on cmake >= 3.1
See: https://cmake.org/cmake/help/v3.1/policy/CMP0054.html
2018-01-22 18:10:54 -08:00
Nuno Lopes
0d820fa23d fix(build): fix Cygwin build 2018-01-22 18:07:04 -08:00
Leonardo de Moura
eff960d498 feat(library/ac_match): add AC match design notes 2018-01-22 18:04:23 -08:00