&& vinst->allowModelValue(this, sf, pv, d_effort))
{
#ifdef CVC4_ASSERTIONS
- if( pvtn.isReal() && options::cbqiNestedQE() && !options::cbqiAll() ){
+ // the instantiation strategy for quantified linear integer/real
+ // arithmetic with arbitrary quantifier nesting is "monotonic" as a
+ // consequence of Lemmas 5, 9 and Theorem 4 of Reynolds et al, "Solving
+ // Quantified Linear Arithmetic by Counterexample Guided Instantiation",
+ // FMSD 2017. We throw an assertion failure if we detect a case where the
+ // strategy was not monotonic.
+ if (options::cbqiNestedQE() && d_qe->getLogicInfo().isPure(THEORY_ARITH)
+ && d_qe->getLogicInfo().isLinear())
+ {
Trace("cbqi-warn") << "Had to resort to model value." << std::endl;
Assert( false );
}
lhs_value = Rewriter::rewrite( lhs_value );
}
Trace("cegqi-arith-debug") << "Disequality : check model values " << lhs_value << " " << rhs_value << std::endl;
- Assert( lhs_value!=rhs_value );
+ // it generally should be the case that lhs_value!=rhs_value
+ // however, this assertion is violated e.g. if non-linear is enabled
+ // since the quantifier-free arithmetic solver may pass full
+ // effort with no lemmas even when we are not guaranteed to have a
+ // model. By convention, we use GEQ to compare the values here.
Node cmp = NodeManager::currentNM()->mkNode( GEQ, lhs_value, rhs_value );
cmp = Rewriter::rewrite( cmp );
Assert( cmp.isConst() );
return d_te->theoryOf(THEORY_QUANTIFIERS)->getValuation();
}
+const LogicInfo& QuantifiersEngine::getLogicInfo() const
+{
+ return d_te->getLogicInfo();
+}
+
QuantifiersModule * QuantifiersEngine::getOwner( Node q ) {
std::map< Node, QuantifiersModule * >::iterator it = d_owner.find( q );
if( it==d_owner.end() ){
OutputChannel& getOutputChannel();
/** get default valuation for the quantifiers engine */
Valuation& getValuation();
+ /** get the logic info for the quantifiers engine */
+ const LogicInfo& getLogicInfo() const;
/** get relevant domain */
quantifiers::RelevantDomain* getRelevantDomain() { return d_rel_dom; }
/** get the BV inverter utility */
return !d_inConflict;
}
+const LogicInfo& TheoryEngine::getLogicInfo() const { return d_logicInfo; }
theory::EqualityStatus TheoryEngine::getEqualityStatus(TNode a, TNode b) {
Assert(a.getType().isComparableTo(b.getType()));
inline bool isTheoryEnabled(theory::TheoryId theoryId) const {
return d_logicInfo.isTheoryEnabled(theoryId);
}
-
+ /** get the logic info used by this theory engine */
+ const LogicInfo& getLogicInfo() const;
/**
* Returns the equality status of the two terms, from the theory
* that owns the domain type. The types of a and b must be the same.