Skip to content

Commit 293ba53

Browse files
committed
SMT2: convert forall/exists with multiple bindings
This adds support for converting forall/exists expressions that have multiple bindings to SMT2.
1 parent 1714e22 commit 293ba53

File tree

1 file changed

+17
-11
lines changed

1 file changed

+17
-11
lines changed

src/solvers/smt2/smt2_conv.cpp

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,13 +1972,16 @@ void smt2_convt::convert_expr(const exprt &expr)
19721972
else if(quantifier_expr.id() == ID_exists)
19731973
out << "(exists ";
19741974

1975-
exprt bound = quantifier_expr.symbol();
1976-
1977-
out << "((";
1978-
convert_expr(bound);
1979-
out << " ";
1980-
convert_type(bound.type());
1981-
out << ")) ";
1975+
out << "( ";
1976+
for(const auto &bound : quantifier_expr.variables())
1977+
{
1978+
out << "(";
1979+
convert_expr(bound);
1980+
out << " ";
1981+
convert_type(bound.type());
1982+
out << ") ";
1983+
}
1984+
out << ") ";
19821985

19831986
convert_expr(quantifier_expr.where());
19841987

@@ -4566,10 +4569,13 @@ void smt2_convt::find_symbols(const exprt &expr)
45664569
// do not declare the quantified symbol, but record
45674570
// as 'bound symbol'
45684571
const auto &q_expr = to_quantifier_expr(expr);
4569-
const auto identifier = q_expr.symbol().get_identifier();
4570-
identifiert &id = identifier_map[identifier];
4571-
id.type = q_expr.symbol().type();
4572-
id.is_bound = true;
4572+
for(const auto &symbol : q_expr.variables())
4573+
{
4574+
const auto identifier = symbol.get_identifier();
4575+
identifiert &id = identifier_map[identifier];
4576+
id.type = symbol.type();
4577+
id.is_bound = true;
4578+
}
45734579
find_symbols(q_expr.where());
45744580
return;
45754581
}

0 commit comments

Comments
 (0)