}
if (node.getType().isArray()) {
- d_equalityEngine.addTriggerTerm(node, THEORY_ARRAY);
d_mayEqualEqualityEngine.addTerm(node);
+ d_equalityEngine.addTriggerTerm(node, THEORY_ARRAY);
}
else {
d_equalityEngine.addTerm(node);
throw LogicException("Array theory solver does not yet support non-constant default values for arrays");
}
d_infoMap.setConstArr(node, node);
- d_equalityEngine.addTriggerTerm(node, THEORY_ARRAY);
d_mayEqualEqualityEngine.addTerm(node);
Assert(d_mayEqualEqualityEngine.getRepresentative(node) == node);
+ d_equalityEngine.addTriggerTerm(node, THEORY_ARRAY);
d_defValues[node] = defaultValue;
break;
}
default:
// Variables etc
if (node.getType().isArray()) {
- d_equalityEngine.addTriggerTerm(node, THEORY_ARRAY);
- Assert(d_equalityEngine.getSize(node) == 1);
// The may equal needs the node
d_mayEqualEqualityEngine.addTerm(node);
+ d_equalityEngine.addTriggerTerm(node, THEORY_ARRAY);
+ Assert(d_equalityEngine.getSize(node) == 1);
}
else {
d_equalityEngine.addTerm(node);
// generate the lemmas on the worklist
Trace("arrays-lem")<<"Arrays::discharging lemmas: "<<d_RowQueue.size()<<"\n";
while (d_RowQueue.size() > 0 && !d_conflict) {
- dischargeLemmas();
+ if (dischargeLemmas()) {
+ break;
+ }
}
}
}
-void TheoryArrays::dischargeLemmas()
+bool TheoryArrays::dischargeLemmas()
{
+ bool lemmasAdded = false;
size_t sz = d_RowQueue.size();
for (unsigned count = 0; count < sz; ++count) {
RowLemmaType l = d_RowQueue.front();
d_RowAlreadyAdded.insert(l);
d_out->lemma(lem);
++d_numRow;
+ lemmasAdded = true;
+ if (options::arraysReduceSharing()) {
+ return true;
+ }
}
+ return lemmasAdded;
}
void TheoryArrays::conflict(TNode a, TNode b) {