2014-05-20 00:48:35 +00:00
|
|
|
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,
|
2014-07-22 16:43:18 +00:00
|
|
|
"inhabited", {l}, 1, mk_arrow(U_l, Prop),
|
2014-06-30 16:14:55 +00:00
|
|
|
"inhabited_intro", Pi(A, a, inhabited(A)))
|
2014-05-20 00:48:35 +00:00
|
|
|
|
|
|
|
function display_type(env, t)
|
|
|
|
print(tostring(t) .. " : " .. tostring(type_checker(env):check(t)))
|
|
|
|
end
|
|
|
|
|
2014-05-21 23:29:25 +00:00
|
|
|
display_type(env, Const("inhabited_rec", {1}))
|