mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	better recovery from incompleteness and interp failure in duality
This commit is contained in:
		
							parent
							
								
									2d2ec38541
								
							
						
					
					
						commit
						b343dcb341
					
				
					 4 changed files with 25 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -782,6 +782,9 @@ namespace Duality {
 | 
			
		|||
        struct ReallyBad {
 | 
			
		||||
        };
 | 
			
		||||
 | 
			
		||||
        // throw when greedy reduction fails
 | 
			
		||||
        struct greedy_reduce_failed {};
 | 
			
		||||
 | 
			
		||||
        /** Pop a scope (see Push). Note, you cannot pop axioms. */
 | 
			
		||||
      
 | 
			
		||||
        void Pop(int num_scopes);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2870,10 +2870,10 @@ namespace Duality {
 | 
			
		|||
            lits = assumps; 
 | 
			
		||||
            std::copy(core.begin(),core.end(),std::inserter(lits,lits.end()));
 | 
			
		||||
      
 | 
			
		||||
            for(int k = 0; k < 100; k++) // keep trying, maybe MBQI will do something!
 | 
			
		||||
            for(int k = 0; k < 4; k++) // keep trying, maybe MBQI will do something!
 | 
			
		||||
                if((res = CheckCore(lits,full_core)) == unsat)
 | 
			
		||||
                    goto is_unsat;
 | 
			
		||||
            throw "should be unsat";
 | 
			
		||||
            throw greedy_reduce_failed();
 | 
			
		||||
        }
 | 
			
		||||
    is_unsat:
 | 
			
		||||
        FilterCore(core,full_core);
 | 
			
		||||
| 
						 | 
				
			
			@ -3084,8 +3084,18 @@ namespace Duality {
 | 
			
		|||
                    }
 | 
			
		||||
                }
 | 
			
		||||
                // AddToProofCore(*core);
 | 
			
		||||
                SolveSingleNode(root,node);
 | 
			
		||||
 | 
			
		||||
                
 | 
			
		||||
                try {
 | 
			
		||||
                    SolveSingleNode(root,node);
 | 
			
		||||
                }
 | 
			
		||||
                catch (char const *msg){
 | 
			
		||||
                    // This happens if interpolation fails
 | 
			
		||||
                    Pop(1);
 | 
			
		||||
                    is.pop(1);
 | 
			
		||||
                    delete core;
 | 
			
		||||
                    timer_stop("InterpolateByCases");
 | 
			
		||||
                    throw msg;
 | 
			
		||||
                }
 | 
			
		||||
                {
 | 
			
		||||
                    expr itp = GetAnnotation(node);
 | 
			
		||||
                    dualModel = is.get_model(); // TODO: what does this mean?
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2295,6 +2295,10 @@ namespace Duality {
 | 
			
		|||
                                        reporter->Message(std::string("interpolation failure:") + msg);
 | 
			
		||||
                                        throw DoRestart();
 | 
			
		||||
                                    }
 | 
			
		||||
                                    catch(const RPFP::greedy_reduce_failed &){
 | 
			
		||||
                                        // if we couldn't reduce, just continue (maybe should restart?)
 | 
			
		||||
                                        reporter->Message("interpolant verification failed");
 | 
			
		||||
                                    }
 | 
			
		||||
                                    if(RecordUpdate(node)){
 | 
			
		||||
                                        update_count++;
 | 
			
		||||
                                        total_updates++;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -562,7 +562,10 @@ class iz3proof_itp_impl : public iz3proof_itp {
 | 
			
		|||
                else res = clone(e,args);
 | 
			
		||||
            }
 | 
			
		||||
            catch (const cannot_simplify &){
 | 
			
		||||
                res = clone(e,args);
 | 
			
		||||
                if(g == sum)
 | 
			
		||||
                    res = clone(e,args);
 | 
			
		||||
                else
 | 
			
		||||
                    throw "interpolation failure";
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        return res;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue