mirror of
https://github.com/Z3Prover/z3
synced 2025-04-24 09:35:32 +00:00
fixes and performance improvements for interp and duality
This commit is contained in:
parent
61905a10db
commit
a6f58bdd17
5 changed files with 88 additions and 45 deletions
|
@ -778,6 +778,8 @@ int iz3mgr::occurs_in(ast var, ast e){
|
|||
|
||||
|
||||
bool iz3mgr::solve_arith(const ast &v, const ast &x, const ast &y, ast &res){
|
||||
if(occurs_in(v,y))
|
||||
return false;
|
||||
if(op(x) == Plus){
|
||||
int n = num_args(x);
|
||||
for(int i = 0; i < n; i++){
|
||||
|
@ -801,8 +803,8 @@ iz3mgr::ast iz3mgr::cont_eq(stl_ext::hash_set<ast> &cont_eq_memo, bool truth, as
|
|||
return ast();
|
||||
cont_eq_memo.insert(e);
|
||||
if(!truth && op(e) == Equal){
|
||||
if(arg(e,0) == v) return(arg(e,1));
|
||||
if(arg(e,1) == v) return(arg(e,0));
|
||||
if(arg(e,0) == v && !occurs_in(v,arg(e,1))) return(arg(e,1));
|
||||
if(arg(e,1) == v && !occurs_in(v,arg(e,0))) return(arg(e,0));
|
||||
ast res;
|
||||
if(solve_arith(v,arg(e,0),arg(e,1),res)) return res;
|
||||
if(solve_arith(v,arg(e,1),arg(e,0),res)) return res;
|
||||
|
|
|
@ -278,7 +278,8 @@ class iz3mgr {
|
|||
}
|
||||
|
||||
symb sym(ast t){
|
||||
return to_app(t.raw())->get_decl();
|
||||
raw_ast *_ast = t.raw();
|
||||
return is_app(_ast) ? to_app(_ast)->get_decl() : 0;
|
||||
}
|
||||
|
||||
std::string string_of_symbol(symb s){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue