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

mixin-instance-type->mixin-src does not use the typing information #521

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Tragicus
Copy link
Contributor

@Tragicus Tragicus commented Mar 4, 2025

mixin-instance-type->mixin-src produces clauses mixin-src clauses that call the unification, without giving the type of the evars it creates. This can lead to a unification of the form S.sort ?a = ?b where S.sort is a primitive projection. However, then Rocq retypes S.sort ?a and since ?a has type ?A which is not an inductive type, it fails.
N.B. Using coq.typecheck feels a bit heavy to do this, when we just have to create the evar with the right type. Is there a better way to do this?

@CohenCyril
Copy link
Member

CohenCyril commented Mar 4, 2025

@gares, @Tragicus minimized his first attempt with the following.
(@pi-decl N T x \ (foo x x :- !)) => foo X Y
This fails while (pi x \ (foo x x :- !)) => foo X Y succeeds... is that expected?

(I rebuilt the example from the top of my head without testing it, I hope that I'm not too wrong...)

@Tragicus
Copy link
Contributor Author

Tragicus commented Mar 4, 2025

The error in coq-8.19/mathcomp-ssreflect is reproducible by adding an HB.saturate in ssreflect/eqtype.v/l.777 and is the following. After doing

coq.typecheck X870 
    (app
        [global (const «cancel»), 
          app
             [global
                 (const «Equality.sort»), 
               X867], X866, X868, X869]) ok

doing

coq.typecheck X869 
     (prod `x` 
        (app
           [global
               (const «Equality.sort»), 
              X867]) c0 \ X866) ok

fails with an Ill-typed evar instance error. Do we have any idea what could be wrong?

@gares
Copy link
Member

gares commented Mar 4, 2025

Can you invoke coq.sigma.print between the two calls?

@Tragicus
Copy link
Contributor Author

Tragicus commented Mar 5, 2025

Yes, I could do it, but X869 still has an evar as its type and I did not see anything wrong, so I am still a bit confused. Nevertheless, I do the typechecks in the wrong order. I assume there is a retyping somewhere that fails for a similar reason that it failed with unifications.

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 this pull request may close these issues.

3 participants