lean4-htt/src
Leonardo de Moura 7a58da1181 fix(library/tactic/user_attribute): nasty interaction between eval_expr and attribute_manager
eval_expr creates auxiliary definitions in the VM. These auxiliary
definitions are gone after the VM finishes.

We store vm_obj's in the attribute_manager.

Before this commit, Lean was crashing in the following scenario:

1- A new caching_user_attribute is defined, and the user data structure
contains closures.

2- The closures are created using eval_expr.

3- When reusing the cached values, the system crashes when trying
to apply a closure created using eval_expr. The closure points to
an auxiliary definition that has already been deleted.

The new test exposes the problem. This is not a hypothetical scenario,
the new test is based on the Lean - Mathematica integration being
developed by @rlewis1988.

The fix consists in making sure we do not cache anything if
the VM environment has been updated by eval_expr.

I believe this is acceptable behavior. eval_expr is a very low level
tactic, and I don't see a good motivation for invoking it when
constructing the cache.

BTW, the test can be relaxed if the vm_attr does not contain closures.
However, it doesn't seem to pay off.

Another potential fix would be to propagate the definitions created
by eval_expr to the main environment. However, I think this is not
acceptable.
We will be flooding the main environment with useless temporary definitions
created by `eval_expr`.

This commit also stores the environment at caching time, and make
sure the cache is only reused if the current environment is a descendant
of the the one at caching time. This is fixing a different potential
bug.
2017-02-10 15:24:01 -08:00
..
api feat(kernel,library,frontends/lean,api): remove global universe levels from kernel and APIs 2017-02-08 17:41:44 -08:00
checker feat(kernel,library,frontends/lean,api): remove global universe levels from kernel and APIs 2017-02-08 17:41:44 -08:00
cmake feat(checker): add simple pretty-printing 2017-01-31 10:20:55 +01:00
emacs fix(emacs): do not update flycheck together with tasks 2017-02-10 09:49:48 +01:00
frontends fix(frontends/lean/tactic_notation): erase position information quoted terms occurring inside `[...] 2017-02-09 19:06:56 -08:00
init feat(*): C++ code generator 2016-12-05 16:11:41 -08:00
kernel feat(kernel,library,frontends/lean,api): remove global universe levels from kernel and APIs 2017-02-08 17:41:44 -08:00
library fix(library/tactic/user_attribute): nasty interaction between eval_expr and attribute_manager 2017-02-10 15:24:01 -08:00
shared fix(shared/init): shared library initialization 2016-12-05 16:48:29 -08:00
shell server: do not use additional_message 2017-02-10 09:06:09 +01:00
tests feat(frontends/lean): no global universes in the frontend 2017-02-08 17:23:04 -08:00
util feat(shell/server): limit full message updates to once every 200ms 2017-02-10 09:01:55 +01:00
vim fix(vim/syntax): update to lean 3 syntax 2016-10-30 08:42:05 +08:00
CMakeLists.txt feat(library/sorry): make sorry a macro 2017-02-05 14:01:03 +01:00
CTestConfig.cmake
CTestCustom.cmake.in
Doxyfile
githash.h.in
memcheck.supp
version.h.in