Definition
A system model is a precise description of a system, written so that claims about the system can be checked. It names the components, the state each one holds, the steps that change that state, how the components communicate, and what the environment can do, including which failures occur. A claim proved about the model covers every execution the model allows, where an execution is one possible run of the system. An execution the model leaves out is not covered, even if the real system can perform it.
The idea
Someone proves that a device always starts a program that has passed its checks. The proof treats “write the new version number to storage” as one indivisible step. On the real device, that write takes several storage operations, and the power can fail between two of them. Storage then holds a mix of old and new bytes that the proof never considered. The proof is still correct, but it is a proof about a different system: one in which power never fails during a write.
A proof establishes a property for every execution of the model, and for nothing else. The rules of a board game are a fair picture. A proof that a player can never lose is a statement about the moves the rules allow; if the real game permits one more move, the proof says nothing about games that use it. The picture fails in one respect. In a board game the rule book is complete by definition, while in a real system nobody announces the extra moves. They come from the environment, meaning everything outside the modeled components that can affect them: the power supply, the network, the storage hardware, other software, people and attackers.
Writing the model down makes these choices visible, so that a reader can challenge them. A diagram of boxes and arrows is not yet a system model: it does not say which steps exist, which of them can be cut short, or what happens to a lost message.
How it works
A system model answers eight questions; together the answers define the executions it allows.
Components. Which parts exist, such as a sender, a relay and a receiving device, and what each can read and change.
State. The variables that describe the system at one moment, marking which are persistent state §8.1, kept through a reset or a power loss, and which are lost.
Steps. The single steps, called transitions, that change the state, such as “receive a fragment” or “switch the active version”: when each is allowed and what it changes. A step in the model happens completely or not at all.
Communication. How components exchange messages, and what the channel can do to a message: lose it, delay it, duplicate it, reorder it or change it.
Timing. In a synchronous model, message delays and processing times have known upper bounds. In an asynchronous model they have no bound, so a slow component cannot be told apart from a stopped one. A partially synchronous model assumes that bounds exist but are not known in advance, or that they hold only after some unknown time.
Failures. The fault model §1.30: which accidental failures occur, such as a reset at any moment, a component that stops for good (a crash), a storage write left incomplete, or a component that behaves arbitrarily (a Byzantine failure §1.31).
Attacker. The threat model §1.2: what a deliberate adversary can observe and control.
Initial states. The states in which every execution starts.
An execution is a sequence of states that begins in an initial state, in which each state follows from the one before by one allowed step. Steps of the environment, such as a reset, count as steps like any other. A property is a statement about executions. “In every reachable state §3.21, the active version has passed its checks” is a safety property §1.11: it says that something bad never happens. “Every request is eventually answered” is a liveness property §1.12: it says that something good eventually happens.
The level of detail follows the claim: a claim about an interrupted update needs the separate storage writes and the moments at which a reset can strike. The model may treat a real operation as one step only when a lower-level guarantee makes it indivisible, for example an atomic operation §9.8 of the processor, a lock, or a commit protocol that makes a multi-part write appear to happen at once. Calling an operation atomic without such a guarantee hides a question instead of answering it.
The choice of model can decide what is possible at all. Fischer, Lynch and Paterson proved in 1985 [232] that in the asynchronous model no deterministic algorithm §14.1 can guarantee that a group of processes reaches agreement on one value, a task called consensus, if even one process may crash, even when no message is ever lost. In the synchronous model with crash failures, consensus can be solved. The task is the same in both statements; only the model differs.
Worked example
A hypothetical device keeps an 8-byte boot record in flash memory §6.6: bytes 0 to 3 hold the version number of the program to start, and bytes 4 to 7 hold a checksum §4.32 of bytes 0 to 3, a value computed from them so that a damaged record can be recognized. At start-up, recovery code accepts the record if neither field is erased and the checksum matches, and starts the version it names; otherwise it has nothing to start. Version 6 is running, version 7 has been received and checked, and the device commits version 7 by rewriting the record. The property to prove: after any reset, recovery finds a valid record.
Model M1 treats the commit as one step. A reset can strike before the commit or after it, so after a reset the record is either (6, checksum of 6) or (7, checksum of 7). Both are valid, so the property holds in every execution of M1.
Model M2 follows the hardware more closely. Flash memory must be erased before it is rewritten, and erasing sets every bit to 1, so an erased byte reads as 0xFF. The record has an erasable block to itself, and the commit takes three operations: erase the block, write bytes 0 to 3, write bytes 4 to 7. M2 treats each of the three operations as indivisible and lets a reset strike before any of them or after the last. A commit of operations has such reset points, here :
before the erase: (6, checksum of 6), valid;
after the erase: all 8 bytes
0xFF, invalid;after the first write: version 7, with bytes 4 to 7 still erased, invalid;
after the second write: (7, checksum of 7), valid.
At two of the four reset points the device is left with nothing to start. The property proved for M1 is false in M2.
The repair changes the system, not the proof. Keep two copies of the record in two separate blocks, each with a sequence number that its checksum also covers. A commit overwrites a copy that fails its check or, when both copies are valid, the one with the lower sequence number, and gives the new record a sequence number one higher than that of the copy it keeps; recovery uses the valid copy with the higher sequence number. A reset during a commit can damage only the copy being rewritten, while the other copy, naming version 6, stays valid, so all 4 reset points leave a valid copy and the property holds in M2. M2 still assumes that each single write is indivisible. If the hardware does not guarantee that, the model must also allow a half-written field, and the argument then depends on the checksum recognizing it.
Stated precisely
A standard mathematical form of a system model is a transition system . Here is the set of all states, is the set of initial states, and is the transition relation: means that the model allows one step from state to state . Environment steps, such as a reset, are transitions too. An execution is a sequence of states with and for every . A state is reachable if some execution contains it.
A model satisfies a property when every execution of satisfies . For a condition on single states, a standard proof that holds in every reachable state has two parts: holds in every initial state, and every transition from a state that satisfies leads to a state that satisfies . A condition with both parts is called an inductive invariant §19.2.4.
The proof carries over from to the real system under one condition: every execution of corresponds to an execution of . Correspond means that a stated mapping takes each real state to the model state it represents, and that the mapped sequence, with consecutive repeats of one model state merged, is an execution of ; the merging allows for real steps that change nothing the model records. may allow more executions than , which can make the proof harder or impossible but never wrong; it must not allow fewer. An omitted behavior breaks the carry-over exactly when can perform an execution that contains the behavior and corresponds to no execution of . The property then fails in if such an execution also violates .
A liveness proof usually needs extra assumptions in the model, such as fairness: a step that stays possible is eventually taken. Those assumptions are part of the model, so they too must hold for the real system.
Limits and common mistakes
A model can be internally correct and describe the wrong system. A proof and a model checking §3.30 run both reason about the model; neither compares the model with the real hardware. That comparison rests on datasheets, standards and experiments, and it is where omitted behavior hides.
Leaving a behavior out is legitimate when the claim says so. “Recovery always finds a valid record, assuming no reset or power failure interrupts a commit” is a true claim about the single-copy device above. The same sentence without the assumption is false. An unstated omission is not evidence of anything.
Hidden indivisibility is the most common mistake. Every step the model treats as indivisible must be indivisible on the real system, or be made so by a mechanism: an atomic operation of the processor, a lock, interrupts §6.11 disabled for the duration, or a commit protocol such as the two-copy record above.
The compiler and the processor belong to the environment. Both may reorder memory accesses whenever a single thread cannot tell the difference, and another thread or an interrupt handler §6.12 can then observe the accesses in an unexpected order. A model of concurrent code that assumes accesses happen in program order needs the ordering rules of the programming language and of the processor to justify that assumption.
Questions answered
Which omitted environmental behavior could invalidate a proof?
Any behavior that the real environment can produce and the model leaves out defeats the proof’s claim about the real system when some real execution containing that behavior violates the proved property; the proof itself stays correct for the model. A proof about a system model, the precise description of components, state, steps and environment that the proof reasons about, covers only the executions that model allows; a real execution outside them is simply not covered. The behaviors most often left out are these:
a reset or power loss in the middle of a multi-step operation, which leaves storage half-written (a torn write §8.19) or variables half-updated;
storage faults: bits that flip, flash memory that wears out, an erased area that reads as all ones;
messages that are lost, duplicated, delayed without bound, reordered or changed, or forged and replayed by an attacker;
concurrency §9.1: an interrupt handler or another thread that runs between two steps the proof treated as one;
reordering of memory accesses by the compiler or the processor;
timing: clocks that drift, timeouts §9.34 that fire early or late, a delay bound that does not hold;
exhausted resources: memory, stack, storage space, or a counter that wraps around to zero;
a component the proof assumed correct that misbehaves, such as a faulty library or faulty hardware.
For each behavior, ask whether an execution that includes it can violate the property: for a safety property, by reaching a bad state; for a liveness property, by postponing the good event forever. If none can, leaving it out is harmless. If one can, there are three honest responses: add the behavior to the model and redo the proof; add a mechanism that rules the behavior out or makes it harmless, such as a two-copy record that survives a reset; or state the exclusion as a named assumption, so that the claim no longer covers that case.
Related entries: Threat model (§1.2), Fault model (§1.30), Concrete state (§3.5), Safety property (§1.11), Liveness property (§1.12), Assumption versus guarantee (§1.36), Torn write (§8.19). Further reading: [232].