Skip to content

Add parsing and interpretation of elimination constraints#21195

Merged
coqbot-app[bot] merged 7 commits intorocq-prover:masterfrom
jrosain:elimination-constraints
Dec 2, 2025
Merged

Add parsing and interpretation of elimination constraints#21195
coqbot-app[bot] merged 7 commits intorocq-prover:masterfrom
jrosain:elimination-constraints

Conversation

@jrosain
Copy link
Contributor

@jrosain jrosain commented Oct 14, 2025

@jrosain jrosain requested review from a team as code owners October 14, 2025 14:22
@coqbot-app coqbot-app bot added the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Oct 14, 2025
@SkySkimmer
Copy link
Contributor

@coqbot run full ci

@coqbot-app coqbot-app bot removed the needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. label Oct 14, 2025
@jrosain jrosain added the request: full CI Use this label when you want your next push to trigger a full CI. label Oct 14, 2025
@jrosain jrosain force-pushed the elimination-constraints branch from ef9e78a to 69e04cb Compare October 14, 2025 15:37
@coqbot-app coqbot-app bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label Oct 14, 2025
@jrosain jrosain added the request: full CI Use this label when you want your next push to trigger a full CI. label Oct 14, 2025
@jrosain jrosain force-pushed the elimination-constraints branch from 69e04cb to 419734b Compare October 14, 2025 15:45
@coqbot-app coqbot-app bot removed the request: full CI Use this label when you want your next push to trigger a full CI. label Oct 14, 2025
@SkySkimmer
Copy link
Contributor

something strange is going on in stdlib_test, the message from https://github.com/rocq-prover/stdlib/blob/e343c58314f5a902e08ec6a211f4e1b5812a8c89/test-suite/output/Fixpoint.v#L123 changed to say to produce a value in sort "Prop" even though the fixpoint is -> bool

@jrosain
Copy link
Contributor Author

jrosain commented Nov 24, 2025

@coqbot run full CI

@jrosain
Copy link
Contributor Author

jrosain commented Nov 25, 2025

@SkySkimmer how do i specify the itauto overlay (project on gitlab)? I tried to do the same stuff as for the others but it didn't work.

Also, I don't know how to fix the refman problem, which comes from this snippet:

.. insertprodn universe_name sort_poly_constraint

.. prodn::
   universe_name ::= @qualid
   | Set
   | Prop
   univ_annot ::= @%{ {* @univ_level_or_quality } {? {| %| | ; } {* @univ_level_or_quality } } %}
   univ_level_or_quality ::= 0
   | Set
   | SProp
   | Prop
   | Type
   | _
   | @qualid
   sort_poly_decl ::= @%{ {? {* @ident } {| %| | ; } } {* @ident } {? + } {? %| {*, @sort_poly_constraint } {? + } } %}
   cumul_sort_poly_decl ::= @%{ {? {* @ident } {| %| | ; } } {* {? {| + | = | * } } @ident } {? + } {? %| {*, @sort_poly_constraint } {? + } } %}
   sort_poly_constraint ::= @universe_name {| < | = | <= } @universe_name
   | @sort_quality_var -> @sort_quality_var

(here, it doesn't know sort_quality_var). Any idea on how to fix this?

@mattam82
Copy link
Member

For the grammar I think you need to follow the instructions on regenerating the files for the linting check between the .mlg's and the doc.
Relevant part of CONTRIBUTING.md:

- **Documented syntax is up-to-date**.  If you update the grammar, you
  should run `make doc_gram_rsts` to update the
  documented syntax.  You should then update the text describing the
  syntax in the documentation and commit the changes.  In some cases,
  the documented syntax is edited to make the documentation more
  readable.  In this case, you may have to edit
  `doc/tools/docgram/common.edit_mlg` to make `doc_gram_rsts` pass.
  See [doc_grammar's README][doc_gram] for details.

  Note that in the case where you added new commands or tactics, you
  will have to manually insert them in the documentation, the tool
  won't do that for you, although it should detect in most cases if you
  have forgotten to add documentation for your new command or tactic,
  or if the documentation is not consistent with the parser.

@SkySkimmer
Copy link
Contributor

@coqbot run full ci

Copy link
Member

@mattam82 mattam82 left a comment

Choose a reason for hiding this comment

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

I only have minor comments, I think we will need to play with this code and have a few iterations anyway to ensure its correctness. Just one thing, we don't touch the "broken" transitivity closure issue found by @tabareau here, right? If not I think this can be merged.

| Irrelevant -> Sorts.sprop
| Relevant when Universe.is_type0 u -> Sorts.set
| Relevant -> Sorts.make Sorts.Quality.qtype u
| Relevant -> Sorts.prop
Copy link
Member

Choose a reason for hiding this comment

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

The comment above the code becomes misleading if you don't change it. I think the solution is fine, but the comment should reflect it.

Polymorphic Definition sort'@{s | u |} := Type@{s|u}.

To help the parser, both `|` in the :n:`@univ_decl` are required.
To help the parser, both `|` in the :n:`@sort_poly_decl` are required.
Copy link
Member

Choose a reason for hiding this comment

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

Isn't this outdated? We have @{s;u} already in this branch no?

Copy link
Contributor

Choose a reason for hiding this comment

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

this is a note about the old syntax (which is still parsed)

@TDiazT
Copy link
Contributor

TDiazT commented Nov 28, 2025

Just one thing, we don't touch the "broken" transitivity closure issue found by @tabareau here, right?

I think it is being handled by the changes in RigidPaths, and checked in the test file test-suite/success/sort_poly_elim_rigid_paths.v.

@tabareau
Copy link
Contributor

Just one thing, we don't touch the "broken" transitivity closure issue found by @tabareau here, right?

I think it is being handled by the changes in RigidPaths, and checked in the test file test-suite/success/sort_poly_elim_rigid_paths.v.

Yes, it has been fixed by Commit e28c9b8

@mattam82
Copy link
Member

Great!

@mattam82
Copy link
Member

mattam82 commented Dec 1, 2025

@jrosain this needs a last rebase due to @ppedrot's PR on effects conflicting... I can help if you're busy, just tell me.

@jrosain
Copy link
Contributor Author

jrosain commented Dec 1, 2025

Should be good now!

@mattam82
Copy link
Member

mattam82 commented Dec 2, 2025

@coqbot merge now

@coqbot-app
Copy link
Contributor

coqbot-app bot commented Dec 2, 2025

@mattam82: You cannot merge this PR because:

  • There is still a needs: fixing label.
  • There is no kind: label.
  • No milestone has been set.

@mattam82
Copy link
Member

mattam82 commented Dec 2, 2025

It's missing a changelog entry

@mattam82
Copy link
Member

mattam82 commented Dec 2, 2025

@jrosain ?

@jrosain
Copy link
Contributor Author

jrosain commented Dec 2, 2025

Is this fine?

@mattam82
Copy link
Member

mattam82 commented Dec 2, 2025

Yes!

@mattam82
Copy link
Member

mattam82 commented Dec 2, 2025

@coqbot merge now

@coqbot-app
Copy link
Contributor

coqbot-app bot commented Dec 2, 2025

@mattam82: You cannot merge this PR because:

  • There is still a needs: changelog entry label.

@mattam82
Copy link
Member

mattam82 commented Dec 2, 2025

@coqbot merge now

@coqbot-app
Copy link
Contributor

coqbot-app bot commented Dec 2, 2025

@mattam82: Please take care of the following overlays:

  • 21195-jrosain-elimination-constraints.sh

@mattam82
Copy link
Member

mattam82 commented Dec 2, 2025

Overlay time!

@mattam82
Copy link
Member

mattam82 commented Dec 2, 2025

I pinged everyone

@ppedrot
Copy link
Member

ppedrot commented Dec 5, 2025

@fajb please merge the overlay on itauto, there is some backlog already.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: feature New user-facing feature request or implementation. part: elaboration The elaboration engine, also known as the pretyper.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants