mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-26 17:29:21 +00:00 
			
		
		
		
	Add eval_and
This commit is contained in:
		
							parent
							
								
									3895d8d6bb
								
							
						
					
					
						commit
						3a34995b03
					
				
					 2 changed files with 15 additions and 0 deletions
				
			
		|  | @ -51,6 +51,8 @@ namespace polysat { | |||
|         switch (m_op) { | ||||
|         case code::lshr_op: | ||||
|             return eval_lshr(p, q, r); | ||||
|         case code::and_op: | ||||
|             return eval_and(p, q, r); | ||||
|         default: | ||||
|             return l_undef; | ||||
|         } | ||||
|  | @ -287,4 +289,16 @@ namespace polysat { | |||
|             } | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     lbool op_constraint::eval_and(pdd const& p, pdd const& q, pdd const& r) const { | ||||
|         auto& m = p.manager(); | ||||
| 
 | ||||
|         if ((p.is_zero() || q.is_zero()) && r.is_zero()) | ||||
|             return l_true; | ||||
| 
 | ||||
|         if (p.is_val() && q.is_val() && r.is_val()) | ||||
|             return r.val() == bitwise_and(p.val(), q.val()) ? l_true : l_false; | ||||
| 
 | ||||
|         return l_undef; | ||||
|     } | ||||
| } | ||||
|  |  | |||
|  | @ -44,6 +44,7 @@ namespace polysat { | |||
|         lbool eval_lshr(pdd const& p, pdd const& q, pdd const& r) const; | ||||
| 
 | ||||
|         void narrow_and(solver& s); | ||||
|         lbool eval_and(pdd const& p, pdd const& q, pdd const& r) const; | ||||
| 
 | ||||
|     public:         | ||||
|         ~op_constraint() override {} | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue