Repository navigation
Fix duplicate atom removal and preserve cross-space definitions - #258
Open
Yadelew-zemene wants to merge 2 commits into
Open
Yadelew-zemene wants to merge 2 commits into
Yadelew-zemene wants to merge 2 commits into
Conversation
This was referenced Oct 26, 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.
Summary
Fixes #251 by correcting how
remove-atomremoves atoms and compiled function definitions.Previously, removal could delete every matching duplicate from a space, and could remove compiled definitions that should have remained available through another space.
Changes
Remove only one matching atom
Replaced
retractall/1withretract/1, so a single call removes one matching instance instead of all duplicates.Make type-declaration cleanup conditional
The type-declaration cache cleanup now runs only when a matching atom was actually removed.
Remove one matching compiled definition
Changed the compiled-clause removal logic to remove a single matching translated clause rather than erasing every matching clause.
Add regression tests
Added
tests/test_remove_atom.pl, covering:Integrate the tests
Updated
test.shto run the new regression tests.Testing
git diff --checkpassesExpected behavior
After this fix:
Related issue
Fixes #251