Commit graph

109 commits

Author SHA1 Message Date
Leonardo de Moura
7b8bd97699 feat(lua/expr): add method for extracting semantic attachment data
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-19 19:06:47 -08:00
Leonardo de Moura
20c6789d1c feat(extra): add extension that demonstrates how to parse 'templates'
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-19 15:56:44 -08:00
Leonardo de Moura
5cfcb7e144 chore(kernel/for_each): use consistent naming convetions
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-19 11:24:02 -08:00
Leonardo de Moura
b2d1acd0b7 test(lua/environment): add missing tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-18 09:27:46 -08:00
Leonardo de Moura
93b02a6fad fix(lua): fix C++ stack unwinding bug, we should never invoke lua_error from a catch block
lua_error and luaL_error are based on the longjmp C function. They will not correctly unwind the C++ stack. We should only invoke them after we finished handling the C++ exceptions and unwinding the C++ stack, and invoking the destructors for each object living on the stack.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-18 06:49:54 -08:00
Leonardo de Moura
2ccd5cc559 fix(lua): workaround memory leak problem with __cxa_thread_atexit code generated by g++
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-18 06:40:32 -08:00
Leonardo de Moura
7976937e4c test(lua/metavar_env): add missing tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-17 19:18:47 -08:00
Leonardo de Moura
69be5f6c94 feat(kernel/environment): track which modules were already imported
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-17 18:15:44 -08:00
Leonardo de Moura
df94e44806 test(lua/expr): add missing tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-17 11:46:24 -08:00
Leonardo de Moura
f586e58ac3 test(lua/justification): add more tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-17 11:13:10 -08:00
Leonardo de Moura
d0bac61e74 fix(lua/numerics): bug in bindings, add more tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-17 11:02:44 -08:00
Leonardo de Moura
0e6df0a55b fix(lua): warning message
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-16 19:58:34 -08:00
Leonardo de Moura
926ed0a02d feat(lua): add type_inferer object to Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-16 19:18:15 -08:00
Leonardo de Moura
590b14570f feat(lua): improve error handling in Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-16 18:21:42 -08:00
Leonardo de Moura
516c5c8fea feat(lua): add metavar_env objects to Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-16 14:44:33 -08:00
Leonardo de Moura
c8fff45319 feat(lua): add justification objects to Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-16 11:12:58 -08:00
Leonardo de Moura
209a2d10f7 fix(lua): replace std::mutex with std::recursive_mutex, add test that demonstrates the problem that is being fixed
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-15 21:26:16 -08:00
Leonardo de Moura
8525e8534b feat(lua): expose parse_expr and parse_commands from frontends/lean in the Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-15 16:11:26 -08:00
Leonardo de Moura
d9d9c05e4f refactor(lua/options): remove unnecessary function
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-15 12:53:27 -08:00
Leonardo de Moura
19533c811b feat(library/script_evaluator): add abstract class that exposes only the API needed by frontend objects
The main motivation is to break the remove the dependency frontends/lean <-- bindings/lua.
This dependency is undesirable because we want to expose the frontends/lean parser and pretty printer objects at bindings/lua.

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-15 12:13:09 -08:00
Leonardo de Moura
782335581b fix(lua/thread): uninitialized memory
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-15 09:07:18 -08:00
Leonardo de Moura
b5dcb93550 feat(lua): communication channels for threads
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 21:10:46 -08:00
Leonardo de Moura
bd1e9c7548 feat(lua): throw an exception if the user tries to create a thread and Lean was compiled without multi-threading support
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 19:06:36 -08:00
Leonardo de Moura
3a924a5fb1 perf(lua/name): improve to_name_ext performance
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 18:06:09 -08:00
Leonardo de Moura
cd6bd79d63 refactor(lua): cleanup Lua API, improve performance
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 17:33:46 -08:00
Leonardo de Moura
6575566f9f fix(lua): rename lua_ref to lref, lua_ref is a macro in LuaJIT
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 15:50:56 -08:00
Leonardo de Moura
09bed4786c feat(lua): add semantic attachments for builtin arithmetical values to Lua API, improve mk_constant
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 15:15:04 -08:00
Leonardo de Moura
05f254f605 refactor(lua): move lua_ref to separate file
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 14:41:54 -08:00
Leonardo de Moura
bdea42b2a9 style(lua): ignore bogus warning
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 14:13:06 -08:00
Leonardo de Moura
abe93dfec0 fix(lua/splay_tree): for_each method was crashing if the map was updated during for_each
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 13:48:23 -08:00
Leonardo de Moura
64cce595a5 feat(lua): add splay_maps to the Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 13:35:36 -08:00
Leonardo de Moura
b0322787ff feat(lua): add has_metavar method
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 10:28:50 -08:00
Leonardo de Moura
9e445d1917 feat(lua): interrupt and sleep Lua APIs
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-14 10:04:32 -08:00
Leonardo de Moura
ae7ea99b56 fix(lua): copy_values and add tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 21:31:27 -08:00
Leonardo de Moura
c759fc93f7 test(lua): object Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 20:59:28 -08:00
Leonardo de Moura
6964e374c0 fix(lua): luajit incompatibility
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 18:08:00 -08:00
Leonardo de Moura
cbc4254ff5 feat(lua): add occurs method to expr Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 17:10:09 -08:00
Leonardo de Moura
351ef867d2 feat(lua): add abstract, instantiate, has_free_vars, lift/lower free_vars to Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 17:02:49 -08:00
Leonardo de Moura
ed3cf8152b feat(lua): add for_each to expr Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 16:30:59 -08:00
Leonardo de Moura
1bf6051866 test(lua): expr LUA API test
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 15:29:31 -08:00
Leonardo de Moura
9a22702383 feat(lua): make objects() and localobjects() methods return iterators in the environment LUA API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 14:26:01 -08:00
Leonardo de Moura
8c52d47692 chore(lua): rename env() to get_env()
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 13:58:51 -08:00
Leonardo de Moura
ba0889265e refactor(lua): cleanup Lua bindings
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 13:55:05 -08:00
Leonardo de Moura
b5f0185729 fix(lua): replace lua_pushfstring with lua_pushstring
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 12:14:55 -08:00
Leonardo de Moura
a80adae1c3 feat(lua): add fields method to sexpr Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 12:10:24 -08:00
Leonardo de Moura
e2efce6b62 style(util/sexpr): name convetion for enumeration types
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 11:50:12 -08:00
Leonardo de Moura
450128e28b refactor(lua): cleanup Lua bindings, and add accessor/tester to expr Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-13 11:46:09 -08:00
Leonardo de Moura
be093ecf90 feat(lua): use formatter available in the state object to convert Lean objects into strings in the Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-12 16:56:30 -08:00
Leonardo de Moura
8190d4fed5 feat(lua): allow Lua scripts to update 'global' options
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-12 15:38:00 -08:00
Leonardo de Moura
b986af09ed feat(lua): add support for copying closures between Lua states
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-12 12:54:34 -08:00