preregister_stack_element& stackHead = toVisit.back();
// The current node we are processing
TNode current = stackHead.node;
- // If we already added all the children its time to register or just pop from the stack
+ // If we already added all the children its time to register or just
+ // pop from the stack
if (stackHead.children_added || current.getAttribute(PreRegistered())) {
if (!current.getAttribute(PreRegistered())) {
// Mark it as registered
} else {
Theory* theory = theoryOf(current);
TheoryId theoryLHS = theory->getId();
- Debug("register") << "preregistering " << current << " with " << theoryLHS << std::endl;
+ Debug("register") << "preregistering " << current
+ << " with " << theoryLHS << std::endl;
markActive(theoryLHS);
theory->preRegisterTerm(current);
}
} else {
- TheoryId theory = Theory::theoryOf(current);
- Debug("register") << "preregistering " << current << " with " << theory << std::endl;
+ TheoryId theory = theoryIdOf(current);
+ Debug("register") << "preregistering " << current
+ << " with " << theory << std::endl;
markActive(theory);
d_theoryTable[theory]->preRegisterTerm(current);
- TheoryId typeTheory = Theory::theoryOf(current.getType());
+ TheoryId typeTheory = theoryIdOf(current.getType());
if (theory != typeTheory) {
- Debug("register") << "preregistering " << current << " with " << typeTheory << std::endl;
+ Debug("register") << "preregistering " << current
+ << " with " << typeTheory << std::endl;
markActive(typeTheory);
d_theoryTable[typeTheory]->preRegisterTerm(current);
}
}
// If this is an atom, we preprocess it with the theory
- if (Theory::theoryOf(current) != THEORY_BOOL) {
+ if (theoryIdOf(current) != THEORY_BOOL) {
d_atomPreprocessingCache[current] = theoryOf(current)->preprocess(current);
continue;
}
*/
inline theory::Theory* theoryOf(TNode node) {
if (node.getKind() == kind::EQUAL) {
- return d_theoryTable[theory::Theory::theoryOf(node[0])];
+ return d_theoryTable[theoryIdOf(node[0])];
} else {
- return d_theoryTable[theory::Theory::theoryOf(node)];
+ return d_theoryTable[theoryIdOf(node)];
}
}
+ /**
+ * Wrapper for theory::Theory::theoryOf() that implements the
+ * array/EUF hack.
+ */
+ inline theory::TheoryId theoryIdOf(TNode node) {
+ theory::TheoryId id = theory::Theory::theoryOf(node);
+ if(d_logic == "QF_AX" && id == theory::THEORY_UF) {
+ id = theory::THEORY_ARRAY;
+ }
+ return id;
+ }
+
/**
* Get the theory associated to a given Node.
*
* of built-in type.
*/
inline theory::Theory* theoryOf(const TypeNode& typeNode) {
- return d_theoryTable[theory::Theory::theoryOf(typeNode)];
+ return d_theoryTable[theoryIdOf(typeNode)];
+ }
+
+ /**
+ * Wrapper for theory::Theory::theoryOf() that implements the
+ * array/EUF hack.
+ */
+ inline theory::TheoryId theoryIdOf(const TypeNode& typeNode) {
+ theory::TheoryId id = theory::Theory::theoryOf(typeNode);
+ if(d_logic == "QF_AX" && id == theory::THEORY_UF) {
+ id = theory::THEORY_ARRAY;
+ }
+ return id;
}
/**
--- /dev/null
+(benchmark fuzzsmt
+:logic QF_AX
+:extrafuns ((v4 Index))
+:extrafuns ((v3 Index))
+:extrafuns ((v5 Element))
+:extrafuns ((v1 Array))
+:status unknown
+:formula
+(let (?n1 (store v1 v4 v5))
+(let (?n2 (select ?n1 v3))
+(let (?n3 (select v1 v3))
+(flet ($n4 (distinct ?n2 ?n3))
+(let (?n5 (ite $n4 v4 v3))
+(let (?n6 (store ?n1 v4 v5))
+(let (?n7 (select ?n6 v3))
+(flet ($n8 (= ?n2 ?n7))
+(let (?n9 (ite $n8 v3 v4))
+(flet ($n10 (distinct ?n5 ?n9))
+$n10
+)))))))))))