Definition
Program Transition
A program transition is a relation that describes a single computation step of a program. It maps a non-final program configuration to its successor configuration.
Formally, the transition relation is
where the left-hand side is a non-final configuration and the right-hand side is either a final or a non-final configuration.
Determinism
Deterministic
Definition
Link to originalDeterministic Program Transition
A deterministic program transition is a program transition relation in which every non-final program configuration has at most one successor configuration.
Formally, for every non-final configuration , if
then .
Nondeterministic
Definition
Link to originalNondeterministic Program Transition
An noneterministic program transition is a program transition relation in which some non-final program configurations may have more than one successor configuration.
Formally, there exists a non-final configuration such that
for distinct configurations .
Examples
Skip
The
skipstatement leaves the state unchanged.
Abort
The
abortstatement has no successor configuration.
Sequencing
If the first command takes one step, then the whole sequence takes one step by advancing to the second command.
This is a typical rule of deterministic program transition in small-step operational semantics.
If takes one step to , then takes one step to .
Conditional
For the conditional, the executed branch depends on the value of in the current state.
While
If the condition is false, the loop does nothing.
Otherwise, execute the body once and continue with the loop.
Assignment
An assignment updates only the assigned variable and keeps all other variables unchanged.
where