Theory KPL_execution_thread
section ‹Execution rules for threads›
theory KPL_execution_thread imports
KPL_state
begin
text ‹Evaluate a local expression down to a word›
fun eval_word :: "local_expr ⇒ thread_state ⇒ word"
where
"eval_word (Loc (Var v)) τ = l τ (Inl v)"
| "eval_word Lid τ = l τ LID"
| "eval_word Gid τ = l τ GID"
| "eval_word eTrue τ = 1"
| "eval_word (e1 ∧* e2) τ =
(eval_word e1 τ * eval_word e2 τ)"
| "eval_word (¬* e) τ = (if eval_word e τ = 0 then 1 else 0)"
text ‹Evaluate a local expression down to a boolean›
fun eval_bool :: "local_expr ⇒ thread_state ⇒ bool"
where
"eval_bool e τ = (eval_word e τ ≠ 0)"
text ‹Abstraction level: none, equality abstraction, or adversarial abstraction›