Fix for DepthFirstGoalChooser: Keep enabled sibling goals on a split#3886
Merged
Conversation
…a split DepthFirstGoalChooser.updateGoalListHelp locates, in its work list, the goal a rule was applied to, so it can replace that goal with the rule's new goals. A splitting rule reuses the goal object for one of its branches (advancing its node), so the split point is found by identity among the new goals rather than by node. That membership test ran against the new goals *after* they had been filtered to automatic goals: when the reused goal was disabled -- proof caching disables a branch it can close by reference -- it was filtered out, the split point was not found, newGoalsInserted stayed false, and the rule's other, still enabled, new goals were never inserted into the work list. getNextGoal() then eventually returns null while those goals still have applicable rules, so automatic proof search stops with an open goal and the user has to restart it (the proof caching "stops the search, restart needed" symptom). Match the split point against all new goals, so a disabled reused goal is still found, and insert only the automatic ones. Behaviour is unchanged when no new goal is disabled, i.e. for all ordinary proof search. Adds ProofCachingSingleRunTest: a proof cached against a closed copy of itself must close in a single automatic run; it fails without this fix.
unp1
enabled auto-merge
July 4, 2026 10:08
wadoon
reviewed
Jul 5, 2026
wadoon
approved these changes
Jul 5, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Not related to a tracked issue. The bug surfaced while exercising proof caching and is reproducible on
main.Intended Change
Fix automatic proof search stopping with an open goal, and requiring the user to restart it, when proof caching is enabled.
How to reproduce (on current main):
Reason:
DepthFirstGoalChooser.updateGoalListHelplocates, in its work list, the goal a rule was applied to (the "split point") so it can replace that goal with the rule's new goals. A splitting rule reuses the applied-to goal object for one of its branches (advancing its node), so the split point is found by identity among the new goals rather than by node. That membership test, however, ran against the new goals after they had been filtered to automatic goals. When the reused goal had been disabled — proof caching disables a branch it can close by reference — it was filtered out, the split point was not found,newGoalsInsertedstayedfalse, and the rule's other, still-enabled, new goals were never inserted into the work list.getNextGoal()then eventually returnsnullwhile those goals still have applicable rules, so automatic proof search stops with an open goal and the user has to restart it for it to continue.The fix matches the split point against all new goals (so a disabled reused goal is still found) and inserts only the automatic ones. Behaviour is unchanged when no new goal is disabled, i.e. for all ordinary proof search.
This is a pre-existing bug in
DepthFirstGoalChooser, independent of any recent work; it is triggered whenever proof caching disables one branch of a splitting rule.Type of pull request
Ensuring quality
ProofCachingSingleRunTest, which proves a method, then proves a second copy with a reference-search listener that mirrorsCachingExtension(disable cache-hit goals during the run, close them afterwards) and asserts the second proof closes in a single automatic run. It fails without the fix (an enabled goal is stranded, requiring a restart) and passes with it. I also verified the multi-core determinism regression test still yields bit-identical proofs (sequential == 4 workers), and thatTestReferenceSearcher/TestGoalremain green.Additional information and contact(s)
The change is small (three lines of logic plus an explanatory comment) and self-contained in
DepthFirstGoalChooser.The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.
Created with AI support