Add the negative conjunction case
authorGuy <katz911@gmail.com>
Thu, 28 Jul 2016 16:01:52 +0000 (09:01 -0700)
committerGuy <katz911@gmail.com>
Thu, 28 Jul 2016 16:01:52 +0000 (09:01 -0700)
src/theory/theory_engine.cpp

index e4b4756bf8698f31584b0dffbfc352121bab5cb6..bd0b467f28871e6d7892949417bd760b8c8ac0d5 100644 (file)
@@ -112,9 +112,17 @@ void TheoryEngine::EngineOutputChannel::registerLemmaRecipe(Node lemma, Node ori
   switch (lemma.getKind()) {
 
   case kind::AND:
-    Assert(!negated); // TODO
-    for (unsigned i = 0; i < lemma.getNumChildren(); ++i)
-      registerLemmaRecipe(lemma[i], originalLemma, false, theoryId);
+    if (!negated) {
+      for (unsigned i = 0; i < lemma.getNumChildren(); ++i)
+        registerLemmaRecipe(lemma[i], originalLemma, false, theoryId);
+    } else {
+      NodeBuilder<> builder(kind::OR);
+      for (unsigned i = 0; i < lemma.getNumChildren(); ++i)
+        builder << lemma[i].negate();
+
+      Node disjunction = (builder.getNumChildren() == 1) ? builder[0] : builder;
+      registerLemmaRecipe(disjunction, originalLemma, false, theoryId);
+    }
     break;
 
   case kind::IFF: