mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-31 19:52:29 +00:00 
			
		
		
		
	simplify diff rewriting
This commit is contained in:
		
							parent
							
								
									4a94abe7d7
								
							
						
					
					
						commit
						efbcdcbffd
					
				
					 1 changed files with 7 additions and 18 deletions
				
			
		|  | @ -741,7 +741,7 @@ br_status bool_rewriter::mk_distinct_core(unsigned num_args, expr * const * args | |||
|     } | ||||
| 
 | ||||
|     expr_fast_mark1 visited; | ||||
|     bool all_value = true; | ||||
|     bool all_value = true, all_diff = true; | ||||
|     for (unsigned i = 0; i < num_args; i++) { | ||||
|         expr * arg = args[i]; | ||||
|         if (visited.is_marked(arg)) { | ||||
|  | @ -751,8 +751,13 @@ br_status bool_rewriter::mk_distinct_core(unsigned num_args, expr * const * args | |||
|         visited.mark(arg); | ||||
|         if (!m().is_unique_value(arg)) | ||||
|             all_value = false; | ||||
|         if (!all_value && all_diff) { | ||||
|             for (unsigned j = 0; all_diff && j + 1 < i; ++j) { | ||||
|                 all_diff = m().are_distinct(arg, args[j]); | ||||
|             } | ||||
|         } | ||||
|     } | ||||
|     if (all_value) { | ||||
|     if (all_diff) { | ||||
|         result = m().mk_true(); | ||||
|         return BR_DONE; | ||||
|     } | ||||
|  | @ -763,22 +768,6 @@ br_status bool_rewriter::mk_distinct_core(unsigned num_args, expr * const * args | |||
|         return BR_DONE; | ||||
|     } | ||||
| 
 | ||||
|     bool all_diff = true, some_eq = false; | ||||
|     for (unsigned i = 0; all_diff && !some_eq && i < num_args; i++) { | ||||
|         for (unsigned j = i + 1; all_diff && !some_eq && j < num_args; j++) { | ||||
|             all_diff = m().are_distinct(args[i], args[j]); | ||||
|             some_eq = m().are_equal(args[i], args[j]); | ||||
|         }         | ||||
|     } | ||||
|     if (all_diff) { | ||||
|         result = m().mk_true(); | ||||
|         return BR_DONE; | ||||
|     } | ||||
|     if (some_eq) { | ||||
|         result = m().mk_false(); | ||||
|         return BR_DONE; | ||||
|     } | ||||
| 
 | ||||
|     if (m_blast_distinct && num_args < m_blast_distinct_threshold) { | ||||
|         ptr_buffer<expr> new_diseqs; | ||||
|         for (unsigned i = 0; i < num_args; i++) { | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue