From 175741488a4dd986ad69ee644617ff735b855031 Mon Sep 17 00:00:00 2001 From: Tim King Date: Thu, 25 Feb 2010 21:55:17 +0000 Subject: Updated uf to reflect APPLY structure after conversation with Chris. Also corrected conflict generation to reflect this morning's discussion. --- src/theory/uf/theory_uf.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'src/theory/uf/theory_uf.cpp') diff --git a/src/theory/uf/theory_uf.cpp b/src/theory/uf/theory_uf.cpp index 47bda5bc4..2a5eb682e 100644 --- a/src/theory/uf/theory_uf.cpp +++ b/src/theory/uf/theory_uf.cpp @@ -107,7 +107,12 @@ void TheoryUF::registerTerm(TNode n){ * of its children. */ if(n.getKind() == APPLY){ - for(TNode::iterator cIter = n.begin(); cIter != n.end(); ++cIter){ + TNode::iterator cIter = n.begin(); + + //The first element of an apply is the function symbol which should not + //have an associated ECData, so it needs to be skipped. + ++cIter; + for(; cIter != n.end(); ++cIter){ TNode child = *cIter; /* Because this can be called after nodes have been merged, we need @@ -137,6 +142,9 @@ bool TheoryUF::sameCongruenceClass(TNode x, TNode y){ } bool TheoryUF::equiv(TNode x, TNode y){ + Assert(x.getKind() == kind::APPLY); + Assert(y.getKind() == kind::APPLY); + if(x.getNumChildren() != y.getNumChildren()) return false; @@ -146,6 +154,10 @@ bool TheoryUF::equiv(TNode x, TNode y){ TNode::iterator xIter = x.begin(); TNode::iterator yIter = y.begin(); + //Skip operator of the applies + ++xIter; + ++yIter; + while(xIter != x.end()){ if(!sameCongruenceClass(*xIter, *yIter)){ @@ -226,9 +238,18 @@ void TheoryUF::merge(){ } } +Node TheoryUF::constructConflict(TNode diseq){ + NodeBuilder<> nb(kind::AND); + nb << diseq; + for(unsigned i=0; iconflict(*diseqIter, true); + Node remakeNeq = (*diseqIter).notNode(); + Node conflict = constructConflict(remakeNeq); + d_out->conflict(conflict, true); } } } -- cgit v1.2.3