2014-05-21 11:24:24 -07:00
|
|
|
local env = bare_environment()
|
2014-10-02 16:54:56 -07:00
|
|
|
env = add_decl(env, mk_constant_assumption("f", mk_arrow(Prop, mk_arrow(Prop, Prop))))
|
2014-05-12 17:49:51 -07:00
|
|
|
local f = Const("f")
|
2014-07-22 09:43:18 -07:00
|
|
|
local x = Local("x", Prop)
|
|
|
|
local y = Local("y", Prop)
|
|
|
|
local z = Local("z", Prop)
|
2014-05-12 17:49:51 -07:00
|
|
|
local tc = type_checker(env)
|
2014-06-30 09:14:55 -07:00
|
|
|
print(tc:whnf(Fun(x, f(x))))
|
|
|
|
print(tc:whnf(Fun(x, y, f(x, y))))
|
|
|
|
print(tc:whnf(Fun(x, y, f(Const("a"), y))))
|
|
|
|
print(tc:whnf(Fun(z, x, y, f(z, y))))
|
|
|
|
assert(tc:is_def_eq(f, Fun(x, f(x))))
|
|
|
|
assert(tc:is_def_eq(f, Fun(x, y, f(x, y))))
|
2014-05-12 17:49:51 -07:00
|
|
|
local A = Const("A")
|
2014-06-30 09:14:55 -07:00
|
|
|
local a = Local("a", A)
|
|
|
|
assert(tc:is_def_eq(Fun(a, a)(f), Fun(x, y, f(x, y))))
|