|
|
|
|
|
by fadmmatt
5950 days ago
|
|
If you're wondering what things like "operational" and "denotational" mean and what they look like in code, I created this article for my compilers students: http://matt.might.net/articles/writing-an-interpreter-substi... Short version: * A denotational semantics is a function M : Program -> (Value -> Value) that maps a program to a mathematical function. * An operational semantics is a relation (=>) between consecutive machine states. That is, if state => state' holds, then the machine transitions from state to state'. * The relation in a "big-step" operational semantics need not be decidable. Big-step relations are usually recursive. * The relation in a "small-step" operational semantics must be decidable. * When you implement a transition relation, =>, it's usually implemented as a function. That is, if you have a relation R \subseteq State x State, you can encode this as a "transfer function" f : State -> 2^State. |
|
* Can you convert a denotational semantics to an operational semantics (and vice versa)? Is there any value in doing this?