Relate concrete service steps to an abstract contract
Define an explicit state mapping, account for internal stuttering steps, and separate safety simulation from progress preservation and observable responses.
On this page
The question for today
What you’ll understand
- Map durable concrete state to a declared abstract variable.
- Classify concrete steps as abstract transitions or stuttering.
- Explain why observable responses, auxiliary state, and liveness may require additional refinement obligations.
A useful abstract contract can describe a committed counter with one atomic increment, while the service performs staging, logging, replication, application, and response delivery. Refinement connects those descriptions through an explicit interpretation of concrete state. The mapping is an engineering commitment: it says which internal facts count as the promised abstract effect. Choosing a convenient mapping without checking every concrete transition can hide premature acknowledgement, duplicate effects, or recovery behavior that the contract forbids.
Declare which observations the abstraction preserves
Suppose concrete state contains staged requests and a durable set D of committed logical identifiers, each associated with one immutable increment amount. An abstract counter can be the sum of amounts for identifiers in D. Staging packets and retransmitting them leave that sum unchanged; recording a new committed identifier changes it once. This definition relies on durable membership and payload uniqueness, not on the number of received packets. A bag of duplicate log records cannot be substituted for a set of unique committed effects without another invariant explaining their interpretation.
The abstract observation set limits the conclusion. If the abstraction includes only the counter, sending a response may leave abstract state unchanged. That can support a counter-state argument but cannot alone establish that responses have correct contents or timing. If client-visible replies are part of the contract, include their relevant history or state and map them too. Likewise a durable record that can disappear after an allowed restart may not justify a permanent abstract commitment. Specify recovery and the evidence that the chosen durable boundary actually preserves the mapped fact.
Check the mapping on initialization and every allowed step
First show that each concrete initial state maps to an abstract initial state. Then show that every concrete step from the maintained concrete invariant maps either to an allowed abstract step or to no change in the abstract variables. The latter is stuttering: an internal implementation step makes no difference at this abstraction level. The concrete invariant may be essential to the simulation argument, because arbitrary malformed concrete states can map to impossible abstract transitions. Check message delivery, duplicate handling, recovery, and exceptional responses rather than proving only the happy-path commit case.
One source-level function of current state is not always enough for a convenient refinement proof. Auxiliary history can retain information that the implementation discarded, and prophecy-style constructions can help relate nondeterministic choices whose justification depends on later behavior. Such variables need their own sound introduction rules; they must not constrain implementation behavior merely to make a proof pass. For practical review, start with a clear mapping and state exactly which invariant and observable traces it preserves before introducing more sophisticated machinery.
Internal activity cannot silently replace required progress
A concrete machine may perform internal retries forever while its abstract counter never changes. Every concrete step could then satisfy the stuttering branch of the safety simulation, yet an abstract promise of eventual commitment would fail. Prove that the concrete progress assumptions imply the abstract progress requirements; a safety mapping does not supply this automatically. Similar care is needed when a response action is abstractly visible: calling it stuttering by omitting the response variable weakens the specification rather than proving the original client contract.
The quadratic instrument illustrates a many-to-one observation map. Reset, set a=1 and x=1, predict y=1, then Play or Step. Separately Reset, set a=1 and x=−1, predict y=1 again, then Play or Step. Distinct input states can have the same chosen output observation, while tangent slopes and signed areas differ. The instrument is only y=ax² and does not implement service refinement, history variables, or temporal proofs. It makes the narrower point that an abstraction can deliberately forget distinctions, so the preserved observations must be named.
Work it through
Classify a staged increment under a counter-only mapping
The durable committed set sums to ten units. A fresh request r proposes an increment of three. The concrete system stages r, durably adds r once to the committed set, and sends its response. The abstract state in this example contains only the committed counter. Calculate the mapping after each step.
Staging changes pending concrete state but not durable D, so h remains ten. This step is abstract stuttering for the declared counter-only observation.
Durably adding fresh r changes the sum to 10+3=13. This step must match an allowed abstract increment of three, with uniqueness preventing a second addition on retry.
Sending the response leaves the mapped counter at thirteen. It is stuttering only for this counter-only abstraction; a contract that observes replies needs a corresponding response transition or mapped response state.
The mapped counter sequence is 10,10,13,13. That sequence illustrates a safety mapping but does not prove response correctness, durability, or eventual commitment by itself.
The living notebook
Explore the model
Interactive lab · function
An observation map can merge different internal states
Reset, set a=1 and x=1, predict y=1, then Play or Step. Separately Reset, set a=1 and x=−1, predict y=1, then Play or Step. The fixed quadratic maps both inputs to one output, although other readouts differ. This is an illustration of information loss, not a refinement checker or an arbitrary abstraction engine.
- y at chosen x
- 0.608
- Tangent slope · 2ax
- 1.35
- Signed area · ax³/3
- 0.182
This lab uses only y = ax². Playback traces the curve within the fixed integration interval from 0 to x; it does not estimate numerical error or change the chosen point. Parameter changes pause playback and recompute the model at the current elapsed time. Reset restores both parameters and returns time to zero. Playback starts paused. Adjust either parameter, then choose Play or Step.
Look forA refinement conclusion is scoped to the observations the mapping actually preserves.
Pause & reason
Check your understanding
Your turn
Try it yourself
A counter-only abstraction maps durable committed identifiers with amounts two, five, and five to their sum. The last two amounts belong to different identifiers. An incoming duplicate packet repeats the first identifier. Find the abstract value before and after receiving the duplicate, and explain why summing packets would be wrong.
Take a moment to make a prediction or work it out on paper. Open a hint when you need one.
Give me a hint
The mapping counts unique committed logical identifiers, not equal amounts and not transport arrivals.
Compare with the solution
The abstract value is 2+5+5=12 before and after the duplicate packet. Distinct identifiers can legitimately carry equal amounts; a repeated packet for the same identifier must not add another two. Summing arrivals would produce fourteen and confuse communication duplication with a new committed effect. The implementation still needs an invariant enforcing the unique durable interpretation.
Keep the idea
Take it with you
- A refinement mapping names the concrete facts that represent abstract observations.
- Initialization and every concrete action need a justified abstract-step or stuttering interpretation.
- Responses and progress cannot be proved by leaving them out of the abstraction.
Read further
Original sources and deeper explanations to follow at your own pace.
Optional progress, saved in this browser when available. Revisit any lesson at any time.
Lesson not marked complete.