3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-13 12:28:44 +00:00
z3/src/test/factor_rewriter.cpp
2022-06-17 17:11:18 +01:00

27 lines
675 B
C++

/*++
Copyright (c) 2015 Microsoft Corporation
--*/
#include "ast/rewriter/factor_rewriter.h"
#include "ast/bv_decl_plugin.h"
#include "ast/ast_pp.h"
#include "ast/reg_decl_plugins.h"
#include <iostream>
void tst_factor_rewriter() {
ast_manager m;
reg_decl_plugins(m);
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";
}