-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Join declaration unstable under renaming #465
Comments
I'm not sure what breaks and shouldn't. Could you provide a MWE with a failure at definition time or during proofs? (using e.g. |
In the following code, the first From HB Require Import structures.
From mathcomp Require Import ssreflect.
HB.mixin Record isA (T : Type) := {fa : T -> T}.
HB.mixin Record isB (T : Type) := {xb : T; fb : T -> T}.
HB.mixin Record isC (T : Type) := {fc : T -> T}.
HB.structure Definition A := {T of isA T}.
HB.structure Definition B := {T of isB T}.
HB.structure Definition C := {T of isC T}.
HB.structure Definition S := {T of A T & B T}.
HB.structure Definition S0 := {T of C T & B T}.
Axiom fbS0E : forall (T : S0.type) (x : T), fb x = xb.
Goal forall (T : S0.type) (x : T), fb (fc x) = fb x.
Proof. move=> T x; rewrite fbS0E.
Abort.
Axiom fbSE : forall (T : S.type) (x : T), fb x = xb.
Goal forall (T : S.type) (x : T), fb (fa x) = fb x.
Proof. move=> T x; rewrite fbSE. |
I think this is not a HB problem, and rather this Rocq problem |
I believe this non-local name-dependent behavior of HB is an issue, even if the example also illustrates an issue with Rocq. |
Declaring join instances in both directions should also solve (or at least mitigate) the issue: math-comp/math-comp#1256 (comment) math-comp/math-comp#1125 (comment) |
The joins
HB
declares depend on the name of the structures, which breaks things when we want to rename structures. Here is a MWE, where the firstCheck
uses the join ofA
andB
, and the second one uses the coercion fromS0
toB
.The text was updated successfully, but these errors were encountered: