Commit graph

10815 commits

Author SHA1 Message Date
Gabriel Ebner
d079f66017 fix(tests/lean/test_single): work around sed on mac 2016-12-23 17:49:20 +01:00
Gabriel Ebner
1e827c1e20 fix(tests/lean/test_single): fix missing_import test on windows 2016-12-23 11:24:45 +01:00
Gabriel Ebner
15157bdf0b feat(frontends/lean/parser): keep going after failed imports 2016-12-23 10:53:47 +01:00
Gabriel Ebner
e3b3de5cf3 fix(module_mgr): guard all accesses to m_mod_info 2016-12-23 18:01:44 +01:00
Leonardo de Moura
104ee1b120 fix(library/tactic/congruence/congruence_tactics): stupid mistake 2016-12-22 20:54:20 -08:00
Leonardo de Moura
6329afc121 chore(library/tactic/congruence/congruence_closure): fix typo 2016-12-22 20:05:02 -08:00
Leonardo de Moura
77737a621d fix(library/tactic/congruence/congruence_closure): name collision, we had congr_lemma_cache in two different modules 2016-12-22 19:35:38 -08:00
Leonardo de Moura
94e6fbcbbf perf(library/vm/vm): make sure builtin cases_on recursors are assigned ids first
This will minimize the size of the m_builtin_cases_vector.
It also indirectly prevents the crash decribed at 144d9096e2.
However, the fix used there is more robust.
2016-12-22 18:46:51 -08:00
Leonardo de Moura
144d9096e2 fix(library/vm/vm): serialization/deserialization of builtin cases_on instruction
We generate internal ids for builtin cases_on recursors.
These ids were being saved in the .olean files.
This was fine before commit 41e8a1712e because we had a separate
mapping for builtin cases_on recursors. Now, all ids are stored in the
same mapping. Thus, minor changes in the set of VM builtin operations
make lean crash when importing .olean files because they will change the
internal id for the builtin cases_on.
The problem can be reproduced in the following way:

0- Go to build/release

1- make clean-olean

2- make
Everything is fine after step 2

3- Comment the following line at tactic_state.cpp

    DECLARE_VM_BUILTIN(name({"tactic", "open_namespaces"}),      tactic_open_namespaces);

4- make

5- Lean will crash when executing the following command

   ../../bin/lean ../../library/init/meta/tactic.lean

I believe this bug is reponsible by the crash that @jroesch reported on Slack.

This commit fixes the problem by storing the name of the builtin
cases_on recursor in the .olean file.
2016-12-22 18:35:30 -08:00
Leonardo de Moura
e5c4231248 fix(library/vm/vm): bug at vm_index_manager?
@gebner, I have been experiencing crashes that are hard to reproduce.
I think one of the problems was that get_vm_name was returning a `name const &`.
I think this may produce a memory access violation in the following
scenario:

1- Thread 1 invokes get_vm_name, and gets a reference R. This is a
   reference to a memory cell in the vector m_idx2name.
2- Thread 2 invokes get_vm_index, and it triggers a vector resize
   operation. After the resize, reference R is invalid.
3- Thread 1 crashes trying to access R.
2016-12-22 18:19:33 -08:00
Leonardo de Moura
eefd4cd6ab feat(library/tactic/congruence/congruence_tactics): add missing functions 2016-12-22 18:11:01 -08:00
Leonardo de Moura
66c781cce6 fix(frontends/lean/pp): bug when pretty printing partially applied polymorphic zero 2016-12-22 16:37:47 -08:00
Leonardo de Moura
f777aafa4e feat(library/init/meta,library/tactic/congruence): add congruence closure lean API 2016-12-22 16:26:17 -08:00
Leonardo de Moura
d16a3df7a3 feat(library/tactic/congruence): initialization and pretty printing 2016-12-22 15:18:52 -08:00
Leonardo de Moura
6bc0952dbc feat(library/tactic/congruence/congruence_closure): generate lazy eq_true proofs 2016-12-22 14:44:38 -08:00
Leonardo de Moura
f7dce940b6 feat(library/tactic/congruence/congruence_closure): proof generation 2016-12-22 14:23:33 -08:00
Daniel Selsam
49de5313fa chore(library/tactic/change_tactic.cpp): better formatting for error message 2016-12-22 11:13:54 -08:00
Leonardo de Moura
60d3255577 fix(library/type_context): issue #1258 again
This is yet another fix.
2016-12-22 10:51:16 -08:00
Leonardo de Moura
f2200510f3 chore(.travis.yml): use "(A)bort" option instead of "(C)ontinue" for assertion violations 2016-12-21 21:52:58 -08:00
Leonardo de Moura
49e296dee2 fix(library/type_context, library/tactic/induction_tactic): fix for issue #1258 was incorrect
The fix was incorrect because it could produce an invalid local context.
Actually, the regression tests/lean/run/1258.lean was producing an
assertion violation.
2016-12-21 21:13:29 -08:00
Leonardo de Moura
48cd421852 feat(library/tactic/congruence): add congruence closure basics 2016-12-21 20:46:25 -08:00
Leonardo de Moura
cc077554b5 fix(library/tactic/change_tactic): use id_locked in the change tactic to create checkpoint
closes #1260
2016-12-21 11:29:03 -08:00
Leonardo de Moura
408ebecc11 fix(frontends/lean/elaborator): missing enforce_type 2016-12-21 09:42:47 -08:00
Leonardo de Moura
fe3ed3d383 fix(library/constructions/induction_on): induction_on was not being marked as aux_recursor 2016-12-20 22:41:50 -08:00
Leonardo de Moura
7e0612306f fix(util/file_lock): issue on Windows 2016-12-20 14:16:58 -08:00
Leonardo de Moura
a358ea32ac fix(tests/lean/interactive): remove local paths 2016-12-20 12:46:10 -08:00
Leonardo de Moura
c9e0727ac0 fix(tests/lean/interactive/info1): fix test 2016-12-20 12:32:21 -08:00
Leonardo de Moura
98a14ee1c9 chore(tests/lean/run/test_single): use '-j 0' when running tests 2016-12-20 11:45:32 -08:00
Leonardo de Moura
896bc2c75a chore(*): fix style 2016-12-20 11:31:00 -08:00
Gabriel Ebner
8132957391 fix(library/module_mgr): build olean files with mtimes in correct order 2016-12-20 10:55:34 -08:00
Leonardo de Moura
5f72e37501 chore(library/vm): fix warning 2016-12-20 10:19:20 -08:00
Gabriel Ebner
f9a61b2b29 fix(tests/lean/interactive): fix test 2016-12-20 10:15:19 -08:00
Gabriel Ebner
0550d2a6ac refactor(library/module): import all modules in a single call 2016-12-20 10:15:19 -08:00
Gabriel Ebner
99fc13af98 refactor(library/module_mgr): cache olean imports as well 2016-12-20 10:15:19 -08:00
Gabriel Ebner
370d69de3f refactor(library/module): interface to get task dependencies for modifications 2016-12-20 10:15:19 -08:00
Gabriel Ebner
a2bc967fac feat(library/module): reuse pre-imported init module 2016-12-20 10:15:19 -08:00
Gabriel Ebner
a26e2c9108 feat(library/module): intermediary data structure for environment modifications 2016-12-20 10:15:19 -08:00
Gabriel Ebner
23be9bc0c2 fix(shell/CMakeLists): ignore temporary emacs files 2016-12-20 10:13:58 -08:00
Gabriel Ebner
41e8a1712e refactor(library/vm): use global indices for declarations and cases 2016-12-20 10:13:58 -08:00
Leonardo de Moura
4c01cb503c fix(library/native_compiler/native_compiler): memory leak 2016-12-20 10:02:31 -08:00
Leonardo de Moura
127ecff79c fix(attribute_manager): finalization problem
Global variables must be simple types. Reason: the finalization of
global objects in different compilation units is not specified by the
standard. The only exception is the global at src/shared/init.cpp.
It is used to automatically initialize the lean shared library.

Before this commit, attribute_manager used a std::unique_ptr in a global
variable. The test shared_test was crashing in one of my machines
because a different finalization order was being used.
2016-12-20 10:02:31 -08:00
Leonardo de Moura
516f45428d fix(library/tactic/simplify): missing clear cache operation 2016-12-19 21:32:46 -08:00
Leonardo de Moura
db2e3727a6 feat(library/type_context): add yet another approximation to unifier
@avigad I decided to fallback into first-order unification to address
the (a ∉ []) issue.

@dselsam Have you experienced similar problems in the ICML project?
The new comment at type_context.cpp explains the problem and hack to
workaround it. The issue is yet another instance where using "first-order
unification" produces imprecision, but generates the solution we want.
2016-12-19 20:34:07 -08:00
Leonardo de Moura
45efccd53e fix(library/tactic/tactic_state): goal pp problem reported by Jared 2016-12-19 20:32:44 -08:00
Leonardo de Moura
47e6f8fa9e fix(library/type_context): do not revert auxiliary local declarations introduced by the recursive equation notation
see #1258
2016-12-19 11:06:50 -08:00
Leonardo de Moura
0492436c42 chore(library/scoped_ext,tests/lean): fix issues raised by @kha 2016-12-19 10:03:16 -08:00
Leonardo de Moura
ffc9c75824 fix(frontends/lean/parser): do not clear local universes when switching to tactic mode and/or quoting 2016-12-19 09:21:54 -08:00
Leonardo de Moura
b65c774f5b chore(library/init/meta): opened_namespaces ==> open_namespaces 2016-12-18 23:55:45 -08:00
Sebastian Ullrich
9a30a06321 fix(frontends/lean/elaborator): output full names for overloads 2016-12-18 23:49:11 -08:00
Sebastian Ullrich
d3f57c6497 fix(library/tactic/tactic_state): include implicitly opened namespaces in opened_namespaces 2016-12-18 23:49:00 -08:00