Skip to content
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

Fix goals panel when no proof is active on Coq >= 8.16. #337

Merged
merged 2 commits into from
Feb 17, 2024

Conversation

jesboat
Copy link
Contributor

@jesboat jesboat commented Feb 14, 2024

Traditionally, Coq IDEs used the 'Goals' XML command to get the proof state, which had the downside that the full details of non-foreground goals would get serialized from coqidetop but never displayed. In Coq 8.16, the 'Subgoals' command was added, which allows more precise goal fetching: IDEs can make one Subgoals call to request the focused goal in full detail, and another call to request just the conclusions of the other goals. Coqtail switched to this pattern in v1.7.1.

Unfortunately, the logic for merging results from the two calls was slightly wrong. If the calls return None, then there is no proof in progress, but the logic in Coqtail handled this as if there is an in-progress proof with no remaining goals. This made the Goals panel always show "0 subgoals" even when no proof was in progress.

Fix it. If the first call returns None, there is no proof in progress, and we don't bother to make the second call. Else, we learned that there is a proof in progress and what the foreground goal (if any) is; we make the second call to learn the other goals, and then merge the results and continue as before.

Fixes c077a72.

jesboat and others added 2 commits February 14, 2024 17:16
Traditionally, Coq IDEs used the 'Goals' XML command to get the proof
state, which had the downside that the full details of non-foreground
goals would get serialized from coqidetop but never displayed. In Coq
8.16, the 'Subgoals' command was added, which allows more precise goal
fetching: IDEs can make one Subgoals call to request the focused goal in
full detail, and another call to request just the conclusions of the
other goals. Coqtail switched to this pattern in v1.7.1.

Unfortunately, the logic for merging results from the two calls was
slightly wrong. If the calls return None, then there is no proof in
progress, but the logic in Coqtail handled this as if there is an
in-progress proof with no remaining goals. This made the Goals panel
always show "0 subgoals" even when no proof was in progress.

Fix it. If the first call returns None, there is no proof in progress,
and we don't bother to make the second call. Else, we learned that there
is a proof in progress and what the foreground goal (if any) is; we make
the second call to learn the other goals, and then merge the results and
continue as before.

Fixes c077a72.
@whonore
Copy link
Owner

whonore commented Feb 17, 2024

Thanks for the fix, this looks great.

@whonore whonore merged commit e52c456 into whonore:main Feb 17, 2024
19 checks passed
@jesboat
Copy link
Contributor Author

jesboat commented Feb 19, 2024

@whonore Thanks! I appreciate the style fix; I didn't have a full python dev env handy to see them locally.

Rixxc pushed a commit to Rixxc/Coqtail that referenced this pull request Jul 2, 2024
Traditionally, Coq IDEs used the 'Goals' XML command to get the proof
state, which had the downside that the full details of non-foreground
goals would get serialized from coqidetop but never displayed. In Coq
8.16, the 'Subgoals' command was added, which allows more precise goal
fetching: IDEs can make one Subgoals call to request the focused goal in
full detail, and another call to request just the conclusions of the
other goals. Coqtail switched to this pattern in v1.7.1.

Unfortunately, the logic for merging results from the two calls was
slightly wrong. If the calls return None, then there is no proof in
progress, but the logic in Coqtail handled this as if there is an
in-progress proof with no remaining goals. This made the Goals panel
always show "0 subgoals" even when no proof was in progress.

Fix it. If the first call returns None, there is no proof in progress,
and we don't bother to make the second call. Else, we learned that there
is a proof in progress and what the foreground goal (if any) is; we make
the second call to learn the other goals, and then merge the results and
continue as before.

Fixes c077a72.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants