Fix "Rule of same name exists already" error after pruning (rare but occuring cases after mass pruning with try-closeable-goals)#3850
Open
unp1 wants to merge 1 commit into
Open
Conversation
When pruning a proof, taclets introduced locally (e.g. via \addrules) must have their justification removed from the InitConfig. ProofPruner did this in the breadth-first pass via visitedNode.parent().getLocalIntroducedRules(), but locally introduced taclets are stored on the node at which they were introduced, not on its parent. As a consequence a node's introduced rules were only deregistered when one of its children was visited, so taclets introduced at the leaf of a branch other than firstLeaf were never deregistered (firstLeaf is handled separately by the child-to-parent traversal). The leaked justification then collided with a freshly registered taclet of the same name on the next automatic run, causing "A rule named ... has already been registered" after Full Auto with try-close pruned closed branches. Iterate the visited node's own getLocalIntroducedRules() instead, skipping the cutting point itself (which survives the pruning). This also avoids the old code's erroneous deregistration of the cutting point's parent's rules.
06662d2 to
58e6c36
Compare
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.
After using the Full-Auto-Macro where some proof goals remained open, I got an error "Rule of same name exists already ", when starting the proof search again.
The problem is a slight oversight in the proof pruner which misses to unregistered locally introduced rules at leaves. This fixes this rare but happening error. It also fixes a separate error that if at the cutting point a new taclet was registered, then this got lost.
Intended Change
Fix spurious double registration bug for taclets in \addrules
Type of pull request
Ensuring quality
Additional information and contact(s)
The contributions within this pull request are licensed under GPLv2 (only) for inclusion in KeY.