mirror of
https://github.com/Z3Prover/z3
synced 2025-04-28 11:25:51 +00:00
interpolation fixes
This commit is contained in:
parent
4f06b347b3
commit
08d892bbdb
4 changed files with 64 additions and 21 deletions
|
@ -82,6 +82,8 @@ namespace Duality {
|
|||
|
||||
Term SubstAtom(hash_map<ast, Term> &memo, const expr &t, const expr &atom, const expr &val);
|
||||
|
||||
Term CloneQuantAndSimp(const expr &t, const expr &body);
|
||||
|
||||
Term RemoveRedundancy(const Term &t);
|
||||
|
||||
Term IneqToEq(const Term &t);
|
||||
|
|
|
@ -523,6 +523,25 @@ namespace Duality {
|
|||
return foo;
|
||||
}
|
||||
|
||||
Z3User::Term Z3User::CloneQuantAndSimp(const expr &t, const expr &body){
|
||||
if(t.is_quantifier_forall() && body.is_app() && body.decl().get_decl_kind() == And){
|
||||
int nargs = body.num_args();
|
||||
std::vector<expr> args(nargs);
|
||||
for(int i = 0; i < nargs; i++)
|
||||
args[i] = CloneQuantAndSimp(t, body.arg(i));
|
||||
return ctx.make(And,args);
|
||||
}
|
||||
if(!t.is_quantifier_forall() && body.is_app() && body.decl().get_decl_kind() == Or){
|
||||
int nargs = body.num_args();
|
||||
std::vector<expr> args(nargs);
|
||||
for(int i = 0; i < nargs; i++)
|
||||
args[i] = CloneQuantAndSimp(t, body.arg(i));
|
||||
return ctx.make(Or,args);
|
||||
}
|
||||
return clone_quantifier(t,body);
|
||||
}
|
||||
|
||||
|
||||
Z3User::Term Z3User::SubstAtom(hash_map<ast, Term> &memo, const expr &t, const expr &atom, const expr &val){
|
||||
std::pair<ast,Term> foo(t,expr(ctx));
|
||||
std::pair<hash_map<ast,Term>::iterator, bool> bar = memo.insert(foo);
|
||||
|
|
|
@ -1916,6 +1916,7 @@ namespace Duality {
|
|||
|
||||
stack.back().level = tree->slvr().get_scope_level();
|
||||
bool was_sat = true;
|
||||
int update_failures = 0;
|
||||
|
||||
while (true)
|
||||
{
|
||||
|
@ -1954,10 +1955,14 @@ namespace Duality {
|
|||
heuristic->Update(node->map); // make it less likely to expand this node in future
|
||||
}
|
||||
if(update_count == 0){
|
||||
if(was_sat)
|
||||
throw Incompleteness();
|
||||
if(was_sat){
|
||||
update_failures++;
|
||||
if(update_failures > 10)
|
||||
throw Incompleteness();
|
||||
}
|
||||
reporter->Message("backtracked without learning");
|
||||
}
|
||||
else update_failures = 0;
|
||||
}
|
||||
tree->ComputeProofCore(); // need to compute the proof core before popping solver
|
||||
bool propagated = false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue