lemma validtI: "[∧s t. [Γ⊨⟨c,Normal s⟩==> t;s ∈ P;t ∉ Fault ` F]==> t ∈ Normal ` Q ∪ Abrupt ` A; ∧s. s ∈ P ==> Γ⊨ c↓(Normal s) ] ==> Γ⊨tF P c Q,A" by (auto simp add: validt_def valid_def)
lemma cvalidtI: "[∧s t. [∀(P,p,Q,A)∈Θ. Γ⊨tF P (Call p) Q,A;Γ⊨⟨c,Normal s⟩==> t;s ∈ P; t ∉ Fault ` F] ==> t ∈ Normal ` Q ∪ Abrupt ` A; ∧s. [∀(P,p,Q,A)∈Θ. Γ⊨tF P (Call p) Q,A; s∈P]==> Γ⊨c↓(Normal s)] ==> Γ,Θ⊨tF P c Q,A" by (auto simp add: cvalidt_def validt_def valid_def)
lemma cvalidt_postD: "[Γ,Θ⊨tF P c Q,A; ∀(P,p,Q,A)∈Θ. Γ⊨tF P (Call p) Q,A;Γ⊨⟨c,Normal s ⟩==> t; s ∈ P;t ∉ Fault ` F] ==> t ∈ Normal ` Q ∪ Abrupt ` A" by (simp add: cvalidt_def validt_def valid_def)
lemma cvalidt_termD: "[Γ,Θ⊨tF P c Q,A; ∀(P,p,Q,A)∈Θ. Γ⊨tF P (Call p) Q,A;s ∈ P] ==> Γ⊨c↓(Normal s)" by (simp add: cvalidt_def validt_def valid_def)
lemma validt_augment_Faults: assumes valid:"Γ⊨tF P c Q,A" assumes F': "F ⊆ F'" shows"Γ⊨tF' P c Q,A" using valid F' by (auto intro: valid_augment_Faults simp add: validt_def)
| Spec: "Γ,Θ⊨tF {s. (∀t. (s,t) ∈ r ⟶ t ∈ Q) ∧ (∃t. (s,t) ∈ r)} (Spec r) Q,A"
| Seq: "[Γ,Θ⊨tF P c1 R,A; Γ,Θ⊨tF R c2 Q,A] ==> Γ,Θ⊨tF P Seq c1 c2 Q,A"
| Cond: "[Γ,Θ⊨tF (P ∩ b) c1 Q,A; Γ,Θ⊨tF (P ∩ - b) c2 Q,A] ==> Γ,Θ⊨tF P (Cond b c1 c2) Q,A"
| While: "[wf r; ∀σ. Γ,Θ⊨tF ({σ} ∩ P ∩ b) c ({t. (t,σ)∈r} ∩ P),A] ==> Γ,Θ⊨tF P (While b c) (P ∩ - b),A"
| Guard: "Γ,Θ⊨tF (g ∩ P) c Q,A ==> Γ,Θ⊨tF (g ∩ P) Guard f g c Q,A"
| Guarantee: "[f ∈ F; Γ,Θ⊨tF (g ∩ P) c Q,A] ==> Γ,Θ⊨tF P (Guard f g c) Q,A"
| CallRec: "[(P,p,Q,A) ∈ Specs; wf r; Specs_wf = (λp σ. (λ(P,q,Q,A). (P ∩ {s. ((s,q),(σ,p)) ∈ r},q,Q,A)) ` Specs); ∀(P,p,Q,A)∈ Specs. p ∈ dom Γ ∧ (∀σ. Γ,Θ ∪ Specs_wf p σ⊨tF ({σ} ∩ P) (the (Γ p)) Q,A) ] ==> Γ,Θ⊨tF P (Call p) Q,A"
| DynCom: "∀s ∈ P. Γ,Θ⊨tF P (c s) Q,A ==> Γ,Θ⊨tF P (DynCom c) Q,A"
| Throw: "Γ,Θ⊨tF A Throw Q,A"
| Catch: "[Γ,Θ⊨tF P c1 Q,R; Γ,Θ⊨tF R c2 Q,A]==> Γ,Θ⊨tF P Catch c1 c2 Q,A"
| Conseq: "∀s ∈ P. ∃P' Q' A'. Γ,Θ⊨tF P' c Q',A' ∧ s ∈ P' ∧ Q' ⊆ Q ∧ A' ⊆ A ==> Γ,Θ⊨tF P c Q,A"
| Asm: "(P,p,Q,A) ∈ Θ ==> Γ,Θ⊨tF P (Call p) Q,A"
| ExFalso: "[Γ,Θ⊨tF P c Q,A; ¬ Γ⊨tF P c Q,A]==> Γ,Θ⊨tF P c Q,A"
― ‹This is a hack rule that enables us to derive completeness for
an arbitrary context ‹Θ›, from completeness for an empty context.›
text‹Does not work, because of rule ExFalso, the context ‹Θ› is to blame.
A weaker version with empty context can be derived from soundness
later on.› lemma hoaret_to_hoarep: assumes hoaret: "Γ,Θ⊨tF P p Q,A" shows"Γ,Θ⊨F P p Q,A" using hoaret proof (induct) case Skip thus ?caseby (rule hoarep.intros) next case Basic thus ?caseby (rule hoarep.intros) next case Seq thus ?caseby - (rule hoarep.intros) next case Cond thus ?caseby - (rule hoarep.intros) next case (While r Θ F P b c A) hence"∀σ. Γ,Θ⊨F ({σ} ∩ P ∩ b) c ({t. (t, σ) ∈ r} ∩ P),A" by iprover hence"Γ,Θ⊨F (P ∩ b) c P,A" by (rule HoarePartialDef.conseq) blast thenshow"Γ,Θ⊨F P While b c (P ∩ - b),A" by (rule hoarep.While) next case Guard thus ?caseby - (rule hoarep.intros) (*next case(CallRecAFPProcsQZ\<Theta>pr) hencehyp:"\<forall>p\<in>Procs.\<forall>\<tau>Z. \<Gamma>,\<Theta>\<union>(\<Union>q\<in>Procs.\<Union>Z.{(PqZ\<inter>{s.((s,q),\<tau>,p)\<in>r}, Callq,QqZ,AqZ)})\<turnstile>\<^bsub>/F\<^esub> ({\<tau>}\<inter>PpZ)(the(\<Gamma>p))(QpZ),(ApZ)" byblast have"\<forall>p\<in>Procs.\<forall>Z. \<Gamma>,\<Theta>\<union>(\<Union>q\<in>Procs.\<Union>Z.{(PqZ, Callq,QqZ,AqZ)})\<turnstile>\<^bsub>/F\<^esub> (PpZ)(the(\<Gamma>p))(QpZ),(ApZ)" proof(introballIallI) fixpZ assume"p\<in>Procs" withhyp havehyp':"\<And>\<tau>. \<Gamma>,\<Theta>\<union>(\<Union>q\<in>Procs.\<Union>Z.{(PqZ\<inter>{s.((s,q),\<tau>,p)\<in>r}, Callq,QqZ,AqZ)})\<turnstile>\<^bsub>/F\<^esub> ({\<tau>}\<inter>PpZ)(the(\<Gamma>p))(QpZ),(ApZ)" byblast have"\<forall>\<tau>. \<Gamma>,\<Theta>\<union>(\<Union>q\<in>Procs.\<Union>Z.{(PqZ, Callq,QqZ,AqZ)})\<turnstile>\<^bsub>/F\<^esub> ({\<tau>}\<inter>PpZ)(the(\<Gamma>p))(QpZ),(ApZ)" (is"\<forall>\<tau>.\<Gamma>,?\<Theta>'\<turnstile>\<^bsub>/F\<^esub>({\<tau>}\<inter>PpZ)(the(\<Gamma>p))(QpZ),(ApZ)") proof(ruleallI,ruleWeakenContext[OFhyp'],clarify) fix\<tau>P'cQ'A' assume"(P',c,Q',A')\<in>\<Theta>\<union> (\<Union>q\<in>Procs. \<Union>Z.{(PqZ\<inter>{s.((s,q),\<tau>,p)\<in>r}, Callq,QqZ, AqZ)})"(is"(P',c,Q',A')\<in>\<Theta>\<union>?Spec") thenshow"\<Gamma>,?\<Theta>'\<turnstile>\<^bsub>/F\<^esub>P'cQ',A'" proof(casesrule:UnE[consumes1]) assume"(P',c,Q',A')\<in>\<Theta>" thenshow?thesis by(blastintro:HoarePartialDef.Asm) next assume"(P',c,Q',A')\<in>?Spec" thenshow?thesis proof(clarify) fixqZ assumeq:"q\<in>Procs" show"\<Gamma>,?\<Theta>'\<turnstile>\<^bsub>/F\<^esub>(PqZ\<inter>{s.((s,q),\<tau>,p)\<in>r}) Callq (QqZ),(AqZ)" proof- fromq have"\<Gamma>,?\<Theta>'\<turnstile>\<^bsub>/F\<^esub>(PqZ)Callq(QqZ),(AqZ)" by-(ruleHoarePartialDef.Asm,blast) thus?thesis by(ruleHoarePartialDef.conseqPre)blast qed qed qed qed thenshow"\<Gamma>,\<Theta>\<union>(\<Union>q\<in>Procs.\<Union>Z.{(PqZ,Callq,QqZ,AqZ)}) \<turnstile>\<^bsub>/F\<^esub>(PpZ)(the(\<Gamma>p))(QpZ),(ApZ)" by(ruleHoarePartialDef.conseq)blast qed thus?case
by - (rule hoarep.CallRec)*) next case DynCom thus ?caseby (blast intro: hoarep.DynCom) next case Throw thus ?caseby - (rule hoarep.Throw) next case Catch thus ?caseby - (rule hoarep.Catch) next case Conseq thus ?caseby - (rule hoarep.Conseq,blast) next case Asm thus ?caseby (rule HoarePartialDef.Asm) next case (ExFalso Θ F P c Q A) assume"Γ,Θ⊨tF P c Q,A" hence"Γ,Θ⊨F P c Q,A" oops
lemma hoaret_augment_context: assumes deriv: "Γ,Θ⊨tF P p Q,A" shows"∧Θ'. Θ ⊆ Θ' ==> Γ,Θ'⊨tF P p Q,A" using deriv proof (induct) case (CallRec P p Q A Specs r Specs_wf Θ F Θ') have aug: "Θ ⊆ Θ'"by fact then have h: "∧τ p. Θ ∪ Specs_wf p τ ⊆ Θ' ∪ Specs_wf p τ" by blast have"∀(P,p,Q,A)∈Specs. p ∈ dom Γ ∧ (∀τ. Γ,Θ ∪ Specs_wf p τ⊨tF ({τ} ∩ P) (the (Γ p)) Q,A ∧ (∀x. Θ ∪ Specs_wf p τ ⊆ x ⟶ Γ,x⊨tF ({τ} ∩ P) (the (Γ p)) Q,A))"by fact hence"∀(P,p,Q,A)∈Specs. p ∈ dom Γ ∧ (∀τ. Γ,Θ'∪ Specs_wf p τ ⊨tF ({τ} ∩ P) (the (Γ p)) Q,A)" apply (clarify) apply (rename_tac P p Q A) apply (drule (1) bspec) apply (clarsimp) apply (erule_tac x=τ in allE) apply clarify apply (erule_tac x="Θ' ∪ Specs_wf p τ"in allE) apply (insert aug) apply auto done with CallRec show ?caseby - (rule hoaret.CallRec) next case DynCom thus ?caseby (blast intro: hoaret.DynCom) next case (Conseq P Θ F c Q A Θ') from Conseq have"∀s ∈ P. (∃P' Q' A'. (Γ,Θ' ⊨tF P' c Q',A') ∧ s ∈ P'∧ Q' ⊆ Q ∧ A' ⊆ A)" by blast with Conseq show ?caseby - (rule hoaret.Conseq) next case (ExFalso Θ F P c Q A Θ') have"Γ,Θ⊨tF P c Q,A""¬ Γ⊨tF P c Q,A""Θ ⊆ Θ'"by fact+ thenshow ?case by (fastforce intro: hoaret.ExFalso simp add: cvalidt_def) qed (blast intro: hoaret.intros)+
subsection‹Some Derived Rules›
lemma Conseq': "∀s. s ∈ P ⟶ (∃P' Q' A'. (∀ Z. Γ,Θ⊨tF (P' Z) c (Q' Z),(A' Z)) ∧ (∃Z. s ∈ P' Z ∧ (Q' Z ⊆ Q) ∧ (A' Z ⊆ A))) ==> Γ,Θ⊨tF P c Q,A" apply (rule Conseq) apply (rule ballI) apply (erule_tac x=s in allE) apply (clarify) apply (rule_tac x="P' Z"in exI) apply (rule_tac x="Q' Z"in exI) apply (rule_tac x="A' Z"in exI) apply blast done
lemma conseq:"[∀Z. Γ,Θ ⊨tF (P' Z) c (Q' Z),(A' Z); ∀s. s ∈ P ⟶ (∃ Z. s∈P' Z ∧ (Q' Z ⊆ Q)∧ (A' Z ⊆ A))] ==> Γ,Θ⊨tF P c Q,A" by (rule Conseq) blast
theorem conseqPrePost: "Γ,Θ⊨tF P' c Q',A' ==> P ⊆ P' ==> Q' ⊆ Q ==> A' ⊆ A ==> Γ,Θ⊨tF P c Q,A" by (rule conseq [where ?P'="λZ. P'"and ?Q'="λZ. Q'"]) auto
lemma conseqPre: "Γ,Θ⊨tF P' c Q,A ==> P ⊆ P' ==> Γ,Θ⊨tF P c Q,A" by (rule conseq) auto
lemma conseqPost: "Γ,Θ⊨tF P c Q',A'==> Q' ⊆ Q ==> A' ⊆ A ==> Γ,Θ⊨tF P c Q,A" by (rule conseq) auto
lemma Spec_wf_conv: "(λ(P, q, Q, A). (P ∩ {s. ((s, q), τ, p) ∈ r}, q, Q, A)) ` (∪p∈Procs. ∪Z. {(P p Z, p, Q p Z, A p Z)}) = (∪q∈Procs. ∪Z. {(P q Z ∩ {s. ((s, q), τ, p) ∈ r}, q, Q q Z, A q Z)})" by (auto intro!: image_eqI)
lemma CallRec': "[p∈Procs; Procs ⊆ dom Γ; wf r; ∀p∈Procs. ∀τ Z. Γ,Θ∪(∪q∈Procs. ∪Z. {((P q Z) ∩ {s. ((s,q),(τ,p)) ∈ r},q,Q q Z,(A q Z))}) ⊨tF ({τ} ∩ (P p Z)) (the (Γ p)) (Q p Z),(A p Z)] ==> Γ,Θ⊨tF (P p Z) (Call p) (Q p Z),(A p Z)" apply (rule CallRec [where Specs="∪p∈Procs. ∪Z. {((P p Z),p,Q p Z,A p Z)}"and
r=r]) apply blast apply assumption apply (rule refl) apply (clarsimp) apply (rename_tac p') apply (rule conjI) apply blast apply (intro allI) apply (rename_tac Z τ) apply (drule_tac x=p' in bspec, assumption) apply (erule_tac x=τ in allE) apply (erule_tac x=Z in allE) apply (fastforce simp add: Spec_wf_conv) done
end
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.14 Sekunden
(vorverarbeitet am 2026-06-10)
¤
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.