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

Universe polymorphic record declaration fails in presence of a coercion #401

Closed
ecranceMERCE opened this issue Nov 18, 2022 · 1 comment · Fixed by #404
Closed

Universe polymorphic record declaration fails in presence of a coercion #401

ecranceMERCE opened this issue Nov 18, 2022 · 1 comment · Fixed by #404

Comments

@ecranceMERCE
Copy link
Collaborator

Trying to add a Box record through Coq-Elpi fails if the field is a coercion. This issue is in the context of PR #400.

From elpi Require Import elpi.

Set Universe Polymorphism.

Elpi Command x.
Elpi Accumulate lp:{{
  gen :-
    coq.univ.new U,
    coq.univ.variable U I,
    RDecl =
      record "Box" (sort (typ {coq.univ.super U})) "MkBox" (
        field [coercion regular] "unbox" (sort (typ U)) (_\
      end-record)),
    coq.say "RDecl =" RDecl,
    @udecl! [I] tt [] tt => coq.env.add-indt RDecl _.
}}.
Elpi Typecheck.

Fail Elpi Query lp:{{ gen. }}.

Record Box@{i} : Type@{i+1} := MkBox { unbox :> Type@{i} }.

Changing coercion regular to coercion off works, but coercion reversible fails too.

cc @CohenCyril

@CohenCyril
Copy link
Collaborator

Cc @gares

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

Successfully merging a pull request may close this issue.

2 participants