Small-Step Semantics

We define a transition system with configurations where is a program (for example a SIMP program) and is a store (memory) represented by a partial function from locations to integers.

Notation: denotes the function that coincides with except that it associated to the value , more precisely:

The transition relation -> on configurations is inductively defined by the axioms and rules:

  • the expression has the value in the memory state if
  • the command has a successful execution in the memory state if . We say that in produces .
Link to original

Small-Step Semantics for Expressions

Below are the definitions for SIMP expressions using small-step semantics.

Example: Let be a state such that and let . The expression evaluates to in , since This is shown as follows:

Small-Step Semantics for Commands

Below are the definitions for SIMP commands using small-step semantics.

Example: Let be the program and (a state such that ). There is a sequence of transitions:

Remarks

There are no axiom or rules for programs of the form:

  • where is an integer
  • where is a boolean
  • where

These are terminal configurations. In the case of where we say that the program is blocked.

Compared with the abstract machine:

  1. Each transition here is doing a part of the computation that leads to the result, whereas some of the transitions of the machine were only manipulating syntax.
  2. Though to show a sequence of reductions is valid, we need a proof.

Determinism

Small-step semantics are deterministic. Given a configuration there is a unique sequence of transitions from with maximal length. This is called the evaluation sequence for . It may be finite.