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
Support grefclass #311
Support grefclass #311
Conversation
HB/common/phant-abbreviation.elpi
Outdated
build-abbreviation K F [implicit|AL] K' FAbbrev :- !, | ||
build-abbreviation K {mk-app F [_]} AL K' FAbbrev. | ||
build-abbreviation K F [unify|AL] K' FAbbrev :- !, | ||
build-abbreviation K {mk-app F [{{lib:@hb.id _ _}}]} AL K' FAbbrev. | ||
|
||
pred build-type-pattern i:gref, o:term. | ||
build-type-pattern GR Pat :- coq.env.typeof GR T, |
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.
build-type-pattern GR Pat :- coq.env.typeof GR T, | |
build-type-pattern GR Pat :- |
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.
I think I'd like a comment for what this piece of code is supposed to do.
Isn't it something like
coq.safe-dest-app Ty (global GR) Args,
coq.subst-prod T Args {{ Type }}
?
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.
Indeed, comment added. The main idea is as follows:
- in case
sortclass
, we know the sort is of some type Type, so we unify withType
- in case
funclass
, we know the sort is a function, so we unify with_ -> _
- in case
grefclass GR
, we know the sort is of typeGR x1 ... xn
whenGR : forall x1 ... xn, Type
, so we unify withGR _ ... _
(withn
holes)
I let @CohenCyril look at the phant thingy, since It is too hard for me. |
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.
Nice!
I need this when porting all the closedness predicates in ssralg.v in mathcomp, in order to have their sort of type
{pred _}
rather than_ -> bool
and write_ \in S
rather than_ \in (S : pred _)
everywhere.