-
Notifications
You must be signed in to change notification settings - Fork 88
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
"Omit proofs" breaks other proofs because it also skips hints #688
Comments
Thanks @Blaisorblade for your detailed report!
I don't know what is the best solution here. Cc @hendriktews and @ProofGeneral/core WDYT? |
Anyway, this issue does not look surprising to me, knowing the way the omit-proof feature is implemented (it replaces the whole I'm not sure if adding Of course, I believe filtering the |
Detection of which commands to ignore (like Print which could fail when inside a proof) from the ones we need is going to be difficult really. |
@Matafou wrote:
@erikmd wrote:
Off the top of my head, commands like
The real point are changes in the middle of a proof — they can be temporary or permanent, if parts of that proof need different hints, but they're too large for
Neither nested lemmas nor nested hints are deprecated, but PG does not support hints (which cause no Coq warnings), only supports nested lemmas — which are disabled by default and discouraged, but can be re-enabled (deprecation isn't settled). |
The difficulty I am expecting is, as often, not at the moment but for long term maintenance. We will have to maintain a non trivial list of regular expressions from coq versions to coq versions. This is the kind of things we try to avoid as much as possible so that pg remains maintainable. |
Thanks for reporting, I suggest to do the same here as for #687, see my comment there. I.e., detecting a hint will disable proof omission. |
@hendriktews wait, there are probably dozens of such commands that are allowed inside a proof and should not be ignored. Those pointed by @Blaisorblade: |
We had a very short pg meeting today and here are the points and solutions we are considering.
We came up with 4 possible solutions + 1 cheap workaround. Solutions:
|
Currently Coq's STM repeats those commands — I'm not sure if there's a single list, @gares might know. I'm not aware of changes to this list, except for the For the rest: I believe I have valid use-cases, but my team already uses 3 IDEs, so per-IDE coding guidelines don't seem compelling and I'd rather move that part of the discussion upstream: https://coq.zulipchat.com/#narrow/stream/237661-User-interfaces-devs-.26-users/topic/Plans.20for.20hints.20in.20proofs. Regarding alternative designs, if this isn't supported I believe I'd need a warning — Take for instance:
That won't be too helpful when I'm stepping through a large proof from a colleague, run into this bug, and I need to debug the proof misbehavior (because the hints are skipped) or the proof slowdown (because the proof was not skipped). In the past, I have adapted my code to support |
Right, a Coq tag #[sync] at the beginning of a command would be better. |
If you want a hack, then any command (i.e. starting with a capital) occurring inside a proof should be kept even if proofs are skipped. If you don't want a hack, then you should not implement this feature in the UI, since it the job of Coq to know the semantics of the commands, and know which one is has a side effect and which one is pure. |
AFAICT the "non-hacky way" requires the (successors of) the XML protocol, but we don't have a complete replacement yet. For the other approach, some commands can prefix tactics or commands, will fail spuriously when they prefix tactics, and arguably warrant skipping; off the top of my head I can list |
Yeah and also commands needing a proof context need be non-ignored What protocol(s) should we ideally use nowadays? I am a bit lost. I will try to attend he next Coq UI meeting. Maybe the LSP stuff is the right way (emacs has good support for it I heard). For now I guess a hack would be ok. |
See also #689. |
Add the predicate `proof-script-cmd-prevents-proof-omission' to the omit-proofs framework, whose purpose is to check whether commands inside proofs might have global effects such that the proof must not be omitted. Fixes ProofGeneral#688
Add the predicate `proof-script-cmd-prevents-proof-omission' to the omit-proofs framework, whose purpose is to check whether commands inside proofs might have global effects such that the proof must not be omitted. Fixes ProofGeneral#688
Add the predicate `proof-script-cmd-prevents-proof-omission' to the omit-proofs framework, whose purpose is to check whether commands inside proofs might have global effects such that the proof must not be omitted. Fixes ProofGeneral#688
Add the predicate `proof-script-cmd-prevents-proof-omission' to the omit-proofs framework, whose purpose is to check whether commands inside proofs might have global effects such that the proof must not be omitted. Fixes ProofGeneral#688
Add the predicate `proof-script-cmd-prevents-proof-omission' to the omit-proofs framework, whose purpose is to check whether commands inside proofs might have global effects such that the proof must not be omitted. Fixes ProofGeneral#688
Add the predicate `proof-script-cmd-prevents-proof-omission' to the omit-proofs framework, whose purpose is to check whether commands inside proofs might have global effects such that the proof must not be omitted. Fixes ProofGeneral#688
Add the predicate `proof-script-cmd-prevents-proof-omission' to the omit-proofs framework, whose purpose is to check whether commands inside proofs might have global effects such that the proof must not be omitted. Fixes ProofGeneral#688
Add the predicate `proof-script-cmd-prevents-proof-omission' to the omit-proofs framework, whose purpose is to check whether commands inside proofs might have global effects such that the proof must not be omitted. Fixes #688
The proof of
bar
breaks when using "Omit proofs" onfoo
:This is with an old proof general, but it doesn't look like much relevant has changed since then:
Ideally, PG would either support this script, warn about occurrences, or document such problems.
If you're wondering "why would you even consider writing this code", at least it can arise temporarily during development, and uses can be hard to find in larger scripts.
The text was updated successfully, but these errors were encountered: