From 3344979103bcec622276fca7c2a21cc0945f6c56 Mon Sep 17 00:00:00 2001 From: ajreynol Date: Thu, 15 Jun 2017 10:31:58 -0500 Subject: Ensure uninterpreted constants do not escape datatypes, fixes bug 823. Fix cbqi for datatypes with uninterpreted sort subfields. Simplify fmc model construction. --- src/theory/quantifiers/inst_strategy_cbqi.cpp | 44 ++++++++++++++++++++++----- 1 file changed, 36 insertions(+), 8 deletions(-) (limited to 'src/theory/quantifiers/inst_strategy_cbqi.cpp') diff --git a/src/theory/quantifiers/inst_strategy_cbqi.cpp b/src/theory/quantifiers/inst_strategy_cbqi.cpp index 88f8e2484..58bebef35 100644 --- a/src/theory/quantifiers/inst_strategy_cbqi.cpp +++ b/src/theory/quantifiers/inst_strategy_cbqi.cpp @@ -496,21 +496,49 @@ bool InstStrategyCbqi::hasNonCbqiOperator( Node n, std::map< Node, bool >& visit } return false; } -int InstStrategyCbqi::hasNonCbqiVariable( Node q ){ - int hmin = 1; - for( unsigned i=0; i& visited ) { + std::map< TypeNode, int >::iterator itv = visited.find( tn ); + if( itv==visited.end() ){ + visited[tn] = 0; + int ret = -1; if( tn.isInteger() || tn.isReal() || tn.isBoolean() || tn.isBitVector() ){ - handled = 0; + ret = 0; }else if( tn.isDatatype() ){ - handled = 0; + ret = 1; + const Datatype& dt = ((DatatypeType)tn.toType()).getDatatype(); + for( unsigned i=0; igetQuantEPR(); if( qepr!=NULL ){ - handled = qepr->isEPR( tn ) ? 1 : -1; + ret = qepr->isEPR( tn ) ? 1 : -1; } } + visited[tn] = ret; + return ret; + }else{ + return itv->second; + } +} + +int InstStrategyCbqi::hasNonCbqiVariable( Node q ){ + int hmin = 1; + for( unsigned i=0; i visited; + int handled = isCbqiSort( tn, visited ); if( handled==-1 ){ return -1; }else if( handled