Trunk+abstracting injection flags#677
Conversation
|
@herbelin would you mind rebasing this? Thanks! |
37ea1ca to
ff32694
Compare
|
Rebased done. (It is actually more than a bugfix, it is the beginning of a proposal for adding a static control of tactic flags on top of the current dynamic control.) |
|
@herbelin It seems there was a failure in |
ff32694 to
82d0aa2
Compare
|
Overlay added for formal-topology (decide equality had become stronger). |
82d0aa2 to
4dd9ac1
Compare
| (* [keep_proofs] is relevant for types in Prop with elimination in Type *) | ||
| (* In particular, it is relevant for injection but not for discriminate *) | ||
|
|
||
| let find_positions keep_proofs env sigma ~no_discr t1 t2 = |
There was a problem hiding this comment.
keep_proofs should be a label here.
There was a problem hiding this comment.
I agree that a label better documents itself (and be consistent with the use of a label for no_discr).
|
|
||
| let injectable env sigma t1 t2 = | ||
| match find_positions env sigma ~no_discr:true t1 t2 with | ||
| let injectable keep_proofs env sigma t1 t2 = |
There was a problem hiding this comment.
Same here, should be a label.
There was a problem hiding this comment.
Finally, I changed this to support a Boolean option so as to have better compatibility. Now, plugin writers have to make a conscious decision of whether they want to use the API with a statically-defined behavior or with a behavior which varies depending on the value of global flags.
| then Proofview.V82.of_tactic (Equality.discrHyp id) g | ||
| else if Equality.injectable (pf_env g) (project g) t1 t2 | ||
| then tclTHENLIST [Proofview.V82.of_tactic (Equality.injHyp None id);thin [id];intros_with_rewrite] g | ||
| else if Equality.injectable false(*?*) (pf_env g) (project g) t1 t2 |
There was a problem hiding this comment.
Is there something that shoud be checked, as indicated by the comment?
There was a problem hiding this comment.
Previously, this behavior was dynamically decided by the Keep Proof Equalities flag. In principle, it should be @forestjulien and @Matafou to know what they want here, but I don't think it matters a lot.
I committed a new version which preserves the former dynamic behavior.
| | None -> !keep_proof_equalities_for_injection | ||
| | Some b -> b | ||
|
|
||
| let dEqThen keep_proofs with_evars ntac = function |
There was a problem hiding this comment.
There are pros and cons. For instance, here, there is also an issue of uniformity of style. The with_evars flag is used pervasively without being a label.
| !injection_in_context | ||
| && Flags.version_strictly_greater Flags.V8_5 | ||
| let use_injection_in_context = function | ||
| | None -> !injection_in_context && Flags.version_strictly_greater Flags.V8_5 |
There was a problem hiding this comment.
What is this option and why do flags have priority over it? I'm not saying anything is wrong, just trying to understand.
There was a problem hiding this comment.
The Boolean injection_in_context is the dynamic value of the Structural Injection option.
The flags is the static configuration, defaulting to the dynamic configuration when None. If Some, the static configuration takes priority. See discussion at ceps #29.
a3c1b60 to
ada2c38
Compare
|
@herbelin Is the topology fix backward compatible? If yes, can you make a PR upstream so that we can remove the overlay? |
|
It is not. We could make one of course but to the price of an uglier code or of getting rid of decide equality. |
|
@herbelin Can you integrate the fix in topology? |
|
Sorry, I failed to understand the policy with fixes to contributor packages. We don't have control on |
|
If you can make a pull request on topology, it would be ideal. But of course, if they don't ship a version of topology for each version of Coq, the fix should be backward compatible. |
|
@maximedenes: I don't know if you are a subscriber to |
|
Indeed, I'm not, so thanks for the update. |
|
@herbelin if you give the link to the PR in the thread, it can help track its status. |
|
PR on topology here. |
|
It seems that this PR creates warnings which make the Travis build fail (and in passing there is also a trivial merge conflict). Maybe a mention should be added in the compatibility file (I'm not sure what's the rule concerning when to update this file). Finally, following your PR on topology, a commit was added to the master branch for backward-forward compatibility. Maybe this branch can be tested as a temporary overlay to confirm this commit does the job? |
|
@herbelin Would you mind fixing the conflict and the warnings? Otherwise, this is going to miss 8.7+beta. |
|
@Zimmi48 I have also now pushed that commit to the |
ada2c38 to
2c1c901
Compare
|
@Zimmi48: I rebased. I cannot reproduced the warning, so I suspect it resulted from a temporary failure of master. |
|
@herbelin Did you try to compile with the |
|
Also note that you should normally be able to drop the overlay (commit 2c1c901) now. |
6059756 to
630ef94
Compare
|
@Zimmi48: Ah, sorry, I did not see the funind warning (I generally don't use the Warning now fixed, and overlay removed. |
Same here. |
|
A travis run on my repo seemed to indicate a failure in formal-topology, but maybe unrelated. A quick rebase would help figuring out. |
|
If we believe the Travis output before the conflict, the failure on formal-topology is real. This is also consistent with the history of this PR that has highlighted that formal-topology uses a lot of |
|
I'm sorry, for some reason I thought that I had pushed the change to stop using the (@Zimmi48 |
ML level can set the flags themselves. In particular, using injection and discriminate with option "Keep Proofs Equalities" when called from "decide equality" and "Scheme Equality". This fixes bug rocq-prover#5281.
|
It seems this branch has been forgotten because of a A property of such tag is of course that it eventually spontaneously becomes relevant again, so I rebased. Anything preventing this fix to be merged? (I guess now in 8.8 since it changes the ML API?) |
If you mean: "I rebased today", then you forgot to push. Not a big deal though because the only conflicts are in the change-log files. |
630ef94 to
91e9e1c
Compare
|
Indeed (I forgot the |
This replaces #420 as discussed during the WG.