8
8
9
9
#include " boolbv.h"
10
10
11
+ #include < iostream>
12
+ #include < util/format_expr.h>
13
+
11
14
#include < util/arith_tools.h>
12
15
#include < util/expr_util.h>
13
16
#include < util/invariant.h>
@@ -169,11 +172,25 @@ instantiate_quantifier(const quantifier_exprt &expr, const namespacet &ns)
169
172
170
173
if (expr.id ()==ID_forall)
171
174
{
172
- return conjunction (expr_insts);
175
+ #if 1
176
+ if (re.id () == ID_and)
177
+ {
178
+ expr_insts.push_back (binary_predicate_exprt (var_expr, ID_gt, from_integer (lb, var_expr.type ())));
179
+ expr_insts.push_back (binary_predicate_exprt (var_expr, ID_le, from_integer (ub, var_expr.type ())));
180
+ }
181
+ #endif
182
+ return simplify_expr (conjunction (expr_insts), ns);
173
183
}
174
184
else if (expr.id () == ID_exists)
175
185
{
176
- return disjunction (expr_insts);
186
+ #if 1
187
+ if (re.id () == ID_or)
188
+ {
189
+ expr_insts.push_back (binary_predicate_exprt (var_expr, ID_gt, from_integer (lb, var_expr.type ())));
190
+ expr_insts.push_back (binary_predicate_exprt (var_expr, ID_le, from_integer (ub, var_expr.type ())));
191
+ }
192
+ #endif
193
+ return simplify_expr (disjunction (expr_insts), ns);
177
194
}
178
195
179
196
UNREACHABLE;
@@ -183,10 +200,12 @@ literalt boolbvt::convert_quantifier(const quantifier_exprt &src)
183
200
{
184
201
PRECONDITION (src.id () == ID_forall || src.id () == ID_exists);
185
202
203
+ std::cerr << " Instantiate: " << format (src) << std::endl;
186
204
const auto res = instantiate_quantifier (src, ns);
187
205
188
206
if (res)
189
207
{
208
+ std::cerr << " Instantiated: " << format (*res) << std::endl;
190
209
return convert_bool (*res);
191
210
}
192
211
else
0 commit comments