coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: "John Wiegley" <johnw AT newartisans.com>
- To: coq-club AT inria.fr
- Subject: [Coq-Club] Question about change in polymorphism with 8.8
- Date: Thu, 17 May 2018 17:33:15 -0700
- Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=johnw AT newartisans.com; spf=Pass smtp.mailfrom=johnw AT newartisans.com; spf=Pass smtp.helo=postmaster AT out1-smtp.messagingengine.com
- Ironport-phdr: 9a23:xFyYixMlNwotqkGNrBkl6mtUPXoX/o7sNwtQ0KIMzox0LfT/rarrMEGX3/hxlliBBdydt6ofzbKO+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpVO5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1Ov71GonPhMiryuy+4ZLebxlGiTanfb9+MAi9oBnMuMURnYZsMLs6xAHTontPdeRWxGdoKkyWkh3h+Mq+/4Nt/jpJtf45+MFOTav1f6IjTbxFFzsmKHw65NfqtRbYUwSC4GYXX3gMnRpJBwjF6wz6Xov0vyDnuOdxxDWWMMvrRr0yRD+s7bpkSAXwhSkHKTA37W/Zistzgq1Vrx2uuwdyw5LIbIyPKPZyYrnQcc8cSGFcXshRTStBAoakYocBC+QBOuZYr4/grFQOrBuxGwasBOfxxT5IiHP9wKo30+YmEQHG2gwhEckDsHLKo9T7LqgSS/y1zKjTzTrZafNWwi3x55TPchAkuPyBW697f8TWyUkqDQzFj1OQpJTjPzyL2OUCqXKb7/ZhVeK0kWEnrRpxriKzyccrj4nEgJ8exFPc9ShhwYs4JMe0RFNmbdK5CpdduDuWO5V2T886QWxluTw2xqMItJO0ZiQHyZAqywTCZ/GId4WF5A/oWvyLLjdinn1lfaqyhxas/kikze3xTs600EtWriZYi9XMrXUN1wDL6sSdT/ty4Fyh2S2V2ADc6+FEJ080mrTdK54uw74wkIQcvV7fES/xnUX6lK6WdkM69ei08+nqY7TrqoWBO4Nplw3yKKsjltahDek4KgQOWnKU+eW41L3t5035R7BKg+U0kqnesJDaI8oaq7W/AwBL3Ics8Qy/Dyun0NQDh3YHKklFdAibgIjuPlHCOOr4Auung1SwjDdrwOjLMaHmApXUN3TMjLPhfatm5ENH0woyzdVf54pOBb0bIfLzXFXxtN3CARMjPQy02bWvNNIo3YQHHGmLH6WxMaXIsFbO6Ph8DfOLYdpfmjH9LbAa5vPhiXIo0xdJf66p24Q/bn2nF+56Il6QZ2GqidAERzRZ9jEiRfDn3QXRGQVYYGy/Cvplt2MLTbm+BIKGfbiDxbmI3SO1BJpTPz8UDF2TGG30dp6NXexKYyWXcJY4zm40EIO5Qopk7imA8RfgwuM4fOzZ5SQCqZP43d5uoebUkENqrGEmP4Gmy2iIClpMsCYISjsxh/ktplFhkxKY1LRgxflVDsda6PJPXQo8Op/awqpxDNWgAw8=
- Organization: New Artisans LLC
Hi,
The code below (or something like it) occurs in several places in one of my
projects. This works fine with Coq 8.5, 8.6, and 8.7. But with 8.8, I'm now
getting universe errors I don't quite understand on the final line:
File "./Bug.v", line 39, characters 0-8:
Error:
Illegal application:
The term "list_equivalence_obligation_1" of type
"forall (A : Type) (H : Setoid A), Reflexive list_equiv"
cannot be applied to the terms
"A" : "Type"
"H" : "Setoid A"
The 1st term has type "Type@{Bug.181}" which should be coercible to
"Type@{Bug.196}".
Note that if I explicitly type the parameter {A : Type}, the error changes to
complain about the 2nd term.
I'd like to know if this is a bug to be reported, or if not, what the nature
of the problem is so I can fix it in a way that's compatible with at least
8.6-8.8.
Thanks,
John
--8<---------------cut here---------------start------------->8---
Require Import Coq.Classes.CMorphisms.
Set Universe Polymorphism.
Class Setoid A := {
equiv : crelation A;
setoid_equiv :> Equivalence equiv
}.
Generalizable All Variables.
Fixpoint list_equiv `{Setoid A} (xs ys : list A) : Type :=
match xs, ys with
| nil, nil => True
| cons x xs, cons y ys => prod (equiv x y) (list_equiv xs ys)
| _, _ => False
end.
Axiom admit : forall A : Type, A.
Program Instance list_equivalence `{Setoid A} : Equivalence list_equiv.
Next Obligation.
repeat intro.
induction x; simpl; split; auto.
apply reflexivity.
Qed.
Next Obligation.
repeat intro.
generalize dependent y.
induction x, y; simpl in *; intros; auto.
destruct X.
split; [now apply symmetry|now apply IHx].
Qed.
Next Obligation.
apply admit.
Defined.
--8<---------------cut here---------------end--------------->8---
--
John Wiegley GPG fingerprint = 4710 CF98 AF9B 327B B80F
http://newartisans.com 60E1 46C4 BD1A 7AC1 4BA2
- [Coq-Club] Question about change in polymorphism with 8.8, John Wiegley, 05/18/2018
Archive powered by MHonArc 2.6.18.