3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-08-05 19:00:25 +00:00

adding pre-processing to nlsat for equations

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2017-12-30 20:35:33 -08:00
parent 5bc4c9809e
commit 79a9dfd8fd
11 changed files with 696 additions and 222 deletions

View file

@ -29,6 +29,7 @@ Notes:
#include "util/params.h"
#include "util/mpbqi.h"
#include "util/rlimit.h"
#include "util/lbool.h"
class small_object_allocator;
@ -98,7 +99,7 @@ namespace polynomial {
};
struct display_var_proc {
virtual void operator()(std::ostream & out, var x) const { out << "x" << x; }
virtual std::ostream& operator()(std::ostream & out, var x) const { return out << "x" << x; }
};
class polynomial;
@ -306,12 +307,27 @@ namespace polynomial {
\brief Return true if m is linear (i.e., it is of the form 1 or x).
*/
static bool is_linear(monomial const * m);
/**
\brief Return true if all monomials in p are linear.
*/
static bool is_linear(polynomial const * p);
/**
\brief Return true if the monomial is a variable.
*/
static bool is_var(monomial const* p, var& v);
/**
\brief Return true if the polynomial is a variable.
*/
bool is_var(polynomial const* p, var& v);
/**
\brief Return true if the polynomial is of the form x + k
*/
bool is_var_num(polynomial const* p, var& v, scoped_numeral& n);
/**
\brief Return the degree of variable x in p.
*/
@ -860,7 +876,13 @@ namespace polynomial {
\brief Return true if p is a square, and store its square root in r.
*/
bool sqrt(polynomial const * p, polynomial_ref & r);
/**
\brief obtain the sign of the polynomial given sign of variables.
*/
lbool sign(polynomial const* p, svector<lbool> const& sign_of_vars);
/**
\brief Return true if p is always positive for any assignment of its variables.
@ -936,6 +958,13 @@ namespace polynomial {
return substitute(p, 1, &x, &v);
}
/**
\brief Apply substiution [x -> p/q] in r.
That is, given r \in Z[x, y_1, .., y_m] return
polynomial q^k * r(p/q, y_1, .., y_m), where k is the maximal degree of x in r.
*/
void substitute(polynomial const* r, var x, polynomial const* p, polynomial const* q, polynomial_ref& result);
/**
\brief Factorize the given polynomial p and store its factors in r.
*/