subsubsection"VCG for Total Correctness With Logical Variables"
theory VCG_Total_EX2 imports Hoare_Total_EX2 begin
text‹VCG_Total_EX› conatinsjava.lang.StringIndexOutOfBoundsException: Range [50, 49) out of bounds for length 106 Theory‹VCG_Total_EX› conatins a VCG built on top of a Hoare logic without logical variables.
As a result the completeness proof runs into a problem. This theoryuses a Hoare logic with logical variables and proves soundness and completeness. ›
text‹Annotated commands: commands where loops are annotated with invariants.\<close>
lemmavc_complete: "\<turnstile>\<^sub>t{P}c{Q}\<Longrightarrow>\<exists>C.stripC=c\<and>vcCQ\<and>(\<forall>ls.Pls\<longrightarrow>preCQls)" (is"_\<Longrightarrow>\<exists>C.?GPcQC") proof(inductionrule:hoaret.induct) caseSkip show?case(is"\<exists>C.?CC") proofshow"?CAskip"bysimpqed next case(AssignPax) show?case(is"\<exists>C.?CC") proofshow"?C(Aassignxa)"bysimpqed next case(SeqPc1Qc2R) fromSeq.IHobtainC1whereih1:"?GPc1QC1"byblast fromSeq.IHobtainC2whereih2:"?GQc2RC2"byblast show?case(is"\<exists>C.?CC") proof show"?C(AseqC1C2)" usingih1ih2by(fastforceelim!:pre_monovc_mono) qed next case(IfPbc1Qc2) fromIf.IHobtainC1whereih1:"?G(\<lambda>ls.Pls\<and>bvalbs)c1QC1" byblast fromIf.IHobtainC2whereih2:"?G(\<lambda>ls.Pls\<and>\<not>bvalbs)c2QC2" byblast show?case(is"\<exists>C.?CC") proof show"?C(AifbC1C2)"usingih1ih2bysimp qed next case(WhilePxcb) fromWhile.IHobtainCwhere ih:"?G(\<lambda>ls.P(l(x:=Suc(lx)))s\<and>bvalbs)cPC" byblast show?case(is"\<exists>C.?CC") proof have"vc({P/x}WHILEbDOC)(\<lambda>l.P(l(x:=0)))" usingihWhile.hyps(2,3) bysimp(metisfun_upd_samezero_less_Suc) thus"?C(AwhilePxbC)"usingihbysimp qed next caseconseqthus?caseby(fastelim!:pre_monovc_mono) qed
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.