[Subsumed] Towards a single code path for the "using" clause + small improvement of "using Type" for co/fixpoints - #18742
Conversation
8f6af45 to
1a3209a
Compare
1a3209a to
1303e48
Compare
1303e48 to
9575db3
Compare
|
I added another small Require Import Program.
Section S.
Variables a : nat.
#[using="Type", warning="-non-recursive"]
Program Fixpoint b (n:nat) : nat := (fun _ => 0) a.
End S.
Print b.
(* "fun _ : nat => fix b (n : nat) : nat := 0" instead of "fix b (n : nat) : nat := 0" *) |
|
Actually, I'm confused about the meaning to give to Another curiosity in passing, which impacts the computation of
|
9575db3 to
aa6cd4c
Compare
|
It is still unclear what would be the best semantics of |
This is an old to-do from the times of `declare.ml` refactoring; thanks to Hugo Herbelin for trying first with rocq-prover#18742 , which this PR could replace. We adopt the following convention: - non-interactive commands ignore the using attribute (that could be resurrected maybe if we add an "Opaque" form) - we remove the per-constant `using` field from `CInfo.t` (as in rocq-prover#18742) - interactive commands pass their using attribute down to the proof initialization, where the parameter is interpreted properly in declare TODOs: - XXX in declare.ml - add warning when attributes are not supported
This is an old to-do from the times of `declare.ml` refactoring; thanks to Hugo Herbelin for trying first with rocq-prover#18742 , which this PR could replace. We adopt the following convention: - non-interactive commands ignore the using attribute (that could be resurrected maybe if we add an "Opaque" form) - we remove the per-constant `using` field from `CInfo.t` (as in rocq-prover#18742) - interactive commands pass their using attribute down to the proof initialization, where the parameter is interpreted properly in declare TODOs: - XXX in declare.ml - add warning when attributes are not supported
|
Indeed, it seems to me that we have only two relevant cases:
I've tried going deeper in #18890 , let me know what you think. If we think the approach in that PR is better, I will finish the XXX (minor), I have to run now so I posted the current WIP code in that PR. |
I put |
|
Your PR is good. Once the design decision of rejecting or accepting You can also add the tests I made to your PR. |
…s altogether. This is currently for non-interactive Co/Fixpoint only. Additionally, for Co/Fixpoint, include the bodies when computing using "Type", as it is done elsewhere.
- We keep only one copy of "using" in declare.ml, shared by all proofs and all statements of a block, that in once Info.t while before it was in each CInfo.t and in the Proof_info.t. - We treat "using" the same way in interactive and non-interactive mode, gaining in uniformity and answering an open comment in vernacentries.ml. As a consequence, the fix for 'using="Type"' on mutual fixpoints in the previous commit also works in interactive mode.
825bdc1 to
b417b85
Compare
This is an old to-do from the times of `declare.ml` refactoring; thanks to Hugo Herbelin for trying first with rocq-prover#18742 , which this PR could replace. We adopt the following convention: - non-interactive commands ignore the using attribute (that could be resurrected maybe if we add an "Opaque" form) - we remove the per-constant `using` field from `CInfo.t` (as in rocq-prover#18742) - interactive commands pass their using attribute down to the proof initialization, where the parameter is interpreted properly in declare - for now we choose to warn on places where using attributes are not used
This is an old to-do from the times of `declare.ml` refactoring; thanks to Hugo Herbelin for trying first with rocq-prover#18742 , which this PR could replace. We adopt the following convention: - we remove the per-constant `using` field from `CInfo.t` (as in rocq-prover#18742) - interactive commands pass their using attribute down to the proof initialization, where the parameter is interpreted properly in declare.ml - for now we choose to warn on places where using attributes are not used (transparent definition not inside a section)
This is an old to-do from the times of `declare.ml` refactoring; thanks to Hugo Herbelin for trying first with rocq-prover#18742 , which this PR could replace. We adopt the following convention: - we remove the per-constant `using` field from `CInfo.t` (as in rocq-prover#18742) - interactive commands pass their using attribute down to the proof initialization, where the parameter is interpreted properly in declare.ml - for now we choose to warn on places where using attributes are not used (transparent definition not inside a section)
This is an old to-do from the times of `declare.ml` refactoring; thanks to Hugo Herbelin for trying first with rocq-prover#18742 , which this PR could replace. We adopt the following convention: - we remove the per-constant `using` field from `CInfo.t` (as in rocq-prover#18742) - interactive commands pass their using attribute down to the proof initialization, where the parameter is interpreted properly in declare.ml - for now we choose to warn on places where using attributes are not used (transparent definition not inside a section) We add tests from rocq-prover#18742, written by Hugo. Co-authored-by: Hugo Herbelin <Hugo.Herbelin@inria.fr>
This is an old to-do from the times of `declare.ml` refactoring; thanks to Hugo Herbelin for trying first with rocq-prover#18742 , which this PR could replace. We adopt the following convention: - we remove the per-constant `using` field from `CInfo.t` (as in rocq-prover#18742) - interactive commands pass their using attribute down to the proof initialization, where the parameter is interpreted properly in declare.ml - for now we choose to warn on places where using attributes are not used (transparent definition not inside a section) We add tests from rocq-prover#18742, written by Hugo. Co-authored-by: Hugo Herbelin <Hugo.Herbelin@inria.fr>
This is an old to-do from the times of `declare.ml` refactoring; thanks to Hugo Herbelin for trying first with rocq-prover#18742 , which this PR could replace. We adopt the following convention: - we remove the per-constant `using` field from `CInfo.t` (as in rocq-prover#18742) - interactive commands pass their using attribute down to the proof initialization, where the parameter is interpreted properly in declare.ml - for now we choose to warn on places where using attributes are not used (transparent definition not inside a section) We add tests from rocq-prover#18742, written by Hugo. Co-authored-by: Hugo Herbelin <Hugo.Herbelin@inria.fr>
This is an old to-do from the times of `declare.ml` refactoring; thanks to Hugo Herbelin for trying first with rocq-prover#18742 , which this PR could replace. We adopt the following convention: - we remove the per-constant `using` field from `CInfo.t` (as in rocq-prover#18742) - interactive commands pass their using attribute down to the proof initialization, where the parameter is interpreted properly in declare.ml - for now we choose to warn on places where using attributes are not used (transparent definition not inside a section) We add tests from rocq-prover#18742, written by Hugo. Co-authored-by: Hugo Herbelin <Hugo.Herbelin@inria.fr>
|
@herbelin alternative PR seems ready, with the tests developed here; I think you can close this one then; thanks for all the help and careful comments! |
This is an old to-do from the times of `declare.ml` refactoring; thanks to Hugo Herbelin for trying first with rocq-prover#18742 , which this PR could replace. We adopt the following convention: - we remove the per-constant `using` field from `CInfo.t` (as in rocq-prover#18742) - interactive commands pass their using attribute down to the proof initialization, where the parameter is interpreted properly in declare.ml - for now we choose to warn on places where using attributes are not used (transparent definition not inside a section) We add tests from rocq-prover#18742, written by Hugo. Co-authored-by: Hugo Herbelin <Hugo.Herbelin@inria.fr>
This is an old to-do from the times of `declare.ml` refactoring; thanks to Hugo Herbelin for trying first with rocq-prover#18742 , which this PR could replace. We adopt the following convention: - we remove the per-constant `using` field from `CInfo.t` (as in rocq-prover#18742) - interactive commands pass their using attribute down to the proof initialization, where the parameter is interpreted properly in declare.ml - for now we choose to warn on places where using attributes are not used (transparent definition not inside a section) We add tests from rocq-prover#18742, written by Hugo. Co-authored-by: Hugo Herbelin <Hugo.Herbelin@inria.fr>
|
Replaced by #18890. |
The
usingclause was stored either in theProof.t(for definitions generating proofs) or in theCInfo.t(for definitions with immediate proof, one for each component if a co/fixpoint). The PR makes a single choice by putting it instead inInfo.t. In particular:XXXcomments invernacentries.mlNote that we renounce to have one
usingper member of theCInfo.ton the assumption that the components ofCInfo.tare mutually dependent, thus, having to share the same section variables (did I miss other uses of CInfo.t than for mutual definitions?).In particular, we enhance a bit the effect of
using Typeon mutual definitions, taking all types together into account so that the dependencies are computed for the block of co/fixpoints as a whole.@gares, @ejgallego: I believe it goes in the direction that you defended, I hope I'm not wrong.