lean2/tests/lua/parser1.lua
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

12 lines
374 B
Lua

local env = environment()
local opts = options()
env:add_var("T", Type())
local T = Const("T")
env:add_var("x", T)
env:add_var("y", T)
env:add_var("f", mk_arrow(T, mk_arrow(T, T)))
print(parse_lean("f x (f x y)", env, opts))
-- parse_lean will use the elaborator to fill missing information
local F = parse_lean("fun x, f x x", env, opts)
print(F)
print(env:check_type(F))