Skip to content
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

HB.mixin anomaly when a parameter with structure is reused as a subject. #431

Open
screenl opened this issue Jun 29, 2024 · 2 comments
Open

Comments

@screenl
Copy link

screenl commented Jun 29, 2024

The following code gives The elpi tactic/command HB.mixin failed without giving a specific error message. Please report this inconvenience to the authors of the program.;

HB.mixin Record barycentric_interval_of (I:Interval.type) of Baryspace_of I I :={

}.

The types are defined as follows

HB.mixin Record Interval_of I:= {
  ...
}.
HB.mixin Record Baryspace_of (I : Interval.type) A := {
  ...
}.
@CohenCyril
Copy link
Member

CohenCyril commented Jun 29, 2024

Hi @screenl, thanks for reporting.
Here is a minimized and complete file, so that we can adress this in the future.

From HB Require Import structures.

HB.mixin Record Interval_of I := {}.
HB.structure Definition Interval := {I of Interval_of I}.
HB.mixin Record Baryspace_of (I : Interval.type) A := {}.
HB.structure Definition Baryspace I := {A of @Baryspace_of I A}.

Fail HB.mixin Record barycentric_interval_of (I : Interval.type) of
  Baryspace_of I I := {}.
(* The error message should be that the head of the subject of
   a structure (here Interval.sort) should probably not be a
   projection from the hierarchy. This will probably cause
   forgetful inheritance problems *)

(* This is the alternative we should strive to suggest, however
   for some reason I failed to diagnose, it fails *)
Fail HB.mixin Record barycentric_interval_of I of
   Interval I & @Baryspace_of I I := {}.

(* This should be also be possible, but fails too *)
Fail HB.structure Definition SelfBaryspace :=
  {I of Interval I & @Baryspace_of I I}.

@CohenCyril CohenCyril changed the title HB.mixin failed without giving a specific error message HB.mixin anomaly when a parameter with structure is reused as a subject. Jun 29, 2024
@CohenCyril
Copy link
Member

I think this is related to a case we might have missed in #295

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants