mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-03 21:09:11 +00:00 
			
		
		
		
	modify #5454
This commit is contained in:
		
							parent
							
								
									429e5ed0cd
								
							
						
					
					
						commit
						904c6e21b1
					
				
					 3 changed files with 7 additions and 4 deletions
				
			
		| 
						 | 
				
			
			@ -175,6 +175,9 @@ namespace array {
 | 
			
		|||
        ptr_buffer<expr> sel1_args, sel2_args;
 | 
			
		||||
        unsigned num_args = select->get_num_args();
 | 
			
		||||
 | 
			
		||||
        expr* arg = select->get_arg(0);
 | 
			
		||||
        if (arg != store && !can_beta_reduce(arg) && expr2enode(arg)->get_root() == expr2enode(store)->get_root()) 
 | 
			
		||||
            return false;
 | 
			
		||||
        bool has_diff = false;
 | 
			
		||||
        for (unsigned i = 1; i < num_args; i++) 
 | 
			
		||||
            has_diff |= expr2enode(select->get_arg(i))->get_root() != expr2enode(store->get_arg(i))->get_root();
 | 
			
		||||
| 
						 | 
				
			
			@ -182,7 +185,7 @@ namespace array {
 | 
			
		|||
            return false;
 | 
			
		||||
 | 
			
		||||
        sel1_args.push_back(store);
 | 
			
		||||
        sel2_args.push_back(store->get_arg(0));        
 | 
			
		||||
        sel2_args.push_back(arg);       
 | 
			
		||||
        
 | 
			
		||||
        for (unsigned i = 1; i < num_args; i++) {
 | 
			
		||||
            sel1_args.push_back(select->get_arg(i));
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -272,8 +272,7 @@ namespace array {
 | 
			
		|||
        return !get_config().m_array_delay_exp_axiom && d.m_prop_upward;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    bool solver::can_beta_reduce(euf::enode* n) const {
 | 
			
		||||
        expr* c = n->get_expr();
 | 
			
		||||
    bool solver::can_beta_reduce(expr* c) const {
 | 
			
		||||
        return a.is_const(c) || a.is_as_array(c) || a.is_store(c) || is_lambda(c) || a.is_map(c);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -209,7 +209,8 @@ namespace array {
 | 
			
		|||
        unsigned get_lambda_equiv_size(var_data const& d) const;
 | 
			
		||||
        bool should_set_prop_upward(var_data const& d) const;
 | 
			
		||||
        bool should_prop_upward(var_data const& d) const;
 | 
			
		||||
        bool can_beta_reduce(euf::enode* n) const;
 | 
			
		||||
        bool can_beta_reduce(euf::enode* n) const { return can_beta_reduce(n->get_expr()); }
 | 
			
		||||
        bool can_beta_reduce(expr* e) const;
 | 
			
		||||
 | 
			
		||||
        var_data& get_var_data(euf::enode* n) { return get_var_data(n->get_th_var(get_id())); }
 | 
			
		||||
        var_data& get_var_data(theory_var v) { return *m_var_data[v]; }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue