mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-30 19:22:28 +00:00 
			
		
		
		
	Improve BoolRef addition (#7045)
This commit is contained in:
		
							parent
							
								
									7c81ee0890
								
							
						
					
					
						commit
						a9513c1998
					
				
					 1 changed files with 6 additions and 1 deletions
				
			
		|  | @ -1572,7 +1572,12 @@ class BoolRef(ExprRef): | |||
|         return BoolSortRef(Z3_get_sort(self.ctx_ref(), self.as_ast()), self.ctx) | ||||
| 
 | ||||
|     def __add__(self, other): | ||||
|         return If(self, 1, 0) + If(other, 1, 0) | ||||
|         if isinstance(other, BoolRef): | ||||
|             other = If(other, 1, 0) | ||||
|         return If(self, 1, 0) + other | ||||
| 
 | ||||
|     def __radd__(self, other): | ||||
|         return self + other | ||||
|   | ||||
|     def __rmul__(self, other): | ||||
|         return self * other | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue