mirror of
				https://github.com/Z3Prover/z3
				synced 2025-10-31 11:42:28 +00:00 
			
		
		
		
	moving remaining qsat functionality over
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
		
							parent
							
								
									296addf246
								
							
						
					
					
						commit
						20bbdfe31a
					
				
					 23 changed files with 3876 additions and 225 deletions
				
			
		|  | @ -22,9 +22,11 @@ Revision History: | |||
| #include"nlsat_solver.h" | ||||
| #include"nlsat_scoped_literal_vector.h" | ||||
| #include"polynomial_cache.h" | ||||
| #include"algebraic_numbers.h" | ||||
| 
 | ||||
| namespace nlsat { | ||||
|     class evaluator; | ||||
| 
 | ||||
|      | ||||
|     class explain { | ||||
|     public: | ||||
|  | @ -32,8 +34,8 @@ namespace nlsat { | |||
|     private: | ||||
|         imp * m_imp; | ||||
|     public: | ||||
|         explain(solver & s, assignment const & x2v, polynomial::cache & u, atom_vector const & atoms, atom_vector const & x2eq, | ||||
|                 evaluator & ev); | ||||
|         explain(solver & s, assignment const & x2v, polynomial::cache & u,  | ||||
|                 atom_vector const& atoms, atom_vector const& x2eq, evaluator & ev); | ||||
|         ~explain(); | ||||
| 
 | ||||
|         void reset(); | ||||
|  | @ -41,6 +43,7 @@ namespace nlsat { | |||
|         void set_full_dimensional(bool f); | ||||
|         void set_minimize_cores(bool f); | ||||
|         void set_factor(bool f); | ||||
|         void set_signed_project(bool f); | ||||
| 
 | ||||
|         /**
 | ||||
|            \brief Given a set of literals ls[0], ... ls[n-1] s.t. | ||||
|  | @ -60,6 +63,48 @@ namespace nlsat { | |||
|                  - s_1, ..., s_m are false in the current interpretation | ||||
|         */ | ||||
|         void operator()(unsigned n, literal const * ls, scoped_literal_vector & result); | ||||
| 
 | ||||
|          | ||||
|         /**
 | ||||
|            \brief projection for a given variable. | ||||
| 
 | ||||
|              Given:    M |= l1[x] /\ ... /\ ln[x] | ||||
|             | ||||
|              Find:     M |= s1, ..., sm | ||||
| 
 | ||||
|              Such that:  |= ~s1 \/ ... \/ ~sm \/ E x. l1[x] /\ ... /\ ln[x] | ||||
| 
 | ||||
|            Contrast this with with the core-based projection above: | ||||
| 
 | ||||
|              Given:     M |= A x . l1[x] \/  ... \/ ln[x] | ||||
|             | ||||
|              Find:      M |= ~s1, ..., ~sm. | ||||
| 
 | ||||
|              Such that:   |= s1 \/ ... \/ sm \/ A x . l1[x] \/  ... \/ ln[x]            | ||||
| 
 | ||||
|            Claim: the two compute the same solutions if the projection operators are independent of the value of x. | ||||
|            Claim: A complete, convergent projection operator can be obtained from M in a way that is independent of x. | ||||
| 
 | ||||
|             | ||||
|          */ | ||||
|         void project(var x, unsigned n, literal const * ls, scoped_literal_vector & result); | ||||
| 
 | ||||
|         /**
 | ||||
|            Maximize the value of x (locally) under the current assignment to other variables and | ||||
|            while maintaining the assignment to the literals ls. | ||||
|            Set unbounded to 'true' if the value of x is unbounded. | ||||
| 
 | ||||
|            Precondition: the set of literals are true in the current model. | ||||
| 
 | ||||
|            By local optimization we understand that x is increased to the largest value within | ||||
|            the signs delineated by the roots of the polynomials in ls. | ||||
|          */ | ||||
|         void maximize(var x, unsigned n, literal const * ls, scoped_anum& val, bool& unbounded); | ||||
| 
 | ||||
|         /**
 | ||||
|            Unit test routine. | ||||
|          */ | ||||
|         void test_root_literal(atom::kind k, var y, unsigned i, poly* p, scoped_literal_vector & result); | ||||
|     }; | ||||
| 
 | ||||
| }; | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue