-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixing Set/Unset Printing broken by auto "Show".
Current coq trunk has a bug with Show that I reported (there is a spurious Show executed) which makes C-u C-c C-a C-s fail for now. Should be fixed shortly.
- Loading branch information
Showing
1 changed file
with
23 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
afb29a6
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.
@Matafou this will be fixed once coq/coq#640 is merged. However I keep wondering about the future of
-emacs
. For instance, it seems to me that having to maintain a list of commands that print the goals between Coq and PG is fragile and prone to error. Wouldn't it easier for PG to just issueShow
when desired? [Another option would be to quote the goals, but I guess you are OK with the current status now]afb29a6
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.
afb29a6
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.
Hi Pierre, I am not sure if you mean "strange auto show" for the current bug, or in general.
What I mean is that in general, "auto goal show" relies on heurisitics, so it is prone to breaking, as PG has to be in sync with emacs heuristics. So an option to avoid this kind of problems in the future would be to entirely disable goal display when
-emacs
is passed to the current toplevel.afb29a6
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.
Yes we can do that. However for efficiency reason we don't want to print goals too often (people do have big goals), so it would result in moving the heuristic from coq to pg (when pg should send a "Show."?) and I guess coq is better at knowing when the goal has changed. Or maybe the information that the goal has changed can be sent by coq?
And moreover my point was that some people use "coqtop" without emacs, and they WANT goal to be printed automatically instead of typing "Show" evey now and then. So you will still have a heuristic present in coq code anyway.
afb29a6
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.
Well, it is the current model that is the most inefficient as the client has no control over when the goals are printed; and a large goal will be printed many times likely unnecessarily. When PG should send a Show, well, is PG business. Not to say if you do go to point and process 1000 sentences, Coq will print the goals 1000 times in the current model.
A set of heuristics has to be always maintained, in the current model, we have to maintain two sets (Coq and PG) and keep them in sync. In my proposed model, only one.
By the wa, AFACIT, currently Coq does not detect if the goal has changed, and that optimization could be implemented in the two models so it is orthogonal.
You hit the crux of the question, people
!=
emacs, what humans need is not what emacs needs.afb29a6
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.
Of course the client has control! Obviously PG Set Silent before sending a group of command to coq, and unsets silent just before the last command.
I fully agree that this is not the right way and the new protocols are way better. Let us just make the old one survive one more version that is all.
Does coqide issue a "Goal" after a Print command if it already saw the goal before the print command? If efficiency becomes an issue (on big goals) that might be something to optimize indeed.