(*>*) section‹ ``Next step'' implication ala Abadi and Merz (and Lamport)\label{sec:abadi_merz} ›
text‹
was apparently well-known in the mid-1990s (see, e.g., 🍋‹‹\S4› in "XuCauCollette:1994"› and
references therein), Heyting implication is inadequate for a
refinement story. (We show it is strong enough for a
assume/guarantee program logic; see
S\ref{sec:abadi_plotkin}, \S\ref{sec:refinement-ag} and
S\ref{sec:abadi_plotkin-parallel}. In our setting it fails to
(at least) because the composition theorem for Heyting
(\S\ref{sec:abadi_plotkin}) is not termination sensitive.)
therefore follow 🍋‹"AbadiLamport:1995"› by developing a stronger implication ‹P \⟶+ Q› with the intuitive semantics that the consequent ‹Q› holds for at least one
beyond the antecedent ‹P›. This is some kind of step indexing.
we sketch the relevant parts of 🍋‹"AbadiMerz:1995"
"AbadiMerz:1996"›, the latter of which has a fuller story,
a formal account of the logical core of TLA and the
implicit) observation that infinitary parallel composition poses no
for safety properties (see the comments under Theorem~5.2 and \S5.5). 🍋‹"AbadiLamport:1995" and "XuCauCollette:1994" and
CauCollette:1996"› provide further background; 🍋‹‹Appendix~B› in
JonssonTsay:1996"› provide a more syntactic account.
:
▪ The hypothesis ‹P› is always a safety property here
▪ TLA does not label transitions or have termination markers
▪ Abadi/Cau/Collette/Lamport/Merz/Xu/... avoid naming this operator
references:
▪ 🍋‹"Maier:2001"›
›
definition"next_imp" :: "'a::preorder set ==> 'a set ==> 'a set"where ―‹🍋‹‹\S2› in "AbadiMerz:1995"›› "next_imp P Q = {σ. ∀σ'≤σ. (∀σ''<σ'. σ'' ∈ P) ⟶ σ' ∈ Q}"
setup‹Sign.mandatory_path "next_imp"›
lemma downwards_closed: assumes"P ∈ downwards.closed" shows"next_imp P Q ∈ downwards.closed" unfolding next_imp_def by (blast elim: downwards.clE intro: order_trans)
lemma mono: assumes"x' ≤ x" assumes"y ≤ y'" shows"next_imp x y ≤ next_imp x' y'" unfolding next_imp_def using assms by fast
lemma strengthen[strg]: assumes"st_ord (¬ F) X X'" assumes"st_ord F Y Y'" shows"st_ord F (next_imp X Y) (next_imp X' Y')" using assms by (cases F) (auto simp: next_imp.mono)
lemma minimal: assumes"trace.T s xs v ∈ next_imp P Q" shows"trace.T s [] None ∈ Q" using assms by (simp add: next_imp_def trace.less trace.less_eq_None)
lemma alt_def: ―‹ This definition coincides with 🍋‹"CauCollette:1996"›, 🍋‹‹\S3.5.3› in "AbadiLamport:1995"›› assumes"P ∈ downwards.closed" shows"next_imp P Q = {σ. trace.T (trace.init σ) [] None ∈ Q ∧ (∀i. trace.take i σ ∈ P ⟶ trace.take (Suc i) σ ∈ Q)}" (is"?lhs = ?rhs") proof(rule antisym) have"trace.take (Suc i) (trace.T s xs v) ∈ Q" if"trace.T s xs v ∈ ?lhs"and"trace.take i (trace.T s xs v) ∈ P" for s xs v i using that ‹P ∈ downwards.closed› by (force simp: next_imp_def trace.less_take_less_eq
dest: spec[where x="trace.take (Suc i) (trace.T s xs v)"]
elim: downwards.closed_in) thenshow"?lhs ⊆ ?rhs" by (clarsimp simp: trace.split_all next_imp.minimal) next have"trace.T s xs v ∈ ?lhs" if minimal: "trace.T s [] None ∈ Q" and imp: "∀i. trace.take i (trace.T s xs v) ∈ P ⟶ trace.take (Suc i) (trace.T s xs v) ∈ Q" for s xs v proof - have"trace.take i (trace.T s xs v) ∈ Q" if"∀σ''<trace.take i (trace.T s xs v). σ'' ∈ P" for i using that proof(induct i) case (Suc i) with imp show ?case by (metis le_add2 order_le_less plus_1_eq_Suc trace.take.mono) qed (simp add: minimal) thenshow"trace.T s xs v ∈ ?lhs" by (clarsimp simp: next_imp_def trace.less_eq_take_def) qed thenshow"?rhs ⊆ ?lhs" by (clarsimp simp: trace.split_all next_imp.minimal) qed
text‹
🍋‹‹\S3.5.3› in "AbadiLamport:1995"› assert but do not prove the following connection with
implication. 🍋‹"AbadiMerz:1995"› do. See also 🍋‹‹\S5.3 and \S5.5› in "AbadiMerz:1996"›.
›
lemma Abadi_Merz_Prop_1_subseteq: ―‹ First half of 🍋‹‹Proposition~1› in "AbadiMerz:1995"›› fixes P :: "'a::preorder set" assumes"P ∈ downwards.closed" assumes wf: "wfP ((<) :: 'a relp)" shows"next_imp P Q ⊆ downwards.imp (downwards.imp Q P) Q" (is"?lhs ⊆ ?rhs") proof(rule subsetI) fix σ assume"σ ∈ ?lhs"with wf show"σ ∈ ?rhs" proof(induct rule: wfp_induct_rule) case (less σ) have"τ ∈ Q"if"τ ≤ σ"and YYY: "∀σ'≤τ. σ' ∈ Q ⟶ σ' ∈ P"for τ proof - have"ρ ∈ P"if"ρ < τ"for ρ proof - from‹ρ < \τ›‹τ ≤ σ›‹P ∈ downwards.closed›have"ρ ∈ next_imp P Q" by (meson downwards.closed_in next_imp.downwards_closed less.prems less_imp_le) with‹ρ < \τ›‹τ ≤ σ›have"ρ ∈ downwards.imp (downwards.imp Q P) Q" using less.hyps less_le_trans by blast moreoverfrom‹ρ < \τ› YYY have"ρ ∈ downwards.imp Q P" by (simp add: downwards.imp_def) (meson order.trans order_less_imp_le) ultimatelyshow ?thesis by (meson downwards.imp_mp') qed with that less.prems show ?thesis unfolding next_imp_def by blast qed thenshow ?case unfolding downwards.imp_def by blast qed qed
text‹
converse holds if either ‹Q› is a safety property or the order is partial.
›
lemma Abadi_Merz_Prop1: ―‹🍋‹‹Proposition~1› in "AbadiMerz:1995"› and 🍋‹‹Proposition~5.2› in "AbadiMerz:1996"›› fixes P :: "'a::preorder set" assumes"P ∈ downwards.closed" assumes"Q ∈ downwards.closed" assumes wf: "wfP ((<) :: 'a relp)" shows"next_imp P Q = downwards.imp (downwards.imp Q P) Q" (is"?lhs = ?rhs") proof(rule antisym[OF next_imp.Abadi_Merz_Prop_1_subseteq[OF assms(1,3)]]) from‹Q ∈ downwards.closed›show"?rhs ⊆ ?lhs" by (auto simp: next_imp_def downwards.imp_def order.strict_iff_not dest: downwards.closed_in) qed
lemma Abadi_Lamport_Lemma6: ―‹🍋‹‹Lemma~6› in "AbadiLamport:1995"› (no proof given there) › fixes P :: "'a::order set" assumes"P ∈ downwards.closed" assumes wf: "wfP ((<) :: 'a relp)" shows"next_imp P Q = downwards.imp (downwards.imp Q P) Q" (is"?lhs = ?rhs") proof(rule Set.equalityI[OF next_imp.Abadi_Merz_Prop_1_subseteq[OF assms]]) show"?rhs ⊆ ?lhs" unfolding next_imp_def downwards.imp_def by (fastforce simp: le_less elim: downwards.closed_in) qed
lemma strengthen[strg]: assumes"st_ord (¬ F) X X'" assumes"st_ord F Y Y'" shows"st_ord F (X \<longrightarrow>+ Y) (X' \<longrightarrow>+ Y')" using assms by (cases F) (auto simp: spec.next_imp.mono)
lemma trans: shows"(P \<longrightarrow>+ Q) ⊓ (Q \<longrightarrow>+ R) ≤ P \<longrightarrow>+ R" by (meson order.trans Heyting.heyting spec.next_imp.heytingL spec.next_imp.heyting_le)
lemma rev_trans: shows"(Q \<longrightarrow>+ R) ⊓ (P \<longrightarrow>+ Q) ≤ P \<longrightarrow>+ R" by (simp add: inf.commute spec.next_imp.trans)
lemma assumes"x' ≤ x" shows discharge_leL: "x' ⊓ (x \<longrightarrow>+ y) = x' ⊓ y" (is ?thesis1) and discharge_leR: "(x \<longrightarrow>+ y) ⊓ x' = y ⊓ x'" (is ?thesis2) proof - from assms show ?thesis1 by (metis inf.absorb_iff2 inf_top.right_neutral spec.next_imp.discharge(4) spec.next_imp.topL) thenshow ?thesis2 by (simp add: ac_simps) qed
lemma invmap: shows"spec.invmap af sf vf (P \<longrightarrow>+ Q) = spec.invmap af sf vf P \<longrightarrow>+ spec.invmap af sf vf Q" by (simp add: spec.next_imp.heyting spec.invmap.heyting)
lemma Abadi_Lamport_Lemma7: assumes"Q ⊓ R ≤ P" shows"P \<longrightarrow>+ Q ≤ R \<longrightarrow>+ Q" by (simp add: assms spec.next_imp.heyting Heyting.heyting heyting.detachment(2) heyting.discharge(2))
setup‹Sign.parent_path›
setup‹Sign.mandatory_path "term"›
setup‹Sign.mandatory_path "none"›
lemma"next_imp": shows"spec.term.none (P \<longrightarrow>+ Q) ≤ spec.term.all P \<longrightarrow>+ spec.term.none Q" by (simp add: spec.next_imp.heyting order.trans[OF spec.term.none.heyting_le] spec.term.all.heyting)
setup‹Sign.parent_path›
setup‹Sign.mandatory_path "all"›
lemma"next_imp": shows"spec.term.all (P \<longrightarrow>+ Q) = spec.term.all P \<longrightarrow>+spec.term.all Q" by (simp add: spec.next_imp.heyting)
(metis spec.term.all.heyting spec.term.all_none spec.term.heyting_noneL_allR_mono spec.term.none_all)
setup‹Sign.parent_path›
setup‹Sign.mandatory_path "closed"›
lemma"next_imp": assumes"Q ∈ spec.term.closed _" shows"P \<longrightarrow>+ Q ∈ spec.term.closed _" using assms by (simp add: spec.next_imp.heyting spec.term.closed.heyting)
setup‹Sign.parent_path›
setup‹Sign.parent_path›
setup‹Sign.mandatory_path "pre"›
lemma next_imp_eq_heyting: assumes"spec.idle ≤ R" shows"Q ⊓ spec.pre P \<longrightarrow>+ R = spec.pre P \<longrightarrow>H (Q \<longrightarrow>+ R)" (is"?lhs = ?rhs") and"spec.pre P ⊓ Q \<longrightarrow>+ R = spec.pre P \<longrightarrow>H (Q \<longrightarrow>+ R)" (is ?thesis1) proof - show"?lhs = ?rhs" proof(rule antisym[OF _ spec.singleton_le_extI]) show"?lhs ≤ ?rhs" by (simp add: heyting spec.next_imp.discharge) show"(•σ•)≤ ?lhs"if"(•σ•)≤ ?rhs"for σ using assms that by (clarsimp simp: spec.singleton.next_imp_le_conv spec.singleton.heyting_le_conv
spec.singleton.le_conv)
(metis order.refl append_self_conv2 spec.singleton.idle_le_conv spec.singleton_le_ext_conv
trace.less(1) trace.less_eqE trace.steps'.simps(1) trace.t.sel(1)) qed thenshow ?thesis1 by (simp add: ac_simps) qed
setup‹Sign.parent_path›
setup‹Sign.parent_path›
subsection‹ Compositionality ala Abadi and Merz (and Lamport) \label{sec:abadi_merz-compositionality} ›
text‹
main theorem for this implication (🍋‹‹Theorem~4› in "AbadiMerz:1995"› and 🍋‹‹Corollary~5.1› in "AbadiMerz:1996"›)
how to do assumption/commitment proofs for TLA considered as an
logic. See also 🍋‹"CauCollette:1996"›.
›
setup‹Sign.mandatory_path "spec"›
lemma Abadi_Lamport_Lemma5: shows"(⊓i∈I. P i \<longrightarrow>+ Q i) ≤ (⊓i∈I. P i) \<longrightarrow>+ (⊓i∈I. Q i)" by (simp add: spec.next_imp.InfR INF_lower INF_superset_mono image_image spec.next_imp.mono)
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.