This represents what I want, but which doesn't work:
syntax
"_F_hex" :: "any => any" ("F;")
translations
"F;" => "True,True,True,True"
I would use F;
like this:
[F;,F;] == [True,True,True,True,True,True,True,True]
This represents what I want, but which doesn't work:
syntax
"_F_hex" :: "any => any" ("F;")
translations
"F;" => "True,True,True,True"
I would use F;
like this:
[F;,F;] == [True,True,True,True,True,True,True,True]
Isabelle must be able to parse the right-hand side of a translation, but True,True,...
does not yield a valid syntax tree. If you use F;
only in list enumerations, you can extend the syntax translation rules for list enumerations as follows.
syntax "_F_hex" :: "logic" ("F;")
translations
"[F;, xs]" => "CONST True # CONST True # CONST True # CONST True # [xs]"
"[F;]" => "CONST True # CONST True # CONST True # CONST True # []"
Note that _F_hex
does not take any argument, so its "type" is logic
(and not something of the form _ => _
) which stands for a parse tree node for a term. In the translations, you have to mark constants in the logic such as True
with CONST
. Otherwise, Isabelle would treat True
as a variable.