|
22 | 22 | #include <util/expr_util.h>
|
23 | 23 | #include <util/find_symbols.h>
|
24 | 24 | #include <util/floatbv_expr.h>
|
| 25 | +#include <util/fresh_symbol.h> |
25 | 26 | #include <util/ieee_float.h>
|
26 | 27 | #include <util/invariant.h>
|
27 | 28 | #include <util/make_unique.h>
|
| 29 | +#include <util/mathematical_expr.h> |
28 | 30 | #include <util/options.h>
|
29 | 31 | #include <util/pointer_expr.h>
|
30 | 32 | #include <util/pointer_offset_size.h>
|
@@ -1747,6 +1749,26 @@ void goto_checkt::check_rec(const exprt &expr, guardt &guard)
|
1747 | 1749 | if(check_rec_member(to_member_expr(expr), guard))
|
1748 | 1750 | return;
|
1749 | 1751 | }
|
| 1752 | + else if(expr.id() == ID_forall || expr.id() == ID_exists) |
| 1753 | + { |
| 1754 | + // In the case of a quantified statement, skolemise the expression |
| 1755 | + // and recurse. |
| 1756 | + const auto quantified_expr = to_quantifier_expr(expr); |
| 1757 | + const auto quantifier_sym = quantified_expr.symbol(); |
| 1758 | + const auto new_symbol = get_fresh_aux_symbol( |
| 1759 | + quantifier_sym.type(), |
| 1760 | + CPROVER_PREFIX, |
| 1761 | + id2string(ns.lookup(quantifier_sym.get_identifier()).base_name), |
| 1762 | + quantified_expr.source_location(), |
| 1763 | + ID_C, |
| 1764 | + const_cast<symbol_table_baset &>(ns.get_symbol_table())); |
| 1765 | + const auto symbol_expr = |
| 1766 | + symbol_exprt(new_symbol.name, quantifier_sym.type()); |
| 1767 | + const std::vector<exprt> new_sym_vec{symbol_expr}; |
| 1768 | + const auto instantiated_expr = quantified_expr.instantiate(new_sym_vec); |
| 1769 | + check_rec(instantiated_expr, guard); |
| 1770 | + return; |
| 1771 | + } |
1750 | 1772 |
|
1751 | 1773 | forall_operands(it, expr)
|
1752 | 1774 | check_rec(*it, guard);
|
|
0 commit comments