From: Andrew Reynolds Date: Tue, 15 May 2018 15:40:29 +0000 (-0500) Subject: Fix free variables in cbqi preregister inst. (#1921) X-Git-Tag: cvc5-1.0.0~5050 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5d660404622a1fa35b228dd691849a64d365d677;p=cvc5.git Fix free variables in cbqi preregister inst. (#1921) --- diff --git a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp index 2ef2563b3..df51ace2d 100644 --- a/src/theory/quantifiers/cegqi/ceg_instantiator.cpp +++ b/src/theory/quantifiers/cegqi/ceg_instantiator.cpp @@ -1110,22 +1110,26 @@ bool CegInstantiator::check() { void collectPresolveEqTerms( Node n, std::map< Node, std::vector< Node > >& teq ) { if( n.getKind()==FORALL || n.getKind()==EXISTS ){ //do nothing - }else{ - if( n.getKind()==EQUAL ){ - for( unsigned i=0; i<2; i++ ){ - std::map< Node, std::vector< Node > >::iterator it = teq.find( n[i] ); - if( it!=teq.end() ){ - Node nn = n[ i==0 ? 1 : 0 ]; - if( std::find( it->second.begin(), it->second.end(), nn )==it->second.end() ){ - it->second.push_back( nn ); - Trace("cbqi-presolve") << " - " << n[i] << " = " << nn << std::endl; - } - } + return; + } + if (n.getKind() == EQUAL) + { + for (unsigned i = 0; i < 2; i++) + { + Node nn = n[i == 0 ? 1 : 0]; + std::map >::iterator it = teq.find(n[i]); + if (it != teq.end() && !nn.hasFreeVar() + && std::find(it->second.begin(), it->second.end(), nn) + == it->second.end()) + { + it->second.push_back(nn); + Trace("cbqi-presolve") << " - " << n[i] << " = " << nn << std::endl; } } - for( unsigned i=0; imkSkolem( "g", NodeManager::currentNM()->booleanType() ); lem = NodeManager::currentNM()->mkNode( OR, g, lem ); Trace("cbqi-presolve-debug") << "Presolve lemma : " << lem << std::endl; + Assert(!lem.hasFreeVar()); d_qe->getOutputChannel().lemma( lem, false, true ); } }