lean2/tests/lua/old/goal1.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

30 lines
805 B
Lua

local hs = hypotheses()
assert(is_hypotheses(hs))
assert(hs:empty())
assert(hs:is_nil())
local hs = hypotheses("H1", Const("q"), hs)
local hs = hypotheses("H2", Const("p"), hs)
local n, p = hs:head()
assert(n == name("H2"))
assert(p == Const("p"))
assert(not hs:empty())
assert(hs:tail():tail():empty())
for n, p in hs:pairs() do
print(n, p)
end
assert(not pcall(function() hypotheses("H1", Const("q"), "H2", Const("p"), hs) end))
assert(#hs == 2)
assert(hs:size() == 2)
local g = goal(hs, Const("p1"))
assert(is_goal(g))
print(g)
assert(#(g:hypotheses()) == 2)
assert(g:conclusion() == Const("p1"))
assert(g:unique_name("H") == name("H"))
assert(g:unique_name("H1") == name("H1", 1))
print(g:pp())
local opts = options()
opts = opts:update(name("pp", "unicode"), false)
print(opts)
print(g:pp(opts))