File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
src/solvers/smt2_incremental Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change 20
20
21
21
static std::string escape_identifier (const irep_idt &identifier)
22
22
{
23
- const std::string "ed_identifier = smt2_convt::convert_identifier (identifier);
24
- if (std::regex_match (quoted_identifier, std::regex (" (\\ w+)|\\ +-/\\ *=%?!\\ .\\ $_~&\\ ^<>@" )))
25
- return quoted_identifier;
26
- return std::string{" |" } + quoted_identifier + " |" ;
23
+ // This matches the definition of a `simple_symbol` according to the SMTLIB
24
+ // specification, version 2.6.
25
+ const std::regex simple_symbol_regex (
26
+ " [a-zA-Z\\ +-\\ /\\ *=%?!\\ .\\ $_~&\\ ^<>@][\\ w\\ +-\\ /\\ *=%?!\\ .\\ $_~&\\ ^<>@]*" );
27
+ if (std::regex_match (id2string (identifier), simple_symbol_regex))
28
+ return id2string (identifier);
29
+
30
+ return std::string{" |" } + smt2_convt::convert_identifier (identifier) + " |" ;
27
31
}
28
32
29
33
class smt_index_output_visitort : public smt_index_const_downcast_visitort
You can’t perform that action at this time.
0 commit comments