mirror of
				https://github.com/Z3Prover/z3
				synced 2025-11-04 13:29:11 +00:00 
			
		
		
		
	Added apply_result::as_expr to the C++ API. Requested here: https://stackoverflow.com/questions/48071840/get-result-of-tactics-application-as-an-expression-in-z3
This commit is contained in:
		
							parent
							
								
									1992749e78
								
							
						
					
					
						commit
						cfdde2f4d1
					
				
					 1 changed files with 13 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -2101,6 +2101,19 @@ namespace z3 {
 | 
			
		|||
            check_error();
 | 
			
		||||
            return model(ctx(), new_m);
 | 
			
		||||
        }
 | 
			
		||||
        expr as_expr() const {
 | 
			
		||||
            unsigned n = size();
 | 
			
		||||
            if (n == 0)
 | 
			
		||||
                return ctx().bool_val(true);
 | 
			
		||||
            else if (n == 1)
 | 
			
		||||
                return operator[](0).as_expr();
 | 
			
		||||
            else {
 | 
			
		||||
                array<Z3_ast> args(n);
 | 
			
		||||
                for (unsigned i = 0; i < n; i++)
 | 
			
		||||
                    args[i] = operator[](i).as_expr();
 | 
			
		||||
                return expr(ctx(), Z3_mk_or(ctx(), n, args.ptr()));
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        friend std::ostream & operator<<(std::ostream & out, apply_result const & r);
 | 
			
		||||
    };
 | 
			
		||||
    inline std::ostream & operator<<(std::ostream & out, apply_result const & r) { out << Z3_apply_result_to_string(r.ctx(), r); return out; }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue