test(lua): add another add_inductive example
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
4f15240a71
commit
eb6807e1d3
1 changed files with 16 additions and 0 deletions
16
tests/lua/ind_ex.lua
Normal file
16
tests/lua/ind_ex.lua
Normal file
|
@ -0,0 +1,16 @@
|
|||
local env = environment()
|
||||
local l = param_univ("l")
|
||||
local U_l = mk_sort(l)
|
||||
local inhabited = Const("inhabited", {l})
|
||||
local A = Local("A", U_l)
|
||||
local a = Local("a", A)
|
||||
|
||||
env = add_inductive(env,
|
||||
"inhabited", {l}, 1, mk_arrow(U_l, Bool),
|
||||
"inhabited_intro", Pi({A, a}, inhabited(A)))
|
||||
|
||||
function display_type(env, t)
|
||||
print(tostring(t) .. " : " .. tostring(type_checker(env):check(t)))
|
||||
end
|
||||
|
||||
display_type(env, Const("inhabited_rec", {1, 1}))
|
Loading…
Add table
Reference in a new issue