lean2/tests/lean/lua12.lean
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

14 lines
254 B
Text

Variables x y z : Int
(**
local env = get_environment()
local plus = Const{"Int", "add"}
local x, y = Consts("x y")
local def = plus(plus(x, y), iVal(1000))
print(def, ":", env:check_type(def))
env:add_definition("sum", def)
**)
Eval sum + 3