Not doing this rewrite for Booleans is probably an artifact of the old IFF kind being removed. This rewrite is important to simplify the generation of proofs for the SAT solver, as clarified in the new comment in the SAT proof manager.
Trace("sat-proof") << push << "SatProofManager::explainLit: Lit: " << lit;
Node litNode = getClauseNode(lit);
Trace("sat-proof") << " [" << litNode << "]\n";
+ // Note that if we had two literals for (= a b) and (= b a) and we had already
+ // a proof for (= a b) this test would return true for (= b a), which could
+ // lead to open proof. However we should never have two literals like this in
+ // the SAT solver since they'd be rewritten to the same one
if (d_resChainPg.hasProofFor(litNode))
{
Trace("sat-proof") << "SatProofManager::explainLit: already justified "
* flattenNode looks for children of same kind, and if found merges
* them into the parent.
*
- * It simultaneously handles a couple of other optimizations:
+ * It simultaneously handles a couple of other optimizations:
* - trivialNode - if found during exploration, return that node itself
* (like in case of OR, if "true" is found, makes sense to replace
* whole formula with "true")
}
}
}
- break;
+ // sort
+ if (n[0].getId() > n[1].getId())
+ {
+ return RewriteResponse(REWRITE_AGAIN,
+ nodeManager->mkNode(kind::EQUAL, n[1], n[0]));
+ }
+ return RewriteResponse(REWRITE_DONE, n);
}
case kind::XOR: {
// rewrite simple cases of XOR
regress0/printer/symbol_starting_w_digit.smt2
regress0/printer/tuples_and_records.cvc
regress0/proofs/issue277-circuit-propagator.smt2
+ regress0/proofs/open-pf-if-unordered-iff.smt2
regress0/proofs/scope.smt2
regress0/proofs/trust-subs-eq-open.smt2
regress0/push-pop/boolean/fuzz_12.smt2
--- /dev/null
+; EXPECT: unsat
+(set-logic ALL)
+(declare-const __ (_ BitVec 3))
+(declare-const ___ (_ BitVec 3))
+(assert (= (_ bv0 64) (bvand (_ bv1 64) ((_ zero_extend 32) ((_ zero_extend 16) ((_ zero_extend 8) ((_ zero_extend 4) ((_ zero_extend 1) __))))))))
+(assert (bvule __ ___))
+(assert (= (_ bv0 64) (bvand (_ bv1 64) (bvadd (_ bv1 64) ((_ zero_extend 32) ((_ zero_extend 16) ((_ zero_extend 8) ((_ zero_extend 4) ((_ zero_extend 1) ___)))))))))
+(assert (bvule ___ __))
+(check-sat)