-
Notifications
You must be signed in to change notification settings - Fork 699
Unifying the syntax of Definition, Theorem, Fixpoint and CoFixpoint (CEP #42) #19301
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unifying the syntax of Definition, Theorem, Fixpoint and CoFixpoint (CEP #42) #19301
Conversation
614575e to
5b1e836
Compare
5b1e836 to
2a209f4
Compare
2a209f4 to
a08fd86
Compare
…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.
a08fd86 to
389592a
Compare
389592a to
34eed0c
Compare
fd1f178 to
46c8918
Compare
…int. Also adding some missing supported attributes.
…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)
46c8918 to
0aff711
Compare
|
🔴 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 🏃
|
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).
0aff711 to
f42a304
Compare
|
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. |
|
This PR was not rebased after 30 days despite the warning, it is now closed. |
This PR is a first attempt at implementing rocq-prover/rfcs#42. It parses all of
Definition/Theorem/Fixpoint/CoFixpointusing the same grammar, and, in particular, it supports:Theorem foo : True := I.or even:
The interpretation is still dispatched into a few commands:
ComDefinition.do_definition_interactiveDeclare.Proof.start_definitionComDefinition.do_definitionwhich itself splits into:Declare.Obls.add_definition(Programmode)Declare.declare_definition(regular mode)ComFixpoint.do_mutually_recursivewhich itself splits into:Declare.Proof.start_mutual_definitions(interactive)Declare.Obls.add_mutual_definitions(Programmode)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 recvsletin OCaml).The
vtmodifyprogram/vtopenproofdispatch 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 functionComDefinition.opacity_of_logical_kind.Coercion f n {struct n} := match n with 0 => 0 | S n => S (f n) end., or mutual coercions, orInstance f n {struct n} := match n with 0 => 0 | S n => S (f n) end.?{measure ...},{struct ...}and{wf ...}so that they can also be used as variable namesIncidentally fixes #19593.
Depends on:
Synchronous overlays: