lean2/tests/lua/tc3.lua
Leonardo de Moura 4d1fecb21d refactor(library/kernel_bindings): rename empty_environment ==> bare_environment in the Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-05-21 11:24:24 -07:00

18 lines
698 B
Lua

local env = bare_environment()
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)
assert(T1 == T2) -- The default equality ignores binder information
assert(not (T1:is_bi_equal(T2)))
print(tc:check(t1))
print(tc:check(t2))
assert(tc:check(t1):binding_info():is_implicit())
assert(not tc:check(t2):binding_info():is_implicit())
assert(tc:check(t1):is_bi_equal(T1))
assert(tc:check(t2):is_bi_equal(T2))