Skip to content

Commit 019f318

Browse files
committed
WIP: Debugging output and additional constraint
1 parent 4e0fda8 commit 019f318

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

src/solvers/flattening/boolbv_quantifier.cpp

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ Author: Daniel Kroening, [email protected]
88

99
#include "boolbv.h"
1010

11+
#include <iostream>
12+
#include <util/format_expr.h>
13+
1114
#include <util/arith_tools.h>
1215
#include <util/expr_util.h>
1316
#include <util/invariant.h>
@@ -169,11 +172,25 @@ instantiate_quantifier(const quantifier_exprt &expr, const namespacet &ns)
169172

170173
if(expr.id()==ID_forall)
171174
{
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);
173183
}
174184
else if(expr.id() == ID_exists)
175185
{
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);
177194
}
178195

179196
UNREACHABLE;
@@ -183,10 +200,12 @@ literalt boolbvt::convert_quantifier(const quantifier_exprt &src)
183200
{
184201
PRECONDITION(src.id() == ID_forall || src.id() == ID_exists);
185202

203+
std::cerr << "Instantiate: " << format(src) << std::endl;
186204
const auto res = instantiate_quantifier(src, ns);
187205

188206
if(res)
189207
{
208+
std::cerr << "Instantiated: " << format(*res) << std::endl;
190209
return convert_bool(*res);
191210
}
192211
else

0 commit comments

Comments
 (0)