The Visitor of Dimensional Walkers
Represent an operation to be performed on the elements of an object structure without changing their classes.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Visitor
ARCANUM SCHOOL: Divination // Temporal Logic
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
---- MODULE Visitor ----
EXTENDS Naturals, FiniteSets
CONSTANTS Nodes, Types, VisitorLogic(_, _)
VARIABLES unvisitedNodes, results
Init ==
/\ unvisitedNodes = Nodes
/\ results = {}
Visit(node, type) ==
/\ node \in unvisitedNodes
/\ results' = results \union {VisitorLogic(node, type)}
/\ unvisitedNodes' = unvisitedNodes \setminus {node}
Next == \E n \in unvisitedNodes, t \in Types : Visit(n, t)
Spec == Init /\ [][Next]_<<unvisitedNodes, results>>
====
Dimensional Walkers traverse the cosmic graph, blessing or cursing nodes based on their innate types. The Visitor pattern decouples the algorithm (VisitorLogic) from the Nodes themselves. TLA+ ensures complete coverage: eventually, unvisitedNodes will be empty, meaning every timeline has been evaluated by the Walker.
Runic Tags:
#tla
#traversal
#temporal-divination
#behavioral