Skip to content

Fix broken proof tree after information flow auto pilot#3911

Merged
unp1 merged 1 commit into
mainfrom
bubel/issue-3713-infflow-tree
Jul 10, 2026
Merged

Fix broken proof tree after information flow auto pilot#3911
unp1 merged 1 commit into
mainfrom
bubel/issue-3713-infflow-tree

Conversation

@unp1

@unp1 unp1 commented Jul 10, 2026

Copy link
Copy Markdown
Member

Related Issue

This pull request resolves #3713.

Intended Change

Applying the Full Information Flow Auto Pilot destroyed the proof tree view with

IllegalStateException: abstract tree node without parent: Proof Tree
    at GUIAbstractTreeNode.getParent(…) / getPath(…) / GUIProofTreeModel.updateTree(…)

The root problem was that two autoModeStarted events were fired, one for the main proof and
one for the side proof. The side proof finished sent its autoModeStopped and the GUI tree
was informed about node changes of the tree it did not show and as the side proof was disposed
an NPE was triggered.

The actual fix is in AbstractMediatorUserInterfaceControl.macroFinished. The ProofTreeView
has a robustness fix discarding any information about a proof it does not display. The error is
not silenced as we still get an Exception from GUIAbstractTreeNode, but that is more fail fast and
once, while the other exception from ProofTreeView would render the whole GUI unresponsive.

  1. AbstractMediatorUserInterfaceControl.macroFinished only freezes the interface
    (stopInterface + setInteractive(false)) instead of broadcasting a spurious
    autoModeStarted for the side proof.
  2. ProofTreeView ignores auto mode events for proofs it does not display, and skips foreign
    nodes when refreshing modified subtrees in autoModeStopped.

DisposedProofTreeUpdateTest reproduces the #3713 constellation headlessly (a foreign disposed
proof's node fed into a live proof's model) and pins the fail-fast contract.

Verified interactively: the auto pilot no longer breaks the proof tree.

Note: while verifying the fix another issue showed up, namely that information flow proofs additionally do not close interactively, an independent regression of the problem loader's profile handling, fixed in a separate follow-up PR.

Type of pull request

  • Bug fix (non-breaking change which fixes an issue)
  • There are changes to the (Java) code

Ensuring quality

  • I made sure that introduced/changed code is well documented (javadoc and inline comments).
  • I have tested the feature as follows: new regression test (DisposedProofTreeUpdateTest),
    manual GUI verification with the InformationFlow examples (the exact reproduction steps of
    Macro auto-infflow breaks UI Proof Tree #3713).

Additional information and contact(s)

PR created with AI tooling

The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.

The Full Information Flow Auto Pilot broke the proof tree view with
'IllegalStateException: abstract tree node without parent: Proof Tree'.

Root cause: when the macro creates its auxiliary side proof, the
StartSideProofMacro handling in macroFinished re-froze the interface via
initiateAutoMode(sideProof), which also broadcasts autoModeStarted for
the side proof (with no matching autoModeStopped ever following). The
ProofTreeView listener trusted any event source and overwrote its
modifiedSubtrees bookkeeping with the side proof's goal nodes. At the
final autoModeStopped, those foreign (by then disposed) nodes were fed
into the tree model of the displayed proof, where the lazily created
parent branch node for the foreign root has no parent and a disposed
proof has no root() anymore, defeating the existing root check.

The fix prevents the poisoning at both ends:
- macroFinished only freezes the interface (stopInterface +
  setInteractive) instead of broadcasting a spurious autoModeStarted
  for the side proof,
- ProofTreeView ignores auto mode events for proofs it does not display
  and skips foreign nodes when refreshing modified subtrees.

GUIAbstractTreeNode.getParent() keeps failing fast on parent-less
nodes so that bookkeeping bugs of this kind surface; the previously
unexplained root-instance escape ('why can there be another instance
of the root node?') is now documented - it stems from stale instances
after cache invalidation and from exactly this kind of foreign-node
walk. A regression test pins the fail-fast contract.

Created with AI tooling
@unp1 unp1 self-assigned this Jul 10, 2026
@unp1 unp1 added this to the v3.0.0 milestone Jul 10, 2026
@unp1 unp1 enabled auto-merge July 10, 2026 18:31
@unp1 unp1 added this pull request to the merge queue Jul 10, 2026
Merged via the queue into main with commit 61d1c54 Jul 10, 2026
36 checks passed
@unp1 unp1 deleted the bubel/issue-3713-infflow-tree branch July 10, 2026 19:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Macro auto-infflow breaks UI Proof Tree

2 participants