logic verification programming-languages

Definition

Operational Semantics

Operational semantics describe the meaning of a program by specifying how it executes on an abstract machine. It defines the transitions between states of the computation.

Types

Structural Operational Semantics (SOS)

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 .

Link to original

Natural Semantics

Definition

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

Link to original

Comparison

FeatureSmall-step (SOS)Big-step (Natural)
GranularityDetailed (individual steps)Abstract (final result)
Non-terminationExplicitly represented by infinite chainsCannot easily distinguish from divergence
ComplexityHigher (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.