We present a shallow embedding of the weakest precondition semantics for a program refinement language. We use the Isabelle/ZF
theorem prover for untyped set theory, and statements in our refinement language are represented as set transformers. Our
representation is significant in making use of the expressiveness of Isabelle/ZF’s set theory to represent states as dependently-typed
functions from variable names to their values. This lets us give a uniform treatment of statements such as variable assignment,
framed specification statements, local blocks, and parameterisation. ZF set theory requires set comprehensions to be explicitly
bounded. This requirement propagates to the definitions of statements in our refinement language, which have operands for
the state type. We reduce the syntactic burden of repeatedly writing the state type by using Isabelle’s meta-logic to define
a lifted set transformer language which implicitly passes the state type to statements.