2013-09-26 03:25:24 +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
|
|
|
|
*/
|
|
|
|
#include "util/test.h"
|
2014-09-23 19:09:13 +00:00
|
|
|
#include "util/init_module.h"
|
|
|
|
#include "util/sexpr/init_module.h"
|
2013-11-19 19:24:02 +00:00
|
|
|
#include "kernel/for_each_fn.h"
|
2013-09-26 03:25:24 +00:00
|
|
|
#include "kernel/abstract.h"
|
2014-09-23 19:09:13 +00:00
|
|
|
#include "kernel/init_module.h"
|
|
|
|
#include "library/init_module.h"
|
2013-09-26 03:25:24 +00:00
|
|
|
#include "library/deep_copy.h"
|
|
|
|
using namespace lean;
|
|
|
|
|
|
|
|
static void tst1() {
|
|
|
|
expr f = Const("f");
|
|
|
|
expr a = Const("a");
|
|
|
|
expr x = Var(0);
|
2014-09-23 19:09:13 +00:00
|
|
|
expr Type = mk_Type();
|
2014-04-22 19:05:49 +00:00
|
|
|
expr t = Type;
|
2013-09-26 03:25:24 +00:00
|
|
|
expr z = Const("z");
|
2014-04-22 19:05:49 +00:00
|
|
|
expr m = mk_metavar("a", Type);
|
2014-06-24 23:27:23 +00:00
|
|
|
expr F = mk_pi("y", t, mk_lambda("x", t, f(f(f(x, a), Const("10")), f(x, m))));
|
2013-09-26 03:25:24 +00:00
|
|
|
expr G = deep_copy(F);
|
|
|
|
lean_assert(F == G);
|
|
|
|
lean_assert(!is_eqp(F, G));
|
|
|
|
}
|
|
|
|
|
|
|
|
int main() {
|
2013-12-07 22:59:21 +00:00
|
|
|
save_stack_info();
|
2014-09-23 19:09:13 +00:00
|
|
|
initialize_util_module();
|
|
|
|
initialize_sexpr_module();
|
|
|
|
initialize_kernel_module();
|
|
|
|
initialize_library_module();
|
2013-09-26 03:25:24 +00:00
|
|
|
tst1();
|
2014-09-23 19:09:13 +00:00
|
|
|
finalize_library_module();
|
|
|
|
finalize_kernel_module();
|
|
|
|
finalize_sexpr_module();
|
|
|
|
finalize_util_module();
|
2013-09-26 03:25:24 +00:00
|
|
|
return has_violations() ? 1 : 0;
|
|
|
|
}
|