2014-05-21 18:24:24 +00:00
|
|
|
local env = bare_environment()
|
2014-05-15 00:14:57 +00:00
|
|
|
local t1 = mk_lambda("A", Type, mk_lambda("a", Var(0), Var(0)), binder_info(true))
|
|
|
|
local t2 = mk_lambda("A", Type, mk_lambda("a", Var(0), Var(0)))
|
|
|
|
print(t1)
|
|
|
|
print(t2)
|
|
|
|
local tc = type_checker(env)
|
|
|
|
local T1 = mk_pi("A", Type, mk_arrow(Var(0), Var(1)), binder_info(true))
|
|
|
|
local T2 = mk_pi("A", Type, mk_arrow(Var(0), Var(1)))
|
|
|
|
print(T1)
|
|
|
|
print(T2)
|
2014-05-15 00:24:49 +00:00
|
|
|
assert(T1 == T2) -- The default equality ignores binder information
|
|
|
|
assert(not (T1:is_bi_equal(T2)))
|
2014-05-15 00:14:57 +00:00
|
|
|
print(tc:check(t1))
|
|
|
|
print(tc:check(t2))
|
2014-05-16 18:13:50 +00:00
|
|
|
assert(tc:check(t1):binding_info():is_implicit())
|
|
|
|
assert(not tc:check(t2):binding_info():is_implicit())
|
2014-05-15 00:24:49 +00:00
|
|
|
assert(tc:check(t1):is_bi_equal(T1))
|
|
|
|
assert(tc:check(t2):is_bi_equal(T2))
|