-
Notifications
You must be signed in to change notification settings - Fork 87
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
add feature to omit complete opaque proofs #559
Conversation
For files with big proofs I measure a reduction of the processing time of the asserted region to 10%. For files with small proofs and many definitions it goes down to 30-40%. |
37ff5d9
to
6d1cf0b
Compare
Hi @hendriktews, thanks, that looks very nice! :) And let us know when/if you'd like we test the feature ^^ |
eecdf84
to
46a1426
Compare
This new test |
It's ready for testing now. All you need to know is documented in |
2a7563c
to
dbcbfcc
Compare
I consider this now complete. I have used the feature for a while for some 2000 lines file and it reduced waiting time there considerably. Does anybody want to try? |
Hi @hendriktews, thanks, I'd like to try − as soon as I can (not this week but before our next meeting on 14th April of course), anyway feel free to merge if other people here, Cc @ProofGeneral/core, were already able to take a closer look :) Thanks a lot 👍 |
I definitely want to try. |
This commit adds a feature to recognize complete opaque proofs in the asserted region and to replace them with an admitted proof. This can drastically improve the processing time for the asserted region at the cost of not checking the omitted proofs. Omitted proofs are displayed slightly darker compared to other parts of the locked region. With this commit, the feature is supported for Coq for files in which proofs are started with some form of Proof and ended with either Qed, Defined, Admitted or Abort. To enable, configure proof-omit-proofs-option or click Proof General -> Quick Options -> Processing -> Omit Proofs.
Make proof-goto-point and proof-process-buffer prefix argument aware. With argument, both commands temporarily switch off proof-omit-proofs-option, such that all proofs are completely processed for one particular invocation.
Work around the wrong order returned by `overlays-at' in Emacs <= 25.
dbcbfcc
to
560c6a2
Compare
changed according to discussion in maintainer telco: Support proof starts without using and treat Abort as end of a non-opaque proof. @erikmd Do you want to check whether it works now in your file that contains Abort? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @hendriktews 👍 yes I've just fetched your last commits and tested on that example file, so I can confim it works very fine!
However there's a small issue I guess: the |
@hendriktews to be more precise: after installing the
Do you think it's feasible to overcome this limitation directly from PG? or maybe we can just open a PR in company-coq's repo. |
company-coq binds a different command to
No, |
* Make company-coq compatible with PR ProofGeneral/PG#559 To reproduce: * Given company-coq * and `Proof-General > Quick Options > Processing > Omit Proofs`, * When doing `C-u C-c C-RET`, * Then the considered lemmas should be fully processed.
Exactly, I just wanted to mean this :) that the issue was related to the rebinding.
Yes that seems to suffice. So I opened PR cpitclaudel/company-coq#247
Yes! BTW, do you agree with the suggestion I had mentioned to extend the manual w.r.t. "Proof using" ? Anyway when |
* Make company-coq compatible with PR ProofGeneral/PG#559 To reproduce: * Given company-coq * and `Proof-General > Quick Options > Processing > Omit Proofs`, * When doing `C-u C-c C-RET`, * Then the considered lemmas should be fully processed.
👍 👏 great job :) |
BTW, do you agree with the suggestion I had mentioned to extend
the manual w.r.t. "Proof using" ?
See my comment there (which I entered already the other day, but
github decided to discard it, maybe because I clicked resolve
before comment.
|
Can we merge this? The fix to company-coq isn't backwards-compatible. |
This reverts commit 9cef9d2. It's not compatible with PG without ProofGeneral/PG#559.
Hi @hendriktews! sorry for late reply.
I'm not fully convinced that this PR has not much to do with Indeed, if there is no Here is a toy example: (* Proof-General > Quick Options > Omit Proofs *)
Section Foo.
Variables (A : Type) (other : True).
Lemma id : A -> A.
Proof .
auto.
Qed.
End Foo.
Fail Definition bar := id nat 0. (* while it would be OK with `Proof using A.` above *) Hence my earlier suggestion to add a small note in 11.5, advising to read 11.3 as well :) But if you strongly disagree with this addition, maybe @Matafou (which implemented the |
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Matafou for your comment!
So I'm going to readily push a commit that documents that Proof-using requirement in the manual and file CHANGES.
Apart from this detail, the PR looks very fine, so @Matafou / @hendriktews / @cpitclaudel, feel free to merge when you see fit (otherwise I'll do it on tomorrow Wednesday in the evening).
Thanks again Hendrik, for this very nice feature!
OK, so let's merge this now. |
Thanks for polishing and merging. The argument about sections and proof using is certainly valid and it is good to have this in the manual (although I am not sure if anybody ever reads the manual). |
This commit adds a feature to recognize complete opaque proofs in
the asserted region and to replace them with an admitted proof.
This can drastically improve the processing time for the asserted
region at the cost of not checking the omitted proofs. Omitted
proofs are displayed in some shade of purple in the locked
region.
With this commit, the feature is supported for Coq for files in
which proofs are started with some form of Proof using and
ended with either Qed, Defined or Admitted.
To enable, configure proof-omit-proofs-option or click
Proof General -> Quick Options -> Processing -> Omit Proofs.