Skip to content

Conversation

@herbelin
Copy link
Member

@herbelin herbelin commented Jul 2, 2024

This PR is a first attempt at implementing rocq-prover/rfcs#42. It parses all of Definition/Theorem/Fixpoint/CoFixpoint using the same grammar, and, in particular, it supports:

Theorem foo : True := I.

or even:

Theorem f n {struct n} := match n with 0 => 0 | S n => S (f n) end .

The interpretation is still dispatched into a few commands:

  • ComDefinition.do_definition_interactive
    • calling Declare.Proof.start_definition
  • ComDefinition.do_definition which itself splits into:
    • Declare.Obls.add_definition (Program mode)
    • Declare.declare_definition (regular mode)
  • ComFixpoint.do_mutually_recursive which itself splits into:
    • Declare.Proof.start_mutual_definitions (interactive)
    • Declare.Obls.add_mutual_definitions (Program mode)
    • Declare.declare_mutual_definitions (regular mode)

which could be merged further. For instance, the recursivity might just be a flag to a regular definition (as in let rec vs let in OCaml).

The vtmodifyprogram/vtopenproof dispatch is done in a rather heavy way which should be simplified.

The PR is complementary to #19029 which implements attributes sealed/unsealed.

A choice of default opacity for Theorem := is easy to do, it is in function ComDefinition.opacity_of_logical_kind.

  • add tests for the different combinations
  • add support for e.g. Coercion f n {struct n} := match n with 0 => 0 | S n => S (f n) end., or mutual coercions, or Instance f n {struct n} := match n with 0 => 0 | S n => S (f n) end.?
  • documentation to update
  • improve parsing of {measure ...}, {struct ...} and {wf ...} so that they can also be used as variable names

Incidentally fixes #19593.

Depends on:

Synchronous overlays:

@herbelin herbelin added kind: feature New user-facing feature request or implementation. needs: merge of dependency This PR depends on another PR being merged first. part: fixpoints About Fixpoint, fix and mutual statements part: cofixpoints About CoFixpoint, cofix and mutual statements part: gallina The gallina commands labels Jul 2, 2024
@herbelin herbelin added this to the 8.21+rc1 milestone Jul 2, 2024
@herbelin herbelin requested review from a team as code owners July 2, 2024 06:11
@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 Jul 2, 2024
@herbelin herbelin force-pushed the master+ceps42-unify-definition-theorem branch from 614575e to 5b1e836 Compare July 2, 2024 07:14
@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 Jul 2, 2024
@herbelin herbelin force-pushed the master+ceps42-unify-definition-theorem branch from 5b1e836 to 2a209f4 Compare July 2, 2024 12:31
@coqbot-app coqbot-app bot removed the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Jul 2, 2024
@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 Jul 3, 2024
@herbelin herbelin marked this pull request as draft July 10, 2024 06:36
@herbelin herbelin force-pushed the master+ceps42-unify-definition-theorem branch from 2a209f4 to a08fd86 Compare July 10, 2024 06:53
@coqbot-app coqbot-app bot removed the needs: rebase Should be rebased on the latest master to solve conflicts or have a newer CI run. label Jul 10, 2024
@herbelin herbelin removed the needs: merge of dependency This PR depends on another PR being merged first. label Jul 10, 2024
herbelin added a commit to herbelin/github-coq that referenced this pull request Sep 30, 2024
…transparent.

The main changes are:
- "opaque" is now part of the Declare.CInfo.t (one per component of the proof)
- at Qed/Defined time, a check is done to determine if there is an
  attribute which takes precedence over the Qed/Defined keyword;
- for non-interactive declaration, Definition is transparent by
  default and (assuming the syntax provided as in rocq-prover#19301) Theorem
  requires an explicit attribute.
@herbelin herbelin added the request: full CI Use this label when you want your next push to trigger a full CI. label Sep 30, 2024
@herbelin herbelin force-pushed the master+ceps42-unify-definition-theorem branch from a08fd86 to 389592a Compare September 30, 2024 19:44
@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 Sep 30, 2024
@herbelin herbelin added the request: full CI Use this label when you want your next push to trigger a full CI. label Sep 30, 2024
@herbelin herbelin force-pushed the master+ceps42-unify-definition-theorem branch from 389592a to 34eed0c Compare September 30, 2024 19:57
@herbelin herbelin force-pushed the master+ceps42-unify-definition-theorem branch from fd1f178 to 46c8918 Compare October 26, 2024 15:11
@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 Oct 26, 2024
herbelin added a commit to herbelin/github-coq that referenced this pull request Oct 27, 2024
…transparent.

The main changes are:
- "opaque" is now part of the Declare.CInfo.t (one per component of the proof)
- at Qed/Defined time, a check is done to determine if there is an
  attribute which takes precedence over the Qed/Defined keyword;
- for non-interactive declaration, Definition is transparent by
  default and (assuming the syntax provided as in rocq-prover#19301) Theorem
  requires an explicit attribute.
- the attribute can be set both globally (before the command name) and
  locally (just before the names declared by the command)
@herbelin herbelin added the request: full CI Use this label when you want your next push to trigger a full CI. label Oct 27, 2024
@herbelin herbelin added the needs: merge of dependency This PR depends on another PR being merged first. label Oct 27, 2024
@herbelin herbelin force-pushed the master+ceps42-unify-definition-theorem branch from 46c8918 to 0aff711 Compare October 27, 2024 09:35
@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 27, 2024
@coqbot-app
Copy link
Contributor

coqbot-app bot commented Oct 27, 2024

🔴 CI failure at commit 0aff711 without any failure in the test-suite

✔️ Corresponding job for the base commit aa08d5a succeeded

❔ Ask me to try to extract a minimal test case that can be added to the test-suite

🏃 @coqbot ci minimize will minimize the following target: ci-elpi_hb
  • You can also pass me a specific list of targets to minimize as arguments.

This goes in the direction of CEP rocq-prover#42.

In particular, we can now do "Theorem thm : True := I.".
The reading of decl_ident is "declaration's identifier".
Maybe related to unifying the treatment of Definition and Fixpoint in
Stm.process_transaction, VtSideff case (at least, that's one of the
visible change I see).
@herbelin herbelin added the request: full CI Use this label when you want your next push to trigger a full CI. label Oct 27, 2024
@herbelin herbelin force-pushed the master+ceps42-unify-definition-theorem branch from 0aff711 to f42a304 Compare October 27, 2024 13:07
@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 27, 2024
@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 Nov 26, 2024
@coqbot-app
Copy link
Contributor

coqbot-app bot commented Dec 26, 2024

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 Dec 26, 2024
@ppedrot ppedrot modified the milestones: 9.0+rc1, 9.1+rc1 Dec 26, 2024
@coqbot-app
Copy link
Contributor

coqbot-app bot commented Jan 27, 2025

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

@coqbot-app coqbot-app bot closed this Jan 27, 2025
@coqbot-app coqbot-app bot removed this from the 9.1+rc1 milestone Jan 27, 2025
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. 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: cofixpoints About CoFixpoint, cofix and mutual statements part: fixpoints About Fixpoint, fix and mutual statements part: gallina The gallina commands stale This PR will be closed unless it is rebased.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fixpoint inside a lemma produces anomaly universe undefined

2 participants