lean2/tests/lua/expr9.lua
Leonardo de Moura 16bdc51fc4 refactor(kernel/type_checker): simplify type checker API, and remove add_cnstr_fn
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-06-26 13:36:31 -07:00

19 lines
572 B
Lua

local env = environment()
local m = mk_metavar("m", mk_arrow(Bool, Bool))
local a = Local("a", Bool)
print(env:normalize(Fun(a, m)))
print(env:normalize(Fun(a, m(a))))
local m2 = mk_metavar("m2", mk_arrow(Bool, Bool, Bool))
print(env:normalize(Fun(a, (m2(a))(a))))
print("step1")
env:type_check(m)
print("step2")
env:type_check(Fun(a, m(a)))
print("step3")
env:type_check(Fun(a, (m2(a))(a)))
local m3 = mk_metavar("m3", mk_metavar("m4", mk_sort(mk_meta_univ("l"))))
print("step4")
env:type_check(m3)
print("step5")
print(env:type_check(m3(a)))
print("before end")