lean2/tests/lua/old/localctx1.lua

25 lines
584 B
Lua
Raw Normal View History

l = local_context()
assert(l:is_nil())
assert(is_local_context(l))
e = mk_inst(1, Const("a"))
assert(is_local_entry(e))
assert(e:is_inst())
assert(not e:is_lift())
assert(e:s() == 1)
assert(e:v() == Const("a"))
assert(e:v() ~= Const("b"))
assert(not e:is_lift())
e2 = mk_lift(0, 2);
assert(is_local_entry(e2))
assert(not e2:is_inst())
assert(e2:is_lift())
assert(e2:s() == 0)
assert(e2:n() == 2)
l = local_context(e, l)
l2 = local_context(e2, l)
assert(l2:head() == e2)
assert(l2:tail():head() == e)
assert(not l2:is_nil())
assert(is_local_context(l2))
assert(not is_local_entry(l2))