test(lua): add example suggested by Cody
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
9de8249d8f
commit
a72be5eea4
1 changed files with 17 additions and 0 deletions
17
tests/lua/ind_tricky.lua
Normal file
17
tests/lua/ind_tricky.lua
Normal file
|
@ -0,0 +1,17 @@
|
|||
local env = environment()
|
||||
|
||||
local tricky = Const("tricky")
|
||||
local P = Const("P")
|
||||
|
||||
env = add_inductive(env,
|
||||
"tricky", Bool,
|
||||
"C", mk_arrow(Pi(P, Bool, mk_arrow(P, P)), tricky))
|
||||
|
||||
function display_type(env, t)
|
||||
print(tostring(t) .. " : " .. tostring(type_checker(env):check(t)))
|
||||
end
|
||||
|
||||
env = env:add_global_level("u")
|
||||
local tricky_rec = Const("tricky_rec", {0})
|
||||
|
||||
display_type(env, tricky_rec)
|
Loading…
Add table
Reference in a new issue