A representation invariant specifies which concrete storage states are valid at the API boundary. Construction must establish it, and each completed operation must preserve it. Internal steps may temporarily violate it only while that state is inaccessible to observers; callbacks or concurrent access would require further reasoning.[ref]
Reading 13: Abstraction Functions & Rep Invariants. Reading 13, How to Establish Invariants: creation, preservation and absence of representation exposure
The short proof pattern is mathematical induction on the number of completed calls: the initial state satisfies ; every permitted transition from an -state ends in an -state; hence every state observable through the API satisfies . An unrestricted external write falls outside this argument.
Articles by others on the same topic
There are currently no matching articles.