lean2/tests/lua/expr2.lua
Leonardo de Moura 3f0279b88c refactor(frontends/lua): replace lean.lua.h with util.lua
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-12-26 19:49:26 -08:00

12 lines
315 B
Lua

import("util.lua")
f = Const("f")
x = Const("x")
y = Const("y")
a = Const("a")
b = Const("b")
print(Let(x, f(a), f(x, x)))
print(Let({{x, f(a)}, {y, f(b)}}, f(x, y)))
x1, x2, x3 = Consts("x1, x2, x3")
assert(tostring(f(x1, x2, x3)) == "f x1 x2 x3")
y1, y2 = Consts("y1 y2")
assert(tostring(f(y1, y2)) == "f y1 y2")