Skip to content

smt2: fix exists/forall #3640

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 29, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions scripts/delete_failing_smt2_solver_tests
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,7 @@ rm Pointer_byte_extract9/test.desc
rm Promotion3/test.desc
rm Quantifiers-assertion/test.desc
rm Quantifiers-assignment/test.desc
rm Quantifiers-if/test.desc
rm Quantifiers-initialisation2/test.desc
rm Quantifiers-invalid-var-range/test.desc
rm Quantifiers-not/test.desc
rm Quantifiers-type/test.desc
rm Struct_Bytewise2/test.desc
rm Union_Initialization1/test.desc
Expand Down
13 changes: 13 additions & 0 deletions src/solvers/smt2/smt2_conv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4173,6 +4173,19 @@ void smt2_convt::find_symbols(const exprt &expr)
// recursive call on type
find_symbols(expr.type());

if(expr.id() == ID_exists || expr.id() == ID_forall)
{
// do not declare the quantified symbol, but record
// as 'bound symbol'
const auto &q_expr = to_quantifier_expr(expr);
const auto identifier = q_expr.symbol().get_identifier();
identifiert &id = identifier_map[identifier];
id.type = q_expr.symbol().type();
id.is_bound = true;
find_symbols(q_expr.where());
return;
}

// recursive call on operands
forall_operands(it, expr)
find_symbols(*it);
Expand Down
3 changes: 2 additions & 1 deletion src/solvers/smt2/smt2_conv.h
Original file line number Diff line number Diff line change
Expand Up @@ -284,10 +284,11 @@ class smt2_convt:public prop_convt
// keeps track of all non-Boolean symbols and their value
struct identifiert
{
bool is_bound;
typet type;
exprt value;

identifiert()
identifiert() : is_bound(false)
{
type.make_nil();
value.make_nil();
Expand Down