2014-05-12 16:50:43 -07:00
|
|
|
local f = Const("f")
|
2014-07-22 09:43:18 -07:00
|
|
|
local x = Local("x", Prop)
|
2014-05-12 16:50:43 -07:00
|
|
|
local a = Const("a")
|
|
|
|
local t1 = f(x, a, Var(1))
|
2014-06-30 09:14:55 -07:00
|
|
|
local t2 = Fun(x, t1)
|
2014-05-12 16:50:43 -07:00
|
|
|
assert(not t2:tag())
|
2014-05-16 11:13:50 -07:00
|
|
|
assert(not t2:binding_body():tag())
|
2014-05-12 16:50:43 -07:00
|
|
|
t2:set_tag(2)
|
2014-05-16 11:13:50 -07:00
|
|
|
t2:binding_body():set_tag(1)
|
2014-05-12 16:50:43 -07:00
|
|
|
assert(t2:tag() == 2)
|
2014-05-16 11:13:50 -07:00
|
|
|
assert(t2:binding_body():tag() == 1)
|
2014-05-12 16:50:43 -07:00
|
|
|
print(t2)
|
|
|
|
local new_t2 = t2:instantiate(Const("b"))
|
|
|
|
assert(new_t2:tag() == 2)
|
2014-05-16 11:13:50 -07:00
|
|
|
assert(new_t2:binding_body():tag() == 1)
|
2014-05-12 16:50:43 -07:00
|
|
|
assert(not (t2 == new_t2))
|
|
|
|
|