3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-04-22 16:45:31 +00:00

work on horner form

Signed-off-by: Lev Nachmanson <levnach@hotmail.com>
This commit is contained in:
Lev Nachmanson 2019-07-12 14:57:42 -07:00
parent b6a99d515b
commit 54be45d818
3 changed files with 4 additions and 3 deletions

View file

@ -44,7 +44,7 @@ void horner::lemmas_on_expr(nex& e) {
cross_nested cn(e, [this](const nex& n) {
auto i = interval_of_expr(n);
m_intervals.check_interval_for_conflict_on_zero(i);} );
cn.run();
}

View file

@ -119,7 +119,7 @@ public:
case expr_type::MUL:
return print_mul(out);
case expr_type::VAR:
out << static_cast<char>('a'+m_j);
out << 'v' << m_j;
return out;
case expr_type::SCALAR:
out << m_v;

View file

@ -72,7 +72,8 @@ void test_cn() {
enable_trace("nla_cn");
// (a(a+(b+c)c+d)d + e(a(e+c)+d)
nex a = nex::var(0), b = nex::var(1), c = nex::var(2), d = nex::var(3), e = nex::var(4);
nex t = a*a*d + a*b*c*d + a*c*c*d + e*a*e + e*a*c + e*d;
nex t = a*a*d + a*b*c*d + a*c*c*d + a*d*d + e*a*e + e*a*c + e*d;
std::cout << "t = " << t << "\n";
TRACE("nla_cn", tout << "t=" << t << '\n';);
cross_nested cn(t, [](const nex& n) { std::cout << n << "\n"; } );
cn.run();