lean2/tests/lua/tc4.lua
Leonardo de Moura bf081ed431 refactor(kernel): rename var_decl to constant_assumption
Motivation: it matches the notation used to declare it.
2014-10-02 17:55:34 -07:00

17 lines
624 B
Lua

local env = bare_environment()
env = add_decl(env, mk_constant_assumption("or", mk_arrow(Prop, Prop, Prop)))
env = add_decl(env, mk_constant_assumption("A", Prop))
local Or = Const("or")
local A = Const("A")
local B = Const("B")
local tc = type_checker(env)
local F = Or(A, B)
assert(tc:infer(F) == Prop)
assert(not pcall(function()
-- The following test must fail since B is not
-- declared in env.
-- This test make sure that infer and check are
-- not sharing the same cache.
print(tc:check(F))
end
))