From: Andrew Reynolds Date: Sat, 18 Jan 2014 18:13:47 +0000 (-0600) Subject: Fixed non-termination issue in bounded integers. X-Git-Tag: cvc5-1.0.0~7141 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f772f276bb8e6e13e8a24a0c94ab2ad351cc72ff;p=cvc5.git Fixed non-termination issue in bounded integers. --- diff --git a/src/theory/quantifiers/bounded_integers.cpp b/src/theory/quantifiers/bounded_integers.cpp index d4faf41fe..5ad4cef92 100644 --- a/src/theory/quantifiers/bounded_integers.cpp +++ b/src/theory/quantifiers/bounded_integers.cpp @@ -104,7 +104,7 @@ Node BoundedIntegers::RangeModel::getNextDecisionRequest() { if (!d_lit_to_pol[it->first]) { rn = rn.negate(); } - Trace("bound-int-dec") << "For " << d_range << ", make decision " << rn << " to make range " << i << std::endl; + Trace("bound-int-dec-debug") << "For " << d_range << ", make decision " << rn << " to make range " << i << std::endl; return rn; } } @@ -312,11 +312,26 @@ void BoundedIntegers::assertNode( Node n ) { } Node BoundedIntegers::getNextDecisionRequest() { - Trace("bound-int-dec") << "bi: Get next decision request?" << std::endl; + Trace("bound-int-dec-debug") << "bi: Get next decision request?" << std::endl; for( unsigned i=0; igetNextDecisionRequest(); if (!d.isNull()) { - return d; + bool polLit = d.getKind()!=NOT; + Node lit = d.getKind()==NOT ? d[0] : d; + bool value; + if( d_quantEngine->getValuation().hasSatValue( lit, value ) ) { + if( value==polLit ){ + Trace("bound-int-dec-debug") << "...already asserted properly." << std::endl; + //already true, we're already fine + }else{ + Trace("bound-int-dec-debug") << "...already asserted with wrong polarity, re-assert." << std::endl; + assertNode( d.negate() ); + i--; + } + }else{ + Trace("bound-int-dec") << "Bounded Integers : Decide " << d << std::endl; + return d; + } } } return Node::null();