2014-06-27 18:11:12 +00:00
|
|
|
local env = environment()
|
|
|
|
local A = Local("A", Type)
|
2014-07-22 16:43:18 +00:00
|
|
|
env = add_decl(env, mk_var_decl("eq", Pi(A, mk_arrow(A, A, Prop))))
|
2014-06-27 18:11:12 +00:00
|
|
|
local eq = Const("eq")
|
|
|
|
local a = Local("a", A)
|
2014-07-01 23:11:19 +00:00
|
|
|
local b = Local("b", A)
|
2014-06-27 18:11:12 +00:00
|
|
|
local H = Local("H", eq(A, a, b))
|
2014-07-01 23:11:19 +00:00
|
|
|
local t = eq(A, b, a)
|
|
|
|
local m = mk_metavar("m", Pi(A, a, b, H, t))(A, a, b, H)
|
|
|
|
print(m)
|
|
|
|
print(env:type_check(m))
|
|
|
|
local g = goal(m, t)
|
|
|
|
assert(g:validate(env))
|
2014-07-22 16:43:18 +00:00
|
|
|
local m1 = g:mk_meta("m1", Prop)
|
2014-06-27 18:11:12 +00:00
|
|
|
print(tostring(m1))
|
|
|
|
print(env:type_check(m1))
|