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
Adapting to Coq PR #14598: adding explicit constr_expr/glob_constr node for projections #274
Adapting to Coq PR #14598: adding explicit constr_expr/glob_constr node for projections #274
Conversation
@@ -182,7 +182,11 @@ let rec gterm2lp ~depth state x = | |||
|
|||
| GEvar(_k,_subst) -> nYI "(glob)HOAS for GEvar" | |||
| GPatVar _ -> nYI "(glob)HOAS for GPatVar" | |||
(* | GProj _ -> nYI "(glob)HOAS for GProj" *) | |||
| GProj ((ref,us),args,c) -> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to be sure: is this node just about the projection syntax? (because I now have a way to represent primitive projections)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As of coq/coq#14598, GProj
strictly corresponds to the t.(f args)
syntax. However, it is not clear to me what will then be the consensus about the role to give to the GProj
, whether it matches CProj
(i.e. the t.(f args)
syntax) or the Proj
kernel syntax (i.e. the "primitive" projections), or if t.(f args)
and kernel-primitive get eventually identified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For instance, in coq/coq#14598, pretyping map GProj
to Proj
when the projection is registered as primitive and to App
if not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So, I don't know what it implies for elpi. I guess it depends if the elpi way to represent primitive projections is about kernel Proj
or about t.(f args)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For instance, in coq/coq#14598, pretyping map
GProj
toProj
when the projection is registered as primitive and toApp
if not.
ok, then I'll try to push a commit on top of yours
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I need #256 to go in first, then I'll rebase this one and add a few lines to it
… node. Also adapting to lighter syntax of CAppExpl and CApp.
8596213
to
60e535d
Compare
rebased, but I don't have the time to write down the code contracting a primitive projection today. I'll do it next week |
done. I made:
I'm not 100% sure about the last one, but tossing away something the user wrote seems wrong. |
I'm not sure either. For instance, as of now, it is not forbidden to explicitly give the parameters of primitive projections. Set Primitive Projections.
Record T A := {a:A}.
Check fun x => x.(a nat).
(* fun x : T nat => a _ x *) |
That, in the code I wrote, would result into its compat constant(in elpi). The idea is: if you pass the params, the you are not talking about the primitive one. I don't know yet if this is a good rule. |
Please merge. |
This PR adds code for the new node
GProj
. So that the examples involving the syntaxt.(f)
continue to work, I did not try to do better than simulating what was done whent.(f)
was encoded with aGApp
node, leading to reusein_elpi_appl
rather than, say, adding a newin_elpi_proj
method.Also adapting to lighter syntax of
CAppExpl
andCApp
.This has to be merged synchrounously with coq/coq#14598.