reconstruct solutions for single invocation conjectures in original grammar
option cegqiSolMinCore --cegqi-si-sol-min-core bool :default false
minimize solutions for single invocation conjectures based on unsat core
+option cegqiSolMinInst --cegqi-si-sol-min-inst bool :default true
+ minimize individual instantiations for single invocation conjectures based on unsat core
option cegqiSingleInvReconstructConst --cegqi-si-reconstruct-const bool :default true
include constants when reconstruct solutions for single invocation conjectures in original grammar
option cegqiSingleInvAbort --cegqi-si-abort bool :default false
}
}
-Node CegConjectureSingleInv::constructSolution( std::vector< unsigned >& indices, unsigned i, unsigned index ) {
+Node CegConjectureSingleInv::constructSolution( std::vector< unsigned >& indices, unsigned i, unsigned index, std::map< Node, Node >& weak_imp ) {
Assert( index<d_inst.size() );
Assert( i<d_inst[index].size() );
unsigned uindex = indices[index];
return d_inst[uindex][i];
}else{
Node cond = d_lemmas_produced[uindex];
+ //weaken based on unsat core
+ std::map< Node, Node >::iterator itw = weak_imp.find( cond );
+ if( itw!=weak_imp.end() ){
+ cond = itw->second;
+ }
cond = TermDb::simpleNegate( cond );
Node ite1 = d_inst[uindex][i];
- Node ite2 = constructSolution( indices, i, index+1 );
+ Node ite2 = constructSolution( indices, i, index+1, weak_imp );
return NodeManager::currentNM()->mkNode( ITE, cond, ite1, ite2 );
}
}
bool useUnsatCore = false;
std::vector< Node > active_lemmas;
//minimize based on unsat core, if possible
- if( options::cegqiSolMinCore() && d_qe->getUnsatCoreLemmas( active_lemmas ) ){
- useUnsatCore = true;
+ std::map< Node, Node > weak_imp;
+ if( options::cegqiSolMinCore() ){
+ if( options::cegqiSolMinInst() ){
+ if( d_qe->getUnsatCoreLemmas( active_lemmas, weak_imp ) ){
+ useUnsatCore = true;
+ }
+ }else{
+ if( d_qe->getUnsatCoreLemmas( active_lemmas ) ){
+ useUnsatCore = true;
+ }
+ }
}
Assert( d_lemmas_produced.size()==d_inst.size() );
std::vector< unsigned > indices;
ssii.d_i = sol_index;
std::sort( indices.begin(), indices.end(), ssii );
Trace("csi-sol") << "Construct solution" << std::endl;
- s = constructSolution( indices, sol_index, 0 );
+ s = constructSolution( indices, sol_index, 0, weak_imp );
Assert( vars.size()==d_sol->d_varList.size() );
s = s.substitute( vars.begin(), vars.end(), d_sol->d_varList.begin(), d_sol->d_varList.end() );
}
std::map< Node, std::vector< Node > >& teq,
Node n, std::vector< Node >& conj );
//constructing solution
- Node constructSolution( std::vector< unsigned >& indices, unsigned i, unsigned index );
+ Node constructSolution( std::vector< unsigned >& indices, unsigned i, unsigned index, std::map< Node, Node >& weak_imp );
Node postProcessSolution( Node n );
private:
//list of skolems for each argument of programs
}
}
+bool QuantifiersEngine::getUnsatCoreLemmas( std::vector< Node >& active_lemmas, std::map< Node, Node >& weak_imp ) {
+ if( getUnsatCoreLemmas( active_lemmas ) ){
+ for (unsigned i = 0; i < active_lemmas.size(); ++i) {
+ Node n = ProofManager::currentPM()->getWeakestImplicantInUnsatCore(active_lemmas[i]);
+ if( n!=active_lemmas[i] ){
+ Trace("inst-unsat-core") << " weaken : " << active_lemmas[i] << " -> " << n << std::endl;
+ }
+ weak_imp[active_lemmas[i]] = n;
+ }
+ return true;
+ }else{
+ return false;
+ }
+}
+
void QuantifiersEngine::getExplanationForInstLemmas( std::vector< Node >& lems, std::map< Node, Node >& quant, std::map< Node, std::vector< Node > >& tvec ) {
if( d_trackInstLemmas ){
if( options::incrementalSolving() ){
void getInstantiations( std::map< Node, std::vector< Node > >& insts );
/** get unsat core lemmas */
bool getUnsatCoreLemmas( std::vector< Node >& active_lemmas );
+ bool getUnsatCoreLemmas( std::vector< Node >& active_lemmas, std::map< Node, Node >& weak_imp );
/** get inst for lemmas */
void getExplanationForInstLemmas( std::vector< Node >& lems, std::map< Node, Node >& quant, std::map< Node, std::vector< Node > >& tvec );
/** statistics class */