Exp :: = Z | Atom | Exp + Exp | Exp * Exp | Exp - Exp | -Exp
Also we define a map
expval : Exp x (Atom -> Z) --> Z
BExp :: = Bool | BExp and BExp | BExp or BExp |
| not BExp | Exp < Exp | Exp = Exp
Where Bool is a standard two-element type. Boolean analog of expval is also defined in this theory:
bexpval : BExp x (Atom -> Z) --> Z
C :: = skip | C ; C | Atom := Exp | if BExp then C else C fi |
| while BExp do C od
Conf := C x (Atom -> Z)
And the basic function is a function that maps any configuration into the successor:
next : Conf -> Conf
It is not absolutely obvious which configuration I consider the successor. Please, refer to the library for the definition.
If next is already given we can define operator nth as a simple iteration of next:
nth : Conf x Z -> Conf
Finally, configuration cf evolves to memory m if for some natural number n:
nth(cf, n) = <skip, m'>
Reader will find lots of theorems in transition theory. Most of them are proven in order to use in hoare theory. But theorem evolves_inv has independent value - it states that any configuration cannot evolve to more than one final state of memory. Proof of this theorem is rather trivial and is based on the fact that for any mamory m, <skip, m> is a fixed point for operator next.
References: