2013-07-22 20:04:27 +00:00
|
|
|
/*
|
|
|
|
Copyright (c) 2013 Microsoft Corporation. All rights reserved.
|
|
|
|
Released under Apache 2.0 license as described in the file LICENSE.
|
|
|
|
|
|
|
|
Author: Leonardo de Moura
|
2013-08-01 22:42:06 +00:00
|
|
|
Soonho Kong
|
2013-07-22 20:04:27 +00:00
|
|
|
*/
|
2013-07-23 18:31:31 +00:00
|
|
|
#include <algorithm>
|
2013-07-22 20:04:27 +00:00
|
|
|
#include "expr.h"
|
2013-07-23 17:09:04 +00:00
|
|
|
#include "sets.h"
|
2013-07-23 16:01:54 +00:00
|
|
|
#include "max_sharing.h"
|
2013-07-23 18:31:31 +00:00
|
|
|
#include "free_vars.h"
|
2013-07-22 20:04:27 +00:00
|
|
|
#include "test.h"
|
2013-07-24 07:32:01 +00:00
|
|
|
#include "abstract.h"
|
|
|
|
#include "instantiate.h"
|
2013-07-24 17:14:22 +00:00
|
|
|
#include "deep_copy.h"
|
2013-07-22 20:04:27 +00:00
|
|
|
using namespace lean;
|
|
|
|
|
2013-07-23 02:02:11 +00:00
|
|
|
void tst1() {
|
2013-07-22 20:04:27 +00:00
|
|
|
expr a;
|
|
|
|
a = numeral(mpz(10));
|
|
|
|
expr f;
|
|
|
|
f = var(0);
|
2013-07-23 18:56:15 +00:00
|
|
|
expr fa = f(a);
|
2013-07-30 02:49:34 +00:00
|
|
|
expr ty = type(level());
|
2013-07-22 20:04:27 +00:00
|
|
|
std::cout << fa << "\n";
|
2013-07-23 18:56:15 +00:00
|
|
|
std::cout << fa(a) << "\n";
|
2013-07-23 18:47:36 +00:00
|
|
|
lean_assert(eqp(arg(fa, 0), f));
|
|
|
|
lean_assert(eqp(arg(fa, 1), a));
|
2013-07-23 18:56:15 +00:00
|
|
|
lean_assert(!eqp(fa, f(a)));
|
|
|
|
lean_assert(app(fa, a) == f(a, a));
|
|
|
|
std::cout << fa(fa, fa) << "\n";
|
2013-07-30 02:49:34 +00:00
|
|
|
std::cout << lambda("x", ty, var(0)) << "\n";
|
2013-07-23 18:56:15 +00:00
|
|
|
lean_assert(f(a)(a) == f(a, a));
|
|
|
|
lean_assert(f(a(a)) != f(a, a));
|
2013-07-30 02:49:34 +00:00
|
|
|
lean_assert(lambda("x", ty, var(0)) == lambda("y", ty, var(0)));
|
|
|
|
std::cout << pi("x", ty, var(0)) << "\n";
|
2013-07-22 20:04:27 +00:00
|
|
|
}
|
|
|
|
|
2013-08-01 22:42:06 +00:00
|
|
|
void tst1_pp() {
|
|
|
|
std::cerr << "=============== PP =====================\n";
|
|
|
|
expr a;
|
|
|
|
a = numeral(mpz(10));
|
|
|
|
expr f;
|
|
|
|
f = var(0);
|
|
|
|
expr fa = f(a);
|
|
|
|
expr ty = type(level());
|
|
|
|
pp(fa(a)); std::cout << "\n";
|
|
|
|
pp(fa(fa, fa)); std::cout << "\n";
|
|
|
|
pp(lambda("x", ty, var(0))); std::cout << "\n";
|
|
|
|
pp(pi("x", ty, var(0))); std::cout << "\n";
|
2013-08-02 17:34:18 +00:00
|
|
|
pp(pi("x", ty, lambda("y", ty, var(0)))); std::cout << "\n";
|
2013-08-01 22:42:06 +00:00
|
|
|
std::cerr << "=============== PP =====================\n";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2013-07-23 18:31:31 +00:00
|
|
|
expr mk_dag(unsigned depth, bool _closed = false) {
|
2013-07-23 16:37:32 +00:00
|
|
|
expr f = constant("f");
|
2013-07-23 18:31:31 +00:00
|
|
|
expr a = _closed ? constant("a") : var(0);
|
2013-07-22 20:04:27 +00:00
|
|
|
while (depth > 0) {
|
|
|
|
depth--;
|
2013-07-23 18:56:15 +00:00
|
|
|
a = f(a, a);
|
2013-07-22 20:04:27 +00:00
|
|
|
}
|
|
|
|
return a;
|
|
|
|
}
|
|
|
|
|
2013-07-22 23:40:17 +00:00
|
|
|
unsigned depth1(expr const & e) {
|
|
|
|
switch (e.kind()) {
|
2013-07-30 02:49:34 +00:00
|
|
|
case expr_kind::Var: case expr_kind::Constant: case expr_kind::Type: case expr_kind::Numeral:
|
2013-07-22 23:40:17 +00:00
|
|
|
return 1;
|
|
|
|
case expr_kind::App: {
|
|
|
|
unsigned m = 0;
|
2013-07-23 18:47:36 +00:00
|
|
|
for (expr const & a : args(e))
|
2013-07-22 23:40:17 +00:00
|
|
|
m = std::max(m, depth1(a));
|
|
|
|
return m + 1;
|
|
|
|
}
|
|
|
|
case expr_kind::Lambda: case expr_kind::Pi:
|
2013-08-03 18:31:42 +00:00
|
|
|
return std::max(depth1(abst_domain(e)), depth1(abst_body(e))) + 1;
|
2013-07-22 23:40:17 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This is the fastest depth implementation in this file.
|
|
|
|
unsigned depth2(expr const & e) {
|
|
|
|
switch (e.kind()) {
|
2013-07-30 02:49:34 +00:00
|
|
|
case expr_kind::Var: case expr_kind::Constant: case expr_kind::Type: case expr_kind::Numeral:
|
2013-07-22 23:40:17 +00:00
|
|
|
return 1;
|
|
|
|
case expr_kind::App:
|
|
|
|
return
|
|
|
|
std::accumulate(begin_args(e), end_args(e), 0,
|
|
|
|
[](unsigned m, expr const & arg){ return std::max(depth2(arg), m); })
|
|
|
|
+ 1;
|
|
|
|
case expr_kind::Lambda: case expr_kind::Pi:
|
2013-08-03 18:31:42 +00:00
|
|
|
return std::max(depth2(abst_domain(e)), depth2(abst_body(e))) + 1;
|
2013-07-22 23:40:17 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// This is the slowest depth implementation in this file.
|
|
|
|
unsigned depth3(expr const & e) {
|
|
|
|
static std::vector<std::pair<expr const *, unsigned>> todo;
|
|
|
|
unsigned m = 0;
|
|
|
|
todo.push_back(std::make_pair(&e, 0));
|
|
|
|
while (!todo.empty()) {
|
|
|
|
auto const & p = todo.back();
|
|
|
|
expr const & e = *(p.first);
|
|
|
|
unsigned c = p.second + 1;
|
|
|
|
todo.pop_back();
|
|
|
|
switch (e.kind()) {
|
2013-07-30 02:49:34 +00:00
|
|
|
case expr_kind::Var: case expr_kind::Constant: case expr_kind::Type: case expr_kind::Numeral:
|
2013-07-22 23:40:17 +00:00
|
|
|
m = std::max(c, m);
|
|
|
|
break;
|
|
|
|
case expr_kind::App: {
|
2013-07-23 18:47:36 +00:00
|
|
|
unsigned num = num_args(e);
|
2013-07-22 23:40:17 +00:00
|
|
|
for (unsigned i = 0; i < num; i++)
|
2013-07-23 18:47:36 +00:00
|
|
|
todo.push_back(std::make_pair(&arg(e, i), c));
|
2013-07-22 23:40:17 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case expr_kind::Lambda: case expr_kind::Pi:
|
2013-08-03 18:31:42 +00:00
|
|
|
todo.push_back(std::make_pair(&abst_domain(e), c));
|
2013-07-24 04:49:19 +00:00
|
|
|
todo.push_back(std::make_pair(&abst_body(e), c));
|
2013-07-22 23:40:17 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return m;
|
|
|
|
}
|
|
|
|
|
2013-07-23 02:02:11 +00:00
|
|
|
void tst2() {
|
2013-07-22 23:40:17 +00:00
|
|
|
expr r1 = mk_dag(20);
|
|
|
|
expr r2 = mk_dag(20);
|
2013-07-24 21:53:45 +00:00
|
|
|
lean_assert(r1 == r2);
|
2013-07-22 23:40:17 +00:00
|
|
|
std::cout << depth2(r1) << "\n";
|
2013-07-24 21:53:45 +00:00
|
|
|
lean_assert(depth2(r1) == 21);
|
2013-07-22 23:40:17 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
expr mk_big(expr f, unsigned depth, unsigned val) {
|
|
|
|
if (depth == 1)
|
2013-07-23 18:31:31 +00:00
|
|
|
return constant(name(val));
|
2013-07-22 23:40:17 +00:00
|
|
|
else
|
2013-07-23 18:56:15 +00:00
|
|
|
return f(mk_big(f, depth - 1, val << 1), mk_big(f, depth - 1, (val << 1) + 1));
|
2013-07-22 23:40:17 +00:00
|
|
|
}
|
|
|
|
|
2013-07-23 02:02:11 +00:00
|
|
|
void tst3() {
|
2013-07-23 16:37:32 +00:00
|
|
|
expr f = constant("f");
|
2013-07-22 23:40:17 +00:00
|
|
|
expr r1 = mk_big(f, 18, 0);
|
|
|
|
expr r2 = mk_big(f, 18, 0);
|
2013-07-24 21:53:45 +00:00
|
|
|
lean_assert(r1 == r2);
|
2013-07-22 20:04:27 +00:00
|
|
|
}
|
|
|
|
|
2013-07-23 02:02:11 +00:00
|
|
|
void tst4() {
|
2013-07-23 16:37:32 +00:00
|
|
|
expr f = constant("f");
|
2013-07-23 00:58:28 +00:00
|
|
|
expr a = var(0);
|
|
|
|
for (unsigned i = 0; i < 10000; i++) {
|
2013-07-23 18:56:15 +00:00
|
|
|
a = f(a);
|
2013-07-23 00:58:28 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-23 02:02:11 +00:00
|
|
|
expr mk_redundant_dag(expr f, unsigned depth) {
|
|
|
|
if (depth == 0)
|
|
|
|
return var(0);
|
|
|
|
else
|
2013-07-23 18:56:15 +00:00
|
|
|
return f(mk_redundant_dag(f, depth - 1), mk_redundant_dag(f, depth - 1));
|
2013-07-23 02:02:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
unsigned count_core(expr const & a, expr_set & s) {
|
|
|
|
if (s.find(a) != s.end())
|
|
|
|
return 0;
|
|
|
|
s.insert(a);
|
|
|
|
switch (a.kind()) {
|
2013-07-30 02:49:34 +00:00
|
|
|
case expr_kind::Var: case expr_kind::Constant: case expr_kind::Type: case expr_kind::Numeral:
|
2013-07-23 02:02:11 +00:00
|
|
|
return 1;
|
|
|
|
case expr_kind::App:
|
|
|
|
return std::accumulate(begin_args(a), end_args(a), 1,
|
|
|
|
[&](unsigned sum, expr const & arg){ return sum + count_core(arg, s); });
|
|
|
|
case expr_kind::Lambda: case expr_kind::Pi:
|
2013-08-03 18:31:42 +00:00
|
|
|
return count_core(abst_domain(a), s) + count_core(abst_body(a), s) + 1;
|
2013-07-23 02:02:11 +00:00
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
unsigned count(expr const & a) {
|
|
|
|
expr_set s;
|
|
|
|
return count_core(a, s);
|
|
|
|
}
|
|
|
|
|
|
|
|
void tst5() {
|
2013-07-23 16:37:32 +00:00
|
|
|
expr f = constant("f");
|
2013-07-23 02:31:27 +00:00
|
|
|
{
|
|
|
|
expr r1 = mk_redundant_dag(f, 5);
|
2013-07-23 15:59:39 +00:00
|
|
|
expr r2 = max_sharing(r1);
|
2013-07-23 02:31:27 +00:00
|
|
|
std::cout << "count(r1): " << count(r1) << "\n";
|
|
|
|
std::cout << "count(r2): " << count(r2) << "\n";
|
2013-08-02 01:54:06 +00:00
|
|
|
std::cout << "r1 = " << std::endl;
|
|
|
|
pp(r1);
|
|
|
|
std::cout << std::endl;
|
|
|
|
std::cout << "r2 = " << std::endl;
|
|
|
|
pp(r2);
|
|
|
|
std::cout << std::endl;
|
2013-07-23 02:31:27 +00:00
|
|
|
lean_assert(r1 == r2);
|
|
|
|
}
|
|
|
|
{
|
|
|
|
expr r1 = mk_redundant_dag(f, 16);
|
2013-07-23 15:59:39 +00:00
|
|
|
expr r2 = max_sharing(r1);
|
2013-07-23 02:31:27 +00:00
|
|
|
lean_assert(r1 == r2);
|
|
|
|
}
|
2013-07-23 02:02:11 +00:00
|
|
|
}
|
|
|
|
|
2013-07-23 15:59:39 +00:00
|
|
|
void tst6() {
|
2013-07-23 16:37:32 +00:00
|
|
|
expr f = constant("f");
|
2013-07-23 15:59:39 +00:00
|
|
|
expr r = mk_redundant_dag(f, 12);
|
|
|
|
for (unsigned i = 0; i < 1000; i++) {
|
|
|
|
r = max_sharing(r);
|
|
|
|
}
|
|
|
|
r = mk_big(f, 16, 0);
|
|
|
|
for (unsigned i = 0; i < 1000000; i++) {
|
|
|
|
r = max_sharing(r);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-23 16:18:18 +00:00
|
|
|
void tst7() {
|
2013-07-23 16:37:32 +00:00
|
|
|
expr f = constant("f");
|
2013-07-23 16:18:18 +00:00
|
|
|
expr v = var(0);
|
2013-07-23 18:56:15 +00:00
|
|
|
expr a1 = max_sharing(f(v,v));
|
|
|
|
expr a2 = max_sharing(f(v,v));
|
2013-07-23 16:18:18 +00:00
|
|
|
lean_assert(!eqp(a1, a2));
|
2013-07-23 18:56:15 +00:00
|
|
|
expr b = max_sharing(f(a1, a2));
|
2013-07-23 18:47:36 +00:00
|
|
|
lean_assert(eqp(arg(b, 1), arg(b, 2)));
|
2013-07-23 16:18:18 +00:00
|
|
|
}
|
|
|
|
|
2013-07-23 18:31:31 +00:00
|
|
|
void tst8() {
|
|
|
|
expr f = constant("f");
|
|
|
|
expr x = var(0);
|
|
|
|
expr a = constant("a");
|
|
|
|
expr n = numeral(mpz(10));
|
2013-07-30 02:49:34 +00:00
|
|
|
expr p = type(level());
|
2013-07-23 18:31:31 +00:00
|
|
|
expr y = var(1);
|
|
|
|
lean_assert(closed(a));
|
|
|
|
lean_assert(!closed(x));
|
|
|
|
lean_assert(closed(f));
|
2013-07-23 18:56:15 +00:00
|
|
|
lean_assert(!closed(f(x)));
|
2013-07-23 18:31:31 +00:00
|
|
|
lean_assert(closed(lambda("x", p, x)));
|
|
|
|
lean_assert(!closed(lambda("x", x, x)));
|
|
|
|
lean_assert(!closed(lambda("x", p, y)));
|
2013-07-23 18:56:15 +00:00
|
|
|
lean_assert(closed(f(f(f(a)))));
|
|
|
|
lean_assert(closed(lambda("x", p, f(f(f(a))))));
|
2013-07-23 18:31:31 +00:00
|
|
|
lean_assert(closed(pi("x", p, x)));
|
|
|
|
lean_assert(!closed(pi("x", x, x)));
|
|
|
|
lean_assert(!closed(pi("x", p, y)));
|
2013-07-23 18:56:15 +00:00
|
|
|
lean_assert(closed(pi("x", p, f(f(f(a))))));
|
2013-07-23 18:31:31 +00:00
|
|
|
lean_assert(closed(lambda("y", p, lambda("x", p, y))));
|
|
|
|
lean_assert(closed(lambda("y", p, app(lambda("x", p, y), var(0)))));
|
|
|
|
expr r = lambda("y", p, app(lambda("x", p, y), var(0)));
|
|
|
|
lean_assert(closed(r));
|
|
|
|
lean_assert(closed(r));
|
|
|
|
r = lambda("y", p, app(lambda("x", p, y), var(1)));
|
|
|
|
lean_assert(!closed(r));
|
|
|
|
r = lambda("y", p, app(lambda("x", p, var(0)), var(1)));
|
|
|
|
lean_assert(!closed(r));
|
|
|
|
lean_assert(closed(lambda("z", p, r)));
|
2013-08-02 01:54:06 +00:00
|
|
|
|
|
|
|
pp(lambda("y", p, app(lambda("x", p, y), var(0)))); std::cout << std::endl;
|
|
|
|
pp(pi("x", p, f(f(f(a))))); std::cout << std::endl;
|
|
|
|
|
2013-07-23 18:31:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void tst9() {
|
|
|
|
expr r = mk_dag(20, true);
|
|
|
|
lean_assert(closed(r));
|
|
|
|
r = mk_dag(20, false);
|
|
|
|
lean_assert(!closed(r));
|
|
|
|
}
|
|
|
|
|
|
|
|
void tst10() {
|
|
|
|
expr f = constant("f");
|
|
|
|
expr r = mk_big(f, 16, 0);
|
|
|
|
for (unsigned i = 0; i < 1000; i++) {
|
|
|
|
lean_assert(closed(r));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-07-24 07:32:01 +00:00
|
|
|
/**
|
|
|
|
\brief Substitute s with t in e.
|
|
|
|
|
|
|
|
\pre s and t must be closed expressions (i.e., no free variables)
|
|
|
|
*/
|
2013-08-03 19:20:01 +00:00
|
|
|
inline expr substitute(expr const & e, expr const & s, expr const & t) {
|
|
|
|
return instantiate(abstract(e, s), t);
|
2013-07-24 07:32:01 +00:00
|
|
|
}
|
|
|
|
|
2013-07-24 02:27:13 +00:00
|
|
|
void tst11() {
|
|
|
|
expr f = constant("f");
|
|
|
|
expr a = constant("a");
|
2013-07-24 07:04:05 +00:00
|
|
|
expr b = constant("b");
|
2013-07-24 02:27:13 +00:00
|
|
|
expr x = var(0);
|
2013-07-24 07:04:05 +00:00
|
|
|
expr y = var(1);
|
2013-07-30 02:49:34 +00:00
|
|
|
expr t = type(level());
|
2013-08-03 19:20:01 +00:00
|
|
|
std::cout << instantiate(lambda("x", t, f(f(y, b), f(x, y))), f(a)) << "\n";
|
|
|
|
lean_assert(instantiate(lambda("x", t, f(f(y, b), f(x, y))), f(a)) ==
|
2013-07-30 02:49:34 +00:00
|
|
|
lambda("x", t, f(f(f(a), b), f(x, f(a)))));
|
2013-08-03 19:20:01 +00:00
|
|
|
std::cout << abstract(lambda("x", t, f(a, lambda("y", t, f(b, a)))), constant("a")) << "\n";
|
|
|
|
lean_assert(abstract(lambda("x", t, f(a, lambda("y", t, f(b, a)))), constant("a")) ==
|
2013-07-30 02:49:34 +00:00
|
|
|
lambda("x", t, f(var(1), lambda("y", t, f(b, var(2))))));
|
2013-08-03 19:20:01 +00:00
|
|
|
std::cout << abstract_p(lambda("x", t, f(a, lambda("y", t, f(b, a)))), constant("a")) << "\n";
|
|
|
|
lean_assert(abstract_p(lambda("x", t, f(a, lambda("y", t, f(b, a)))), constant("a")) ==
|
2013-07-30 02:49:34 +00:00
|
|
|
lambda("x", t, f(a, lambda("y", t, f(b, a)))));
|
2013-08-03 19:20:01 +00:00
|
|
|
std::cout << abstract_p(lambda("x", t, f(a, lambda("y", t, f(b, a)))), a) << "\n";
|
|
|
|
lean_assert(abstract_p(lambda("x", t, f(a, lambda("y", t, f(b, a)))), a) ==
|
2013-07-30 02:49:34 +00:00
|
|
|
lambda("x", t, f(var(1), lambda("y", t, f(b, var(2))))));
|
2013-07-24 02:27:13 +00:00
|
|
|
|
2013-08-03 19:20:01 +00:00
|
|
|
lean_assert(substitute(f(f(f(a))), f(a), b) == f(f(b)));
|
2013-07-24 07:04:05 +00:00
|
|
|
}
|
2013-07-24 02:27:13 +00:00
|
|
|
|
2013-07-24 17:14:22 +00:00
|
|
|
void tst12() {
|
|
|
|
expr f = constant("f");
|
|
|
|
expr a = constant("a");
|
|
|
|
expr x = var(0);
|
2013-07-30 02:49:34 +00:00
|
|
|
expr t = type(level());
|
|
|
|
expr F = pi("y", t, lambda("x", t, f(f(f(x,a),numeral(10)),x)));
|
2013-07-24 17:14:22 +00:00
|
|
|
expr G = deep_copy(F);
|
|
|
|
lean_assert(F == G);
|
|
|
|
lean_assert(!eqp(F, G));
|
|
|
|
lean_assert(count(F) == count(G));
|
|
|
|
}
|
|
|
|
|
2013-07-24 19:24:49 +00:00
|
|
|
void tst13() {
|
|
|
|
expr f = constant("f");
|
|
|
|
expr v = var(0);
|
|
|
|
expr a1 = max_sharing(f(v,v));
|
|
|
|
expr a2 = max_sharing(f(v,v));
|
|
|
|
lean_assert(!eqp(a1, a2));
|
|
|
|
lean_assert(a1 == a2);
|
|
|
|
max_sharing_fn M;
|
|
|
|
lean_assert(eqp(M(f(v,v)), M(f(v,v))));
|
|
|
|
lean_assert(eqp(M(a1), M(a2)));
|
|
|
|
}
|
|
|
|
|
2013-07-30 02:44:26 +00:00
|
|
|
void tst14() {
|
|
|
|
expr t0 = type(level());
|
|
|
|
expr t1 = type(level()+1);
|
|
|
|
lean_assert(ty_level(t1) == level()+1);
|
|
|
|
lean_assert(t0 != t1);
|
|
|
|
std::cout << t0 << " " << t1 << "\n";
|
|
|
|
}
|
|
|
|
|
2013-07-22 20:04:27 +00:00
|
|
|
int main() {
|
2013-07-23 15:59:39 +00:00
|
|
|
continue_on_violation(true);
|
2013-07-24 08:16:35 +00:00
|
|
|
std::cout << "sizeof(expr): " << sizeof(expr) << "\n";
|
|
|
|
std::cout << "sizeof(expr_app): " << sizeof(expr_app) << "\n";
|
|
|
|
std::cout << "sizeof(expr_cell): " << sizeof(expr_cell) << "\n";
|
2013-07-23 02:31:27 +00:00
|
|
|
tst1();
|
2013-08-01 22:42:06 +00:00
|
|
|
tst1_pp();
|
2013-07-23 02:31:27 +00:00
|
|
|
tst2();
|
|
|
|
tst3();
|
|
|
|
tst4();
|
2013-07-23 02:02:11 +00:00
|
|
|
tst5();
|
2013-07-23 15:59:39 +00:00
|
|
|
tst6();
|
2013-07-23 16:18:18 +00:00
|
|
|
tst7();
|
2013-07-23 18:47:36 +00:00
|
|
|
tst8();
|
|
|
|
tst9();
|
|
|
|
tst10();
|
2013-07-24 02:27:13 +00:00
|
|
|
tst11();
|
2013-07-24 17:14:22 +00:00
|
|
|
tst12();
|
2013-07-24 19:24:49 +00:00
|
|
|
tst13();
|
2013-07-30 02:44:26 +00:00
|
|
|
tst14();
|
2013-07-23 00:58:28 +00:00
|
|
|
std::cout << "done" << "\n";
|
2013-07-22 20:04:27 +00:00
|
|
|
return has_violations() ? 1 : 0;
|
|
|
|
}
|