[P2] Canonicalize recursive-plan fingerprints before cycle detection #42
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
nsaspy/prolog-rlm#42
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
While implementing #20, a depth-2 capability-narrowing test used a term-form plan containing an anonymous-tag SWI dict literal (
_{secret:true}). The recursive-plan cycle check inrlm_completionfingerprints nested plans withterm_hash/2directly. Because the anonymous dict tag is representation-level non-ground state, the hash can remain non-ground and unify with an ancestor fingerprint, producing a falserecursive_cycle(...)rejection before capability validation.Reproduction
A nested
rlm(...)plan whose grandchild includes an anonymous-tag dict literal can be rejected as a cycle even when the nested plans are structurally distinct. Replacing the dict with a named-tag dict makes the intended child-capability denial observable.Desired fix
Constraints
Do not weaken duplicate/cycle protection. Model-origin JSON plans already normalize to closed structures; this primarily hardens the Prolog term API and prevents false positives.
Discovered by
Issue #20 deep-recursion experiment work.