Why does Coq not accept this?
Notation "[ d1 , .. , d2 ]" := (addition (multiply ( .. d1 .. ) ten) d2).
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Recursive notations need to obey fairly strict rules. The pattern to repeat must appear twice (that’s how Coq knows what is to be repeated): once using
d2around the hole, and once usingd1around a terminating expression. You’ve only used your pattern once, usingd2around the hole. You need another iteration, around somezero(likenilin the notation for lists).If you don’t wish to introduce a zero, you can require at least two digits inside the brackets (instead of just one as above), and use that as the terminating expression. This is like the notation for pairs (in
Init/Notations.v, also presented in the manual). You could complement this with a notation for[d0]with lower priority, but as this is justd0there isn’t much point.