lean2/tests/lua/tag1.lua
Leonardo de Moura cb000eda13 refactor(kernel): store binder_infor in local constants
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-30 11:37:46 -07:00

17 lines
427 B
Lua

local f = Const("f")
local x = Local("x", Bool)
local a = Const("a")
local t1 = f(x, a, Var(1))
local t2 = Fun(x, t1)
assert(not t2:tag())
assert(not t2:binding_body():tag())
t2:set_tag(2)
t2:binding_body():set_tag(1)
assert(t2:tag() == 2)
assert(t2:binding_body():tag() == 1)
print(t2)
local new_t2 = t2:instantiate(Const("b"))
assert(new_t2:tag() == 2)
assert(new_t2:binding_body():tag() == 1)
assert(not (t2 == new_t2))