Open liammachado opened 5 years ago
Thanks for reporting this. We probably have to escape an initial dot while translating identifiers from Boogie to SMT-LIB.
I will have a look.
I had some time to think about this.
We should use the quoted symbols mentioned in 3.1 of the SMT-LIB standard
We can then translate .myConst
into |.myConst|
.
A question is whether we should translate every Boogie identifier into a quoted SMT symbol or only those where we have to quote something (Is there more that has to be quoted?)
The SMT-LIB standard demand that .myConst and |.myConst| are treated as the same identifier. At least this is explicitly mentioned for abc and |abc|. So quoting doesn't help.
Our library decides itself whether to print the symbol quoted or unquoted. You cannot force to quote it.
For completeness sake: The SMT-LIB Standard Version 2.6, Sec 3.1, p24, Symbols, last paragraph:
Simple symbols starting with the character @ or . are reserved for solver use.^4 Solvers can use them respectively as identifiers for abstract values and solver-generated function symbols other than abstract values. ... ^4 This includes symbols such as |@abc| and |.abc| which are considered the same as @abc and .abc, respectively.
z3 allows these symbols, cvc4 does not. I did not try SMTInterpol, but Liam's example from above suggests that SMTInterpol is also ok with that.
I will rename the offending identifiers during ICFG creation, i.e., in Boogie2SmtSymbolTable
.
When I run the command
./Ultimate -tc config/AutomizerBpl.xml -s config/svcomp-Reach-64bit-Automizer_Bitvector.epf -i test.bpl
on the below file, I get the errorSMTLIBException: Parse Error: <stdin>:14.15: cannot declare or define symbol '.a'; symbols starting with . and @ are reserved in SMT-LIB
:Below is the full error message:
While it is true that SMT-LIB disallows symbols beginning with a period, Boogie does not. In the original paper, at the bottom of page 3 it describes what characters identifiers may consist of, and periods are listed. Would you be able to allow periods at the beginning of Boogie identifiers so that it's consistent with the Boogie specification?
By the way, if I instead run the command
./Ultimate -tc config/AutomizerBpl.xml -s config/svcomp-Reach-64bit-Automizer_Default.epf -i test2.bpl
on the below file (the non-bitvector version of the original), it results in no errors: