Implementing Operational Semantics (While Statement)
⟨S, s⟩ → s' ⟨while b S, s'⟩ → s''
----------------------------------------- if B⟦b⟧(s) = true ------------------------- if B⟦b⟧(s) = false
⟨while b S, s⟩ → s' ⟨while b S, s⟩ → s
let rec execute : cmd -> state -> state
= fun c s -> match c with
| ...
| If (b, c1, c2) -> if eval b s then execute c1 s else execute c2 s
| While (b, c) -> if eval b s then execute (While (b,c)) (execute c s) else s
| ...