Trace("builtin-rewrite-debug") << "...failed to get array representation." << std::endl;
}
return RewriteResponse(REWRITE_DONE, node);
+ }
+ else if (node.getKind() == kind::CHOICE)
+ {
+ if (node[1].getKind() == kind::EQUAL)
+ {
+ for (unsigned i = 0; i < 2; i++)
+ {
+ if (node[1][i] == node[0][0])
+ {
+ return RewriteResponse(REWRITE_DONE, node[1][1 - i]);
+ }
+ }
+ }
+ return RewriteResponse(REWRITE_DONE, node);
}else{
return doRewrite(node);
}
nm->mkSkolem("ek",
ex.getType(),
"variable to represent disjoint extract region");
- Node ceq_lem = var.eqNode(ex);
- Trace("cegqi-bv-pp") << "Introduced : " << ceq_lem << std::endl;
- new_lems.push_back(ceq_lem);
children.push_back(var);
vars.push_back(var);
}
if (visited.find(cur) == visited.end())
{
visited.insert(cur);
-
- if (cur.getKind() == BITVECTOR_EXTRACT)
+ if (cur.getKind() != FORALL)
{
- extract_map[cur[0]].push_back(cur);
- }
+ if (cur.getKind() == BITVECTOR_EXTRACT)
+ {
+ extract_map[cur[0]].push_back(cur);
+ }
- for (const Node& nc : cur)
- {
- visit.push_back(nc);
+ for (const Node& nc : cur)
+ {
+ visit.push_back(nc);
+ }
}
}
} while (!visit.empty());
virtual ~BvInstantiatorPreprocess() {}
/** register counterexample lemma
*
- * This method modifies the contents of lems based on removing extract terms
- * when the option --cbqi-bv-rm-extract is enabled.
+ * This method modifies the contents of lems based on the extract terms
+ * it contains when the option --cbqi-bv-rm-extract is enabled. It introduces
+ * a dummy equality so that segments of terms t under extracts can be solved
+ * independently.
*
* For example:
* P[ ((extract 7 4) t), ((extract 3 0) t)]
* becomes:
* P[((extract 7 4) t), ((extract 3 0) t)] ^
- * t = concat( x74, x30 ) ^
- * x74 = ((extract 7 4) t) ^
- * x30 = ((extract 3 0) t)
- * where x74 and x30 are fresh variables.
+ * t = concat( x74, x30 )
+ * where x74 and x30 are fresh variables of type BV_4.
*
* Another example:
* P[ ((extract 7 3) t), ((extract 4 0) t)]
* becomes:
* P[((extract 7 4) t), ((extract 3 0) t)] ^
- * t = concat( x75, x44, x30 ) ^
- * x75 = ((extract 7 5) t) ^
- * x44 = ((extract 4 4) t) ^
- * x30 = ((extract 3 0) t)
- * where x75, x44 and x30 are fresh variables.
+ * t = concat( x75, x44, x30 )
+ * where x75, x44 and x30 are fresh variables of type BV_3, BV_1, and BV_4
+ * respectively.
*
* Notice we leave the original conjecture alone. This is done for performance
* since the added equalities ensure we are able to construct the proper