From 5d660404622a1fa35b228dd691849a64d365d677 Mon Sep 17 00:00:00 2001 From: Andrew Reynolds Date: Tue, 15 May 2018 10:40:29 -0500 Subject: [PATCH] Fix free variables in cbqi preregister inst. (#1921) --- .../quantifiers/cegqi/ceg_instantiator.cpp | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) 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 ); } } -- 2.30.2