function trywith {
limit=$1; shift;
echo "--- Run $@ at $limit...";
- (ulimit -t "$limit";$cvc4 --lang=tptp --no-checking --no-interactive "$@" $bench) 2>/dev/null |
+ (ulimit -t "$limit";$cvc4 --lang=tptp --no-checking --no-interactive --force-logic="UFNIRA" "$@" $bench) 2>/dev/null |
(read w1 w2 w3 result w4 w5;
case "$result" in
Satisfiable) echo "$w1 $w2 $w3 $result $w4 $w5";cat;exit 0;;
}
function finishwith {
echo "--- Run $@...";
- $cvc4 --lang=tptp --no-checking --no-interactive "$@" $bench
+ $cvc4 --lang=tptp --no-checking --no-interactive --force-logic="UFNIRA" "$@" $bench
}
trywith 30 --cbqi2 --decision=internal --full-saturate-quant
-trywith 60 --finite-model-find --sort-inference --uf-ss-fair
trywith 30 --cbqi --full-saturate-quant
trywith 60 --cbqi --cbqi-recurse --full-saturate-quant
trywith 60 --fmf-bound-int --macros-quant
}
}
dumpAssertions("post-skolem-quant", d_assertions);
- if( options::macrosQuant() ){
+ if( options::macrosQuant() && !options::incrementalSolving() ){
//quantifiers macro expansion
bool success;
do{
*/
}
-void CegInstantiator::check() {
+bool CegInstantiator::check() {
for( unsigned r=0; r<2; r++ ){
std::vector< Node > subs;
std::vector< int > subs_typ;
//try to add an instantiation
if( addInstantiation( subs, vars, coeff, has_coeff, subs_typ, 0, r==0 ? 0 : 2 ) ){
- return;
+ return true;
}
}
Trace("cegqi-engine") << " WARNING : unable to find CEGQI single invocation instantiation." << std::endl;
+ return false;
}
//delta
Node d_n_delta;
//check : add instantiations based on valuation of d_vars
- void check();
+ bool check();
// get delta lemmas : on-demand force minimality of d_n_delta
void getDeltaLemmas( std::vector< Node >& lems );
};
for( std::map< Node, TermArgTrie >::iterator it = getTermDatabase()->d_func_map_trie.begin(); it != getTermDatabase()->d_func_map_trie.end(); ++it ){
if( !getTermDatabase()->d_op_map[it->first].empty() ){
Node nn = getTermDatabase()->d_op_map[it->first][0];
+ Trace("sg-rel-sig-debug") << "Check in signature : " << nn << std::endl;
if( d_cg->isHandledTerm( nn ) && nn.getKind()!=APPLY_SELECTOR_TOTAL && !nn.getType().isBoolean() ){
bool do_enum = true;
//check if we have enumerated ground terms
if( nn.getKind()==APPLY_UF ){
+ Trace("sg-rel-sig-debug") << "Check enumeration..." << std::endl;
if( !d_cg->hasEnumeratedUf( nn ) ){
do_enum = false;
}
}
if( do_enum ){
+ Trace("sg-rel-sig-debug") << "Set enumeration..." << std::endl;
d_funcs.push_back( it->first );
for( unsigned i=0; i<nn.getNumChildren(); i++ ){
d_func_args[it->first].push_back( nn[i].getType() );
getTermDatabase()->computeUfEqcTerms( it->first );
}
}
+ Trace("sg-rel-sig-debug") << "Done check in signature : " << nn << std::endl;
}
}
//shuffle functions
void InstStrategyCegqi::processResetInstantiationRound( Theory::Effort effort ) {
d_check_delta_lemma = true;
+ d_check_delta_lemma_lc = true;
}
int InstStrategyCegqi::process( Node f, Theory::Effort effort, int e ) {
d_n_delta = NodeManager::currentNM()->mkSkolem( "delta", NodeManager::currentNM()->realType(), "delta for cegqi inst strategy" );
Node delta_lem = NodeManager::currentNM()->mkNode( GT, d_n_delta, NodeManager::currentNM()->mkConst( Rational( 0 ) ) );
d_quantEngine->getOutputChannel().lemma( delta_lem );
+ d_n_delta_ub = NodeManager::currentNM()->mkConst( Rational(1)/Rational(1000000) );
+ Node delta_lem_ub = NodeManager::currentNM()->mkNode( LT, d_n_delta, d_n_delta_ub );
+ d_quantEngine->getOutputChannel().lemma( delta_lem_ub );
}
cinst->d_n_delta = d_n_delta;
for( int i=0; i<d_quantEngine->getTermDatabase()->getNumInstantiationConstants( f ); i++ ){
}
Trace("inst-alg") << "-> Run cegqi for " << f << std::endl;
d_curr_quant = f;
- cinst->check();
+ bool addedLemma = cinst->check();
d_curr_quant = Node::null();
+ return addedLemma ? STATUS_UNKNOWN : STATUS_UNFINISHED;
+ }else if( e==3 ){
+ if( d_check_delta_lemma_lc ){
+ d_check_delta_lemma_lc = false;
+ d_n_delta_ub = NodeManager::currentNM()->mkNode( MULT, d_n_delta_ub, d_n_delta_ub );
+ d_n_delta_ub = Rewriter::rewrite( d_n_delta_ub );
+ Trace("cegqi") << "Delta lemma for " << d_n_delta_ub << std::endl;
+ Node delta_lem_ub = NodeManager::currentNM()->mkNode( LT, d_n_delta, d_n_delta_ub );
+ d_quantEngine->getOutputChannel().lemma( delta_lem_ub );
+ }
}
return STATUS_UNKNOWN;
}
CegqiOutputInstStrategy * d_out;
std::map< Node, CegInstantiator * > d_cinst;
Node d_n_delta;
+ Node d_n_delta_ub;
Node d_curr_quant;
bool d_check_delta_lemma;
+ bool d_check_delta_lemma_lc;
/** process functions */
void processResetInstantiationRound( Theory::Effort effort );
int process( Node f, Theory::Effort effort, int e );
}
Node TermDb::getEnumerateTerm( TypeNode tn, unsigned index ) {
+ Trace("term-db-enum") << "Get enumerate term " << tn << " " << index << std::endl;
std::map< TypeNode, unsigned >::iterator it = d_typ_enum_map.find( tn );
unsigned teIndex;
if( it==d_typ_enum_map.end() ){