mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-03 21:09:11 +00:00 
			
		
		
		
	experimental feature to access congruence closure of SimpleSolver
This update includes an experimental feature to access a congruence closure data-structure after search.
It comes with several caveats as pre-processing is free to eliminate terms. It is therefore necessary to use a solver that does not eliminate the terms you want to track for congruence of. This is partially addressed by using SimpleSolver or incremental mode solving.
```python
from z3 import *
s = SimpleSolver()
x, y, z = Ints('x y z')
s.add(x == y)
s.add(y == z)
s.check()
print(s.root(x), s.root(y), s.root(z))
print(s.next(x), s.next(y), s.next(z))
```
			
			
This commit is contained in:
		
							parent
							
								
									c0f1f33898
								
							
						
					
					
						commit
						f6d411d54b
					
				
					 21 changed files with 145 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -110,6 +110,8 @@ namespace opt {
 | 
			
		|||
        void get_levels(ptr_vector<expr> const& vars, unsigned_vector& depth) override; 
 | 
			
		||||
        expr_ref_vector get_trail(unsigned max_level) override { return m_context.get_trail(max_level); }
 | 
			
		||||
        expr_ref_vector cube(expr_ref_vector&, unsigned) override { return expr_ref_vector(m); }
 | 
			
		||||
        expr* congruence_root(expr* e) override { return e; }
 | 
			
		||||
        expr* congruence_next(expr* e) override { return e; }
 | 
			
		||||
        void set_phase(expr* e) override { m_context.set_phase(e); }
 | 
			
		||||
        phase* get_phase() override { return m_context.get_phase(); }
 | 
			
		||||
        void set_phase(phase* p) override { m_context.set_phase(p); }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue