chore(*): do not type check imported modules when running .cpp tests
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
d7493ea86c
commit
0cb741285c
12 changed files with 91 additions and 90 deletions
|
@ -563,14 +563,15 @@ void init_frontend(environment const & env, io_state & ios, bool no_kernel) {
|
|||
import_nat(env);
|
||||
}
|
||||
}
|
||||
void init_full_frontend(environment const & env, io_state & ios) {
|
||||
void init_test_frontend(environment const & env, io_state & ios) {
|
||||
env->set_trusted_imported(true);
|
||||
init_frontend(env, ios);
|
||||
import_int(env);
|
||||
import_real(env);
|
||||
}
|
||||
void init_full_frontend(environment const & env) {
|
||||
void init_test_frontend(environment const & env) {
|
||||
io_state ios;
|
||||
init_full_frontend(env, ios);
|
||||
init_test_frontend(env, ios);
|
||||
}
|
||||
|
||||
void add_infix(environment const & env, io_state const & ios, name const & opn, unsigned p, expr const & d) {
|
||||
|
|
|
@ -22,8 +22,8 @@ void init_frontend(environment const & env, io_state & ios, bool no_kernel = fal
|
|||
\brief Load kernel, nat, int, real and set pretty printer.
|
||||
It is used for testing.
|
||||
*/
|
||||
void init_full_frontend(environment const & env, io_state & ios);
|
||||
void init_full_frontend(environment const & env);
|
||||
void init_test_frontend(environment const & env, io_state & ios);
|
||||
void init_test_frontend(environment const & env);
|
||||
|
||||
/**
|
||||
@name Notation for parsing and pretty printing.
|
||||
|
|
|
@ -42,7 +42,7 @@ static void parse_error(environment const & env, io_state const & ios, char cons
|
|||
}
|
||||
|
||||
static void tst1() {
|
||||
environment env; io_state ios; init_full_frontend(env, ios);
|
||||
environment env; io_state ios; init_test_frontend(env, ios);
|
||||
parse(env, ios, "Variable x : Bool Variable y : Bool Axiom H : x && y || x => x");
|
||||
parse(env, ios, "Eval true && true");
|
||||
parse(env, ios, "Show true && false Eval true && false");
|
||||
|
@ -63,7 +63,7 @@ static void check(environment const & env, io_state & ios, char const * str, exp
|
|||
}
|
||||
|
||||
static void tst2() {
|
||||
environment env; io_state ios; init_full_frontend(env, ios);
|
||||
environment env; io_state ios; init_test_frontend(env, ios);
|
||||
env->add_var("x", Bool);
|
||||
env->add_var("y", Bool);
|
||||
env->add_var("z", Bool);
|
||||
|
@ -80,7 +80,7 @@ static void tst2() {
|
|||
}
|
||||
|
||||
static void tst3() {
|
||||
environment env; io_state ios; init_full_frontend(env, ios);
|
||||
environment env; io_state ios; init_test_frontend(env, ios);
|
||||
parse(env, ios, "Help");
|
||||
parse(env, ios, "Help Options");
|
||||
parse_error(env, ios, "Help Echo");
|
||||
|
|
|
@ -63,7 +63,7 @@ static void tst2() {
|
|||
|
||||
static void tst3() {
|
||||
std::cout << "tst3\n";
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
try {
|
||||
env->add_definition("a", Int, Const("a"));
|
||||
lean_unreachable();
|
||||
|
@ -108,7 +108,7 @@ static void tst3() {
|
|||
|
||||
static void tst4() {
|
||||
std::cout << "tst4\n";
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_definition("a", Int, iVal(1), true); // add opaque definition
|
||||
expr t = iAdd(Const("a"), iVal(1));
|
||||
std::cout << t << " --> " << normalize(t, env) << "\n";
|
||||
|
@ -121,7 +121,7 @@ static void tst4() {
|
|||
}
|
||||
|
||||
static void tst5() {
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_definition("a", Int, iVal(1), true); // add opaque definition
|
||||
try {
|
||||
std::cout << type_check(iAdd(Const("a"), Int), env) << "\n";
|
||||
|
@ -132,7 +132,7 @@ static void tst5() {
|
|||
}
|
||||
|
||||
static void tst6() {
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
level u = env->add_uvar("u", level() + 1);
|
||||
level w = env->add_uvar("w", u + 1);
|
||||
env->add_var("f", mk_arrow(Type(u), Type(u)));
|
||||
|
@ -159,7 +159,7 @@ static void tst6() {
|
|||
}
|
||||
|
||||
static void tst7() {
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("a", Int);
|
||||
env->add_var("b", Int);
|
||||
expr t = If(Int, True, Const("a"), Const("b"));
|
||||
|
@ -207,7 +207,7 @@ static void tst9() {
|
|||
|
||||
static void tst10() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_definition("a", Int, iVal(1));
|
||||
lean_assert(env->get_object("a").get_weight() == 1);
|
||||
expr a = Const("a");
|
||||
|
|
|
@ -546,7 +546,7 @@ static void tst26() {
|
|||
*/
|
||||
std::cout << "\ntst26\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
buffer<unification_constraint> up;
|
||||
type_checker checker(env);
|
||||
|
@ -588,7 +588,7 @@ static void tst27() {
|
|||
*/
|
||||
std::cout << "\ntst27\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
buffer<unification_constraint> up;
|
||||
type_checker checker(env);
|
||||
|
|
|
@ -192,7 +192,7 @@ static void tst2() {
|
|||
|
||||
static void tst3() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_var("a", Bool);
|
||||
expr t1 = Const("a");
|
||||
expr t2 = Const("a");
|
||||
|
@ -220,7 +220,7 @@ static void tst5() {
|
|||
#if !defined(__APPLE__) && defined(LEAN_MULTI_THREAD)
|
||||
expr t = mk_big(18);
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_var("f", Bool >> (Bool >> Bool));
|
||||
env->add_var("a", Bool);
|
||||
normalizer proc(env);
|
||||
|
@ -256,7 +256,7 @@ static void tst6() {
|
|||
|
||||
static void tst7() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
expr m1 = menv->mk_metavar();
|
||||
expr x = Const("x");
|
||||
|
@ -280,7 +280,7 @@ static void tst7() {
|
|||
|
||||
static void tst8() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_var("P", Int >> (Int >> Bool));
|
||||
expr P = Const("P");
|
||||
expr v0 = Var(0);
|
||||
|
@ -308,7 +308,7 @@ static void tst9() {
|
|||
|
||||
static void tst10() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
context ctx({{"x", Bool}, {"y", Bool}});
|
||||
expr m = menv->mk_metavar(ctx);
|
||||
|
|
|
@ -26,7 +26,7 @@ expr norm(expr const & e, environment & env) {
|
|||
}
|
||||
|
||||
static void mk(expr const & a) {
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
expr b = Const("b");
|
||||
for (unsigned i = 0; i < 100; i++) {
|
||||
expr h = Const("h");
|
||||
|
|
|
@ -78,7 +78,7 @@ static void tst2() {
|
|||
|
||||
static void tst3() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr f = Fun("a", Bool, Eq(Const("a"), True));
|
||||
std::cout << type_check(f, env) << "\n";
|
||||
lean_assert(type_check(f, env) == mk_arrow(Bool, Bool));
|
||||
|
@ -88,7 +88,7 @@ static void tst3() {
|
|||
|
||||
static void tst4() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr a = Eq(iVal(1), iVal(2));
|
||||
expr pr = mk_lambda("x", a, Var(0));
|
||||
std::cout << type_check(pr, env) << "\n";
|
||||
|
@ -96,7 +96,7 @@ static void tst4() {
|
|||
|
||||
static void tst5() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_var("P", Bool);
|
||||
expr P = Const("P");
|
||||
expr H = Const("H");
|
||||
|
@ -114,7 +114,7 @@ static void tst5() {
|
|||
|
||||
static void tst6() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr A = Const("A");
|
||||
expr f = Const("f");
|
||||
expr x = Const("x");
|
||||
|
@ -129,7 +129,7 @@ static void tst6() {
|
|||
|
||||
static void tst7() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr A = Const(name{"foo", "bla", "bla", "foo"});
|
||||
expr f = Const("f");
|
||||
expr x = Const("x");
|
||||
|
@ -144,7 +144,7 @@ static void tst7() {
|
|||
|
||||
static void tst8() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_var("P", mk_arrow(Int, mk_arrow(Int, Bool)));
|
||||
env->add_var("x", Int);
|
||||
expr P = Const("P");
|
||||
|
@ -164,7 +164,7 @@ static void tst8() {
|
|||
|
||||
static void tst9() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_var("P", mk_arrow(Int, mk_arrow(Int, Bool)));
|
||||
env->add_var("x", Int);
|
||||
expr P = Const("P");
|
||||
|
@ -184,7 +184,7 @@ static void tst9() {
|
|||
|
||||
static void tst10() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_var("f", mk_arrow(Int, Int));
|
||||
env->add_var("b", Int);
|
||||
expr f = Const("f");
|
||||
|
@ -201,7 +201,7 @@ static void tst10() {
|
|||
|
||||
static void tst11() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_var("f", Int >> (Int >> Int));
|
||||
env->add_var("a", Int);
|
||||
unsigned n = 1000;
|
||||
|
@ -232,7 +232,7 @@ static void tst12() {
|
|||
#if !defined(__APPLE__) && defined(LEAN_MULTI_THREAD)
|
||||
expr t = mk_big(18);
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_var("f", Int >> (Int >> Int));
|
||||
env->add_var("a", Int);
|
||||
type_checker checker(env);
|
||||
|
@ -255,7 +255,7 @@ static void tst12() {
|
|||
|
||||
static void tst13() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_var("f", Type() >> Type());
|
||||
expr f = Const("f");
|
||||
std::cout << type_check(f(Bool), env) << "\n";
|
||||
|
@ -264,7 +264,7 @@ static void tst13() {
|
|||
|
||||
static void tst14() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr f = Const("f");
|
||||
expr a = Const("a");
|
||||
env->add_var("f", Int >> Int);
|
||||
|
@ -282,7 +282,7 @@ static void tst14() {
|
|||
|
||||
static void tst15() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
context ctx1, ctx2;
|
||||
expr A = Const("A");
|
||||
expr vec1 = Const("vec1");
|
||||
|
@ -350,7 +350,7 @@ static void f2(type_checker & tc, expr const & F) {
|
|||
|
||||
static void tst17() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
type_checker tc(env);
|
||||
expr A = Const("A");
|
||||
expr F;
|
||||
|
@ -374,7 +374,7 @@ static std::ostream & operator<<(std::ostream & out, buffer<unification_constrai
|
|||
|
||||
static void tst18() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
type_inferer type_of(env);
|
||||
expr f = Const("f");
|
||||
expr g = Const("g");
|
||||
|
@ -406,7 +406,7 @@ static expr mk_big(unsigned val, unsigned depth) {
|
|||
|
||||
static void tst19() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
type_inferer type_of(env);
|
||||
type_checker type_of_slow(env);
|
||||
expr t = mk_big(0, 10);
|
||||
|
@ -428,7 +428,7 @@ static void tst19() {
|
|||
|
||||
static void tst20() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
context ctx1, ctx2;
|
||||
expr A = Const("A");
|
||||
expr vec1 = Const("vec1");
|
||||
|
@ -456,7 +456,7 @@ static void tst20() {
|
|||
|
||||
static void tst21() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
buffer<unification_constraint> uc;
|
||||
type_inferer inferer(env);
|
||||
|
|
|
@ -16,7 +16,7 @@ using namespace lean;
|
|||
|
||||
static void tst0() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
normalizer norm(env);
|
||||
env->add_var("n", Nat);
|
||||
expr n = Const("n");
|
||||
|
@ -47,7 +47,7 @@ static void tst0() {
|
|||
|
||||
static void tst1() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr e = mk_int_value(mpz(10));
|
||||
lean_assert(is_int_value(e));
|
||||
lean_assert(type_check(e, env) == Int);
|
||||
|
@ -56,7 +56,7 @@ static void tst1() {
|
|||
|
||||
static void tst2() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr e = iAdd(iVal(10), iVal(30));
|
||||
std::cout << e << "\n";
|
||||
std::cout << normalize(e, env) << "\n";
|
||||
|
@ -73,7 +73,7 @@ static void tst2() {
|
|||
|
||||
static void tst3() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr e = iMul(iVal(10), iVal(30));
|
||||
std::cout << e << "\n";
|
||||
std::cout << normalize(e, env) << "\n";
|
||||
|
@ -90,7 +90,7 @@ static void tst3() {
|
|||
|
||||
static void tst4() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr e = iSub(iVal(10), iVal(30));
|
||||
std::cout << e << "\n";
|
||||
std::cout << normalize(e, env) << "\n";
|
||||
|
@ -107,7 +107,7 @@ static void tst4() {
|
|||
|
||||
static void tst5() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_var(name("a"), Int);
|
||||
expr e = Eq(iVal(3), iVal(4));
|
||||
std::cout << e << " --> " << normalize(e, env) << "\n";
|
||||
|
|
|
@ -20,7 +20,7 @@ using namespace lean;
|
|||
|
||||
static void tst1() {
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
buffer<unification_constraint> ucs;
|
||||
type_checker checker(env);
|
||||
|
@ -75,7 +75,7 @@ static void tst2() {
|
|||
?m4 in { Id, nat2int, nat2real }
|
||||
*/
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
buffer<unification_constraint> ucs;
|
||||
type_checker checker(env);
|
||||
|
@ -116,7 +116,7 @@ static void tst3() {
|
|||
?m5 in { Id, int2real }
|
||||
*/
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
buffer<unification_constraint> ucs;
|
||||
type_checker checker(env);
|
||||
|
@ -158,7 +158,7 @@ static void tst4() {
|
|||
?m6 in { Id, int2real }
|
||||
*/
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
buffer<unification_constraint> ucs;
|
||||
type_checker checker(env);
|
||||
|
@ -202,7 +202,7 @@ static void tst5() {
|
|||
?m4 in { Id, int2real }
|
||||
*/
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
buffer<unification_constraint> ucs;
|
||||
type_checker checker(env);
|
||||
|
@ -239,7 +239,7 @@ static void tst6() {
|
|||
Theorem T : (f a (f b b)) == a := Subst _ _ _ _ H1 H2
|
||||
*/
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
buffer<unification_constraint> ucs;
|
||||
type_checker checker(env);
|
||||
|
@ -307,7 +307,7 @@ static void unsolved(expr const & e, environment const & env) {
|
|||
static void tst7() {
|
||||
std::cout << "\nTST 7\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr A = Const("A");
|
||||
expr B = Const("B");
|
||||
expr F = Const("F");
|
||||
|
@ -328,7 +328,7 @@ static void tst7() {
|
|||
static void tst8() {
|
||||
std::cout << "\nTST 8\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr a = Const("a");
|
||||
expr b = Const("b");
|
||||
expr c = Const("c");
|
||||
|
@ -354,7 +354,7 @@ static void tst8() {
|
|||
static void tst9() {
|
||||
std::cout << "\nTST 9\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr Nat = Const("N");
|
||||
env->add_var("N", Type());
|
||||
env->add_var("vec", Nat >> Type());
|
||||
|
@ -386,7 +386,7 @@ static void tst9() {
|
|||
static void tst10() {
|
||||
std::cout << "\nTST 10\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr Nat = Const("N");
|
||||
env->add_var("N", Type());
|
||||
expr R = Const("R");
|
||||
|
@ -410,7 +410,7 @@ static void tst10() {
|
|||
static void tst11() {
|
||||
std::cout << "\nTST 11\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr A = Const("A");
|
||||
expr B = Const("B");
|
||||
expr a = Const("a");
|
||||
|
@ -428,7 +428,7 @@ static void tst11() {
|
|||
static void tst12() {
|
||||
std::cout << "\nTST 12\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr lst = Const("list");
|
||||
expr nil = Const("nil");
|
||||
expr cons = Const("cons");
|
||||
|
@ -449,7 +449,7 @@ static void tst12() {
|
|||
static void tst13() {
|
||||
std::cout << "\nTST 13\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr B = Const("B");
|
||||
expr A = Const("A");
|
||||
expr x = Const("x");
|
||||
|
@ -472,7 +472,7 @@ static void tst13() {
|
|||
static void tst14() {
|
||||
std::cout << "\nTST 14\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr A = Const("A");
|
||||
expr B = Const("B");
|
||||
expr f = Const("f");
|
||||
|
@ -513,7 +513,7 @@ static void tst14() {
|
|||
static void tst15() {
|
||||
std::cout << "\nTST 15\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr A = Const("A");
|
||||
expr B = Const("B");
|
||||
expr C = Const("C");
|
||||
|
@ -539,7 +539,7 @@ static void tst15() {
|
|||
static void tst16() {
|
||||
std::cout << "\nTST 16\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr a = Const("a");
|
||||
expr b = Const("b");
|
||||
expr c = Const("c");
|
||||
|
@ -560,7 +560,7 @@ static void tst16() {
|
|||
EqTIntro(c, EqMP(a, c, Symm(Bool, c, a, Trans(Bool, c, b, a, Symm(Bool, b, c, H2), Symm(Bool, a, b, H1))), H3))),
|
||||
env);
|
||||
environment env2;
|
||||
init_full_frontend(env2);
|
||||
init_test_frontend(env2);
|
||||
success(Fun({{a, Bool}, {b, Bool}, {c, Bool}, {H1, Eq(a, b)}, {H2, Eq(b, c)}, {H3, a}},
|
||||
EqTIntro(_, EqMP(_, _, Symm(_, _, _, Trans(_, _, _, _, Symm(_, _, _, H2), Symm(_, _, _, H1))), H3))),
|
||||
Fun({{a, Bool}, {b, Bool}, {c, Bool}, {H1, Eq(a, b)}, {H2, Eq(b, c)}, {H3, a}},
|
||||
|
@ -577,7 +577,7 @@ static void tst16() {
|
|||
void tst17() {
|
||||
std::cout << "\nTST 17\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr A = Const("A");
|
||||
expr B = Const("B");
|
||||
expr a = Const("a");
|
||||
|
@ -592,7 +592,7 @@ void tst17() {
|
|||
void tst18() {
|
||||
std::cout << "\nTST 18\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr A = Const("A");
|
||||
expr h = Const("h");
|
||||
expr f = Const("f");
|
||||
|
@ -606,7 +606,7 @@ void tst18() {
|
|||
void tst19() {
|
||||
std::cout << "\nTST 19\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
expr R = Const("R");
|
||||
expr A = Const("A");
|
||||
expr r = Const("r");
|
||||
|
@ -633,7 +633,7 @@ void tst19() {
|
|||
void tst20() {
|
||||
std::cout << "\nTST 20\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
expr N = Const("N1");
|
||||
expr M = Const("M1");
|
||||
|
@ -666,7 +666,7 @@ void tst20() {
|
|||
void tst21() {
|
||||
std::cout << "\nTST 21\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
expr N = Const("N");
|
||||
expr M = Const("M");
|
||||
|
@ -698,7 +698,7 @@ void tst21() {
|
|||
void tst22() {
|
||||
std::cout << "\nTST 22\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
expr N = Const("N");
|
||||
env->add_var("N", Type());
|
||||
|
@ -733,7 +733,7 @@ void tst22() {
|
|||
void tst23() {
|
||||
std::cout << "\nTST 23\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
expr N = Const("N");
|
||||
env->add_var("N", Type());
|
||||
|
@ -763,7 +763,7 @@ void tst23() {
|
|||
void tst24() {
|
||||
std::cout << "\nTST 24\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
expr N = Const("N");
|
||||
env->add_var("N", Type());
|
||||
|
@ -783,7 +783,7 @@ void tst24() {
|
|||
void tst25() {
|
||||
std::cout << "\nTST 25\n";
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
expr N = Const("N");
|
||||
env->add_var("N", Type());
|
||||
|
@ -819,7 +819,7 @@ void tst26() {
|
|||
Axiom H : g _ a = a
|
||||
*/
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
buffer<unification_constraint> ucs;
|
||||
type_checker checker(env);
|
||||
|
@ -849,7 +849,7 @@ void tst27() {
|
|||
fun f : _, eq _ ((g _ f) a) a
|
||||
*/
|
||||
environment env;
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
metavar_env menv;
|
||||
buffer<unification_constraint> ucs;
|
||||
type_checker checker(env);
|
||||
|
|
|
@ -37,7 +37,7 @@ static void theorem_rewriter1_tst() {
|
|||
Eq(nAdd(Const("x"), Const("y")), nAdd(Const("y"), Const("x")))));
|
||||
expr add_comm_thm_body = Const("ADD_COMM");
|
||||
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("a", Nat);
|
||||
env->add_var("b", Nat);
|
||||
env->add_axiom("ADD_COMM", add_comm_thm_type); // ADD_COMM : Pi (x, y: N), x + y = y + z
|
||||
|
@ -69,7 +69,7 @@ static void theorem_rewriter2_tst() {
|
|||
Eq(nAdd(Const("x"), zero), Const("x")));
|
||||
expr add_id_thm_body = Const("ADD_ID");
|
||||
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("a", Nat);
|
||||
env->add_axiom("ADD_ID", add_id_thm_type); // ADD_ID : Pi (x : N), x = x + 0
|
||||
|
||||
|
@ -107,7 +107,7 @@ static void then_rewriter1_tst() {
|
|||
Eq(nAdd(Const("x"), zero), Const("x")));
|
||||
expr add_id_thm_body = Const("ADD_ID");
|
||||
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("a", Nat);
|
||||
env->add_axiom("ADD_COMM", add_comm_thm_type); // ADD_COMM : Pi (x, y: N), x + y = y + z
|
||||
env->add_axiom("ADD_ID", add_id_thm_type); // ADD_ID : Pi (x : N), x = x + 0
|
||||
|
@ -163,7 +163,7 @@ static void then_rewriter2_tst() {
|
|||
Eq(nAdd(Const("x"), zero), Const("x")));
|
||||
expr add_id_thm_body = Const("ADD_ID");
|
||||
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("a", Nat);
|
||||
env->add_axiom("ADD_ASSOC", add_assoc_thm_type); // ADD_ASSOC : Pi (x, y, z : N), x + (y + z) = (x + y) + z
|
||||
env->add_axiom("ADD_COMM", add_comm_thm_type); // ADD_COMM : Pi (x, y: N), x + y = y + z
|
||||
|
@ -222,7 +222,7 @@ static void orelse_rewriter1_tst() {
|
|||
Eq(nAdd(Const("x"), zero), Const("x")));
|
||||
expr add_id_thm_body = Const("ADD_ID");
|
||||
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("a", Nat);
|
||||
env->add_var("b", Nat);
|
||||
env->add_axiom("ADD_COMM", add_comm_thm_type); // ADD_COMM : Pi (x, y: N), x + y = y + z
|
||||
|
@ -269,7 +269,7 @@ static void orelse_rewriter2_tst() {
|
|||
Eq(nAdd(Const("x"), zero), Const("x")));
|
||||
expr add_id_thm_body = Const("ADD_ID");
|
||||
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("a", Nat);
|
||||
env->add_var("b", Nat);
|
||||
env->add_axiom("ADD_ASSOC", add_assoc_thm_type);
|
||||
|
@ -318,7 +318,7 @@ static void try_rewriter1_tst() {
|
|||
Eq(nAdd(Const("x"), zero), Const("x")));
|
||||
expr add_id_thm_body = Const("ADD_ID");
|
||||
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("a", Nat);
|
||||
env->add_var("b", Nat);
|
||||
env->add_axiom("ADD_COMM", add_comm_thm_type); // ADD_COMM : Pi (x, y: N), x + y = y + z
|
||||
|
@ -369,7 +369,7 @@ static void try_rewriter2_tst() {
|
|||
Eq(nAdd(Const("x"), zero), Const("x")));
|
||||
expr add_id_thm_body = Const("ADD_ID");
|
||||
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("a", Nat);
|
||||
env->add_var("b", Nat);
|
||||
env->add_axiom("ADD_COMM", add_comm_thm_type); // ADD_COMM : Pi (x, y: N), x + y = y + z
|
||||
|
@ -415,7 +415,7 @@ static void app_rewriter1_tst() {
|
|||
Eq(nAdd(Const("x"), Const("y")), nAdd(Const("y"), Const("x")))));
|
||||
expr add_comm_thm_body = Const("ADD_COMM");
|
||||
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("f1", Nat >> Nat);
|
||||
env->add_var("f2", Nat >> (Nat >> Nat));
|
||||
env->add_var("f3", Nat >> (Nat >> (Nat >> Nat)));
|
||||
|
@ -505,7 +505,7 @@ static void repeat_rewriter1_tst() {
|
|||
Eq(nAdd(Const("x"), zero), Const("x")));
|
||||
expr add_id_thm_body = Const("ADD_ID");
|
||||
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("a", Nat);
|
||||
env->add_axiom("ADD_ASSOC", add_assoc_thm_type); // ADD_ASSOC : Pi (x, y, z : N), x + (y + z) = (x + y) + z
|
||||
env->add_axiom("ADD_COMM", add_comm_thm_type); // ADD_COMM : Pi (x, y: N), x + y = y + z
|
||||
|
@ -563,7 +563,7 @@ static void repeat_rewriter2_tst() {
|
|||
Eq(nAdd(Const("x"), zero), Const("x")));
|
||||
expr add_id_thm_body = Const("ADD_ID");
|
||||
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("a", Nat);
|
||||
env->add_axiom("ADD_ASSOC", add_assoc_thm_type); // ADD_ASSOC : Pi (x, y, z : N), x + (y + z) = (x + y) + z
|
||||
env->add_axiom("ADD_COMM", add_comm_thm_type); // ADD_COMM : Pi (x, y: N), x + y = y + z
|
||||
|
@ -610,7 +610,7 @@ static void depth_rewriter1_tst() {
|
|||
Eq(nAdd(Const("x"), Const("y")), nAdd(Const("y"), Const("x")))));
|
||||
expr add_comm_thm_body = Const("ADD_COMM");
|
||||
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("f1", Nat >> Nat);
|
||||
env->add_var("f2", Nat >> (Nat >> Nat));
|
||||
env->add_var("f3", Nat >> (Nat >> (Nat >> Nat)));
|
||||
|
@ -657,7 +657,7 @@ static void lambda_body_rewriter_tst() {
|
|||
Eq(nAdd(Const("x"), Const("y")), nAdd(Const("y"), Const("x")))));
|
||||
expr add_comm_thm_body = Const("ADD_COMM");
|
||||
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
env->add_var("f1", Nat >> Nat);
|
||||
env->add_var("f2", Nat >> (Nat >> Nat));
|
||||
env->add_var("f3", Nat >> (Nat >> (Nat >> Nat)));
|
||||
|
@ -702,7 +702,7 @@ static void lambda_type_rewriter_tst() {
|
|||
// Result : fun (x : vec(Nat, b + a)), x
|
||||
cout << "=== lambda_type_rewriter_tst() ===" << std::endl;
|
||||
context ctx;
|
||||
environment env; init_full_frontend(env);
|
||||
environment env; init_test_frontend(env);
|
||||
expr a = Const("a"); // a : Nat
|
||||
env->add_var("a", Nat);
|
||||
expr b = Const("b"); // b : Nat
|
||||
|
|
|
@ -49,7 +49,7 @@ static void check_failure(tactic t, ro_environment const & env, io_state const &
|
|||
static void tst1() {
|
||||
environment env;
|
||||
io_state io(options(), mk_simple_formatter());
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_var("p", Bool);
|
||||
env->add_var("q", Bool);
|
||||
expr p = Const("p");
|
||||
|
@ -115,7 +115,7 @@ static void tst1() {
|
|||
static void tst2() {
|
||||
environment env;
|
||||
io_state io(options(), mk_simple_formatter());
|
||||
init_full_frontend(env);
|
||||
init_test_frontend(env);
|
||||
env->add_var("p", Bool);
|
||||
env->add_var("q", Bool);
|
||||
env->add_var("r", Bool);
|
||||
|
|
Loading…
Reference in a new issue