Definition
Structural Operational Semantics
Structural Operational Semantics (also known as small-step semantics) describes the execution of a program as a sequence of individual computation steps. A single transition is typically written as:
where is the remaining program fragment to be executed, is the current state, and the arrow represents a single atomic transition to a new program and state .
Small vs Big Step
Both structural operational semantics and natural semantics are operational semantics, since they model program execution as a sequence of computation steps.
Structural Operational Semantics
- close to the real machine model, since it represents individual computation steps
- captures low-level details such as interleaving, divergence, and program aborts
- useful when the execution path itself matters
Natural Semantics
- more abstract than SOS: it omits intermediate states and transition chains
- focuses on the final result of execution rather than the steps taken to reach it
- usually simpler to use because the definition is more compact
Examples
SIMPLE rules
The SOS of
SIMPLE(ℤ)includes the following transition rules:
Skip
Assignment
where
Sequencing
Conditional
While