mirror of
https://github.com/Z3Prover/z3
synced 2025-09-03 16:48:06 +00:00
n/a
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
cbefe74219
commit
6a572543b4
2 changed files with 26 additions and 2 deletions
|
@ -45,9 +45,33 @@ static void test1() {
|
|||
std::cout << g << "\n";
|
||||
}
|
||||
|
||||
static void test2() {
|
||||
ast_manager m;
|
||||
reg_decl_plugins(m);
|
||||
euf::egraph g(m);
|
||||
g.add_plugins();
|
||||
arith_util a(m);
|
||||
sort_ref I(a.mk_int(), m);
|
||||
|
||||
expr_ref x(m.mk_const("x", I), m);
|
||||
expr_ref y(m.mk_const("y", I), m);
|
||||
auto* nx = get_node(g, a.mk_add(x, y));
|
||||
auto* ny = get_node(g, a.mk_add(y, x));
|
||||
TRACE("plugin", tout << "before merge\n" << g << "\n");
|
||||
g.merge(nx, get_node(g, x), nullptr);
|
||||
g.merge(ny, get_node(g, y), nullptr);
|
||||
|
||||
TRACE("plugin", tout << "before propagate\n" << g << "\n");
|
||||
g.propagate();
|
||||
TRACE("plugin", tout << "after propagate\n" << g << "\n");
|
||||
SASSERT(get_node(g, x)->get_root() == get_node(g, y)->get_root());
|
||||
g.merge(get_node(g, a.mk_add(x, a.mk_add(y, y))), get_node(g, a.mk_add(y, x)), nullptr);
|
||||
g.propagate();
|
||||
std::cout << g << "\n";
|
||||
}
|
||||
|
||||
void tst_euf_arith_plugin() {
|
||||
enable_trace("plugin");
|
||||
test1();
|
||||
test2();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue