Theory ProcState

Up to index of Isabelle/HOL/Jinja/HRB-Slicing

theory ProcState
imports Com
header {* \isaheader{The state} *}

theory ProcState imports Com begin

fun "interpret" :: "expr => (vname \<rightharpoonup> val) => val option"
where Val: "interpret (Val v) cf = Some v"
| Var: "interpret (Var V) cf = cf V"
| BinOp: "interpret (e1«bop»e2) cf =
(case interpret e1 cf of None => None
| Some v1 => (case interpret e2 cf of None => None
| Some v2 => (
case binop bop v1 v2 of None => None | Some v => Some v)))"



abbreviation update :: "(vname \<rightharpoonup> val) => vname => expr => (vname \<rightharpoonup> val)"
where "update cf V e ≡ cf(V:=(interpret e cf))"

abbreviation state_check :: "(vname \<rightharpoonup> val) => expr => val option => bool"
where "state_check cf b v ≡ (interpret b cf = v)"

end