Hi everyone,
I am trying to define some notations for my project but I am a bit confused with how to actually define it.
For the first case, I would like to have the following :
Notation "'on' v { s }" := (Baz v s) : my_scope.
If I try to use it it complains with a Syntax error: [constr:operconstr] expected after [constr:operconstr level 200] (in [constr:operconstr]).
. I imagine it might have something to do with this in the docs, but… I don’t know. If I define it like this:
Notation "'on' v { s }" := (Baz v s) (v at next level, s at next level) : my_scope.
Then everything is ok, but I don’t completely understand what is happening (I have an idea but not sure).
The second case is the following:
Notation "f ( a )" := (Bar1 f a) (at level 20) : my_scope.
Notation "l : f ( a )" := (Bar2 l f a) (at level 20) : my_scope.
Notation "f ( a ) { s }" := (Bar3 f a s) (at level 20) : my_scope.
Notation "l : f ( a ) { s }" := (Bar4 l f a s) (at level 20) : my_scope.
If I use any of these in a function I get : Syntax error: '(' expected after [constr:pattern level 200] (in [constr:pattern]).
. For instance in the following function:
Definition foo (bar : Bar) :=
match bar with
| _ : _ ( _ ) => true
| _ => false
end.
And again, I am not entirely sure what to do… I am guessing I have to adjust the levels of the different parameters, but I’m not sure I understand what is happening .
Thanks in advance !