mirror of
https://github.com/Z3Prover/z3
synced 2025-06-20 04:43:39 +00:00
fix viable
This commit is contained in:
parent
b72a0ed4c8
commit
13f000942a
3 changed files with 14 additions and 4 deletions
|
@ -29,6 +29,10 @@ namespace polysat {
|
||||||
* \returns True iff a forbidden interval exists and the output parameters were set.
|
* \returns True iff a forbidden interval exists and the output parameters were set.
|
||||||
*/
|
*/
|
||||||
bool forbidden_intervals::get_interval(signed_constraint const& c, pvar v, fi_record& fi) {
|
bool forbidden_intervals::get_interval(signed_constraint const& c, pvar v, fi_record& fi) {
|
||||||
|
// verbose_stream() << "get_interval for v" << v << " " << c << "\n";
|
||||||
|
SASSERT(fi.side_cond.empty());
|
||||||
|
SASSERT(fi.src.empty());
|
||||||
|
fi.bit_width = s.size(v); // TODO: preliminary
|
||||||
if (c->is_ule())
|
if (c->is_ule())
|
||||||
return get_interval_ule(c, v, fi);
|
return get_interval_ule(c, v, fi);
|
||||||
if (c->is_umul_ovfl())
|
if (c->is_umul_ovfl())
|
||||||
|
|
|
@ -25,11 +25,19 @@ namespace polysat {
|
||||||
vector<signed_constraint> side_cond;
|
vector<signed_constraint> side_cond;
|
||||||
vector<signed_constraint> src; // only units may have multiple src (as they can consist of contracted bit constraints)
|
vector<signed_constraint> src; // only units may have multiple src (as they can consist of contracted bit constraints)
|
||||||
rational coeff;
|
rational coeff;
|
||||||
unsigned bit_width; // number of lower bits
|
unsigned bit_width = 0; // number of lower bits
|
||||||
|
|
||||||
/** Create invalid fi_record */
|
/** Create invalid fi_record */
|
||||||
fi_record(): interval(eval_interval::full()) {}
|
fi_record(): interval(eval_interval::full()) {}
|
||||||
|
|
||||||
|
void reset() {
|
||||||
|
interval = eval_interval::full();
|
||||||
|
side_cond.reset();
|
||||||
|
src.reset();
|
||||||
|
coeff.reset();
|
||||||
|
bit_width = 0;
|
||||||
|
}
|
||||||
|
|
||||||
struct less {
|
struct less {
|
||||||
bool operator()(fi_record const& a, fi_record const& b) const {
|
bool operator()(fi_record const& a, fi_record const& b) const {
|
||||||
return a.interval.lo_val() < b.interval.lo_val();
|
return a.interval.lo_val() < b.interval.lo_val();
|
||||||
|
|
|
@ -78,10 +78,8 @@ namespace polysat {
|
||||||
if (m_alloc.empty())
|
if (m_alloc.empty())
|
||||||
return alloc(entry);
|
return alloc(entry);
|
||||||
auto* e = m_alloc.back();
|
auto* e = m_alloc.back();
|
||||||
e->src.reset();
|
e->fi_record::reset();
|
||||||
e->side_cond.reset();
|
|
||||||
e->refined.reset();
|
e->refined.reset();
|
||||||
e->coeff = 1;
|
|
||||||
m_alloc.pop_back();
|
m_alloc.pop_back();
|
||||||
return e;
|
return e;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue