#ifndef OPS_H
#define OPS_H
-enum LogicOp {SATC_AND, SATC_OR, SATC_NOT, SATC_XOR, SATC_IMPLIES};
+enum LogicOp {SATC_AND, SATC_OR, SATC_NOT, SATC_XOR, SATC_IFF, SATC_IMPLIES};
typedef enum LogicOp LogicOp;
enum ArithOp {SATC_ADD, SATC_SUB};
case SATC_NOT:
replaceBooleanWithFalse(parent);
break;
+ case SATC_IFF:
+ handleXORFalse(logicop, bexpr);
+ break;
case SATC_XOR:
handleXORTrue(logicop, bexpr);
break;
case SATC_NOT:
replaceBooleanWithTrue(parent);
break;
+ case SATC_IFF:
+ handleXORTrue(logicop, bexpr);
+ break;
case SATC_XOR:
handleXORFalse(logicop, bexpr);
break;
updatePolarity(tmp, negatePolarity(parentpolarity));
break;
}
+ case SATC_IFF:
case SATC_XOR: {
updatePolarity(This->inputs.get(0), P_BOTHTRUEFALSE);
updatePolarity(This->inputs.get(1), P_BOTHTRUEFALSE);
updateMustValue(This->inputs.get(1), parentbv);
}
return;
+ case SATC_IFF:
case SATC_XOR:
return;
default:
return constraintNegate(array[0]);
case SATC_XOR:
return constraintXOR(cnf, array[0], array[1]);
+ case SATC_IFF:
+ return constraintIFF(cnf, array[0], array[1]);
case SATC_IMPLIES:
return constraintIMPLIES(cnf, array[0], array[1]);
default:
#define IS_OUT_FD 3
-#define IS_UNSAT 0
-#define IS_SAT 1
-#define IS_INDETER 2
-#define IS_FREEZE 3
-#define IS_RUNSOLVER 4
+enum SolverResult {IS_UNSAT=0, IS_SAT=1, IS_INDETER=2, IS_FREEZE=3, IS_RUNSOLVER=4};
#define IS_BUFFERSIZE 1024
}
break;
}
+ case SATC_IFF: {
+ for(uint i=0;i<2;i++) {
+ if (array[i]->type == BOOLCONST) {
+ if (array[i]->isTrue()) {
+ return array[1-i];
+ } else {
+ newarray[0]=array[1-i];
+ return applyLogicalOperation(SATC_NOT, newarray, 1);
+ }
+ }
+ }
+ break;
+ }
case SATC_XOR: {
for(uint i=0;i<2;i++) {
if (array[i]->type == BOOLCONST) {
#include "ops.h"
#include "corestructs.h"
#include "asthash.h"
+#include "solver_interface.h"
class CSolver {
public: