coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Abhishek Kr Singh <abhishek.uor AT gmail.com>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] Ltac: Matching on hypothesis which contains user defined notations
- Date: Thu, 16 Aug 2018 15:41:35 +0530
- Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=abhishek.uor AT gmail.com; spf=Pass smtp.mailfrom=abhishek.uor AT gmail.com; spf=None smtp.helo=postmaster AT mail-ua1-f45.google.com
- Ironport-phdr: 9a23:F7fF5RawRCQTh8rgGaZ8FYb/LSx+4OfEezUN459isYplN5qZoMm4bnLW6fgltlLVR4KTs6sC17KI9fi4EUU7or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6arXK99yMdFQviPgRpOOv1BpTSj8Oq3Oyu5pHfeQpFiCa8bL9oMBm6sRjau9ULj4dlNqs/0AbCrGFSe+RRy2NoJFaTkAj568yt4pNt8Dletuw4+cJYXqr0Y6o3TbpDDDQ7KG81/9HktQPCTQSU+HQRVHgdnwdSDAjE6BH6WYrxsjf/u+Fg1iSWIdH6QLYpUjmk8qxlSgLniD0fOjA5/m/ZidF+grxHrx+6vRNz35TZbZuJOPZifK7Qe84RS2pbXsZWUixMGp+xYJAPD+oAJuZYr5fyp1gTphW7HwmnGf7hyj5Ohn/53a0xzuMsHhvd0wwgHtIOq3TUo8v2NKsITOC1y7PIwC7Mb/NTwzj96YzIfgo9rvGLWLJ9aMzcwlQhGQPCi1Wfs43lPzWN2+QRsmib4fBgWfi1i2E5sAF9uDmvxsEqh4LUhYwV0kjJ+TtlzIsxP9G1S052bcS6HJdOqS2WLYR7T8MkTmp1oig10KcGtoS+fCUSyJQo2Rrfa/uffoiN+B3jVeKRLS5lhH1/Zb6znhiy/Eegx+HmWcm011FKriVBktbSrHwCyxvT6s2fRvt8+EeuxyqP2hjN5u1YJU04j6nWJp47zrIuiJYfr17PEyD2lUnuia+ZbEQk+uym6+T9ZbXmo4eROJVvhQH+M6Qugcy/Dvo7MgQUQmib/v682abs/U38WrpKj/k2nrPFv5DdIMQXvrS5DBNN0oY/9xa/CC+r38gfnXkeNV5KZBaHj5XyNFzVO/D5DfK/g0y2nztxxvDGOKfhApTXIXTZnrfhZ+U110kJww0qiNtb+ph8C7cbIfu1VFWimsbfC0oQOQy12ObqC51ezMslWGSAAufNOanSsESI6+FpPu6WTIAQsTf5bfMi4qi93jcChVYBcPzxjtMsY3eiE6E+ehTLUT/Xmt4EVFwykE87Re3uhkeFVGcKNXm3VqM4oDo8DdD/VNuRdsWWmLWEmRyDMNhOfGkfUwKDFH7pc8OPXPJeMHvPcP8kqSQNUP2ac6Fk1Ryqs1Wnmb9uL+6R5yRB8Jy/iZ564OrckRx0/jtxXZyQ
I have the following definition for an ordType
and infix notations for its boolean comparison operators ==
, <b
and <=b
Module Order.
Structure type: Type:= Pack {
sort: Type;
eqb: sort-> sort -> bool;
ltb: sort-> sort -> bool;
eq_P: forall x y, reflect (eq x y)(eqb x y);
ltb_irefl: forall x, ltb x x=false;
ltb_antisym: forall x y, x<>y -> ltb x y = negb (ltb y x);
ltb_trans: forall x y z, ltb x y -> ltb y z -> ltb x z }.
Module Exports.
Coercion sort : type >-> Sortclass.
Notation ordType:= type.
End Exports.
End Order.
Export Order.Exports.
Definition sort:= Order.sort.
Definition eqb := Order.eqb.
Definition ltb := Order.ltb.
Notation "x == y":= (@eqb _ x y)(at level 50, no associativity): bool_scope.
Notation "x <b y":= (@ltb _ x y)(at level 0, no associativity): bool_scope.
Notation " x <=b y" := (@leb _ x y)(at level 70, no associativity): bool_scope.
Now consider the following Ltac definition for show_H
which should print the hypothesis whose type is of the form x == y
.
Ltac show_H:= match goal with | H: ?x == ?y |- _ => idtac H end.
However, when I use this definition to show the name of hypothesis in the following Lemma it fails with the following error message.
Lemma triv (T:ordType)(x y:T): x == y -> y <b x -> 2=3. Proof. intros. show_H.
(Error: No matching clauses for match.)
Why is the parser unable to match the notation ==
in the hypothesis ?
Abhishek Kr. Singh,
Research Scholar, STCS, TIFR Mumbai.
Homepage: http://www.tcs.tifr.res.in/~abhishek/
http://www.tcs.tifr.res.in/people/abhishek-singh
- [Coq-Club] Ltac: Matching on hypothesis which contains user defined notations, Abhishek Kr Singh, 08/16/2018
- RE: [Coq-Club] Ltac: Matching on hypothesis which contains user defined notations, Soegtrop, Michael, 08/16/2018
- Re: [Coq-Club] Ltac: Matching on hypothesis which contains user defined notations, Abhishek Kr Singh, 08/16/2018
- RE: [Coq-Club] Ltac: Matching on hypothesis which contains user defined notations, Soegtrop, Michael, 08/16/2018
Archive powered by MHonArc 2.6.18.