coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Tom Prince <tom.prince AT ualberta.net>
- To: Vladimir Voevodsky <vladimir AT ias.edu>, Coq-Club Club <coq-club AT inria.fr>
- Subject: Re: [Coq-Club] an issue with notations
- Date: Sun, 17 Apr 2011 19:10:47 -0400
On 2011-04-17, Vladimir Voevodsky wrote:
> Hello,
>
> I am trying to learn the Coq system for notations. When I write:
>
>
> Notation "'total2'" := (@sigT) (at level 0): type_scope.
> Notation "'tpair'" := (@existT) (at level 0) : type_scope.
I don't think you want type_scope here.
>
>
> Definition pr21 (T:UU) (P:T -> UU) (z: total2 T P) : T :=
> match z with
> tpair t x => t
> end.
>
> Coq complains at the definition by saying "Constructor expected". What is
> wrong there?
In this case, you could write:
Notation total2 := (@sigT).
Notation tpair := (@existT).
Definition UU := Type.
Definition pr21 (T:UU) (P:T -> UU) (z: total2 T P) : T :=
match z with
| tpair t x => t
end.
One difference is that tpair and total2 are treated like normal
identifiers by the parser, rather than adding new rules to the parser.
The parser for patterns is different from the one for general terms,
although I am not entirely sure why it isn't accepting this case.
Tom
- [Coq-Club] Re: [coqdev] messy behavior with universes, (continued)
- [Coq-Club] Re: [coqdev] messy behavior with universes, Tom Prince
- [Coq-Club] Re: [coqdev] messy behavior with universes, Vladimir Voevodsky
- Re: [Coq-Club] Re: [coqdev] messy behavior with universes, Carlos Simpson
- [Coq-Club] an issue with notations, Vladimir Voevodsky
- [Coq-Club] a problem with canonical structures, Vladimir Voevodsky
- Re: [Coq-Club] a problem with canonical structures, Cyril Cohen
- [Coq-Club] Another question, Vladimir Voevodsky
- Re: [Coq-Club] Another question, Vincent Siles
- Re: [Coq-Club] an issue with notations, Hugo Herbelin
- Re: [Coq-Club] an issue with notations, Vladimir Voevodsky
- Re: [Coq-Club] an issue with notations, Tom Prince
- Re: [Coq-Club] Impredicative [ Set ], Alexandre Pilkiewicz
- Re: [Coq-Club] Guard Condition, Frederic Blanqui
Archive powered by MhonArc 2.6.16.