Skip to content

Printing for if <term> is <pattern> then _ else _ syntax - #22124

Merged
coqbot-app[bot] merged 2 commits into
rocq-prover:masterfrom
proux01:if-printing
Jul 1, 2026
Merged

Printing for if <term> is <pattern> then _ else _ syntax#22124
coqbot-app[bot] merged 2 commits into
rocq-prover:masterfrom
proux01:if-printing

Conversation

@proux01

@proux01 proux01 commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Add printing for the syntax introduced (only parsing) in #21609 .
All if _ then _ else _ and if _ is _ then _ else _ are printed as if _ is _ then _ else _ except for boolean guards which remain printed as if _ then _ else _.

Depends on: #21609 (merged)

  • Added / updated test-suite.
  • Added changelog.
  • Added / updated documentation.
    • Documented any new / changed user messages.
    • Updated documented syntax by running make doc_gram_rsts.

Overlays (to be merged before the current PR)

@proux01 proux01 added kind: enhancement Enhancement to an existing user-facing feature, tactic, etc. needs: merge of dependency This PR depends on another PR being merged first. part: printer The printing mechanism of Coq. labels Jun 12, 2026
@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 Jun 12, 2026
Use the :cmd:`Add` and :cmd:`Remove` commands to update this set.


Printing matching on booleans

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

why is this removed?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

shouldn't it use the new printing instead?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

It seems pretty useless now. But if you think it's still worth having (using the new syntax), I'm fine keeping it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Please revert

@SkySkimmer

Copy link
Copy Markdown
Contributor

Would be nice to have some tests

@SkySkimmer

Copy link
Copy Markdown
Contributor

in particular a test where the case info tag is IfStyle but can't be printed as if (because both branches use constructor arguments)
eg

Lemma test : sumbool True True -> True.
Proof.
  refine (fun x : sumbool True True => if x then _ else _);assumption.
Defined.
Print test.

@proux01 proux01 added the request: full CI Use this label when you want your next push to trigger a full CI. label Jun 12, 2026
@coqbot-app coqbot-app Bot removed request: full CI Use this label when you want your next push to trigger a full CI. needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. labels Jun 12, 2026
Comment thread test-suite/output/If.out Outdated
@proux01 proux01 added the request: full CI Use this label when you want your next push to trigger a full CI. label Jun 12, 2026
@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 Jun 12, 2026
@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 Jun 12, 2026
@proux01 proux01 added the request: full CI Use this label when you want your next push to trigger a full CI. label Jun 12, 2026
@coqbot-app coqbot-app Bot removed request: full CI Use this label when you want your next push to trigger a full CI. needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. labels Jun 12, 2026
@proux01 proux01 added this to the 9.3+rc1 milestone Jun 12, 2026
@proux01 proux01 added the request: full CI Use this label when you want your next push to trigger a full CI. label Jun 15, 2026
@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 Jun 15, 2026
@proux01 proux01 added the request: full CI Use this label when you want your next push to trigger a full CI. label Jun 15, 2026
@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 Jun 15, 2026
@proux01 proux01 added the request: full CI Use this label when you want your next push to trigger a full CI. label Jun 15, 2026
@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 Jun 15, 2026
jdchristensen added a commit to HoTT/Coq-HoTT that referenced this pull request Jun 16, 2026
@github-actions github-actions Bot added the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Jun 17, 2026
@proux01 proux01 added request: full CI Use this label when you want your next push to trigger a full CI. and removed needs: merge of dependency This PR depends on another PR being merged first. labels Jun 23, 2026
@coqbot-app coqbot-app Bot removed needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. request: full CI Use this label when you want your next push to trigger a full CI. labels Jun 23, 2026
@proux01
proux01 marked this pull request as ready for review June 23, 2026 10:08
@proux01
proux01 requested review from a team as code owners June 23, 2026 10:08
@proux01 proux01 mentioned this pull request Jun 23, 2026
5 tasks
Comment thread pretyping/detyping.ml
@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 Jun 30, 2026
@gares gares self-assigned this Jun 30, 2026
@gares

gares commented Jun 30, 2026

Copy link
Copy Markdown
Member

@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 Jun 30, 2026
@gares

gares commented Jul 1, 2026

Copy link
Copy Markdown
Member

@coqbot merge now

@coqbot-app
coqbot-app Bot merged commit bd9018d into rocq-prover:master Jul 1, 2026
8 checks passed
@coqbot-app

coqbot-app Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

@gares: Please take care of the following overlays:

  • 22124-proux01-if-printing.sh

@proux01
proux01 deleted the if-printing branch July 1, 2026 11:10
Janno pushed a commit to Mtac2/Mtac2 that referenced this pull request Jul 1, 2026
Janno added a commit to Mtac2/Mtac2 that referenced this pull request Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind: enhancement Enhancement to an existing user-facing feature, tactic, etc. part: printer The printing mechanism of Coq.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants