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

Add "coq.env.query-extra-dep" external predicate #525

Merged
merged 4 commits into from
Oct 22, 2023

Conversation

phikal
Copy link
Contributor

@phikal phikal commented Oct 21, 2023

As discussed on Zulip, this would allow for a predicate to resolve the real path behind a Extra Dependency. As seen in the patch, this just amounts to wrapping ComExtraDeps.query_extra_dep in the right way.

Copy link
Contributor

@gares gares left a comment

Choose a reason for hiding this comment

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

Thanks for this PR.
There are a few things to improve before merging, see the comments.

You should also add a line to the ChangeLog.md file


Elpi Query lp:{{ coq.env.query-extra-dep "elab" File }}.

Fail Elpi Query lp:{{ coq.env.query-extra-dep "foo" File }}.
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add the test file to _CoqProject.test.

This file is a good test, but the API returns None instead of raising No_clause, so this will fail once it runs.

@@ -2325,6 +2325,15 @@ denote the same x as before.|};
Some (c, np + na))))))),
DocAbove);

MLCode(Pred("coq.env.query-extra-dep",
Copy link
Contributor

Choose a reason for hiding this comment

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

coq.env is for accessing the logical environment.
Please move this code just before

-- Datatypes conversions --------------------------------------------

maybe in a dedicated section, say -- Extra Dependency ------------------------.

Also I'd call it coq.extra-dep

@phikal
Copy link
Contributor Author

phikal commented Oct 21, 2023 via email

Copy link
Contributor

@gares gares left a comment

Choose a reason for hiding this comment

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

A few more nits

@@ -3884,6 +3884,15 @@ Supported attributes:
state, !: s, [])),
DocAbove);

MLCode(Pred("coq.extra-dep",
Copy link
Contributor

Choose a reason for hiding this comment

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

Please add an LPDoc line with something like

-- Extra Dependencies -------------

coq-builtin.elpi Outdated
@@ -901,6 +901,10 @@ external pred coq.env.projections i:inductive, o:list (option constant).
external pred coq.env.primitive-projections i:inductive,
o:list (option (pair projection int)).

% [coq.env.query-extra-dep Identifier File Name] Resolve the file name of an
Copy link
Contributor

Choose a reason for hiding this comment

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

Please regenerate this file

@phikal
Copy link
Contributor Author

phikal commented Oct 21, 2023

Sorry, missed those.

@gares gares merged commit a6d325c into LPCIC:master Oct 22, 2023
5 checks passed
@phikal
Copy link
Contributor Author

phikal commented Nov 5, 2023

Do you have a schedule when you are planning to publish a release with these changes?

@gares
Copy link
Contributor

gares commented Nov 5, 2023

Before the end of November

@phikal phikal deleted the query-extra-dep branch November 5, 2023 18:31
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.

2 participants