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

Support grefclass #311

Merged
merged 1 commit into from Aug 29, 2022
Merged

Support grefclass #311

merged 1 commit into from Aug 29, 2022

Conversation

proux01
Copy link
Contributor

@proux01 proux01 commented Aug 27, 2022

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.

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,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
build-type-pattern GR Pat :- coq.env.typeof GR T,
build-type-pattern GR Pat :-

Copy link
Member

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 }}

?

Copy link
Contributor Author

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 with Type
  • in case funclass, we know the sort is a function, so we unify with _ -> _
  • in case grefclass GR, we know the sort is of type GR x1 ... xn when GR : forall x1 ... xn, Type, so we unify with GR _ ... _ (with n holes)

@gares
Copy link
Member

gares commented Aug 27, 2022

I let @CohenCyril look at the phant thingy, since It is too hard for me.
The rest seems ok.

Copy link
Member

@CohenCyril CohenCyril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

@CohenCyril CohenCyril merged commit f86869f into math-comp:master Aug 29, 2022
@proux01 proux01 deleted the grefclass branch August 29, 2022 13:44
proux01 added a commit to math-comp/math-comp that referenced this pull request Aug 29, 2022
proux01 added a commit to math-comp/math-comp that referenced this pull request Aug 31, 2022
proux01 added a commit to math-comp/math-comp that referenced this pull request Sep 7, 2022
proux01 added a commit to math-comp/math-comp that referenced this pull request Sep 8, 2022
proux01 added a commit to math-comp/math-comp that referenced this pull request Oct 11, 2022
proux01 added a commit to math-comp/math-comp that referenced this pull request Oct 29, 2022
proux01 added a commit to proux01/math-comp that referenced this pull request Jan 24, 2023
proux01 added a commit to math-comp/math-comp that referenced this pull request Jan 24, 2023
proux01 added a commit to math-comp/math-comp that referenced this pull request Feb 23, 2023
proux01 added a commit to math-comp/math-comp that referenced this pull request Mar 8, 2023
proux01 added a commit to math-comp/math-comp that referenced this pull request Mar 9, 2023
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.

None yet

3 participants