bug fixes
authorbdemsky <bdemsky@uci.edu>
Fri, 20 Jul 2018 19:38:40 +0000 (12:38 -0700)
committerbdemsky <bdemsky@uci.edu>
Fri, 20 Jul 2018 19:38:40 +0000 (12:38 -0700)
src/ASTTransform/integerencoding.cc
src/Backend/constraint.cc

index 78f1b73..5e4bfb8 100644 (file)
@@ -6,6 +6,7 @@
 #include "integerencodingrecord.h"
 #include "integerencorderresolver.h"
 #include "tunable.h"
+#include "polarityassignment.h"
 
 IntegerEncodingTransform::IntegerEncodingTransform(CSolver *_solver)
        : Transform(_solver)
@@ -48,6 +49,7 @@ void IntegerEncodingTransform::orderIntegerEncodingSATEncoder(BooleanOrder *bool
        Predicate *predicate = solver->createPredicateOperator(SATC_LT, sarray, 2);
        Element *parray[] = {elem1, elem2};
        BooleanEdge boolean = solver->applyPredicate(predicate, parray, 2);
+       updateEdgePolarity(boolean, boolOrder);
        solver->replaceBooleanWithBoolean(boolOrder, boolean);
 }
 
index 535d058..34ddb0a 100644 (file)
@@ -471,7 +471,7 @@ Edge disjoinAndFree(CNF * cnf, Edge newvec, Edge cnfform) {
                        uint cSize = isNodeEdge(cedge) ? cedge.node_ptr->numEdges : 1;
                        if (equalsEdge(cedge, nedge)) {
                                addEdgeToResizeNode(&result, cedge);
-                               result->numVars += cedge.node_ptr->numEdges;
+                               result->numVars += cSize;
                        } else if (!sameNodeOppSign(nedge, cedge)) {
                                Node *clause = allocResizeNode(cSize + nSize);
                                if (isNodeEdge(nedge)) {