mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 05:19:11 +00:00 
			
		
		
		
	tweak bound propagation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
		
							parent
							
								
									88269edd4b
								
							
						
					
					
						commit
						4828ed97be
					
				
					 3 changed files with 13 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -1627,7 +1627,6 @@ br_status arith_rewriter::mk_lshr_core(unsigned sz, expr* arg1, expr* arg2, expr
 | 
			
		|||
    
 | 
			
		||||
    if (is_num_y) {        
 | 
			
		||||
        result = m_util.mk_mod(arg1, m_util.mk_int(N));
 | 
			
		||||
        //result = arg1; // unsound
 | 
			
		||||
        result = m_util.mk_idiv(result, m_util.mk_int(rational::power_of_two(y.get_unsigned())));
 | 
			
		||||
        return BR_DONE;
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2702,7 +2702,13 @@ public:
 | 
			
		|||
        api_bound* lo_inf = end, *lo_sup = end;
 | 
			
		||||
        api_bound* hi_inf = end, *hi_sup = end;
 | 
			
		||||
            
 | 
			
		||||
        for (api_bound* other : bounds) {
 | 
			
		||||
        // todo: use a different data-structure for bounds that makes indexing fast?
 | 
			
		||||
        // for example a B-tree.
 | 
			
		||||
        unsigned count = 0;
 | 
			
		||||
        unsigned start = ctx().get_random_value();
 | 
			
		||||
        for (unsigned i = 0; i < bounds.size(); ++i) {
 | 
			
		||||
            auto j = (i + start) % bounds.size();
 | 
			
		||||
            auto other = bounds[j];
 | 
			
		||||
            if (other == &b) continue;
 | 
			
		||||
            if (b.get_lit() == other->get_lit()) continue;
 | 
			
		||||
            lp_api::bound_kind kind2 = other->get_bound_kind();
 | 
			
		||||
| 
						 | 
				
			
			@ -2711,6 +2717,9 @@ public:
 | 
			
		|||
                // the bounds are equivalent.
 | 
			
		||||
                continue;
 | 
			
		||||
            }
 | 
			
		||||
            ++count;
 | 
			
		||||
            if (count > 10)
 | 
			
		||||
                break;
 | 
			
		||||
 | 
			
		||||
            SASSERT(k1 != k2 || kind1 != kind2);
 | 
			
		||||
            if (kind2 == lp_api::lower_t) {
 | 
			
		||||
| 
						 | 
				
			
			@ -2732,6 +2741,7 @@ public:
 | 
			
		|||
                hi_sup = other;
 | 
			
		||||
            }
 | 
			
		||||
        }        
 | 
			
		||||
        // verbose_stream() << bounds.size() << "\n";
 | 
			
		||||
        if (lo_inf != end) mk_bound_axiom(b, *lo_inf);
 | 
			
		||||
        if (lo_sup != end) mk_bound_axiom(b, *lo_sup);
 | 
			
		||||
        if (hi_inf != end) mk_bound_axiom(b, *hi_inf);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -202,7 +202,8 @@ tactic * mk_preamble_tactic(ast_manager& m) {
 | 
			
		|||
            mk_simplify_tactic(m),
 | 
			
		||||
            mk_propagate_values_tactic(m),
 | 
			
		||||
            using_params(mk_ctx_simplify_tactic(m), ctx_simp_p),
 | 
			
		||||
            using_params(mk_simplify_tactic(m), pull_ite_p),
 | 
			
		||||
            using_params(mk_simplify_tactic(m), pull_ite_p), 
 | 
			
		||||
            mk_propagate_ineqs_tactic(m),
 | 
			
		||||
            mk_solve_eqs_tactic(m),
 | 
			
		||||
            mk_lia2card_tactic(m, lia2card_p),
 | 
			
		||||
            mk_elim_uncnstr_tactic(m));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue