lean2/tests/lua/cex_builder1.lua
Leonardo de Moura fd3b9e39f6 feat(bindings/lua): add cex_builder to Lua API
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2013-11-26 09:17:57 -08:00

14 lines
465 B
Lua

local cex = cex_builder(function(n, cex, a)
if cex then
return cex
else
error("no counterexample")
end
end)
assert(is_cex_builder(cex))
local env = environment()
env:add_var("T", Type())
local a = assignment()
local env2 = cex("main", env, a)
assert(env2:find_object("T"))
assert(not pcall(function() cex("main", nil, a) end))