}else if(reduction.getKind() == kind::LT){
Node geq = currNM->mkNode(kind::GEQ, reduction[0], reduction[1]);
reduction = currNM->mkNode(kind::NOT, geq);
+ }else if( Options::rewriteArithEqualities && reduction.getKind() == kind::EQUAL){
+ Node geq = currNM->mkNode(kind::GEQ, reduction[0], reduction[1]);
+ Node leq = currNM->mkNode(kind::LEQ, reduction[0], reduction[1]);
+ reduction = currNM->mkNode(kind::AND, geq, leq);
}
+
return RewriteResponse(REWRITE_DONE, reduction);
}
--produce-models support the get-value command\n\
--produce-assignments support the get-assignment command\n\
--lazy-definition-expansion expand define-fun lazily\n\
+ --rewrite-arithmetic-equalities rewrite (= x y) to (and (<= x y) (>= x y)) in arithmetic \n\
--incremental enable incremental solving\n";
static const string languageDescription = "\
LAZY_TYPE_CHECKING,
EAGER_TYPE_CHECKING,
INCREMENTAL,
- PIVOT_RULE
+ PIVOT_RULE,
+ REWRITE_ARITHMETIC_EQUALITIES
};/* enum OptionValue */
/**
{ "eager-type-checking", no_argument, NULL, EAGER_TYPE_CHECKING},
{ "incremental", no_argument, NULL, INCREMENTAL},
{ "pivot-rule" , required_argument, NULL, PIVOT_RULE },
+ { "rewrite-arithmetic-equalities" , no_argument, NULL, REWRITE_ARITHMETIC_EQUALITIES},
{ NULL , no_argument , NULL, '\0' }
};/* if you add things to the above, please remember to update usage.h! */
incrementalSolving = true;
break;
+ case REWRITE_ARITHMETIC_EQUALITIES:
+ rewriteArithEqualities = true;
+ break;
+
case PIVOT_RULE:
if(!strcmp(optarg, "min")) {
pivotRule = MINIMUM;
return optind;
}
+bool Options::rewriteArithEqualities = false;
+
}/* CVC4 namespace */
/** Whether incemental solving (push/pop) */
bool incrementalSolving;
+ static bool rewriteArithEqualities;
typedef enum { MINIMUM, BREAK_TIES, MAXIMUM } ArithPivotRule;
ArithPivotRule pivotRule;