3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-07 15:55:46 +00:00

evaluate with don't cares

Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
Nikolaj Bjorner 2020-01-18 09:17:15 -08:00
parent 321bad2c84
commit 495b88ce99
5 changed files with 47 additions and 28 deletions

View file

@ -166,9 +166,10 @@ namespace sat {
sat-sweep evaluation. Given 64 bits worth of possible values per variable,
find possible values for function table encoded by cut.
*/
uint64_t cut::eval(svector<uint64_t> const& env) const {
uint64_t result = 0ull;
cut_val cut::eval(cut_eval const& env) const {
cut_val v;
uint64_t t = table();
uint64_t n = table();
unsigned sz = size();
if (sz == 1 && t == 2) {
return env[m_elems[0]];
@ -176,11 +177,12 @@ namespace sat {
for (unsigned i = 0; i < 64; ++i) {
unsigned offset = 0;
for (unsigned j = 0; j < sz; ++j) {
offset |= (((env[m_elems[j]] >> i) & 0x1) << j);
offset |= (((env[m_elems[j]].m_t >> i) & 0x1) << j);
}
result |= ((t >> offset) & 0x1) << i;
v.m_t |= ((t >> offset) & 0x1) << i;
v.m_f |= ((n >> offset) & 0x1) << i;
}
return result;
return v;
}
std::ostream& cut::display(std::ostream& out) const {