Skip to content

Commit 232ecfd

Browse files
committed
Add comment explaining why smt identifiers are checked
Because the purpose of this INVARIANT was not neccessarily apparent without reading the doxygen in the header file.
1 parent c3f1985 commit 232ecfd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/solvers/smt2_incremental/smt_terms.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,10 @@ static bool is_valid_smt_identifier(irep_idt identifier)
5959
smt_identifier_termt::smt_identifier_termt(irep_idt identifier, smt_sortt sort)
6060
: smt_termt(ID_smt_identifier_term, std::move(sort))
6161
{
62+
// The below invariant exists as a sanity check that the string being used for
63+
// the identifier is in unescaped form. This is because the escaping and
64+
// unescaping are implementation details of the printing to string and
65+
// response parsing respectively, not part of the underlying data.
6266
INVARIANT(
6367
is_valid_smt_identifier(identifier),
6468
R"(Identifiers may not contain | characters.)");

0 commit comments

Comments
 (0)