theory utp_rel_opsem imports
utp_rel_laws
utp_hoare begin
text‹ This theory uses the laws of relational calculus to create a basic operational semantics.
It is based on Chapter 10 of the UTP book~cite‹"Hoare&98"›. ›
lemma seq_skip_trel: "(σ, II ;; P) →u (σ, P)" by simp
lemma nondet_left_trel: "(σ, P ⊓ Q) →u (σ, P)" by (metis (no_types, opaque_lifting) disj_comm disj_upred_def semilattice_sup_class.sup.absorb_iff1 semilattice_sup_class.sup.left_idem seqr_or_distr trel.simps)
lemma nondet_right_trel: "(σ, P ⊓ Q) →u (σ, Q)" by (simp add: seqr_mono)
lemma rcond_true_trel: assumes"σ † b = true" shows"(σ, P ◃ b ▹r Q) →u (σ, P)" using assms by (simp add: assigns_r_comp usubst alpha cond_unit_T)
lemma rcond_false_trel: assumes"σ † b = false" shows"(σ, P ◃ b ▹r Q) →u (σ, Q)" using assms by (simp add: assigns_r_comp usubst alpha cond_unit_F)
lemma while_true_trel: assumes"σ † b = true" shows"(σ, while b do P od) →u (σ, P ;; while b do P od)" by (metis assms rcond_true_trel while_unfold)
lemma while_false_trel: assumes"σ † b = false" shows"(σ, while b do P od) →u (σ, II)" by (metis assms rcond_false_trel while_unfold)
text‹ Theorem linking Hoare calculus and operational semantics. If we start $Q$ in a state $\sigma_0$
satisfying $p$, and $Q$ reaches final state $\sigma_1$ then $r$ holds in this final state. ›
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.