3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-14 03:04:44 +00:00

more of shr

This commit is contained in:
Nikolaj Bjorner 2021-12-14 19:23:31 -08:00
parent 842e9234c9
commit 6eb6eb39a4
5 changed files with 44 additions and 2 deletions

View file

@ -19,6 +19,7 @@ Author:
#include "math/polysat/log_helper.h"
#include "math/polysat/ule_constraint.h"
#include "math/polysat/mul_ovfl_constraint.h"
#include "math/polysat/shr_constraint.h"
namespace polysat {
@ -232,6 +233,10 @@ namespace polysat {
return { dedup(alloc(mul_ovfl_constraint, *this, a, b)), true };
}
signed_constraint constraint_manager::shr(pdd const& p, pdd const& q) {
return { dedup(alloc(shr_constraint, *this, p, q)), true };
}
// To do signed comparison of bitvectors, flip the msb and do unsigned comparison:
//
@ -279,6 +284,14 @@ namespace polysat {
return *dynamic_cast<mul_ovfl_constraint const*>(this);
}
shr_constraint& constraint::to_shr() {
return *dynamic_cast<shr_constraint*>(this);
}
shr_constraint const& constraint::to_shr() const {
return *dynamic_cast<shr_constraint const*>(this);
}
std::string constraint::bvar2string() const {
std::stringstream out;
out << " (b";