Skip to content

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

Draft
proux01 wants to merge 4 commits into
rocq-prover:masterfrom
proux01:if-printing
Draft

Printing for if <term> is <pattern> then _ else _ syntax#22124
proux01 wants to merge 4 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

  • 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.

@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
@proux01 proux01 added the request: full CI Use this label when you want your next push to trigger a full CI. label Jun 16, 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 16, 2026
@proux01 proux01 added the request: full CI Use this label when you want your next push to trigger a full CI. label Jun 16, 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 16, 2026
jdchristensen pushed a commit to HoTT/Coq-HoTT that referenced this pull request Jun 16, 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
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. needs: merge of dependency This PR depends on another PR being merged first. needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. part: printer The printing mechanism of Coq.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants