mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-03 21:09:11 +00:00 
			
		
		
		
	n/a
This commit is contained in:
		
							parent
							
								
									ddf2d28350
								
							
						
					
					
						commit
						388b2f5eec
					
				
					 9 changed files with 274 additions and 202 deletions
				
			
		| 
						 | 
				
			
			@ -28,11 +28,10 @@ Author:
 | 
			
		|||
namespace bv {
 | 
			
		||||
 | 
			
		||||
    struct sls_valuation {
 | 
			
		||||
        unsigned bw;           // bit-width
 | 
			
		||||
        unsigned nw;           // num words
 | 
			
		||||
        svector<digit_t> lo,  hi;     // range assignment to bit-vector, as wrap-around interval
 | 
			
		||||
        unsigned bw;                     // bit-width
 | 
			
		||||
        unsigned nw;                     // num words
 | 
			
		||||
        svector<digit_t> lo,  hi;        // range assignment to bit-vector, as wrap-around interval
 | 
			
		||||
        svector<digit_t> bits, fixed;    // bit assignment and don't care bit
 | 
			
		||||
        bool is_feasible() const; // the current bit-evaluation is between lo and hi.
 | 
			
		||||
        sls_valuation(unsigned bw);
 | 
			
		||||
        ~sls_valuation();
 | 
			
		||||
        
 | 
			
		||||
| 
						 | 
				
			
			@ -44,17 +43,15 @@ namespace bv {
 | 
			
		|||
        void add_range(rational lo, rational hi);
 | 
			
		||||
        void set1(svector<digit_t>& bits);
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        void clear_overflow_bits(svector<digit_t>& bits) const;
 | 
			
		||||
        bool in_range(svector<digit_t> const& bits) const;        
 | 
			
		||||
        bool can_set(svector<digit_t> const& bits) const;
 | 
			
		||||
 | 
			
		||||
        bool eq(sls_valuation const& other) const { return eq(other.bits); }
 | 
			
		||||
 | 
			
		||||
        bool eq(svector<digit_t> const& other) const;
 | 
			
		||||
 | 
			
		||||
        bool gt(svector<digit_t> const& a, svector<digit_t> const& b) const {
 | 
			
		||||
            return 0 > memcmp(a.data(), b.data(), num_bytes());
 | 
			
		||||
        }
 | 
			
		||||
        bool eq(svector<digit_t> const& other) const { return eq(other, bits); }
 | 
			
		||||
        bool eq(svector<digit_t> const& a, svector<digit_t> const& b) const;
 | 
			
		||||
        bool gt(svector<digit_t> const& a, svector<digit_t> const& b) const;
 | 
			
		||||
 | 
			
		||||
        bool is_zero() const { return is_zero(bits); }
 | 
			
		||||
        bool is_zero(svector<digit_t> const& a) const { 
 | 
			
		||||
| 
						 | 
				
			
			@ -79,6 +76,10 @@ namespace bv {
 | 
			
		|||
            return i;               
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        // retrieve number at or below src which is feasible
 | 
			
		||||
        // with respect to fixed, lo, hi.
 | 
			
		||||
        bool get_below(svector<digit_t> const& src, svector<digit_t>& dst);
 | 
			
		||||
 | 
			
		||||
        bool try_set(svector<digit_t> const& src) {
 | 
			
		||||
            if (!can_set(src))
 | 
			
		||||
                return false;
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue