Definition. Abstract strongest postcondition [005e]
- December 22, 2025
Definition. Abstract strongest postcondition [005e]
- December 22, 2025
1. The idea
- December 22, 2025
1. The idea
- December 22, 2025
Our usual strongest postcondition can be understood as a mapping from a concrete domain to a concrete domain, i.e.
\[ \begin {align} \texttt {sp} : \texttt {Stmt} \times \texttt {C} \to C \end {align} \]Where \(C\) represents our concrete domain, in the world of program logic this is typically assertions on the state of some memory environment. The idea behind the abstract \(\texttt {sp}\), is that we have a function
\[ \begin {align} \texttt {sp}^\# : \texttt {Stmt} \times \texttt {A} \to \texttt {A} \end {align} \]In other words we are considering the strongest postcondition from within the abstract domain. Intuitively this just means that our predicates or assertions on the memory states (or equivalently the set of states we characterize) will be expressed in abstract terms.
2. In more detail
- December 22, 2025
2. In more detail
- December 22, 2025
The abstract strongest postcondition, denoted \(\texttt {sp}^\#\) or \(\textrm {post\#}\) is defined as
\[ \texttt {sp}^\# (s, a) = \alpha (\texttt {sp}(s, \gamma (a))) \]Let's explain a bit on how we can derive this, we begin with the idea that for each \(a \in A\) and each statement \(s\) we want:
\[ \texttt {sp}(s, \gamma (a)) \subseteq \gamma (\texttt {sp}^\#(s, a)) \]This expresses soundness in other words, the resulting set of states, generated by concretizing the abstraction \(a\) must be contained within the prediction of the abstract transformer predicate \(\texttt {sp}^\#\). Then using the Galois connection we have between \(\alpha \) and \(\gamma \)
\[ \forall a \in A, c \in C.\ \alpha (c) \subseteq a \iff c \leq \gamma (a) \]which expresses the notion that \(c\) is approximated by \(a\). We can rewrite our earlier soundness condition as:
\[ \alpha (\texttt {sp}(s, \gamma (a))) \sqsubseteq \texttt {sp}^\# (s, a) \]two again denote the same conceptual thing that our abstract predicate transformer \(\texttt {sp}^\#\) is an over-approximation of the analogous transformer for the concrete domain. As we would preferably like to have the most precise approximation we choose equality. Or stated differently by definition the most precise abstracted approximation of the strongest post-condition we can have for some abstracted state is literally just this state concretized, and the resulting set abstracted.
\[ \texttt {sp}^\# (s, a) = \alpha (\texttt {sp}(s, \gamma (a))) \]
3. Correctness
- December 22, 2025
3. Correctness
- December 22, 2025
The most important property to remember about the abstract strongest post-condition is that if we do over-approximate an error state it does not allow us to conclude that the program is wrong.