From: Dejan Jovanović Date: Tue, 7 May 2013 19:01:16 +0000 (-0400) Subject: fix for bug500 X-Git-Tag: cvc5-1.0.0~7287^2~145 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e138840f8dbe4eedf692ca81a99e6415737b573c;p=cvc5.git fix for bug500 --- diff --git a/src/theory/theory_engine.cpp b/src/theory/theory_engine.cpp index 63fc1ae65..a81b38fe9 100644 --- a/src/theory/theory_engine.cpp +++ b/src/theory/theory_engine.cpp @@ -931,8 +931,10 @@ void TheoryEngine::assertToTheory(TNode assertion, TNode originalAssertion, theo if (fromTheoryId == THEORY_SAT_SOLVER) { // We know that this is normalized, so just send it off to the theory if (markPropagation(assertion, originalAssertion, toTheoryId, fromTheoryId)) { - // We assert it, and we know it's preregistereed coming from the SAT solver directly - theoryOf(toTheoryId)->assertFact(assertion, assertion == originalAssertion); + // Is it preregistered + bool preregistered = d_propEngine->isSatLiteral(assertion) && Theory::theoryOf(assertion) == toTheoryId; + // We assert it + theoryOf(toTheoryId)->assertFact(assertion, preregistered); // Mark that we have more information d_factsAsserted = true; } @@ -1211,6 +1213,9 @@ void TheoryEngine::ensureLemmaAtoms(const std::vector& atoms, theory::The // Rewrite the equality Node eqNormalized = Rewriter::rewrite(atoms[i]); + + Debug("theory::atoms") << "TheoryEngine::ensureLemmaAtoms(): " << eq << " with nf " << eqNormalized << std::endl; + // If the equality is a boolean constant, we send immediately if (eqNormalized.isConst()) { if (eqNormalized.getConst()) { @@ -1221,8 +1226,11 @@ void TheoryEngine::ensureLemmaAtoms(const std::vector& atoms, theory::The continue; } + Assert(eqNormalized.getKind() == kind::EQUAL); + + // If the normalization did the just flips, keep the flip - if (eqNormalized[0] == eq[1]) { + if (eqNormalized[0] == eq[1] && eqNormalized[1] == eq[0]) { eq = eqNormalized; } diff --git a/test/regress/regress0/aufbv/Makefile.am b/test/regress/regress0/aufbv/Makefile.am index 937123bf7..862e4880b 100644 --- a/test/regress/regress0/aufbv/Makefile.am +++ b/test/regress/regress0/aufbv/Makefile.am @@ -20,6 +20,7 @@ TESTS = \ bug347.smt \ bug348.smt \ bug451.smt \ + bug509.smt \ try5_small_difret_functions_wp_su.set_char_quoting.il.wp.delta01.smt \ try3_sameret_functions_fse-bfs_tac.calc_next.il.fse-bfs.delta01.smt \ diseqprop.01.smt \ diff --git a/test/regress/regress0/aufbv/bug509.smt b/test/regress/regress0/aufbv/bug509.smt new file mode 100644 index 000000000..b23f9c6d5 --- /dev/null +++ b/test/regress/regress0/aufbv/bug509.smt @@ -0,0 +1,117 @@ +(benchmark fuzzsmt +:logic QF_AUFBV +:status sat +:extrafuns ((v0 BitVec[1])) +:extrafuns ((v1 BitVec[13])) +:extrafuns ((v2 BitVec[5])) +:extrafuns ((a3 Array[1:16])) +:formula +(let (?e4 bv1[1]) +(let (?e5 (sign_extend[1] v1)) +(let (?e6 (bvneg v0)) +(let (?e7 (rotate_right[0] ?e4)) +(let (?e8 (bvnand v1 v1)) +(let (?e9 (zero_extend[11] v2)) +(let (?e10 (store a3 (extract[14:14] ?e9) (sign_extend[3] ?e8))) +(let (?e11 (select a3 ?e6)) +(let (?e12 (select a3 (extract[14:14] ?e11))) +(let (?e13 (select a3 (extract[14:14] ?e11))) +(let (?e14 (select a3 ?e4)) +(let (?e15 (select a3 ?e4)) +(let (?e16 (ite (bvsgt ?e14 (zero_extend[15] ?e6)) bv1[1] bv0[1])) +(let (?e17 (bvnand (sign_extend[12] ?e4) ?e8)) +(let (?e18 (ite (bvsge ?e12 ?e14) bv1[1] bv0[1])) +(let (?e19 (bvxor ?e15 (zero_extend[15] ?e7))) +(let (?e20 (ite (bvslt (sign_extend[12] ?e6) v1) bv1[1] bv0[1])) +(let (?e21 (bvand ?e11 (sign_extend[15] ?e16))) +(let (?e22 (ite (bvult (sign_extend[8] v2) v1) bv1[1] bv0[1])) +(let (?e23 (bvsrem (sign_extend[2] ?e5) ?e11)) +(let (?e24 (bvurem ?e9 ?e12)) +(let (?e25 (bvashr (zero_extend[3] ?e8) ?e19)) +(let (?e26 (bvlshr ?e13 (sign_extend[15] ?e20))) +(let (?e27 (ite (= ?e13 ?e12) bv1[1] bv0[1])) +(let (?e28 (bvxnor v0 v0)) +(flet ($e29 (bvugt (sign_extend[15] ?e4) ?e26)) +(flet ($e30 (bvugt ?e11 (sign_extend[15] v0))) +(flet ($e31 (distinct (zero_extend[11] v2) ?e12)) +(flet ($e32 (bvsge ?e14 (zero_extend[15] ?e18))) +(flet ($e33 (bvsle (sign_extend[15] ?e27) ?e19)) +(flet ($e34 (distinct (sign_extend[12] ?e16) v1)) +(flet ($e35 (bvsle ?e24 ?e15)) +(flet ($e36 (distinct ?e13 (zero_extend[15] ?e16))) +(flet ($e37 (bvugt ?e22 ?e18)) +(flet ($e38 (bvslt ?e19 ?e24)) +(flet ($e39 (bvule ?e26 ?e9)) +(flet ($e40 (bvslt ?e7 ?e16)) +(flet ($e41 (bvuge ?e21 ?e9)) +(flet ($e42 (bvule ?e24 ?e9)) +(flet ($e43 (bvuge ?e7 ?e16)) +(flet ($e44 (distinct (zero_extend[12] ?e28) v1)) +(flet ($e45 (bvsge ?e4 v0)) +(flet ($e46 (bvule ?e17 (sign_extend[12] ?e22))) +(flet ($e47 (bvugt ?e15 (zero_extend[15] ?e27))) +(flet ($e48 (bvsgt ?e12 ?e24)) +(flet ($e49 (bvsgt ?e13 ?e13)) +(flet ($e50 (bvslt ?e20 ?e6)) +(flet ($e51 (bvsgt ?e19 (zero_extend[15] ?e28))) +(flet ($e52 (bvsgt ?e21 (sign_extend[15] ?e7))) +(flet ($e53 (bvslt ?e9 ?e15)) +(flet ($e54 (bvule ?e21 ?e12)) +(flet ($e55 (= ?e24 (zero_extend[3] v1))) +(flet ($e56 (bvsle v0 ?e16)) +(flet ($e57 (= (sign_extend[15] ?e4) ?e12)) +(flet ($e58 (distinct (sign_extend[2] ?e5) ?e9)) +(flet ($e59 (bvult (sign_extend[15] ?e22) ?e25)) +(flet ($e60 (bvsge ?e20 ?e20)) +(flet ($e61 (distinct ?e14 ?e24)) +(flet ($e62 (bvuge (sign_extend[15] v0) ?e19)) +(flet ($e63 (bvuge ?e25 (sign_extend[3] ?e8))) +(flet ($e64 (bvult ?e4 ?e7)) +(flet ($e65 (bvsle (zero_extend[12] ?e16) ?e17)) +(flet ($e66 (bvule ?e26 ?e9)) +(flet ($e67 (bvugt ?e14 ?e23)) +(flet ($e68 (or $e37 $e45)) +(flet ($e69 (or $e31 $e30)) +(flet ($e70 (iff $e46 $e65)) +(flet ($e71 (or $e42 $e44)) +(flet ($e72 (iff $e43 $e69)) +(flet ($e73 (iff $e32 $e35)) +(flet ($e74 (or $e49 $e49)) +(flet ($e75 (or $e33 $e51)) +(flet ($e76 (xor $e53 $e61)) +(flet ($e77 (implies $e38 $e34)) +(flet ($e78 (and $e57 $e41)) +(flet ($e79 (iff $e50 $e68)) +(flet ($e80 (implies $e73 $e77)) +(flet ($e81 (if_then_else $e60 $e62 $e55)) +(flet ($e82 (and $e56 $e54)) +(flet ($e83 (if_then_else $e67 $e80 $e81)) +(flet ($e84 (iff $e72 $e36)) +(flet ($e85 (if_then_else $e83 $e39 $e59)) +(flet ($e86 (iff $e58 $e29)) +(flet ($e87 (and $e47 $e64)) +(flet ($e88 (not $e40)) +(flet ($e89 (not $e82)) +(flet ($e90 (xor $e76 $e78)) +(flet ($e91 (not $e79)) +(flet ($e92 (if_then_else $e74 $e85 $e89)) +(flet ($e93 (xor $e75 $e92)) +(flet ($e94 (not $e86)) +(flet ($e95 (if_then_else $e84 $e88 $e70)) +(flet ($e96 (and $e91 $e94)) +(flet ($e97 (and $e96 $e95)) +(flet ($e98 (not $e97)) +(flet ($e99 (if_then_else $e90 $e98 $e52)) +(flet ($e100 (implies $e71 $e48)) +(flet ($e101 (or $e93 $e87)) +(flet ($e102 (xor $e100 $e66)) +(flet ($e103 (if_then_else $e102 $e102 $e63)) +(flet ($e104 (if_then_else $e101 $e99 $e101)) +(flet ($e105 (xor $e103 $e103)) +(flet ($e106 (or $e104 $e105)) +(flet ($e107 (and $e106 (not (= ?e12 bv0[16])))) +(flet ($e108 (and $e107 (not (= ?e11 bv0[16])))) +(flet ($e109 (and $e108 (not (= ?e11 (bvnot bv0[16]))))) +$e109 +))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))) +