The Memento of Time Crystals
Capture and externalize an entity's internal state so it can be restored to this exact moment later.
✧ GANG OF FOUR LINEAGE & ARCANUM ✧
GOF DESIGN PATTERN: Memento
ARCANUM SCHOOL: Divination // Temporal Logic
SCRIBE / ARCHON: Joshua Edward McLaughlin Cox
CANONICAL REGISTRATION:
// CODEX INCANTATION //
---- MODULE Memento ----
EXTENDS Naturals
VARIABLES currentState, savedMemento
Init ==
/\ currentState = 0
/\ savedMemento = -1
MutateState ==
/\ currentState' = currentState + 1
/\ UNCHANGED savedMemento
SaveMemento ==
/\ savedMemento' = currentState
/\ UNCHANGED currentState
RestoreMemento ==
/\ savedMemento # -1
/\ currentState' = savedMemento
/\ UNCHANGED savedMemento
Next == MutateState \/ SaveMemento \/ RestoreMemento
Spec == Init /\ [][Next]_<<currentState, savedMemento>>
====
When traversing treacherous futures, an chronomancer may embed their current essence into a Time Crystal. The Memento pattern captures currentState into savedMemento. Should the future lead to ruin, RestoreMemento acts as a perfect temporal anchor, resetting reality back to the pristine crystalized state.
Runic Tags:
#tla
#state-restoration
#temporal-divination
#behavioral