mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-03 21:09:11 +00:00 
			
		
		
		
	fix max/min length to handle concatenation
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
		
							parent
							
								
									f1b8376739
								
							
						
					
					
						commit
						0fc9f1d46a
					
				
					 1 changed files with 8 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -932,7 +932,10 @@ unsigned seq_util::str::min_length(expr* s) const {
 | 
			
		|||
            return 0u;
 | 
			
		||||
    };
 | 
			
		||||
    while (is_concat(s, s1, s2)) {
 | 
			
		||||
        result += get_length(s1);
 | 
			
		||||
        if (is_concat(s1))
 | 
			
		||||
            result += min_length(s1);
 | 
			
		||||
        else
 | 
			
		||||
            result += get_length(s1);
 | 
			
		||||
        s = s2;
 | 
			
		||||
    }
 | 
			
		||||
    result += get_length(s);
 | 
			
		||||
| 
						 | 
				
			
			@ -960,7 +963,10 @@ unsigned seq_util::str::max_length(expr* s) const {
 | 
			
		|||
            return UINT_MAX;
 | 
			
		||||
    };
 | 
			
		||||
    while (is_concat(s, s1, s2)) {
 | 
			
		||||
        result = u.max_plus(get_length(s1), result);
 | 
			
		||||
        if (is_concat(s1))
 | 
			
		||||
            result = u.max_plus(max_length(s1), result);
 | 
			
		||||
        else
 | 
			
		||||
            result = u.max_plus(get_length(s1), result);
 | 
			
		||||
        s = s2;
 | 
			
		||||
    }
 | 
			
		||||
    result = u.max_plus(get_length(s), result);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue