Thiemann, René
2018-09-05 08:32:45 UTC
Dear all,
I’m currently changing the error messages in our formalization from the “string” type to
“String.literal”, so that the exported code uses target language
strings in the generated code. Unfortunately, there seems to be a mistake
in the handling of newline:
definition "message = STR ''this is⏎a two line text''"
is translated into Haskell as
message :: String;
message = "this is\\a two line text";
where the \\ should be a \n
Moreover, also the following behavior is weird:
lemma "STR ''⏎'' = STR 0x5C" "integer_of_char (CHR ''⏎'') = 10"
by code_simp+
Here, one observes that the ''⏎'' gets different characters codes,
depending on whether it is put into a CHR or into a STR.
Note that 0x5C is precisely the backslash as in the genera
I’m currently changing the error messages in our formalization from the “string” type to
“String.literal”, so that the exported code uses target language
strings in the generated code. Unfortunately, there seems to be a mistake
in the handling of newline:
definition "message = STR ''this is⏎a two line text''"
is translated into Haskell as
message :: String;
message = "this is\\a two line text";
where the \\ should be a \n
Moreover, also the following behavior is weird:
lemma "STR ''⏎'' = STR 0x5C" "integer_of_char (CHR ''⏎'') = 10"
by code_simp+
Here, one observes that the ''⏎'' gets different characters codes,
depending on whether it is put into a CHR or into a STR.
Note that 0x5C is precisely the backslash as in the genera