Web Portfolio
IMP is a tiny imperative language specially designed for giving a formal description on execution of a program: Operational Semantics.
Input commands and an initial state then press run to see the derivation tree (based on big-step semantics).
a
::= (arithmetic expression)
n
(integer number)X
(variable)a + a
(add)a * a
(times)b
::= (boolean expression)
true
false
a <= a
(less than or equals to)not b
(not)b & b
(logical and)c
::= (command(s))
skip
(skip)X := a
(update)if b then c else c
(if)while b do c
(while)c; c
(sequence)s
::= (state)
{X -> n, ..., X -> n}
(map from variable to int)Program
::= (program as a whole)
<c, s>
This interpreter may contains bugs.