3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-10 03:07:07 +00:00
z3/test/theory_dl.cpp
Leonardo de Moura 68269c43a6 other components
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
2012-10-02 11:48:48 -07:00

36 lines
818 B
C++

#include "smt_context.h"
#include "dl_decl_plugin.h"
#include "ast_pp.h"
#include "model_v2_pp.h"
void tst_theory_dl() {
ast_manager m;
front_end_params params;
params.m_model = true;
datalog::dl_decl_util u(m);
smt::context ctx(m, params);
m.register_decl_plugins();
expr_ref a(m), b(m), c(m);
sort_ref s(m);
s = u.mk_sort(symbol("S"),111);
a = m.mk_const(symbol("a"),s);
b = m.mk_const(symbol("b"),s);
ctx.assert_expr(u.mk_lt(a, b));
ctx.check();
ref<model> md;
ctx.get_model(md);
model_v2_pp(std::cout, *md.get());
c = m.mk_const(symbol("c"),s);
ctx.assert_expr(u.mk_lt(b, c));
ctx.check();
ctx.get_model(md);
model_v2_pp(std::cout, *md.get());
ctx.assert_expr(u.mk_lt(c, a));
std::cout << ctx.check() << "\n";
}