Skip to content

Commit 9027d98

Browse files
committed
Implement symbol_exprt to smt_termt conversion
1 parent 778962e commit 9027d98

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

src/solvers/smt2_incremental/convert_expr_to_smt.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ smt_sortt convert_type_to_smt_sort(const typet &type)
4646

4747
static smt_termt convert_expr_to_smt(const symbol_exprt &symbol_expr)
4848
{
49-
UNIMPLEMENTED_FEATURE(
50-
"Generation of SMT formula for symbol expression: " + symbol_expr.pretty());
49+
return smt_identifier_termt{symbol_expr.get_identifier(),
50+
convert_type_to_smt_sort(symbol_expr.type())};
5151
}
5252

5353
static smt_termt convert_expr_to_smt(const nondet_symbol_exprt &nondet_symbol)

unit/solvers/smt2_incremental/convert_expr_to_smt.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,13 @@ TEST_CASE("\"typet\" to smt sort conversion", "[core][smt2_incremental]")
3434
}
3535
}
3636

37+
TEST_CASE("\"symbol_exprt\" to smt term conversion", "[core][smt2_incremental]")
38+
{
39+
CHECK(
40+
convert_expr_to_smt(symbol_exprt{"foo", bool_typet{}}) ==
41+
smt_identifier_termt("foo", smt_bool_sortt{}));
42+
}
43+
3744
TEST_CASE(
3845
"\"exprt\" to smt term conversion for constants/literals",
3946
"[core][smt2_incremental]")

0 commit comments

Comments
 (0)