mirror of
https://github.com/Z3Prover/z3
synced 2025-05-08 16:25:48 +00:00
other components
Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
parent
e9eab22e5c
commit
68269c43a6
250 changed files with 70871 additions and 0 deletions
37
test/substitution.cpp
Normal file
37
test/substitution.cpp
Normal file
|
@ -0,0 +1,37 @@
|
|||
#include "expr_substitution.h"
|
||||
#include "front_end_params.h"
|
||||
#include "substitution.h"
|
||||
#include "unifier.h"
|
||||
#include "bv_decl_plugin.h"
|
||||
#include "ast_pp.h"
|
||||
#include "arith_decl_plugin.h"
|
||||
|
||||
|
||||
void tst_substitution()
|
||||
{
|
||||
memory::initialize(0);
|
||||
front_end_params params;
|
||||
params.m_model = true;
|
||||
|
||||
enable_trace("subst_bug");
|
||||
|
||||
ast_manager m;
|
||||
m.register_decl_plugins();
|
||||
|
||||
var_ref v1(m.mk_var(0, m.mk_bool_sort()), m);
|
||||
var_ref v2(m.mk_var(1, m.mk_bool_sort()), m);
|
||||
|
||||
substitution subst(m);
|
||||
subst.reserve(1,2);
|
||||
unifier unif(m);
|
||||
|
||||
bool ok1 = unif(v1.get(), v2.get(), subst, false);
|
||||
bool ok2 = unif(v2.get(), v1.get(), subst, false);
|
||||
|
||||
expr_ref res(m);
|
||||
|
||||
TRACE("substitution", subst.display(tout););
|
||||
TRACE("substitution", tout << ok1 << " " << ok2 << "\n";);
|
||||
subst.display(std::cout);
|
||||
subst.apply(v1.get(), res);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue