program-proofing

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

Deterministic 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 .

Link to original

Nondeterministic

Definition

Nondeterministic 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 .

Link to original

Examples

Skip

The skip statement leaves the state unchanged.

Abort

The abort statement 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