Commit graph

11 commits

Author SHA1 Message Date
Leonardo de Moura
248d55d454 chore(util/script_state): remove dead code
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-01-07 16:59:50 -08:00
Leonardo de Moura
1fd81dd3a1 feat(frontends/lean/parser): disable verbose messages when importing files
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-28 12:24:13 -08:00
Leonardo de Moura
44a31dd8fb feat(frontends/lean/parser): improve Import command
- The extension does not have to be provided.
- It can also import Lua files.
- Hierachical names can be used instead of strings.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-28 12:05:01 -08:00
Leonardo de Moura
b5d23619cb feat(util/script_state): add 'import' command to Lua, it import files from the LEAN_PATH
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-22 21:27:12 -08:00
Leonardo de Moura
8f2fe273ea refactor(*): isolate std::thread dependency
This commit allows us to build Lean without the pthread dependency.
It is also useful if we want to implement multi-threading on top of Boost.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-09 15:20:26 -08:00
Leonardo de Moura
1a02abf7b2 feat(util/script_state): add a lua hook function that checks for the interrupt flag
This is a very convenient feature for interrupting non-terminating user scripts.
Before this commit, the user had to manually invoke check_interrupt() in potentially expensive loops. Now, this is not needed anymore.

Remark: we still have to check whether this trick works with LuaJIT or not.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-04 09:57:36 -08:00
Leonardo de Moura
83aaf64318 fix(library/tactic): memory leaks
Proof/Cex builders and tactics implemented in Lua had a "strong reference" to script_state. If they are stored in the Lua state, then we get a cyclic reference.
That is, script_state points to these objects, and they point back to script_state.

To avoid this memory leak, this commit defines a weak reference for script_state objects. The Proof/Cex builders and tactics now store a weak reference to the Lua state.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-30 00:44:39 -08:00
Leonardo de Moura
b4a8418d38 feat(library/tactic): expose tactics in the Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-27 17:47:29 -08:00
Leonardo de Moura
a2aa90ae66 refactor(util/script_state): replace std::recursive_mutex with std::mutex, and use unlock_guard
The unlock_guard and exec_unprotected will be useful also for implementing the Lua tactic API.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-27 15:40:41 -08:00
Leonardo de Moura
b038636ff5 refactor(util/script_state): remove unsafe unguarded_apply
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-27 15:14:26 -08:00
Leonardo de Moura
f7e8545e97 refactor(frontends/lua): rename leanlua_state to script_state, and move it to util
This commit also minimizes the dependencies of script_state.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-27 14:57:36 -08:00
Renamed from src/frontends/lua/leanlua_state.h (Browse further)