The Alloy formal modeling language has been used to explore two central aspects of Eventful Stories, the properties of the type context and the process of sharing data between two or more type contexts.
Incorrect models are exposed immediately. The model may be either inconsistent or missing necessary constraints. Determining what needs to change to repair the model is both humbling and highly instructive.
Alloy models are also very much more compact than even very simple test test code written in a conventional programming language.
In the end, the designs have been become conceptually simpler and easier to develop and understand step by step. These benefits are well worth the time spent building the models.
More complex and capable models will continue to be evolved step-by-step until all key timing, error and logical features are represented and understood. The result will be a rock-solid validated design.
Alloy Formal Model Scripts
Soon there will be pages discussing each design project using Alloy. For now, the text files with the Alloy scripts are being made available.
The four script files below should have an “.als” extension meaning “Alloy model” to the Alloy Analyzer system. However, the downloaded files will have names ending in “.als.txt” because the software running this site does not allow distributing files whose names end in “.als”. Rename them as, for example, “A_TypCtxStruct.als.txt -> A_TypCtxStruct.als” to make them acceptable to Alloy.
They are written in Alloy version 6 (available here).
A structural model of a type context capturing super- and sub-types and naming constraints:
A structural model of a type context with UUIDs added as identifiers for entities:
A structural model showing graphically how entities that are owned by an evidence module, and those referenced that are owned by an external evidence module are cached locally:
A dynamic model of the cache coherency protocol that copies externally referenced entities to the modules needing them. It is a first step in developing the full robust inter-module protocol:
