lean2/tests/lua/old/proof_state1.lua
Leonardo de Moura a6116e3156 test(lua): reactivate some of the Lua unit tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2014-04-29 10:36:57 -07:00

26 lines
706 B
Lua

import("util.lua")
local ps = proof_state()
local env = environment()
local Bool = Const("Bool")
env:add_var("p", Bool)
env:add_var("q", Bool)
local p, q = Consts("p, q")
local ctx = context()
ctx = ctx:extend("H1", p)
ctx = ctx:extend("H2", q)
ps = to_proof_state(env, ctx, p)
print(ps)
for n, g in ps:goals():pairs() do
assert(is_goal(g))
print(n, g)
end
assert(#(ps:goals()) == 1)
assert(ps:goals():tail():is_nil())
assert(ps:goals():head() == name("main"))
assert(not ps:goals():empty())
assert(ps:precision() == precision.Precise)
local menv = ps:menv()
local pb = ps:proof_builder()
local cb = ps:cex_builder()
assert(not ps:is_proof_final_state())
assert(not ps:is_cex_final_state())