summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDejan Jovanović <dejan.jovanovic@gmail.com>2012-06-16 23:58:07 +0000
committerDejan Jovanović <dejan.jovanovic@gmail.com>2012-06-16 23:58:07 +0000
commit3f94a7cacbdf22c26c406b411da3a220ef5520d1 (patch)
treefacff297f64d7084a6eb761f5c1b024c6d75b23e
parent94d13d40b27beb6e1ae8ec8221f6610d9d1a024d (diff)
small change to equality assertions so that one doesn't get x = y and y = x
-rw-r--r--src/theory/theory_engine.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp
index 92e4b17df..161d0febd 100644
--- a/src/theory/theory_engine.cpp
+++ b/src/theory/theory_engine.cpp
@@ -894,13 +894,17 @@ void TheoryEngine::assertToTheory(TNode assertion, theory::TheoryId toTheoryId,
}
}
- // Normalize to lhs < rhs
+ // Normalize to lhs < rhs if not a sat literal
Assert(atom.getKind() == kind::EQUAL);
Assert(atom[0] != atom[1]);
+
Node normalizedAtom = atom;
- if (atom[0] > atom[1]) {
- normalizedAtom = atom[1].eqNode(atom[0]);
- }
+ if (!d_propEngine->isSatLiteral(normalizedAtom)) {
+ Node reverse = atom[1].eqNode(atom[0]);
+ if (d_propEngine->isSatLiteral(reverse) || atom[0] > atom[1]) {
+ normalizedAtom = reverse;
+ }
+ }
Node normalizedAssertion = polarity ? normalizedAtom : normalizedAtom.notNode();
// Try and assert (note that we assert the non-normalized one)
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback