mirror of
https://github.com/Z3Prover/z3
synced 2025-08-24 20:16:00 +00:00
hoist out fixed-bits reasoning into self-contained module
without dependencies on viable entries
This commit is contained in:
parent
658f079efd
commit
b1072d0a1c
8 changed files with 183 additions and 158 deletions
|
@ -17,13 +17,33 @@ Author:
|
|||
|
||||
namespace polysat {
|
||||
|
||||
bool get_eq_fixed_lsb(pdd const& p, fixed_bits& out);
|
||||
bool get_eq_fixed_bits(pdd const& p, fixed_bits& out);
|
||||
class core;
|
||||
|
||||
bool get_ule_fixed_lsb(pdd const& lhs, pdd const& rhs, bool is_positive, fixed_bits& out);
|
||||
bool get_ule_fixed_msb(pdd const& lhs, pdd const& rhs, bool is_positive, fixed_bits& out);
|
||||
bool get_ule_fixed_bit(pdd const& lhs, pdd const& rhs, bool is_positive, fixed_bits& out);
|
||||
bool get_ule_fixed_bits(pdd const& lhs, pdd const& rhs, bool is_positive, fixed_bits& out);
|
||||
bool get_fixed_bits(signed_constraint c, fixed_bits& out);
|
||||
bool get_eq_fixed_lsb(pdd const& p, fixed_slice& out);
|
||||
bool get_eq_fixed_slice(pdd const& p, fixed_slice& out);
|
||||
|
||||
bool get_ule_fixed_lsb(pdd const& lhs, pdd const& rhs, bool is_positive, fixed_slice& out);
|
||||
bool get_ule_fixed_msb(pdd const& lhs, pdd const& rhs, bool is_positive, fixed_slice& out);
|
||||
bool get_ule_fixed_bit(pdd const& lhs, pdd const& rhs, bool is_positive, fixed_slice& out);
|
||||
bool get_ule_fixed_slice(pdd const& lhs, pdd const& rhs, bool is_positive, fixed_slice& out);
|
||||
bool get_fixed_slice(signed_constraint c, fixed_slice& out);
|
||||
|
||||
class fixed_bits {
|
||||
core& c;
|
||||
pvar m_var = null_var;
|
||||
vector<fixed_slice> m_fixed_slices;
|
||||
svector<lbool> m_fixed;
|
||||
bool_vector m_bits;
|
||||
public:
|
||||
fixed_bits(core& c) : c(c) {}
|
||||
|
||||
// reset with fixed bits information for variable v
|
||||
void reset(pvar v);
|
||||
|
||||
// find then next value >= val that agrees with fixed bits, or false if none exists within the maximal value for val.
|
||||
bool next(rational& val);
|
||||
|
||||
// explain the fixed bits ranges.
|
||||
dependency_vector explain();
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue