From d027c90bd0f6e3d2588d929de39faa60a8a3913e Mon Sep 17 00:00:00 2001 From: Leonardo de Moura Date: Wed, 25 Jun 2014 16:50:30 -0700 Subject: [PATCH] fix(tests/lua/tc_bug1): update test to reflect recent changes Signed-off-by: Leonardo de Moura --- tests/lua/tc_bug1.lua | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/tests/lua/tc_bug1.lua b/tests/lua/tc_bug1.lua index 013116539..1f7862009 100644 --- a/tests/lua/tc_bug1.lua +++ b/tests/lua/tc_bug1.lua @@ -11,6 +11,7 @@ local And = Const("and") local and_intro = Const("and_intro") local A = Local("A", Bool) local B = Local("B", Bool) +local C = Local("C", Bool) env = add_decl(env, mk_var_decl("N", Type)) env = add_decl(env, mk_var_decl("p", mk_arrow(N, N, Bool))) env = add_decl(env, mk_var_decl("q", mk_arrow(N, Bool))) @@ -19,8 +20,8 @@ env = add_decl(env, mk_var_decl("a", N)) env = add_decl(env, mk_var_decl("b", N)) env = add_decl(env, mk_var_decl("and", mk_arrow(Bool, Bool, Bool))) env = add_decl(env, mk_var_decl("and_intro", Pi({A, B}, mk_arrow(A, B, And(A, B))))) -env = add_decl(env, mk_var_decl("foo_intro", Pi({A, B}, mk_arrow(B, B)))) -env = add_decl(env, mk_var_decl("foo_intro2", Pi({A, B}, mk_arrow(B, B)))) +env = add_decl(env, mk_var_decl("foo_intro", Pi({A, B, C}, mk_arrow(B, B)))) +env = add_decl(env, mk_var_decl("foo_intro2", Pi({A, B, C}, mk_arrow(B, B)))) env = add_decl(env, mk_axiom("Ax1", q(a))) env = add_decl(env, mk_axiom("Ax2", q(a))) env = add_decl(env, mk_axiom("Ax3", q(b))) @@ -38,13 +39,18 @@ assert(not tc:is_def_eq(and_intro(m1, q(a)), and_intro(q(a), q(b)))) assert(#cs == 0) local cs = {} local tc = type_checker(env, ng, function (c) print(c); cs[#cs+1] = c end) -assert(tc:is_def_eq(foo_intro(m1, q(a), Ax1), foo_intro(q(a), q(a), Ax2))) +assert(tc:is_def_eq(foo_intro(m1, q(a), q(a), Ax1), foo_intro(q(a), q(a), q(a), Ax2))) assert(#cs == 1) -- constraint is used, but there is an alternative that does not use it assert(cs[1]:lhs() == m1) assert(cs[1]:rhs() == q(a)) cs = {} local tc = type_checker(env, ng, function (c) print(c); cs[#cs+1] = c end) -assert(tc:is_def_eq(foo_intro(m1, q(a), Ax1), foo_intro2(q(a), q(a), Ax2))) +assert(#cs == 0) +print(tostring(foo_intro) .. " : " .. tostring(tc:check(foo_intro))) +print(tostring(foo_intro2) .. " : " .. tostring(tc:check(foo_intro2))) +assert(tc:is_def_eq(foo_intro, foo_intro2)) +print("before is_def_eq2") +assert(tc:is_def_eq(foo_intro(m1, q(a), q(b), Ax1), foo_intro2(q(a), q(a), q(a), Ax2))) assert(#cs == 0) -- constraint should be ignored since we have shown definitional equality using proof irrelevance cs = {} local tc = type_checker(env, ng, function (c) print(c); cs[#cs+1] = c end)