3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-07-18 02:16:40 +00:00

fix sorting network bug, add network compilation,...

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2014-09-11 18:47:21 -07:00
parent 72f09e4729
commit 019ff77613
15 changed files with 350 additions and 100 deletions

View file

@ -271,3 +271,12 @@ rational pb_util::to_rational(parameter const& p) const {
SASSERT(p.is_rational());
return p.get_rational();
}
bool pb_util::has_unit_coefficients(func_decl* f) const {
if (is_at_most_k(f) || is_at_least_k(f)) return true;
unsigned sz = f->get_arity();
for (unsigned i = 0; i < sz; ++i) {
if (!get_coeff(f, i).is_one()) return false;
}
return true;
}