Skip to content

Adding "Body", synonymous of "Proof", for interactively-defined definitions - #18709

Closed
herbelin wants to merge 1 commit into
rocq-prover:masterfrom
herbelin:master+body-keyword
Closed

Adding "Body", synonymous of "Proof", for interactively-defined definitions#18709
herbelin wants to merge 1 commit into
rocq-prover:masterfrom
herbelin:master+body-keyword

Conversation

@herbelin

Copy link
Copy Markdown
Member

See discussion at rocq-prover/rfcs#42.

We introduce Body as a synonymous of Proof to delimit the beginning of a definition by tactics. When used in the form Body c, it indicates an Opaque declaration (independently of the question of whether the forms Proof c and Body c, that add little, are worth to be kept). This is useful in particular for UIs that rely on Proof .. Qed-like blocks for highlighting, while Proof sounds odd for a Definition.

  • Added changelog.
  • Added / updated documentation.
  • Inform UIs about the alternative

If wanted, this may help to introduce a warning on proofs not started with Proof.

@herbelin herbelin added kind: enhancement Enhancement to an existing user-facing feature, tactic, etc. kind: usability Not a bug (fix) but a usability issue / improvement, e.g. UI or syntax inconsistencies labels Feb 22, 2024
@herbelin herbelin added this to the 8.20+rc1 milestone Feb 22, 2024
@herbelin
herbelin requested review from a team as code owners February 22, 2024 19:15
@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 Feb 22, 2024
@ejgallego

Copy link
Copy Markdown
Contributor

IMHO I'd instead remove the VernacExactProof construction at all.

@herbelin

herbelin commented Feb 26, 2024

Copy link
Copy Markdown
Member Author

IMHO I'd instead remove the VernacExactProof construction at all.

That's a different question than what the PR is doing. The motivation of the PR is to support scripts of the form:

Definition f (n:nat) : nat.
Body.
blabla.
Defined.

so that we don't have to write neither the non-bracketed:

Definition f (n:nat) : nat.
blabla.
Defined.

nor the misleading:

Definition f (n:nat) : nat.
Proof.
blabla.
Defined.

If the PR introduces Body t it is because there is already Proof t. Would Proof t be removed, then the PR would not have to add Body t.

Would you like me to make a PR deprecating Proof t?

@ejgallego

Copy link
Copy Markdown
Contributor

@herbelin based on your examples I'm not sure the PR is doing what you want?

(Do examples compile at all?)

I think you've modified the Proof term command

@SkySkimmer SkySkimmer added the needs: discussion Further discussion is needed. label Feb 26, 2024
@SkySkimmer

Copy link
Copy Markdown
Contributor

I'm not convinced that we want more aliases.

Also CI indicates that the Show Proof change is broken.

@herbelin
herbelin force-pushed the master+body-keyword branch from 86b29b2 to d7833a9 Compare February 26, 2024 18:08
@herbelin
herbelin requested review from a team as code owners February 26, 2024 18:08
@herbelin

Copy link
Copy Markdown
Member Author

I'm not convinced that we want more aliases.

Would you rather go in the direction of removing Defined and have only Proof/Qed brackets for tactic scripts?

@herbelin

herbelin commented Feb 26, 2024

Copy link
Copy Markdown
Member Author

Excerpts from rocq-prover/rfcs#42:

"The motivation for the second part of the CEP (separating the transparency status from the Defined / Qed commands) is that Defined is naturally associated with the notion of definition and Qed with the notion of proof. The use case that it has taken (defined theorems to mean non-opaque ones) was not anticipated and now we would have other ways of specifying it (the attribute). Furthermore, having the transparency status of an object always be determined at declaration time would remove an inconsistency between the case where a body is provided and the case where the body is built in interactive proof mode."

"The end goal is that the transparency status is only determined by the attributes and that Qed and Defined become synonyms of each other (Qed being encouraged in combination with Theorem and Defined being encouraged in combination with Definition)."

@herbelin
herbelin marked this pull request as draft February 26, 2024 19:08
@proux01

proux01 commented May 31, 2024

Copy link
Copy Markdown
Contributor

Doesn't seem ready for 8.20, removing the milestone.

@proux01 proux01 removed this from the 8.20+rc1 milestone May 31, 2024
@herbelin

Copy link
Copy Markdown
Member Author

This is a design question somehow related to the rocq-prover/rfcs#42. No urgency.

@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 Oct 23, 2024
@coqbot-app

coqbot-app Bot commented Nov 22, 2024

Copy link
Copy Markdown
Contributor

The "needs: rebase" label was set more than 30 days ago. If the PR is not rebased in 30 days, it will be automatically closed.

@coqbot-app coqbot-app Bot added the stale This PR will be closed unless it is rebased. label Nov 22, 2024
@coqbot-app

coqbot-app Bot commented Dec 23, 2024

Copy link
Copy Markdown
Contributor

This PR was not rebased after 30 days despite the warning, it is now closed.

@coqbot-app coqbot-app Bot closed this Dec 23, 2024
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. kind: usability Not a bug (fix) but a usability issue / improvement, e.g. UI or syntax inconsistencies needs: discussion Further discussion is needed. needs: full CI The latest GitLab pipeline that ran was a light CI. Say "@coqbot run full ci" to get a full CI. needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. stale This PR will be closed unless it is rebased.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants