logic verification programming-languages
Definition
Operational Semantics
Types
Structural Operational Semantics (SOS)
Definition
Link to originalStructural 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 .
Natural Semantics
Definition
Link to originalNatural Semantics
Natural semantics (also known as big-step semantics) describes the overall result of executing a statement in its entirety, rather than the individual steps. A transition is written as:
This indicates that executing the program fragment starting in state results in the final state .
Comparison
| Feature | Small-step (SOS) | Big-step (Natural) |
|---|---|---|
| Granularity | Detailed (individual steps) | Abstract (final result) |
| Non-termination | Explicitly represented by infinite chains | Cannot easily distinguish from divergence |
| Complexity | Higher (requires tracking intermediate states) | Lower (more direct) |
Relation to Hoare Calculus
The Hoare calculus provides an axiomatic semantics, which abstracts away from the specific execution steps defined by operational semantics and focuses instead on assertions about the state.