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

19 lines
552 B
C++

#include "factor_rewriter.h"
#include "bv_decl_plugin.h"
#include "ast_pp.h"
void tst_factor_rewriter() {
ast_manager m;
m.register_decl_plugins();
factor_rewriter_star fw(m);
arith_util a(m);
expr_ref fml1(m), fml2(m);
expr_ref z(m.mk_const(symbol("z"), a.mk_real()), m);
expr_ref two(a.mk_numeral(rational(2),false),m);
expr_ref zero(a.mk_numeral(rational(0),false),m);
fml1 = a.mk_le(zero, a.mk_mul(two, z, z));
fw(fml1, fml2);
std::cout << mk_pp(fml1, m) << " -> " << mk_pp(fml2, m) << "\n";
}