It complains to me I have a parsing error but I can't find in the manual what the right syntax is suppose to be...
| "my_function x b (Cons3 y) = if x=y then b else (Cons3 y)"
error:
Inner syntax error⌂
Failed to parse prop
It complains to me I have a parsing error but I can't find in the manual what the right syntax is suppose to be...
| "my_function x b (Cons3 y) = if x=y then b else (Cons3 y)"
error:
Inner syntax error⌂
Failed to parse prop
You need brackets:
| "my_function x b (Cons3 y) = (if x=y then b else (Cons3 y) )"
for some reason.
Found an example and copied it from this resource:
In the HOL object logic, the if-then-else
, case
, and let
constructs have as low a precedence as quantifiers, which requires additional enclosing parentheses in the context of most other operations. Please have a look at https://isabelle.in.tum.de/dist/Isabelle2019/doc/logics.pdf, page 10.