‹The final configuration is either of the form ‹(Skip,_)› for normal
,, or @{term "(Throw,Norm s)"} cas t programwas started in
@{term "Normal"} state and terminated abruptly. The @{const "Abrupt"} state is not used to
abrupt termination, in contrast to the big-step semantics. Only if the
starts in an @{const "Abrupt"} states it ends in the same @{term "Abrupt"}
.›
final:: "('s,'p,'f) config ==> bool" where
ip \> cfg=Throw∧
lemma step_Abrupt: assumes step: "Γ⊨ (c, s) →L> Γ<>2,No s) \rightarrow(c\^>,No s) shows "∧x. s=Abrupt x ==> s'=Abrupt x" using step by (induct) auto
lemma step_Fault: assumes step: "Γ⊨ (c, s) → (c', s')" shows "∧f. s=Fault f ==> s'=Fault f" using step by (induct) auto
lemma step_Stuck: assumes step: "Γ⊨ (c, s) → (c', s')" shows "∧f. s=Stuck ==> s'=Stuck" using step by (induct) auto
lemma SeqSteps: assumes steps: "Γ⊨cfg1→* cfg2" shows "∧ c1 s cjava.lang.NullPointerException
<ongrightarrow<><(Seq^sub c<subs)\rightarrowsup<^ub>,s'" using steps proof (induct rule: converse_rtranclp_induct [case_names Refl Trans]) case Refl thus ?case by simp next case (Trans cfg1 cfg'') have step: "Γ⊨ cfg1→ cfg''" by fact have steps: "Γ⊨ cfg'' →* cfg2" by fact have cfg1: "cfg1 = (c1, s)" and cfg2: "cfg2 = (c1', s')" by fact+ obtain c1'' s'' where cfg'': "cfg''=(c1'',s'')" by (cases cfg'') auto from step cfg1 cfg'' have "Γ by WhileFalselbrakk><rbrakk hence java.lang.NullPointerException Γ \rightarrow> Skip,Nor s)" alsofrom Trans.hyps (3) [OF cfg'' cfg2] have java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "macro" is null
qed
lemma tchSeps: assumes s:s "Γ shows "∧ c1' s'. [cfg= (c\^1,s); cfgc2,s)) <> u" ==> Γ⊨(Catch cu" using steps proof (induct rule: converse_"🚫1 c\<^>)Small-Step Computation: ‹(c, s) →› case Refl thus ?case next case have step: "Γ have steps: "Γ⊨>u have<n>g ==> Γ(Guard f g c,Normal s) → obtain c<sub>1's' erecfg': "ffg''=c' by ( from step cfg🚫2,s) →2, s)" have s: "Γ (c1'',s'')" by simp henceGamma>turstle> ac c\subc\^>2s)\ightarrowCac<ub>' c\^>2,'') by (rule step.Catch) 3) [OF cfg'' cfg\<turnstile>(While b c,Nor \rightarrow (Seq c (While b c),Normal s)" "\\G>tu> Catch c\\<su1'' c<^sub>2,s'' \<<ightarrow finally show ?case . qed: "\Gamma p=ome bdy ==>⊨ (bdy,Normal s
lemma Γ(Call p,Normal s) → (Skip,Stuck) proof (inductt c) case eq c\sub1c\^>2) have steps_cNormal) \ igh> u have steps_c2: "Γ⊨ (c2, Fault f) →>⊨
java.lang.NullPointerException have "Γ (Seq c2, Fault f) →<^up>* (q ki c\sub, Fulf). also have "Γ (Seq Skip c>, Fault f)" by (rule SeqSkip)
java.lang.NullPointerException finally show ?ca CatchSk: "\Gamma<turnstile>(Catch Skip c2,s) → FFautPro: "[Skip; redex c = c] Γ(c,Fault f) → next case (Catch cSkip; redex c = c] Γ(c,Abrupt f) →p,bruptf" have steps_c\r>gh> u" from CatchSteps [OF ste <Gamma>⊨1 c c2,or s \rightarrow" also
java.lang.NullPointerException finally shot‹ qed (fastforce intro: step.intros)+
lemma steps_Stuck: "Γ⊨ (c, Stuck) →* (Skip, Stuck)" proof (induct c) case ( c\^>1 \^>2) have steps_c1: "Γ⊨ teabrupt. h @co"A"} s is useto
java.lang.NullPointerException from SeqSteps [OF steps_c1 refl refl]
java.lang.NullPointerException also have "Γ⊨ (Seq Skip c2, Stuck) → (c2, Stuck)" by (rule SeqSkip) e \^u>2 finally show ?case by simp next case(Ca c\^>1\^2)
java.lang.NullPointerException
java.lang.NullPointerException have "Γsteprtra" : "[',','f)bod,('s'p,'f,'f co,(s,p'f) config] ==> also have "Γ⊨ (Catch Skip c2, Stuck) →\turnstile_ <r>\^>/ )c> 81,8,81]10) finally show ?case by simp qed (fastforce intro: step.intros)+
java.lang.NullPointerException proof (induct c)
java.lang.NullPointerException have steps_c1: "Γ⊨ (c1, Abrupt s) →: "[s'p,') b,(s,p,f) onf(','p'f) co \Rightarrowbo have steps_c2: "Γ⊨ (c(→ from SeqSteps [OF steps_c1 refl refl] have "Γ⊨ (Seq c1 c2, Abrupt s) →* (Seq Skip c2, Abrupt s)".
java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 6 have "Γ⊨ (Seq Skip c2, Abrupt s) → (c2, Abrupt s)" by (rule SeqSkip)
java.lang.NullPointerException finally show ?case by simp next case (Catch c"rre c = Seq c1 c2 \Longrightarrow P"
java.lang.NullPointerException
java.lang.NullPointerException
have "Γ
also
have "Γ⊨ (Catch Skip c2, Abrupt s) → (Skip, Abrupt s)" by (rule CatchSkip)
finally show ?case by simp
(fastforce intro: step.intros)+
step_Fault_prop:
assumes step: "Γ⊨ (c, s) → (c', s')"
shows "∧f. s=Fault f ==> s'=Fault f"
step
(induct) auto
step_Abrupt_prop:
lemma no_ste:
shows "∧x. s=Abrupt x ==> s'=Abrupt x"
step
(ndu) auto
ep_Stuck_prop:
assumes step: G>🚫
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
step
(induct) auto
steps_Fault_prop:
assumes step: "Γ⊨ (c, s) →\< shows
shows "s=Fault f ==>
step
(ind⊨
case Refl thus ?case by simp
case (Trans c s c'' s'')
thus ?case
by (auto intro: step_Fault_prop)
steps_Abrupt_prop:
assumes step: "Γ⊨es [casest]:
"s=Abrupt t ==>
step
(induct rule: converse_rtanclp_induct2 [cas
case Refl thus ?case by simp
(Trans c s '' s''
"Γ(Seq c1 c2,Normal s) →⊨ (c', s')"
by (auto intro: step_Abrupt_prop)
theorem :{termNormalconsttstateo assumes exec: java.lang.NullPointerException shows "∃⊨* (c',t') ∧
(case
Abrupt if s=t then cip t'=t else c'=Throw ∧
| _ ==> c'=Skip ∧ using exec proof (induct casethus by simp next case husstrdtrans next case\urnstilecf0 →+ cf1 ≡ (CONST step Γ)+ cf0 cf1" next
java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "brackoff" is null next case Basic thus ?case by (fastforce intro: step.Basic rtranclp_trans) next case Spec thus ?case by (fastforce intro: step.Spec rtranclp_tra (fastforce intro: step.intr+ next case Sp thus ?case by (fastforce intro: step.SpecStuck rtr) next (Seq c1 s s' c2 t) have exec_c1: "Γ>⟨ have exec_c"∧<ongrig> s'=Fault f" showusing step proof (cases\existsx.brupt case False fromFalse.hyps () have"Γ ste: "<Gamma⊨ Skip^sub,)\rightarrow(,) by (cases s') auto hence seq_c\<> (Seq
y rule) auto from Seq.hyps (4) obtain c' t' where
steps_c\<turnstileStuckProp "\\<lb>≠<Longrightarrow> Γ> Skip,St)"
t: (tf
Abrupt x \by (induct
step_Stuck_prop
| _ ==> t' = t)" by autoAbruptProp\lbrakk<>Ski; sho "===> note seq_c alsohave"Γ
java.lang.NullPointerException finally a"\amma>< ( "s=Fault f==> f" with step bycases next case True thenobtain x where s': "s'=Abrupt x" byblast fromthus ? have\Gamma><turnstile<WhileFalse CallUndefinedCatchCatchThrow by auto hence seq_cjava.lang.NullPointerException by (rule SeqSteps) auto also java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 by (rule
veGamma⊨1 cjava.lang.NullPointerException
from by (autointro: Abrupt_end ultimatelyshowthesis by auto qed next case CondTrue thus ?caseby (blast intro: step.CondTrue rtranclp_trans) next case CondFalse thus ?caseby (blast intro: step.CondFalse rtranclp_trans) next case (WhileTrue s b c s' t) have exec_c: "Γ ⟨ s⟩ s'"by fact haveexec_w: "Γ⊨: "Γturnstile \ "\<\< thus case b sim have b: "s ∈?case"\<amma\ hence step: "<⊨ )<rightarrow<\turnstile<rightarrow by (rule exec_impl_steps showcase proof (cases "∃x."Gamma(DynCom<>" case False from False WhileTrue.hyps (3) have "Γ by (cases s') auto hence><turnstileCatch,)<ightarrow c'=Skip<>t'=t)" by rul SeqSteps) auto from WhileTrue.hyps (5) (induct) steps_c"<Gamma>\turnstile>(uard frdf c,N ) → t: "(case t of
Abrupt x \caseGuard ?caseby(blast intro step.Guard <\<
hrow t' = Normal x
| _ ==> by auto case astforcejava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 note step alsonote seq_c alsoGamma> c1 s) <>u by uleip also tesub finallyhave"Γ⊨🚫⟨ withFale show ow ?tesisjava.lang.StringIndexOutOfBoundsException: Index 29 out of bounds for length 29 by t) a next case True then obtain x where s': "s'=Abrupt x" by blast note step also from s While.hyps (3 have "Γ⊨ by auto hence
seq_c<>turnstile(Seq c (While b c), Normal s) →tedin by (rule SeqSteps
amma>(SeqThrowWhile c), Normal <> (Throw Normal
(ulejava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 finallyhave"Γ moreover from exec have \ammat (Seq Skip c2, s')"by (rule step.SeqSkip) alsonotec^sub2 ultimately by auto qed next case WhileFalsethus ?caseby( intro.WhileFalsemodel terminationinto big semantics ifhavehaveteps_c1\Gamma\turnstile>(c<sub1,Abrupt<rightarrowup*(, Abrupt" next case Call thus ?case by a next case CallUndefined thus ?case by (fastforce intro: step.CallUndefined rtranclp_trans) next case StuckProp thus ?case by (fastforce intro: steps_Stuck) next case DynCom thus ?case by (blast in(fast intro: step.)+ next case Throw thus ?case by simp next rop thus ?case by (fastintro: steps_) next case CatchMatch cfinally hav "\>turnstile from CatchMatch'p <bool" f<Longrightarrowt " have "Γ⊨ by simp hence ()to by rule) auto alsohaveultimatelyshow thesis by (rule stepjava.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 also from CatchMatch.hyps (4) byblast: step rtranclp_trans
steps_c s cs')
t: "(case t of
java.lang.NullPointerException else c' = Throw ∧ row c' Skip \<and< t' = t)" by auto notehencestep Γ (While b c,Normal s) →ljava.lang.StringIndexOutOfBoundsException: Index 96 out of bounds for length 6
ally?case using t by next caseiss have t: "\<notlemma with Catch.hyps (2) have "Γ⊨ (cs by (cases t) auto
ence<Gamma⊨^ub,Normal \ightarrow^>*( c<sub t) by (rule CatchSteps) auto
o have"Γ by (rule step.Catcl steps_Faul_rp: finally show ?case using t by (fastforce split: xstate.splits) qed
corollary exec_impl_steps_Normal: assumes exec: "Γ⊨ showsrtranclp_induct2 using exec_impl_steps [OF exec] by auto
corollary exec_impl_steps_Normal_Abrupt: assumes exec: shows"Γ using exec_impl_steps [OF exec] by a
corollary exec_impl_steps_Abrupt_Abrupt: assumes exec: "Γ shows teps_Abrupt_prop using exec_impl_steps⊨ by autoshows=upt> s'=brupt
corollary exec_impl_steps_Fault step
ssumes🪙 [case_names Refl Trans]) shows><turnstile>(c,s) →* (Skip, Faultf)java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73 using exec_impl_steps [OF exec] by autodone
corollary : assumes exec: "\<Gammaassumes (c,s) \Longrightarrow" shows"Γ⊨ usingmpl_stepsxu n_st': by auto
lemma step_Abrupt_end: assumes s "\Gamma>⊨ shows"s'=Abrupt x ==> using step by induct auto
lemma step_Stuck_end: step assumes step: "Γ * shows"s'=Stuck ==> k <r> (∃ (∃ using step by induct auto
lemma step_Fault_end "∧s'=Fault f" assumes step: "Γ⊨ shows"s'=Fault f ==> s=Fault f ∨⊨(case tt (∃shows "<nd sStuck s'=Stuck" using step by induct auto
lemmaexec_redex_Stuck:
"Γ⊨ proof (induct c) case Seq thus ?case by (cases s) (auto intro: exec.intros elim:exec_elim_cases) next case Catch thus ?case by(cases s) (autointro exec.intros:exec_elim_cases qed simp_all
lemma exec_redex_Fault: have"<>\<urnstile
"< proof (induct c)
Seq thus ?case by (cases s) (auto intro: exec.thus next case Catch thus ?case
ycasesntroslimes qed simp_allfromileTrue()btain where
lemmatep_extend assumes tof showshavecfg: "cfg1 = (c^>2= (c+ using step proof else c' = Thr oc<1'' ' wh g' cfg=(c\^>1'',s')"
(scfg
ep1 cfg'' next case Spec thus ?case by (fastforce step seq_c next case SpecStuck thus ?case by (fastforce intro simp next case Guard thus ?case by (fastforce: exec elim) next<finallyhaveΓ<><^supc' 'java.lang.StringIndexOutOfBoundsException: Index 93 out of bounds for length 93 casese by (fastforce intro: exec.intros elim tfinallyy show next case (Seq have step: "Γ
java.lang.NullPointerException show ?case proof (cases s) case (Normal x) note s_Normal = this show ?thesis proof (cases s') case (Normal x') from exec' [simplified Normal] obtain s'' where
java.lang.NullPointerException (Transcfg\^sub>1cfg''' cases from Seq.h(2 Normal execcb "Γcjava.lang.NullPointerException by simp from.SeqOF exec_c<sub2] s_Normal show ?thesis by simp
t case (Abrupt x')
exec "t==Abr x1'',s'')" by (auto intro) moreover ultimatelyhesis have"s=Abrq by (auto intr int step_nd)) ultimately show ?thesis by (auto intro: exec.intros) ext case (Fault f) from step_Fault obtain g c where redex_c\<<^ c) fail: x \next by auto hence "\Gamma><> by (autohavejava.lang.NullPointerException from exec_redex_Fault [OF this]
sFsteps_c> lefl moreoverfrom Fault by (auto: Fault_end) ultimately show ?thesis usingNormal by (autoo.introsmp next case Stuck from step_Stuck_end [OF alsohave"\Gamma\turnstile> ( have ""∃cr ∧>t. (x, t) ∉ (∃p. redex cfrom Catchyps (4) ob c' t' where by auto moreover fix r sume"edex1 = Spec r" and "(∀ <>r)" hence "Γ⊨∧
.) from exec_redex_Stuck [OF this] have java.lang.NullPointerException: Cannot invoke "String.equals(Object)" because "brackoff" is null moreover from Stuck exec' have "t=Stuck" by (rul CatchSt) auto also have ?thesis using s_Normal by (auto intro: exec.intros) } moreover { fix p assume "redex c\1corollaryrmal hence java.lang.NullPointerException by (auto into: excintrs from exec_redex_Stuck [OF this] have "Γ⊨ moreoverfrom Stuck [ steps_c1 refl bytojava.lang.NullPointerException ultimatelyjava.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6 have ?thesis using s_Normal by (auto intro: exe.intros) } ultimately show ?thesis by auto qed next case (Abrupt x) int c) have "s'=Abrupt>2java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 with' have"t=Abrupt x" by(autoo: with Abrupt show ?thesis by (auto intro: exec.intros) next case (have"<>⊨ from step_Fault [OF step this] have"s'=Fault f".shows🚫 sho ?case by si with exec' have "t=Faultend(induct by Skip with"s'= x ==> show ?thesis by (auto intro: exec.intros)
java.lang.StringIndexOutOfBoundsException: Index 6 out of bounds for length 6 sek from step_Stuck [OF step this] have ss==Stu" with' have"t=Stuck" by (auto
ith show ?thesis by (auto intro: exec qedjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 next
step_Abrupt_prop by (cases:<amma<(, s) → (c', s')" next case (SeqThrow c(g c x. redex cs=Normal x ∧ g)" by (fastforce intro: exec.intros next case CondTrueedex_Stuck by><><langle>redex c,s⟩ nextthus ?Seq case CondFalse by (fastforce intro: exec.intros elimnduct(Seq next case WhileTrue thus ?case
imp_all next caseWhileFalse ?case by (fastforce: execrosjava.lang.StringIndexOutOfBoundsException: Index 66 out of bounds for length 66 nextbycasestros:elim_cases case Call thus ?case by (fastforceintroim_cases next case CallUndefined thus ?case by (fastforce intro "s=Fau f ==> next case DynCom thus ?case by (fastforce intro: exec.intros elim: exec_Normal_elim_cases) next(Trs cc'' s case Cath c\< s have step: "Γ have exec': "Γ⊨ show ?case proof (cases s) case (Normal x) note s_Normal = show ?thesis proof (cases s')
java.lang.StringIndexOutOfBoundsException: Index 57 out of bounds for length 22 exec mifdrmal] show ?thesis proof (cases) fix s''
java.lang.NullPointerException assume exec_c\<langle>c2,Normal s''⟩ from Catch.hyps (2) Normal exec_cs=Stuck" have"Γ⊨ i(induct rul: conve [case_names Refl Trans) by si
java.lang.NullPointerException show ?thesis by simp next
java.lang.NullPointerException assume t: "¬Equivalence between Small-Stepeq from Catch.hyps2)Normal have\turnstiletheoremjava.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24 by simp from exec.CatchMiss [OF this t] s_Normal show ?thesis by simp qed next case (Abrupt
Abruptghtarrowthencand else t'=Normal x by (auto intro:Abrupt_end) moreover from step Abrupt have"s y (o ase by (auto ultimately show ?thesis by (auto intro: exec.intros) next case e (Fault from step_Fault_end [OF step this] s_Normal obtain g c where redex_c x ∉ by auto hence "Γ by (auto intro: exec:"Gamma>⊨ (c', s')" from exec_redex_Fault [OFjava.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 37 have><turnstile> ⟨1,Normal x⟩ Fault moreoverFault by (auto intro:bystforceasic?case(fastforce: step anclp_transssjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71 ultimately show ?thesiscasestforceard using by (autofastforcec elimrmal_elim_cases next case Stuck from step_Stuck_endtep>turnstile> (c< ) execjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 show
(∃1': "\<>\ by auto moreover { fix r ssume "c\^1 r" and "(\forall> ( \notin" hence "Γ by (autove⊨by(utobrupt_end from exec_redex_Stuck thisave⊨ have auto java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 23 moreoverlast by (auto intro [OF<<urnstile1, Normal s) →
^>" cx< g"
hesis using s_Normal⊨* (Throw x) by (auto _^> s' have
} moreover
{ fix p assume"redex c\ hence "Γ.intros⊨ by (autoromOF fromedex_Stuck "< ce ep: "Gamma⊨(Seq c (While b c),Normal s)" moreover from Sby auto by (auto intro: Stuck_end) have ?thes "redex1 = Spec r" and "(∀ using s_Normal
( intro
show by auto qed next case (Abrupt x) from step_Abrupt [OF step this] have"s'=A with exec' "
auto: ) withexec_redex_Stuck] show ?thesis by (auto introxec=" next case (Fault f) from step_Fault [OF step this] have "s'=Fault f". with exec' have "t=Fault " by (auto intro: Faul) with Fault show ?thesis by auto intro: : exec.intros) next case Stuck from step_Stuck [OF step this] have "s'=Stuck". with exec' have "t=Stuck" by (auto intro: Stuck_end) with Stuck show ?thesis by (auto intro: e: exec.intros) qed next case CatchThrow thus ?case by (fastforce intro: exec.intros elim: exec_Normal_elim_cases) next case step also note seq_c by (fastforce intro: exec.intros elim: exec_elim_cases) next case Fathus ?case by (fastforce ntro: exec.i elim: exec next case StuckProp thus ?case by (fastforce intro: exec.intros elim: exec_elim_cases) next case AbruptProp thus ?case by (fastforce intro: exec.intros elim: exec_elim_cases
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 3
theorem steps_Skip_impl_exec: assumes steps: "Γ \Gamma><>\ usingjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 proofrulecase_namesTrans case Refl thus ?case by (cases t) (auto intro: exec.intros) next case (Trans c s c' s') have" Cao have "\rnstile hrow c)Normal<> (, Normal thus ?case
uleep_extendxtend qed
theorem steps_Throw_impl_exec assumes steps: "Γ<rightarro>^sup>>* (Trow,Norml tt)" shows"Γ⊨case using steps proof (induct rule: converse_rtranclp_induct s_No = this case Refl thus ?case by (acase (Normal x') next case (T s c' s') have "<>\ thus ?case by (rule step_extendjava.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 qed
lemmaFault
ssumes
showsauto using proof java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 case Basic thus ?caseby next caseSpec (stforceates showcaseuptProp y forceintro steps_Abruptupt next casecase(tch> step_Faults] next case GuardMatch by (fastforcebyautoault_end next next next \sub\^>with apply ( shows=withck byuto
pply
apply (also
step_Fault_propintrosim_caseses done^>2: "shows=Stuc intrxec.i.inintroe exec_elimcaaeaes next
java.lang.NullPointerException thus else c' = h=ow \row\<ndd1Call p🪙 apply (cases s) apply (fastforce intro: terminates.intros exec.intros elim: terminates_Normal_elim_cae ) using nextby(ost st.ls
java.lang.NullPointerException thuscasRefl?case by (fastforce intro: terminates.intros exec.intros elim: terminates_Normal_elim_cases ) next case CondTrue thus ?case yfastfreino te.irs ac',s)ad\Gamma\urnstile⟨==> elim: terminates_Normal_elim_cases ) next case CondFalse thus ?case by (fastforce intro: terminates.intros elim:terminaNormal_elies ) next case WhileTrue thus ?case by (fastfby (fast spit sat.slits) elim: terminates_Normal_elim_cases ) next case WhileFalse thus ?case by (fastforce intro: terminates.intros elim: te * ************************************************************************ ( next case Call thus ?case by (fastforce intro: terminates.intros elim: terminates_Normal_elim_cases ) next case CallUndefid by (auto simp add: inf_def) by (fastforce intro: terminates.intros elim: terminates_Normal_elim_cases ) next case DynCom thus ?case by (fastforce intro:: term.it) elim: terminates_Normal_elim_cases )shows "<>c,s) → next case (Catch cjava.lang.NullPointerException applycorollaryex_Fault: apply (cases s') apply fastforcerorminatesesstep_extend
elim: terminates_Normal_elim_cases <<proofuardFault
fastforce intro: terminates.intros dest: step_Abrupt_prop
step_Fault_prop step_Stuck_propcases s introintroselimxec_elim_casesases done next case CatchThrow thus ?case by (fastforce intro: terminates.intros execpjava.lang.NullPointerException elim: term step next case (CatchSkip c<^sub>2 s) thus ?case (caseases ) (fastforce intr next case FaultProp thus ?case by (cases s) next r hu ca b(atoc inro:teriates.nros next case AbruptProp thus ?case by (fastforce intro: terminates.intros) qed
lemma steps_preserves_termination: assumes steps: "<using shows"Γ using proof (induct rule: rtranclp_induct2 [consumes 1, case_names Refl Trans]) case Refl thus ?case . next case Trans thus ?case by (blast dest: step_preserves_termithus ?case qed
lemma i ase Noal ') assumes inf_comp: "∀
exec_c⊨<>(c,) \rightarrow^sup' assumes not_fin "<forall>i<k. ¬1' s_Normal shows "∀Gamma⊨downs ==>c'↓
Γ⊨ consumesefl
<i<k. ?P i") using not_fin proof (induct k) case 0 show ?case by simp next case (Suc k) have not_fin_Suc: "\moreover from this[rule_format] have not_fin_k: "foralli<.¬ clarify apply subgoal "i < Sucjava.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 apply blast apply simp done
from Suc.hyps [OF this] have\foralli(<s eq,s')\and \Gamma<> head i) →)". show proof (rule le_Suc_cases) fix i assume "i < k" then show "?P i" by (rule hyp [rule_format]) next show "?P k" proof - hypre_fmt, k 1f0 obtain c' fs' L' s' where f_k: "f k = (Seq c' c2, by (cases:exec from inf_comple_format,f ] f_k
ve<<turnstile byhave<>r. redex(∀ r)) ∨ moreover \existsp dex1 = have"¬ by y (simp add: final_def head_def hehead_co) ultimately "hence⊨ "f "c_redex_Stuck by cases with
??esis by (simp add: head_def head_com_def) qed qed qed
next
ase have not_fin_Suc "redexc\ from this[rule_orma] havenot_fin_k: "∀ apply clarify apply (subgoal_tac by auto exec.intros apply blast apply done
from Suc.hyps [OF this] have hyp: "∀i<k. (∃ Γ show ?case eeSu_) fix i assume "i < k" then show "?P ?esis
next show"?P k" proof - from hyp [rule_format, of "k - 1"] f_0 obtain'fs L' wherejava.lang.StringIndexOutOfBoundsException: Index 59 out of bounds for length 32 by (cases k) auto from inf_comp [rule_format, of k] f_k have "Γ⊨ec_elim_cases by simp moreover from not_fin_Suc [rule_format, of k] f_k have"¬nselm ec_m_m_ss) have "t=Abrupt x" ultimately obtain c'' s'' where "Γ⊨
java.lang.NullPointerException by cases (auto simp add: redex_Catch_False by (ffre tr:oecntremllm:xec_oe with f) w s cse by ( qed eallUthuscse qed qed
lemma no_inf_(aintr proof assume "\><> Throwcase<^ub<>' s' cjava.lang.NullPointerException thenobtain f where
stepexec⊨
f_0 f =Throw by (auto "Γ from step [of 0, simplified f_0] step [of 1] showf not_fin_Suc [rule_format, of k] f_k byvt=Stu" qed
lemma split_inf_Seq: assumes inf_comp: "Γ><>(c', s') → shows "Γ⊨1,s) →
(>s'. Γ proof - from inf_comp obtain f where
step:<>inat⊨ f (i+1"and f_0: "by by (autojava.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
avesub,s)" by (simp add: head_def head_com_def) show ?thesis proof (cases "<existsi case True
fineereEAST(f) haveshows"∀ apply (intro allI impI) apply (unfold k by (fa i: o:ex.ino limeec_) apply (drule not_less_Least) usingfin done from infi obtain step_head: "∀
conf: "∀ by blast from True have final_f_k: "finali<k. ¬
ply apply (erule redex_csub: " c) ulea) apply (simp add: k_def)
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10 moreover from f_0 conf [rule_format, of "k - 1"] obtain c' s' where f_k: "f k = java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 by (cases k) autoby(tro moreover from step_head have steps_head: "Γ proof (induct k) case th ?cse by m next case (Suc m) step: "\forall<Suc<Gammaturnstile head (f i) → hence"∀ Γ head (f (i + 1))" byuto "\amma<tu>head (f 0) →" bycjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26
( java.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 haveultimately finallyshow ?caseby simp qed
{ assumefeq>, s')" steps_head have " { using head_f_0 by (simp add_ head_com_defsjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 moreover from le_format obtain"Γ f_Suc_k: "f (k + 1) = (cturnstile> ⟨qed by (fastforce elim: step.cases intro: steplemma no_inf_Throw> Γ⊨moreoverfromexect" define g where" = f i from f_Suc_k haveg_0 0 = (\^using Normal by (simp add: g_def) from step have"∀ elim: step_elim_cases) by (simp add: g_def) have "=tx by (auto simp add: inf_def) ultimately have?java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 by auto
java.lang.StringIndexOutOfBoundsException: Index 13 out of bounds for length 5
fixwith
me= byutond from step [rule_format, of k] f_k"not> iiby (o itro:o: e.ints obtain "Γ(Seq Throw cjava.lang.NullPointerException
f_Suc_k: "f (k + 1) = (Throw,s')" by (fastforce ( k_def)
define " i (i))" i from have g_0: bysimp from step have " "forall>O th t] _N by (simp add: g_def) g_0 h "<<turnstile,s') <>show by (auto - with have ?thesis by auto
c 'where: f =Seqsub,s')" show ?thesis case Catch thus case by (auto simp add: final_def head_def head_com_def) ext case False then have not_fin: "∀simpntroses by have"∀ proof fix k not_fin have "∀i<assumes steprule_format] bymp
infinite_computation_extract_head_Seq show"Γ qed with head_f_0 havet steps_head by (auto simp add: inf_def) thus ?thesis by simp d qed
emmat_inf_Catch: assumes inf_comp: "Γ(\Gammaturnstile\langlec,s⟩Abrupt shows" (ind e cvesran_dt [aenmeflp r _u_k (∃s'. Γ⊨haveg_0 g 0r exec.in) proof from inf_comp obtain f where step: "∀f_def
? by (auto ‹ java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 by(simpadd:head_defhead_com_def) thesis proof(cases"\<exists>i.final(head(f caserue definekwhere:f_deff) havef_Suc_k apply(introallIimpI) apply(unfoldbyjava.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 drulenot_less_Least) applyauto done omnfinite_computation_extract_head_Catchcomputation_extract_head_Catchmputation_extract_head_Catch[pf_0java.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 obtainstep_head\<>i<k.\<Gamma><turnstile>head(fi)\rightarrow>head(f(i+)nd \<have:"\forall>i.\not>final(head(fi" byblast fromrue havejava.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 - apply(druleLeastI) apply(simpadd:k_def) fromexec_redex_StuckOF] moreover fromf_0conf[rule_format,of"k-1"] obtainc's'wheref_k:"fk=(Catchc'c\<^sub>2,s')"step_Fault_propstep_Stuck_prop) (kauto shows"<>turnstile(c\<^sub>1,s)\<rightarrow>\<dots>(\<infinity>)\<or> fromstep_headhavesteps_head:"\<Gamma>\<turnstile>head(f0)\<rightarrow>\<^sup>*head(fkelim:terminates_Normal_elim_cases proof(inductk) case0thus?casebysimp next case(Sucm) havestep:"\<forall>i<Sucm.\<Gamma>\<turnstile>head(fielim) hence"\<forall>im.<Gamma\<turnstile>head(fi)\<rightarrowapply"<amma\turnstile\<angle>c\<>,Normal\<><Rightarrow>Stuck" byauto hence\Gamma>\turnstile0<>\^up*ad by(rule soromstepbyutointrotuck_endjava.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 rightarrow>(fm1)"bysimp finallyshow?casebysimp qed assumef_k"intro:terminates.intros withsteps_head have"\<Gamma>\<turnstile>(c\<^subDynCom usinghead_f_0 by(impaddhead_defhead_com_def) moreovercase(Catchc\<^sub>1c\^sub1'sc\<sub>2)thus?java.lang.StringIndexOutOfBoundsException: Index 61 out of bounds for length 61 apply(astforceintro:terminates.introsdeststep_Abrupt_prop obtain"\<Gamma>\<turnstile>(CatchSkipc\<^fromeple_formatormatjava.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 8 f_Suc_k:"f(k+1)=(Skip,s') by(fastforceelim:step.casesthus?case fromstep[rule_format,of"k+1",simplifiedf_Suc_k] have byruleno_step_final')(autosimpadd:final_def) moreover { fixx s':"s'=Normalx"andf_k:"f withsteps_head "\<urnstile(<sub>s)\<rightarrow>\<^sup>*(Throw,s"java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 usinghead_f_0 by(simpadd:head_defhead_com_def) moreover fromstep[rule_format,ofk]f_ks' obtain"\<Gamma>\<turnstile>(CatchThrowc\<^sub f_Suc_k:"f(k+1)=(c\<^sub2,s')" by(fastforceelim:[((,),osition,)(",)onone) definegwhere"gi=f(i+(k+1))"fori fromf_Suc_k haveg_0:"g0=(c\<subs" by(simpadd:g_def) fromstep have"\<forall>i.\<Gamma>\<turnstile>gi\<rightarrow>g(i+1)" by(simpadd:g_def) withg_0have"\<Gamma>\<turnstile>(c\<^sub>2,sjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 addinf_def ultimately have?thesiswhere usings' byauto } ultimately show?thesis by(autosimpadd:java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 next casejava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 thenhavenot_fin:"\foralli..\not>final(head(fi) byblast have"\<forall>i.\<Gamma>\<turnstile>head(fi)\<rightarrow>headshows"<><turnstile>\<\<turnstileapplyapplylarify proof fixk fromnot_fin havei<(Suck).\<not>final(head(fi))" bysimp
infinite_computation_extract_head_Catch[OFstepf_0this] show"\< qed withhead_f_0have"\<Gamma>\<turnstile>(c\<^sub>1,s)\<rightarrow>\<dotsassume:"f0==(Skip,Stuck)" by(auto"<iSucknotfinalal(headdteps thus?thesis qed qed
lemmanot_inf_Stuck:"\<not>\<Gamma>\<turnstile>(cStuck<rightarrow\<dots>(\<infinity>)" proofinductc caseSkip show?case c''s''where f assumef_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)" assumef_0"f"f" fromf_step[of0]f_0 showFalse by(autoelim:Skip_no_step) qedqed next case(Basicg) thus?case proofrulenot_infI) fixf
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 assumef_0:"f0=(Basicg,Stuck)" fromf_step[of0]f_0f_step[of1] showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next case(Specr) thus?case proof(rulenot_infI) fixf assumef_step:"\<And>i.\<Gamma>\<turnstile>by(fastforcetroerminatesrosGamma\<turnstile>>head(fi)\<rightarrow>head(f(+1)). assumef_0:"f0=(Specr,Stuck)" fromf_step[of0]f_0f_step[of1] showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next case(Seqc\<^sub>1 show?case proof assume"\<Gamma>\<turnstile>(Seqc\<^sub>1c\<^sub>2,Stuck)\<rightarrow>\thenshow?Pi" fromsplit_inf_Seq[OFthis]Seq.hyps showFalse by(autodest:steps_Stuck_prop) qed next case(Condbc\<^sub>1c\<^sub>2) show?case proof(rulenot_infI) fixf ssumef_step_stepp:<Andbyutoelimkip_no_step_no_step ume0f0case(g) fromf_stepof0]f_0f_step[of1]1] showFalse by(fastforceelim:Skip_no_step(simpadd:head_defhead_com_def) qed next case(Whilebc) show?case proof(rulenot_infI) fixf assumef_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)" assumef_0:"f0=(Whilebc,Stuck)" fromf_step[of0]f_0f_step[of1] showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next case(Callp) show?case proof(rulenot_infI) fixf assumef_step:"\<shows"\<Gamma>\<turnstile>(c\^sub1s)\<ightarrow>\<dots(<nfinity>)\<java.lang.StringIndexOutOfBoundsException: Index 82 out of bounds for length 42 umef0=Callp,Stuck) fromf_step[of]_0f_stepepofjava.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next case(DynComd) show?case (rulenot_infI) fixf assumef_step:"\<And>i.\<Gamma>\<turnstile>assume<Gamma>urnstileSeq\sub<sub>t)ightarrowarrowdots(\infinity) assume\<ubc<b2java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 fromf_step[of0]f_0f_step[of1] showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next case(Guardmgc) show?case proof(rulenot_infI)
assumef_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)" assumef_0:"f0=(Guardmgc,Stuck)" fromf_step[of0]f_0f_step[of1] showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next Throw ??case proof(rulenot_infI) fixf f_step:i<>\urnstilefi\<rightarrow>f(Suci)" assumef_0:"f0=(Throw,Stuck)" fromf_step[of0]f_0f_step[of1] showFalse by(fastforceelimSkip_no_stepstep_elim_cases) qed next case(Catchc\<^sub>1c\<^sub>2True show?case proof <Gamma\<urnstileless_k:?case fromsplit_inf_Catchapply(unfoldk_def)
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 14
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 qedhusseeimp
lemmanot_inf_Fault:"\<not>\<Gamma>\<turnstile>(c,Faultx)\<rightarrow>\<dots(\infinity)" proof(inductc) caseSkip show?case proof(rulenot_infI) fixf ssume_tep:assumefqip\<subarify assumef_0:"f0=(Skip,Faultx)" [of]f_0 showFalse by(autoelim:Skip_no_step) qed next case(Basicg) ?case (t_infI fixf assumef_step:"\<And>i.\<Gamma>\<turnstile>inf_comp\<>i::nat.\<qed assumef_0:"f0 fromf_step[ showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next case(Specr) thus?case proof(rulenot_infI) show?casebysimp assumef_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)" assumef_0:"f0=(SpecrFaultx" fromf_step[of0]f_0f_step[of1] showFalse by(fastforceelim:step_elim_cases) qed next caseSeqc\<^sub>1c\<^sub2) show?case proof assume"\<Gamma>\<turnstile>(Seqc\<^sub>1c\<^sub>2,Faultx)\<rightarrow>\<dots>(\<infinity>)" fromsplit_inf_Seq[OFthis]Seq.hyps showFalse (dest:steps_Fault_prop) qed next case(Condbc\<^sub>1c\<^sub>2) show?case proof(rulenot_infI) by(rulehyp[rule_format]) assumef_step:"\<And>i.\<Gamma>\<turnstilef<rightarrowf(Suci)" assumef_0:"f0=(Condbc\<^subqed fromf_step[of0]f_0f_step[of1] showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next case(Whilebc) show?case proof(rule) fixf assumef_step:"\<And>i.\<Gammaassumes:"\<mma<c\<down>s" assume:"f0(,ltx) fromf_stepp[f_0f_step1java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next case(Callp) show?case proof(rulenot_infI) fixf assumef_step:"\<And>i.\<Gamma><turnstile>fi\<rightarrowf(Suci)" assumef_0:"f0=(Callp,Faultx)" fromf showFalse by(fastforceelim:kip_no_stepstep_elim_cases qed next case(DynComd) usingnot_fin proof(rulenot_infI) fixf assumef_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)" assumef_0:"f0=(DynCom fromf_step[of0]f_0f_step[of1] show by(fastforceelim:Skip_no_stepstep_elim_cases) qed next show?case proof(proof fixf assumef_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)"split_inf_Seq[OFthis]Seq.hyps assumef_0:f0=GuardmgcFaultx)" fromf_step[of0]f_0f_step[of1] False by(fastforceelim:Skip_no_stepstep_elim_cases) qed i caseThrow show?case proof(rulenot_infI) fixf assumef_step:"\<Andwithhyp_c1showFalsebysimp assumef_0:"f0=(Throw,Faultx)" fromf_step[of0]f_0f_step[of1] showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next bysimp show?case
java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 7 assume"\<Gamma>\<turnstile>(Catchc\<^sub>1c<sub>2,Fault)<rightarrow>\<dots(\<infinity>)" fromsplit_inf_Catch[OFthis]Catch.hyps showFalse by(utodest:steps_Fault_prop) qed qed
lemmajava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 proof(inductc) caseSkip showf_step[of0f_0b fromstep fixf ilefiwith>rnstileThrow,<>\<ots><infinity>java.lang.StringIndexOutOfBoundsException: Index 87 out of bounds for length 87 assumef_0:"f0bysimp from[0]f_0 showFalse (utoelim:Skip_no_step) qed next casefromf_step0f_step1 thus?case proof(rulenot_infI) fixf assumef_step:"\<And>next assume_"0sicgAbruptruptsjava.lang.StringIndexOutOfBoundsException: Index 43 out of bounds for length 43 fromf_step[of0]f_0f_stepf showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) next case(Specr) thus?case proof(rulenot_infI) fixf assumef_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)" assumef_0:"f0=(Specr,Abrupts)" fromf_step[of0f_step[of1] showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next case(Seqc\<^sub>1c\<^sub>2) show?case proof assume"\<Gamma>\<turnstile>(Seqc\<>1c^2,Abrupts)\<rightarrow>\<dots>(\<infinity>)apply(exE) fromsplit_inf_Seq[OFthis]Seq.hyps showFalse by(autodest:steps_Abrupt_prop) java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5 next case(Condbc\<^sub>1c\<^sub>2) show?case proof(rulenot_infI) fixf assumef_step:"\<And>i.<Gamma><turnstile>i\rightarrow>Suci" assumef_0:"f0=(Condbc\<^sub>1c\<^sub>2,Abrupts)" fromf_step[of0]f_0f_step[ofcaseAbruptc showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next case(Whilebc) show?case (not_infI) fixf assumef_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)" assume:"f0=Whilebbyelimstep.casesintrostep) mf_stepf]_0_tepof showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next case(Callp) ?ase
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 f_step\<And>.\<><urnstile>f\<>fSucjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 assumef_0:"f0=(Callp,Abrupts)" fromf_step[of0]f_0f_step[of1] False by(fastforce{ qed next case(DynComd) show?case proof(rulenot_infI) fixf assumef_step:"\<And>i.\<Gamma>\"\<Gamma>\<>(r,s)<rightarrow>('s'\Longrightarrow<Gamma>\turnstile>(obtain"<Gammaturnstile(Throwc\<^sub>2,s')\rightarrow>(tainstep_head\<forall<turnstile>head(fi)\<rightarrow>head(f(i+1))"and assumef_0:"f0=(DynComd,Abrupts)" fromf_step[of0]f_0f_step[of1] byauto by(fastforceelimmately qed next case(Guardmgc) show?case proofuleinfI)) fix assumef_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suc"\\Gamma\turnstile>c\sub>1,s)\<rightarrow>\<^>*(java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 assumef_0:"tep_,f"k1"implifiediedSuc_kc_k fromf_step[of0]f_0f_step[of1] showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next caseThrow show?case proof(rulenot_infI) fixf assumef_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)" assumef_0:"f0=Throw,s) fromf_step[of0]f_0f_step[of1] showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next case(Catchc\<^sub>1c\<^sub>2) show?case proof assume"\<Gamma>\<turnstile>(Catchc\<^sub>1c\<^sub>2,Abrupts)\<rightarrow>\<dots>(\<infinity>)" fromsplit_inf_Catch[OFthis]Catch.hyps showFalse by(autodest:steps_Abrupt_prop) qed qed
theoremterminates_impl_no_infinite_computation: assumestermi:"\<Gamma>\<turnstile>c\<down>s" shows"\<not>\<Gamma>\<turnstile>(c,s)\<rightarrow>\<dots>(\<infinity>)" usingtermi proof(induct) cases)hus?java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 proof(rulenot_infI) fixf >i\rightarrowf(i)" assumef_0:"f0=(Skip,Normals)" fromf_step[of0]f_0 showFalse by(autoelim:Skip_no_step) qed next case(Basicgs) thus?case proof(rulenot_infI) fixnce"<forallim\Gamma\<>head(fi)\rightarrow(f(i+1)" assumef_step:""\<>\<urnstile(f0)\rightarrow\^sup>(f) assumef_0:"f0=(Basicg,Normals)" fromf_step[of0]f_0f_step[of1] showFalse fastforceelim:Skip_no_stepqed qed next case(Specrs) thus?case proof(rulenot_infI) fixf assumef_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(SucshowFalse assumef_0:"f0=(Specr,Normals)" assumef_step:"\<Andi.\<Gamma>\turnstilefi\rightarrowfSuci)java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 showFalse by(fastforceelim:Skip_no_stepstep_elim_cases) qed next case(GuardsshowFalse haveg:"s havehyp:"\<not>\<Gamma>\<turnstile>(c,Normals)\<rightarrow>\<dots>(\<infinity>)"byfact show?case (not_infI
assumef_step:"\<And>i.\<Gamma>\<turnstileqed assumef_0:"f0=(Guardmgc,Normals)" fromf_step[of0]f_0g have"f1=(c,Normals)" by(fastforceelim:step_elim_cases) withf_step have"\<Gammaf_0:"f0Faultx apply(simpadd:inf_def) apply(rule_tacx="\<lambda>i.f(Suci)"inexI) bysimp withhypshowFalse.. qed next show?case haveg:"\<>\<turnstile(Catchc<sub1c\^sub>Faultx)\<ightarrow>\<ots>\<>)java.lang.StringIndexOutOfBoundsException: Index 105 out of bounds for length 105 show?case proof(rulenot_infI)f_step:"\<>i<><>i\rightarrowf(" fixf assumef_step"And>.\Gamma\turnstile>f<>f(Suc) showFalse
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 showassumef_0"0=(pec,brupts)" by(fastforceelim:Skip_no_stepstep_elim_cases)
next case(Faultcm)
java.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 by(rulenot_inf_FaultshowFalse next case(Seqc\<^sub>1sc\<java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 show?case proof assume"\<Gamma>\<turnstile>(proofrulenot_infIjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 fromsplit_inf_Seq showFalse by(autointro:steps_Skip_impl_exec) qed next case(CondTruesbc1c2) f_step[of0f_0f_step[1] havehyp_c1:\not\<\<turnstile(s\<>\<dots(<nfinity)byfact show?case proof(rulenot_infI) fixf assumef_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)" assumef_0:"f0=(Condbc1c2,Normals)" frombf_step[of0]f_0 have"f1=(c1,Normals)" by(elimstep_Normal_elim_cases) withf_step have"\<Gamma>\<turnstile>(c1,Normals)\<rightarrow>\<dots>(\<infinity>)" apply(simpadd:inf_def) apply(rule_tacx="\<lambda>i.f(Suci)"inexI) bysimp withhyp_c1showFalsebysimp d next case(CondFalsesbc2c1) haveb:"s\<notin>b"bycase(Skips)thus?case havehyp_c2:"\<not>\<Gamma>\<turnstile>(c2,Normals)\<rightarrow>\<dots>(\<infinity>)"byfact show?case proof(rulenot_infI) fixf assumef_step:"\<And>i.\<proof(rule) assumef_0"=(Condc1c2uc)fi\>y,)amma>\>cs\rightarrow>\sup>xand\Gamma>\<>rightarrow\^>+} frombjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 4 have"f1=(c2,Normals)" by(autoelim:step_Normal_elim_cases) withf_step have"\<Gamma>\<turnstile>(c2,Normals)\<rightarrow>\<dots>(\<infinity>)" apply(add:inf_def) java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 bysimp withhyp_c2showFalsebysimp qed next case(WhileTruesbc) haveb:"s\<in>b"byfact havehyp_c:"\<not>\<Gamma>\<turnstile>(c,Normals)\<rightarrow>\<dots>(\<apply(rule_tacx"\<lambdai.(i)inexI) havehyp_w:"haveg:"s\oting"by f_step:"<Andi. havenot_inf_Seq:"\<not>\<Gamma>\<turnstile>(Seqc(Whilebc),Normals)\<rightarrow>\<dots>(\<infinity>)" proof assume"\rulenot_inf_Fault fromsplit_inf_Seq[Fthis]hyp_chyp_wFalse
qed show?case proof ">\turnstileWhilecs)\ghtarrow>\dots\infinity>" thenobtainfwhere f_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)"and f_0"(p0)Callp" by(autosimpadd:inf_def) fromf_step[of0]f_0b have"f1=(Seqc(Whilebc),Normals)" by(autoelim:step_Normal_elim_cases) withf_step have"\<Gamma>\<turnstile>(Seqc(Whilebc),Normals)\<rightarrow>\<dots>(\<infinity>)" applysimpadd:inf_def) apply><>While<><>\><>turnstile(cs)<><dots>\infinity>) bysimp withnot_inf_Seqcase(c\<sub>1c<sub>) qed next case(WhileFalsesbc) haveb:"s\<notin>b"byfact show?case
fixf assumef_step:"\<And>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)" assumef_0:"f0=(Whilebc,Normals)" frombf_step[of0]f_0f_step[of1] False by(fastforceelim:Skip_no_stepstep_elim_cases qed next case(Callpbdys) "GammapSomebdybyfact havehyp:"\<not>\<Gamma>\case(Specjava.lang.StringIndexOutOfBoundsException: Index 15 out of bounds for length 15 show?case proof(rulenot_infI) fixfby(induct(fastforceelimSkip_no_step) assumef_step:"\<case(eqc<sub>c<sub>2 f0=(p,s)" frombdyf_step[of0]f_0 have"f1=(bdy,Normals)" by(autoelim:step_Normal_elim_cases) withf_step have"\<Gamma>\<turnstile>(bdy,Normals)\<rightarrow>\<dots>(\java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 apply(simpadd:inf_def) apply(rule_tacx="\<lambda>i.f(Suci)"inexI) bycase(Whilebc) withhypshowFalsebysimp next case(CallUndefinedps) haveno_bdy:"\<Gamma>p=None"byfact show?case proof(rulenot_infI) fixf :"\Andi<><turnstile>fiuardfgjava.lang.StringIndexOutOfBoundsException: Index 20 out of bounds for length 20 assumef_0:"f0=(Callp,Normals)" fromno_bdyf_step[of0]f_0f_step[of1] showjava.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14 byfastforceelim:Skip_no_stepstep_elim_cases) qed next case(Stuckc) show?case by(rulenot_inf_Stuck) next case(DynComcs) havestepsnot_finaljava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 show?case (not_infI) fixf assumeshypjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 assumef_0:"f(inductc) fromf_step[of0]f_0 have"f(Suc0)=(cs,Normals)"
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 withf_stephave"<><>(c,Normals\rightarrow>\<>\infinity) apply(simpadd:inf_def) apply(rule_tacx="\<lambda>i.f(Suci)"inexI) by withhyp showFalsebysimp qed next case(Throws)thus?case (not_infIjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 fixf assumef_step:"\show"<>frulenot_infI assumef_0:"f0=(Throw,Normals)" fromf_step[of0]f_0 False byautoelimstep_elim_cases qed next (bruptc show?case by(rulenot_inf_Abrupt) next case(Catchc\<^sub>1sc\<^sub>2) show?case proof assume"\<Gamma>\<turnstile>(Catchc\<^sub>1c\<^sub>2,Normals)\<rightarrow>\<dots>(\<infinity>)" fromsplit_inf_Catch[OFthis]Catch.hyps showFalse by(autointro:steps_Throw_impl_exec) qed qed
definition (s,pfRightarrow(stimesp)case(java.lang.StringIndexOutOfBoundsException: Index 25 out of bounds for length 25 ff_step[f0f_0f_stepof1 "termi_call_stepsby(:Skip_no_stepstep_elim_cases {((t,q),(s,p)).\<Gamma>\<turnstile>Callp\<down>Normals\<and> (existsc.Gammaturnstile>(pNormal)<>\<+cNormalt)\ndc=)
:: where "subst_redexSkipsteps_Throw_impl_exec[OFrest[simplifiedthis]]Normal "subst_redex(Basicf)c=c"| "subst_redex(Specr)c=c"| "subst_redex(Seqc\<^sub>1c\<^sub>2)c=Seq(subst_redexc\<^sub>1c)c\<^sub>2"| "Condc\<>1\^sub>2)c==c"f_0:f0=(d,Abrupts" "subst_redex(Whilebc')c=c"| "subst_redex(Callp)c=c"| "(dd)c=c"java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 "step"\<i\<>turnstilefi\rightarrow(uci" "subst_redex(Throw)c=c"| "subst_redex(Catchc\by(elim:step_elim_cases
lemmastep_redex': \<amma><(c,)\<'s<>\>\(c)<subst_redexc''java.lang.StringIndexOutOfBoundsException: Index 143 out of bounds for length 143 by(inductc)(autointro:step.Seqstep.Catch)
lemmasteps_redex: assumessteps:"\<Gamma>\<turnstile>( row\^>*subst_redexc's' usingsteps proof[of0]java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 caseRefl show"\<Gamma>\<turnstile>(subst_redexcr',s')\<rightarrow>\<^sup>*(subst_redexcr',s')" bysimp next case(Transrsr''s'') have"\<Gamma>\<turnstile>(r,s)\<rightarrow>(r'',s'')"byfact fromstep_redex[OFthis] have"\<Gamma>\<turnstile>(subst_redexcr,s)\<rightarrow>(subst_redexcr'',s'')". also have"\<Gamma>\<turnstile>(subst_redexcr'',s'')\<rightarrow>\<showFalse finallyshow?case. qed
showby(stepDynCom) ML_Thms.bind_thm("trancl_induct2",Split_Rule.split_rule@{context} (Rule_Instsjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 [((a).none(a,ab",(("b,0,Positionproofcases"s\g" @{thmtrancl_induct})); \(rule_tac=<>.(Suci"inexIjava.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55
lemmasteps_redex': assumessteps:"\<Gamma>\<turnstile>(r,s)\<rightarrow>\<^sup>+(r',s')" shows"\<And>c.\<Gamma>\<turnstile>(subst_redexcr,s)\<rightarrow>\<^sup>+(subst_redexcr',s')" usingsteps proof(inductrule:tranclp_induct2[consumes1,case_namesStepTrans]) case(Stepr's') have"\<Gamma>\<turnstile>(r,s)\<rightarrow>(r',s')"byfact then\<Gamma<turnstile(subst_redexc,s<>cr's) by(rulestep_redex) thenshow"\<Gamma>\<turnstile>(subst_redexcr,s)\<rightarrow>\<^sup>+(subst_redexcr',s')".. next case(Transr's'r''s'') have"\<Gamma>\<turnstile>(subst_redexcr,s)\<rightarrow>\<^sup>+(subst_redexcr',s')"byfact also have"\<Gamma>\<turnstile>(rjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 17 hence"\<Gamma>\<turnstile>(subst_redexcr',s')\<rightarrow>(subst_redexcr'',s'')" by(elim:) finally"\<>\ qed
primrecsteps_c\<^sub>1"<amma\turnstile>case(CondFalsesbc2java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28 where "seqcby(utosimpaddfinal_def) <Gamma\turnstileCatch\^>\^>,Normal)<rightarrow>(c'\^>f_step:\nd>>i\rightarrow>(uc"
lemmarenumber': assumesf:"\<forall>i.show?thesis assumesa_b:"(a,b)\<in>r\<^sup>*" shows"b=f0\<Longrightarrow>(\<exists>f.f0=a\<and>(\<forall>i.(fi,f(Suci))\<in>rjava.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 using proof(inductrule:converse_rtrancl_induct[consumes1]) assume"b=f0" withfshow"\<exists>f.f0=b\<and>(\<forall>i.(fi,f(Suci))\<in>r)" byblast next fixaf_0:"f0(hilec,s) assumea_z:fromf_stepof0]f_0java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 assume"b=f0\<Longrightarrow>\<exists>show?thesis "b=f0" thenobtainfwheref0:"f0=z"andseq:"\<forall>i.(fi,f(Suci))\<in>r" byiprover { fixihave"((\<lambda>i.caseiof0\<Rightarrow>a|Suci\<Rightarrow>fi)i,fi)\<in>r" usingseqa_zf0 by(casesi)auto } then (************************havehyp\>\<>turnstile(,Normals\<ightarrow\>\)fact by-(ruleexI[wherex="\<lambda>i.caseiof0\<Rightarrow>a|Suci\<Rightarrow>fi"],simp) qed
lemmarenumber: \forall.fi\in>\sup>\>f,(uc)\injava.lang.StringIndexOutOfBoundsException: Index 67 out of bounds for length 67 \<Longrightarrow>\<exists>f.f0=a\<and>(\<forall>i.(fi,f(Suci))\<in>r)" by(blastdest:renumber')
corollaryterminates_impl_no_infinite_trans_computation: assumesterminates:"\<Gamma>\<turnstile>c\<down>s" shows"\<not>(\<exists>f.f0=(c,s)\<and>(\<forall>i.\<GammaTranshyps()[OFr'] proof- have"wf({(y,x).\<Gamma>\<turnstile>(c,s)\<rightarrow>\<^sup>*x\<and>\<Gamma>\<turnstile>x\<rightarrow>y}\<^sup>+)" proof(rulewf_trancl) show"wf{(y,x).\<Gamma>\<turnstile>(c,s)\<rightarrow>\<^sup>*x\<and>\apply:\>\turnstile(,)<<uprsjava.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 proofbysimp fixf assume"<forall>.by(:) hence"\<exists>f.f(0::nat)=(c,s)\<and>(\<forall>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci))" by(rulerenumber[to_pred]) moreoverfromterminates_impl_no_infinite_computationsplit_inf_Catch[OFthisCatch.hyps have"\<not>(\<exists>f.f(0::nat)=(c,s)\<and>(\<forall>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)))" >\Gamma\turnstile(pNormal)\rightarrow>\<sup>+(c,t)<{thmtrancl_induct}; ultimatelyshowFalse bysimp qed hence"\<not>(\<exists>f.\<forall>i.(f(Suci),fi) \<in>{(y,x).\<Gamma>\<turnstile>(c,s)\<rightarrow>\<^sup>*x\<and>\<Gamma>by(rulestep_redex) by(simpadd:wf_iff_no_infinite_down_chain) thus?thesis proof(rulecontrapos_nn) assume"\<exists>f.f(0::nat)=(c,s)"\<amma><(subst_redexr,)<rightarrow>(subst_redex'',s'')" thenobtainfwhere f0:"f0=(c,s)"and seq:"\<forall>i.\<Gamma>\lemmasteps_redex: iprover show"\<Gamma><turnstile>(subst_redexcr',s)\rightarrow>\^>*(subst_redexr,'" proof(uleexI[wherexf],allI) fixi show"(f(Suci),fi)\<in>{(y,x).\<Gamma>\<turnstile>(c,s)\<rightarrow>\<^sup>*x\<and>\<Gamma>\<turnstile>x\<rightarrow>y}\<^sup>+" proof- { fixjava.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 proof(inducti) 0showthen by(simpadd:f0) next case(Sucn) rule withseqshow"\<Gamma>\<turnstile>(c,s)\<rightarrow>\<^sup>*f(Sucn)" by(blastintro:tranclp_into_rtranclprtranclp_trans) qed } hence"\<Gamma>\<turnstile>(c,s)\<rightarrow>\<^sup>*fi" byiprover withseqhave "(f(Suci),fi)\<in>{(y,x).\<Gamma>\<turnstile>(c,s)\<rightarrow>\<^sup>*x\<and>\Gamma><>\rightarrow><>y" byclarsimp moreover haveterminates_impl_no_infinite_trans_computation by(blastintro:tranclp_into_rtranclprtranclp_trans) ultimately show?thesis by(substlem) qed qed qed
theoremwf_termi_call_steps:"wf(termi_call_steps\<Gamma>)" proof(simponly:termi_call_steps_defwf_iff_no_infinite_down_chain, clarify,simp) fix:"Gamma\<>c<owns" assumeinf:"\<forall>i.(\<lambda>(t,q)(s,p). \<Gamma>\<turnstile>Callp\<down>Normals\<and> (exists.\Gamma><>Call,Normalsimp:wf_iff_no_infinite_down_chain (ffixf defineswhere"si=fst(fi)"fori::nat i=snd(f:)fori:nat inf have':forall.\Gamma\>allpi<downNormal((s)\<> (\<exists>c.\<Gamma>\<turnstile>(Call(pi),Normal(si))\<rightarrow>\<^sup>+(c,Normal(s(i+1hence<not>(<exists>.<forall>i.((uleexI[f]rule) redexc=Callshow apply- apply(ruleallI) apply(erule_tacx=iinjava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 13 apply done
proof- frominf' have"\<exists>c.\<forall>i.\<Gamma>\<turnstile>Call(pi)\<down>Normal(sibyiprover \<Gamma>\<turnstile>(Call(pi),Normal(si))\<rightarrowhave"<forall>y\><turnstile><rightarrow><sup>+y\longrightarrow\Gamma>turnstile(cs)\subst redex(ci)=Call(p(i+1))" apply- apply(rulechoice) byblast thenobtaincwhere termi_c:"\<forall>i.\<Gamma>\<turnstile>Call(pi)f(i))(fi)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 steps_c:"\<forall>i.\defineswhere"sfst(fi)"fori::nat red_c:"\<forall>i.redex(ci)=Call(p(i+1))" byauto definegwhere"gi=(seqc(p0)i,Normal(si)::('a,'c)xstate)"fori fromred_c[rule_format,of0] have"g0=(Call(p0),Normal(s0))" by(simpadd:g_def) moreover { fixi have"redex(seqc(p0)i)=Call(pi)" by(inducti)(autosimpadd:redex_subst_redexred_c) fromthis[symmetric] have"subst_redex(seqc(p0termi_c"\<forall>.<Gamma>>(pi<>Normalfixi by(simpadd: }notesubst_redex_seq=this "Gamma>\>(i)\rightarrow\<sup+g(i1)) proof fixi fromsteps_c[rule_format,ijava.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 have"\<Gamma>\<turnstile>(Call(pi),Normal(si))\<rightarrow>\<^sup>+(ci,Normal(s(i+1)))". from"<><subst_redexcp))Calli)Normals)<>\sup> have"\<Gamma>\<turnstile>(subst_redex(seqc(p0)i)(Call(pi)),Normal(si))\<rightarrow>\<^by(:inf_defjava.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 (subst_redex(seqc(p0)i)(ci),Normal(s(i+1)))". hence"\<Gamma>\<turnstile>(seqc(p0)i,Normal(si))\<rightarrow>\<^sup>+ (seqc(p0)(i+1><exists>cs'java.lang.StringIndexOutOfBoundsException: Index 120 out of bounds for length 120 bysimpadd:subst_redex_seq) thus"\<Gamma>\<turnstile>(gi)\<rightarrow>\<^sup>+(g(i+1))" by(simpadd:g_def) by(cases"final(c\^sub>1,Normals))(fastforceintrostep.ntrossimp:final_def+ moreover fromterminates_impl_no_infinite_trans_computation[OFtermi_c[rule_format,of0]] have"\<not>(\<exists>f.f0=(Call(p0),Normal(s0))\<and>(\<forall>i.\<Gammajava.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18 ultimatelyshowFalse byauto qed qed
lemmano_infinite_computation_implies_wf: assumesal_termi: shows"wf{(c2,c1).\<Gamma>\<turnstile>(c,s)\<rightarrow>\<^sup>*c1\<and>\<Gamma>\<turnstile>c1\<rightarrow>c2}" proof(simponly:wf_iff_no_infinite_down_chain,clarify,simp) fixbycases"<>.inductconverse_rtranclp_induct2[case_namesTransjava.lang.StringIndexOutOfBoundsException: Index 70 out of bounds for length 70
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3 hence"\<exists>f.f0=(c,s)\<and>(\<forall>i.\<Gamma [to_pred]java.lang.StringIndexOutOfBoundsException: Index 32 out of bounds for length 32 moreoverfromnot_inf have"\<not>(\<exists>f.f0=(c,s)\<and>(\<forall>i.\<Gamma>\<turnstile>fi\<rightarrow>f(Suci)))" simpaddinf_def) ultimatelyshowFalse qed
lemmanot_final_Stuck_step:"\<not>final(c,Stuck)\<Longrightarrow>\<exists>c's'.\<Gamma>\<turnstile>(c,Stuck)\<rightarrow>by bylemmajava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
lemmasplit_computation "\<not>final(c,Abrupts)\<Longrightarrow>\<exists>c's'.\ byc(fastforce:step.introssimpaddassumesGamma\<rightarrow,'java.lang.StringIndexOutOfBoundsException: Index 65 out of bounds for length 65
lemmanot_final_Normal_step: thus"\<Gamma>\<turnstilec'<>ss' proof(inductc) caseSkipthus?caseby(fastforceintro:step.introssimpadd:final_def) next Basicthus?casebyfastforceintro:step.intros) next case(Specr) thus?case by(cases"\<exists>t.(,t)\inr")(fastforceintro:step.intros)+ next case(Seqc\<^sub>1c\<^sub>2) thus?case by(cases"final(c\<^sub>1,Normals)")(fastforceintro:step.introssimpadd:final_def)+ next case(Condbc1c2) "s<>)fastforceintrostepintros+ next case(Whilebc) show?case by(cases"s\<in>b")(fastforceintro:step.intros)+
java.lang.StringIndexOutOfBoundsException: Index 4 out of bounds for length 4 case(Callp) show?case by(cases"\<Gamma>p"(fastforceintro:step.intros)+ next (ynComcjava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 next case(Guardfgc) show?case by(cases"s\<in>g")(fastforcecase(Guardfgc) next lemmawf_implies_termi_reach ?casebyfastforceintro:step.introssimpaddfinal_def) next case(Catchc\<^sub>c<^sub>2 thus?case byhypp:<>c2s2.\<Gamma>\<turnstile>(c1,s1)<(c2,s2)\<Longrightarrow>\<Gamma>\<turnstile>c2\<down>s2" qed
text‹
an important lemma for the completeness proof of the Hoare-logic for
correctness we need a generalisation of @{const "redex"} that not only
the redex itself but all the enclosing statements as well. ›
primrec redexes:: "('s,'p,'f)com ==> ('s,'p,'f)com set" where "redexes Skip = {Skip}" | "redexes (Basic f) = {Basic f}" | "redexes (Spec r) = {Spec r}" | "redexes (Seq c1 c2) = {Seq c1 c2} ∪ redexes c1" | "redexes (Cond b c1 c2) = {Cond b c1 c2}" | "redexes (While b c) = {While b c}" | "redexes (Call p) = {Call p}" | "redexes (DynCom d) = {DynCom d}" | "redexes (Guard f b c) = {Guard f b c}" | "redexes (Throw) = {Throw}" | "redexes (Catch c1 c2) = {Catch c1 c2} ∪ redexes c1"
lemma root_in_redexes: "c ∈ redexes c" apply (induct c) apply auto done
lemma redex_in_redexes: "redex c ∈ redexes c" apply (induct c) apply auto done
lemma redex_redexes: "∧c'. [c' ∈ redexes c; redex c' = c']==> redex c = c'" apply (induct c) apply auto done
lemma step_redexes: shows"∧r r'. [Γ⊨(r,s) → (r',s'); r ∈ redexes c] ==>∃c'. Γ⊨(c,s) → (c',s') ∧ r' ∈ redexes c'" proof (induct c) case Skip thus ?caseby (fastforce intro: step.intros elim: step_elim_cases) next case Basic thus ?caseby (fastforce intro: step.intros elim: step_elim_cases) next case Spec thus ?caseby (fastforce intro: step.intros elim: step_elim_cases) next case (Seq c1 c2) have"r ∈ redexes (Seq c1 c2)"by fact hence r: "r = Seq c1 c2∨ r ∈ redexes c1" by simp have step_r: "Γ⊨ (r, s) → (r', s')"by fact from r show ?case proof assume"r = Seq c1 c2" with step_r show ?case by (auto simp add: root_in_redexes) next assume r: "r ∈ redexes c1" from Seq.hyps (1) [OF step_r this] obtain c' where
step_c1: "Γ⊨ (c1, s) → (c', s')"and
r': "r' ∈ redexes c'" by blast from step.Seq [OF step_c1] have"Γ⊨ (Seq c1 c2, s) → (Seq c' c2, s')". with r' show ?case by auto qed next case Cond thus ?case by (fastforce intro: step.intros elim: step_elim_cases simp add: root_in_redexes) next case While thus ?case by (fastforce intro: step.intros elim: step_elim_cases simp add: root_in_redexes) next case Call thus ?case by (fastforce intro: step.intros elim: step_elim_cases simp add: root_in_redexes) next case DynCom thus ?case by (fastforce intro: step.intros elim: step_elim_cases simp add: root_in_redexes) next case Guard thus ?case by (fastforce intro: step.intros elim: step_elim_cases simp add: root_in_redexes) next case Throw thus ?case by (fastforce intro: step.intros elim: step_elim_cases simp add: root_in_redexes) next case (Catch c1 c2) have"r ∈ redexes (Catch c1 c2)"by fact hence r: "r = Catch c1 c2∨ r ∈ redexes c1" by simp have step_r: "Γ⊨ (r, s) → (r', s')"by fact from r show ?case proof assume"r = Catch c1 c2" with step_r show ?case by (auto simp add: root_in_redexes) next assume r: "r ∈ redexes c1" from Catch.hyps (1) [OF step_r this] obtain c' where
step_c1: "Γ⊨ (c1, s) → (c', s')"and
r': "r' ∈ redexes c'" by blast from step.Catch [OF step_c1] have"Γ⊨ (Catch c1 c2, s) → (Catch c' c2, s')". with r' show ?case by auto qed qed
lemma steps_redexes: assumes steps: "Γ⊨ (r, s) →* (r', s')" shows"∧c. r ∈ redexes c ==>∃c'. Γ⊨(c,s) →* (c',s') ∧ r' ∈ redexes c'" using steps proof (induct rule: converse_rtranclp_induct2 [case_names Refl Trans]) case Refl then show"∃c'. Γ⊨ (c, s') →* (c', s') ∧ r' ∈ redexes c'" by auto next case (Trans r s r'' s'') have"Γ⊨ (r, s) → (r'', s'')""r ∈ redexes c"by fact+ from step_redexes [OF this] obtain c' where
step: "Γ⊨ (c, s) → (c', s'')"and
r'': "r'' ∈ redexes c'" by blast note step also from Trans.hyps (3) [OF r''] obtain c'' where
steps: "Γ⊨ (c', s'') →* (c'', s')"and
r': "r' ∈ redexes c''" by blast note steps finally show ?case using r' by blast qed
lemma steps_redexes': assumes steps: "Γ⊨ (r, s) →+ (r', s')" shows"∧c. r ∈ redexes c ==>∃c'. Γ⊨(c,s) →+ (c',s') ∧ r' ∈ redexes c'" using steps proof (induct rule: tranclp_induct2 [consumes 1, case_names Step Trans]) case (Step r' s' c') have"Γ⊨ (r, s) → (r', s')""r ∈ redexes c'"by fact+ from step_redexes [OF this] show ?case by (blast intro: r_into_trancl) next case (Trans r' s' r'' s'') from Trans obtain c' where
steps: "Γ⊨ (c, s) →+ (c', s')"and
r': "r' ∈ redexes c'" by blast note steps moreover have"Γ⊨ (r', s') → (r'', s'')"by fact from step_redexes [OF this r'] obtain c'' where
step: "Γ⊨ (c', s') → (c'', s'')"and
r'': "r'' ∈ redexes c''" by blast note step finallyshow ?case using r'' by blast qed
lemma step_redexes_Seq: assumes step: "Γ⊨(r,s) → (r',s')" assumes Seq: "Seq r c2∈ redexes c" shows"∃c'. Γ⊨(c,s) → (c',s') ∧ Seq r' c2∈ redexes c'" proof - from step.Seq [OF step] have"Γ⊨ (Seq r c2, s) → (Seq r' c2, s')". from step_redexes [OF this Seq] show ?thesis . qed
lemma steps_redexes_Seq: assumes steps: "Γ⊨ (r, s) →* (r', s')" shows"∧c. Seq r c2∈ redexes c ==> ∃c'. Γ⊨(c,s) →* (c',s') ∧ Seq r' c2∈ redexes c'" using steps proof (induct rule: converse_rtranclp_induct2 [case_names Refl Trans]) case Refl thenshow ?case by (auto)
next case (Trans r s r'' s'') have"Γ⊨ (r, s) → (r'', s'')""Seq r c2∈ redexes c"by fact+ from step_redexes_Seq [OF this] obtain c' where
step: "Γ⊨ (c, s) → (c', s'')"and
r'': "Seq r'' c2∈ redexes c'" by blast note step also from Trans.hyps (3) [OF r''] obtain c'' where
steps: "Γ⊨ (c', s'') →* (c'', s')"and
r': "Seq r' c2∈ redexes c''" by blast note steps finally show ?case using r' by blast qed
lemma steps_redexes_Seq': assumes steps: "Γ⊨ (r, s) →+ (r', s')" shows"∧c. Seq r c2∈ redexes c ==>∃c'. Γ⊨(c,s) →+ (c',s') ∧ Seq r' c2∈ redexes c'" using steps proof (induct rule: tranclp_induct2 [consumes 1, case_names Step Trans]) case (Step r' s' c') have"Γ⊨ (r, s) → (r', s')""Seq r c2∈ redexes c'"by fact+ from step_redexes_Seq [OF this] show ?case by (blast intro: r_into_trancl) next case (Trans r' s' r'' s'') from Trans obtain c' where
steps: "Γ⊨ (c, s) →+ (c', s')"and
r': "Seq r' c2∈ redexes c'" by blast note steps moreover have"Γ⊨ (r', s') → (r'', s'')"by fact from step_redexes_Seq [OF this r'] obtain c'' where
step: "Γ⊨ (c', s') → (c'', s'')"and
r'': "Seq r'' c2∈ redexes c''" by blast note step finallyshow ?case using r'' by blast qed
lemma step_redexes_Catch: assumes step: "Γ⊨(r,s) → (r',s')" assumes Catch: "Catch r c2∈ redexes c" shows"∃c'. Γ⊨(c,s) → (c',s') ∧ Catch r' c2∈ redexes c'" proof - from step.Catch [OF step] have"Γ⊨ (Catch r c2, s) → (Catch r' c2, s')". from step_redexes [OF this Catch] show ?thesis . qed
lemma steps_redexes_Catch: assumes steps: "Γ⊨ (r, s) →* (r', s')" shows"∧c. Catch r c2∈ redexes c ==> ∃c'. Γ⊨(c,s) →* (c',s') ∧ Catch r' c2∈ redexes c'" using steps proof (induct rule: converse_rtranclp_induct2 [case_names Refl Trans]) case Refl thenshow ?case by (auto)
next case (Trans r s r'' s'') have"Γ⊨ (r, s) → (r'', s'')""Catch r c2∈ redexes c"by fact+ from step_redexes_Catch [OF this] obtain c' where
step: "Γ⊨ (c, s) → (c', s'')"and
r'': "Catch r'' c2∈ by blast note step o ranssh() [O '] btain'' wheere steps:"<⊨* (c'', s')" and bolol | wsymbol s ers,,[membe]), tes
java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 9 show ?case usingarcter0C)]), by (CH xF9)]), qed
lemma steps_redexes_Catch': assumes steps: "Γ+ (r', s')" shows "size_binsL JSON_cfg JSON_inp2)<comment33720›
tjava.lang.StringIndexOutOfBoundsException: Index 12 out of bounds for length 12 usingjava.lang.StringIndexOutOfBoundsException: Index 11 out of bounds for length 11 proof etranclp_induct2 se_names Step "PagesRefresh"
row2∈ from step_redexes_CatchFhis show rce by (blast intror_into_trancl next case (Trans r' s' r'' s'') from Trans obtain c' where
steps: "Γ⊨ (c, s) →+ (c', s')"and
r': "Catch r' c2∈ redexes c'" by blast note steps moreover have"Γ⊨ (r', s') → (r'', s'')"by fact from step_redexes_Catch [OF this r'] obtain c'' where
step: "Γ⊨ (c', s') → (c'', s'')"and
r'': "Catch r'' c2∈ redexes c''" by blast note step finallyshow ?case using r'' by blast qed
lemma redexes_subset:"∧c'. c' ∈ redexes c ==> redexes c' ⊆ redexes c" by (induct c) auto
lemma redexes_preserves_termination: assumes termi: "Γ⊨c↓s" shows"∧c'. c' ∈ redexes c ==> Γ⊨c'↓s" using termi by induct (auto intro: terminates.intros)
end
Messung V0.5 in Prozent
¤ 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.0.162Bemerkung:
(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.