mirror of
https://github.com/Z3Prover/z3
synced 2025-06-07 06:33:23 +00:00
fingers starting on xor_gaussian.cpp
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
130432370f
commit
12be80524d
1 changed files with 26 additions and 24 deletions
|
@ -39,7 +39,7 @@ unsigned PackedRow::find_watchVar(
|
||||||
tmp_clause.clear();
|
tmp_clause.clear();
|
||||||
|
|
||||||
for(int i = 0; i < size*64; i++) {
|
for(int i = 0; i < size*64; i++) {
|
||||||
if (this->operator[](i)){
|
if ((*this)[i]) {
|
||||||
popcnt++;
|
popcnt++;
|
||||||
unsigned var = col_to_var[i];
|
unsigned var = col_to_var[i];
|
||||||
tmp_clause.push_back(sat::literal(var, false));
|
tmp_clause.push_back(sat::literal(var, false));
|
||||||
|
@ -66,31 +66,33 @@ void PackedRow::get_reason(
|
||||||
PackedRow& tmp_col2,
|
PackedRow& tmp_col2,
|
||||||
literal prop) {
|
literal prop) {
|
||||||
tmp_col2.set_and(*this, cols_vals);
|
tmp_col2.set_and(*this, cols_vals);
|
||||||
for (int i = 0; i < size; i++) if (mp[i]) {
|
for (int i = 0; i < size; i++)
|
||||||
int64_t tmp = mp[i];
|
if (mp[i]) {
|
||||||
unsigned long at;
|
int64_t tmp = mp[i];
|
||||||
at = scan_fwd_64b(tmp);
|
unsigned long at;
|
||||||
int extra = 0;
|
|
||||||
while (at != 0) {
|
|
||||||
unsigned col = extra + at-1 + i*64;
|
|
||||||
SASSERT(operator[](col) == 1);
|
|
||||||
const unsigned var = col_to_var[col];
|
|
||||||
if (var == prop.var()) {
|
|
||||||
tmp_clause.push_back(prop);
|
|
||||||
std::swap(tmp_clause[0], tmp_clause.back());
|
|
||||||
} else {
|
|
||||||
const bool val_bool = tmp_col2[col];
|
|
||||||
tmp_clause.push_back(sat::literal(var, val_bool));
|
|
||||||
}
|
|
||||||
|
|
||||||
extra += at;
|
|
||||||
if (extra == 64)
|
|
||||||
break;
|
|
||||||
|
|
||||||
tmp >>= at;
|
|
||||||
at = scan_fwd_64b(tmp);
|
at = scan_fwd_64b(tmp);
|
||||||
|
int extra = 0;
|
||||||
|
while (at != 0) {
|
||||||
|
unsigned col = extra + at - 1 + i * 64;
|
||||||
|
SASSERT(operator[](col) == 1);
|
||||||
|
const unsigned var = col_to_var[col];
|
||||||
|
if (var == prop.var()) {
|
||||||
|
tmp_clause.push_back(prop);
|
||||||
|
std::swap(tmp_clause[0], tmp_clause.back());
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
bool val_bool = tmp_col2[col]; // NSB: double check if z3 use of sign is compatible
|
||||||
|
tmp_clause.push_back(sat::literal(var, val_bool));
|
||||||
|
}
|
||||||
|
|
||||||
|
extra += at;
|
||||||
|
if (extra == 64)
|
||||||
|
break;
|
||||||
|
|
||||||
|
tmp >>= at;
|
||||||
|
at = scan_fwd_64b(tmp);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gret PackedRow::propGause(
|
gret PackedRow::propGause(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue