Small-Step Semantics and Evaluation Order
Specify a one-step reduction relation and use evaluation contexts to make the order of computation explicit.
- Source
- Anbloq
- Language
- English
- Created
- Updated
- Chapters
- 2
- Reading time
- 1 min
In this article2 chapters
Separate the redex from its location
A reduction rule computes one local piece, such as adding two integer literals. An evaluation context selects where that rule may apply next. In left-to-right call by value, evaluate the function position, then the argument, then substitute the argument value into the body. For \((\lambda x.x+1)\,(2+3)\), the steps first obtain argument \(5\), then expression \(5+1\), then value \(6\).
The step sequence exposes effects and divergence
Two pure arguments may produce the same final value in either evaluation order, while two expressions writing to an output log reveal that order. An infinite computation appears as an infinite sequence of steps. A stuck computation has no next step and has not reached a value. Progress and preservation rule out certain stuck states in well-typed terms. Big-step semantics summarizes terminating evaluations by a direct judgment.[1][2]