:: SCMFSA_9 semantic presentation begin Lm1: card (Stop SCM+FSA) = 1 by AFINSQ_1:33; Lm2: (Stop SCM+FSA) . 0 = halt SCM+FSA by AFINSQ_1:34; Lm3: 0 in dom (Stop SCM+FSA) by COMPOS_1:3; set SA0 = Start-At (0,SCM+FSA); theorem Th1: :: SCMFSA_9:1 for I being Program of for a being Int-Location holds card (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (card I) + 6 proof let I be Program of ; ::_thesis: for a being Int-Location holds card (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (card I) + 6 let a be Int-Location; ::_thesis: card (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (card I) + 6 thus card (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = ((card (I ";" (Goto 0))) + 1) + 4 by Lm1, SCMFSA8B:11 .= (((card I) + (card (Goto 0))) + 1) + 4 by SCMFSA6A:21 .= (((card I) + 1) + 1) + 4 by SCMFSA8A:15 .= (card I) + 6 ; ::_thesis: verum end; theorem Th2: :: SCMFSA_9:2 for I being Program of for a being Int-Location holds card (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (card I) + 6 proof let I be Program of ; ::_thesis: for a being Int-Location holds card (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (card I) + 6 let a be Int-Location; ::_thesis: card (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (card I) + 6 thus card (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = ((card (I ";" (Goto 0))) + 1) + 4 by Lm1, SCMFSA8B:12 .= (((card I) + (card (Goto 0))) + 1) + 4 by SCMFSA6A:21 .= (((card I) + 1) + 1) + 4 by SCMFSA8A:15 .= (card I) + 6 ; ::_thesis: verum end; definition let a be Int-Location; let I be Program of ; func while=0 (a,I) -> Program of equals :: SCMFSA_9:def 1 (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)); correctness coherence (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)) is Program of ; proof set C = if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)); set i = ((card I) + 4) .--> (goto 0); set P = (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)); ( card (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (card I) + 6 & (card I) + 4 < (card I) + 6 ) by Th1, XREAL_1:6; then (card I) + 4 in dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by AFINSQ_1:66; then A1: {((card I) + 4)} c= dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by ZFMISC_1:31; A2: dom ((if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0))) = (dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1 .= (dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ {((card I) + 4)} by FUNCOP_1:13 .= dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A1, XBOOLE_1:12 ; (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)) is initial proof let m, n be Nat; :: according to AFINSQ_1:def_12 ::_thesis: ( not n in dom ((if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0))) or n <= m or m in dom ((if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0))) ) thus ( not n in dom ((if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0))) or n <= m or m in dom ((if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0))) ) by A2, AFINSQ_1:def_12; ::_thesis: verum end; hence (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)) is Program of ; ::_thesis: verum end; func while>0 (a,I) -> Program of equals :: SCMFSA_9:def 2 (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)); correctness coherence (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)) is Program of ; proof set C = if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)); set i = ((card I) + 4) .--> (goto 0); set P = (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)); ( card (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (card I) + 6 & (card I) + 4 < (card I) + 6 ) by Th2, XREAL_1:6; then (card I) + 4 in dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by AFINSQ_1:66; then A3: {((card I) + 4)} c= dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by ZFMISC_1:31; A4: dom ((if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0))) = (dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1 .= (dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ {((card I) + 4)} by FUNCOP_1:13 .= dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A3, XBOOLE_1:12 ; (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)) is initial proof let m, n be Nat; :: according to AFINSQ_1:def_12 ::_thesis: ( not n in dom ((if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0))) or n <= m or m in dom ((if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0))) ) thus ( not n in dom ((if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0))) or n <= m or m in dom ((if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0))) ) by A4, AFINSQ_1:def_12; ::_thesis: verum end; hence (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)) is Program of ; ::_thesis: verum end; end; :: deftheorem defines while=0 SCMFSA_9:def_1_:_ for a being Int-Location for I being Program of holds while=0 (a,I) = (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)); :: deftheorem defines while>0 SCMFSA_9:def_2_:_ for a being Int-Location for I being Program of holds while>0 (a,I) = (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)); theorem Th3: :: SCMFSA_9:3 for I being Program of for a being Int-Location holds card (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) = (card I) + 11 proof let I be Program of ; ::_thesis: for a being Int-Location holds card (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) = (card I) + 11 let a be Int-Location; ::_thesis: card (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) = (card I) + 11 thus card (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) = (1 + (card (if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) + 4 by Lm1, SCMFSA8B:11 .= ((((card (I ";" (Goto 0))) + 1) + 4) + 1) + 4 by Lm1, SCMFSA8B:12 .= (((((card I) + (card (Goto 0))) + 1) + 4) + 1) + 4 by SCMFSA6A:21 .= (((((card I) + 1) + 1) + 4) + 1) + 4 by SCMFSA8A:15 .= (card I) + 11 ; ::_thesis: verum end; definition let a be Int-Location; let I be Program of ; func while<0 (a,I) -> Program of equals :: SCMFSA_9:def 3 (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) +* (((card I) + 4) .--> (goto 0)); correctness coherence (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) +* (((card I) + 4) .--> (goto 0)) is Program of ; proof set C = if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0))))); set i = ((card I) + 4) .--> (goto 0); set P = (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) +* (((card I) + 4) .--> (goto 0)); ( card (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) = (card I) + 11 & (card I) + 4 < (card I) + 11 ) by Th3, XREAL_1:6; then (card I) + 4 in dom (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) by AFINSQ_1:66; then A1: {((card I) + 4)} c= dom (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) by ZFMISC_1:31; A2: dom ((if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) +* (((card I) + 4) .--> (goto 0))) = (dom (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0))))))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1 .= (dom (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0))))))) \/ {((card I) + 4)} by FUNCOP_1:13 .= dom (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) by A1, XBOOLE_1:12 ; (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) +* (((card I) + 4) .--> (goto 0)) is initial proof let m, n be Nat; :: according to AFINSQ_1:def_12 ::_thesis: ( not n in dom ((if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) +* (((card I) + 4) .--> (goto 0))) or n <= m or m in dom ((if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) +* (((card I) + 4) .--> (goto 0))) ) thus ( not n in dom ((if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) +* (((card I) + 4) .--> (goto 0))) or n <= m or m in dom ((if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) +* (((card I) + 4) .--> (goto 0))) ) by A2, AFINSQ_1:def_12; ::_thesis: verum end; hence (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) +* (((card I) + 4) .--> (goto 0)) is Program of ; ::_thesis: verum end; end; :: deftheorem defines while<0 SCMFSA_9:def_3_:_ for a being Int-Location for I being Program of holds while<0 (a,I) = (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) +* (((card I) + 4) .--> (goto 0)); theorem Th4: :: SCMFSA_9:4 for I being Program of for a being Int-Location holds card (while=0 (a,I)) = (card I) + 6 proof let I be Program of ; ::_thesis: for a being Int-Location holds card (while=0 (a,I)) = (card I) + 6 let a be Int-Location; ::_thesis: card (while=0 (a,I)) = (card I) + 6 set i = ((card I) + 4) .--> (goto 0); set C = if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)); set P = (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)); A1: card (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (card I) + 6 by Th1; (card I) + 4 < (card I) + 6 by XREAL_1:6; then (card I) + 4 in dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A1, AFINSQ_1:66; then A2: {((card I) + 4)} c= dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by ZFMISC_1:31; dom ((if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0))) = (dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1 .= (dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ {((card I) + 4)} by FUNCOP_1:13 .= dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A2, XBOOLE_1:12 ; hence card (while=0 (a,I)) = (card I) + 6 by A1; ::_thesis: verum end; theorem Th5: :: SCMFSA_9:5 for I being Program of for a being Int-Location holds card (while>0 (a,I)) = (card I) + 6 proof let I be Program of ; ::_thesis: for a being Int-Location holds card (while>0 (a,I)) = (card I) + 6 let a be Int-Location; ::_thesis: card (while>0 (a,I)) = (card I) + 6 set i = ((card I) + 4) .--> (goto 0); set C = if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)); set P = (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0)); A1: card (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (card I) + 6 by Th2; (card I) + 4 < (card I) + 6 by XREAL_1:6; then (card I) + 4 in dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A1, AFINSQ_1:66; then A2: {((card I) + 4)} c= dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by ZFMISC_1:31; dom ((if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0))) = (dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1 .= (dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ {((card I) + 4)} by FUNCOP_1:13 .= dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A2, XBOOLE_1:12 ; hence card (while>0 (a,I)) = (card I) + 6 by A1; ::_thesis: verum end; theorem :: SCMFSA_9:6 for I being Program of for a being Int-Location holds card (while<0 (a,I)) = (card I) + 11 proof let I be Program of ; ::_thesis: for a being Int-Location holds card (while<0 (a,I)) = (card I) + 11 let a be Int-Location; ::_thesis: card (while<0 (a,I)) = (card I) + 11 set i = ((card I) + 4) .--> (goto 0); set C = if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0))))); set P = (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) +* (((card I) + 4) .--> (goto 0)); A1: card (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) = (card I) + 11 by Th3; (card I) + 4 < (card I) + 11 by XREAL_1:6; then (card I) + 4 in dom (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) by A1, AFINSQ_1:66; then A2: {((card I) + 4)} c= dom (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) by ZFMISC_1:31; dom ((if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) +* (((card I) + 4) .--> (goto 0))) = (dom (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0))))))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1 .= (dom (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0))))))) \/ {((card I) + 4)} by FUNCOP_1:13 .= dom (if=0 (a,(Stop SCM+FSA),(if>0 (a,(Stop SCM+FSA),(I ";" (Goto 0)))))) by A2, XBOOLE_1:12 ; hence card (while<0 (a,I)) = (card I) + 11 by A1; ::_thesis: verum end; theorem :: SCMFSA_9:7 canceled; theorem :: SCMFSA_9:8 canceled; theorem :: SCMFSA_9:9 canceled; theorem Th10: :: SCMFSA_9:10 for a being Int-Location for I being Program of holds ( 0 in dom (while=0 (a,I)) & 1 in dom (while=0 (a,I)) & 0 in dom (while>0 (a,I)) & 1 in dom (while>0 (a,I)) ) proof set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of holds ( 0 in dom (while=0 (a,I)) & 1 in dom (while=0 (a,I)) & 0 in dom (while>0 (a,I)) & 1 in dom (while>0 (a,I)) ) let I be Program of ; ::_thesis: ( 0 in dom (while=0 (a,I)) & 1 in dom (while=0 (a,I)) & 0 in dom (while>0 (a,I)) & 1 in dom (while>0 (a,I)) ) set I1 = I ";" (Goto 0); set f = ((card I) + 4) .--> (goto 0); set i = a =0_goto ((card (Stop SCM+FSA)) + 3); if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_1 .= (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by SCMFSA6A:25 .= ((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) by SCMFSA6A:25 .= (a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) by SCMFSA6A:29 .= (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) ; then A1: dom (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) c= dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by SCMFSA6A:17; dom (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) = {0,1} by COMPOS_1:61; then A2: ( 0 in dom (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) & 1 in dom (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ) by TARSKI:def_2; dom (while=0 (a,I)) = (dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1; then dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) c= dom (while=0 (a,I)) by XBOOLE_1:7; then dom (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) c= dom (while=0 (a,I)) by A1, XBOOLE_1:1; hence ( 0 in dom (while=0 (a,I)) & 1 in dom (while=0 (a,I)) ) by A2; ::_thesis: ( 0 in dom (while>0 (a,I)) & 1 in dom (while>0 (a,I)) ) set i = a >0_goto ((card (Stop SCM+FSA)) + 3); if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_2 .= (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by SCMFSA6A:25 .= ((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) by SCMFSA6A:25 .= (a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) by SCMFSA6A:29 .= (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) ; then A3: dom (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) c= dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by SCMFSA6A:17; dom (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) = {0,1} by COMPOS_1:61; then A4: ( 0 in dom (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) & 1 in dom (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ) by TARSKI:def_2; dom (while>0 (a,I)) = (dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1; then dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) c= dom (while>0 (a,I)) by XBOOLE_1:7; then dom (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) c= dom (while>0 (a,I)) by A3, XBOOLE_1:1; hence ( 0 in dom (while>0 (a,I)) & 1 in dom (while>0 (a,I)) ) by A4; ::_thesis: verum end; theorem Th11: :: SCMFSA_9:11 for a being Int-Location for I being Program of holds ( (while=0 (a,I)) . 0 = a =0_goto 4 & (while=0 (a,I)) . 1 = goto 2 & (while>0 (a,I)) . 0 = a >0_goto 4 & (while>0 (a,I)) . 1 = goto 2 ) proof set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of holds ( (while=0 (a,I)) . 0 = a =0_goto 4 & (while=0 (a,I)) . 1 = goto 2 & (while>0 (a,I)) . 0 = a >0_goto 4 & (while>0 (a,I)) . 1 = goto 2 ) let I be Program of ; ::_thesis: ( (while=0 (a,I)) . 0 = a =0_goto 4 & (while=0 (a,I)) . 1 = goto 2 & (while>0 (a,I)) . 0 = a >0_goto 4 & (while>0 (a,I)) . 1 = goto 2 ) set I1 = I ";" (Goto 0); set f = ((card I) + 4) .--> (goto 0); set i = a =0_goto ((card (Stop SCM+FSA)) + 3); A1: dom (while=0 (a,I)) = (dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1; A2: dom (((card I) + 4) .--> (goto 0)) = {((card I) + 4)} by FUNCOP_1:13; then A3: not 0 in dom (((card I) + 4) .--> (goto 0)) ; A4: dom (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) = {0,1} by COMPOS_1:61; then A5: 0 in dom (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) by TARSKI:def_2; A6: 1 in dom (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) by A4, TARSKI:def_2; A7: if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_1 .= (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by SCMFSA6A:25 .= ((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) by SCMFSA6A:25 .= (a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) by SCMFSA6A:29 .= (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) ; 1 <> (card I) + 4 by NAT_1:11; then A8: not 1 in dom (((card I) + 4) .--> (goto 0)) by A2, TARSKI:def_1; 0 in dom (while=0 (a,I)) by Th10; hence (while=0 (a,I)) . 0 = (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) . 0 by A3, A1, FUNCT_4:def_1 .= (Directed (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3)))) . 0 by A7, A5, SCMFSA8A:14 .= a =0_goto 4 by Lm1, SCMFSA7B:1 ; ::_thesis: ( (while=0 (a,I)) . 1 = goto 2 & (while>0 (a,I)) . 0 = a >0_goto 4 & (while>0 (a,I)) . 1 = goto 2 ) A9: dom (while>0 (a,I)) = (dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1; 1 in dom (while=0 (a,I)) by Th10; hence (while=0 (a,I)) . 1 = (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) . 1 by A1, A8, FUNCT_4:def_1 .= (Directed (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3)))) . 1 by A7, A6, SCMFSA8A:14 .= goto 2 by SCMFSA7B:2 ; ::_thesis: ( (while>0 (a,I)) . 0 = a >0_goto 4 & (while>0 (a,I)) . 1 = goto 2 ) set i = a >0_goto ((card (Stop SCM+FSA)) + 3); A10: if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_2 .= (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by SCMFSA6A:25 .= ((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) by SCMFSA6A:25 .= (a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) by SCMFSA6A:29 .= (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) ; A11: dom (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) = {0,1} by COMPOS_1:61; then A12: 0 in dom (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) by TARSKI:def_2; A13: 1 in dom (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) by A11, TARSKI:def_2; 0 in dom (while>0 (a,I)) by Th10; hence (while>0 (a,I)) . 0 = (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) . 0 by A3, A9, FUNCT_4:def_1 .= (Directed (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3)))) . 0 by A10, A12, SCMFSA8A:14 .= a >0_goto 4 by Lm1, SCMFSA7B:1 ; ::_thesis: (while>0 (a,I)) . 1 = goto 2 1 in dom (while>0 (a,I)) by Th10; hence (while>0 (a,I)) . 1 = (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) . 1 by A8, A9, FUNCT_4:def_1 .= (Directed (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3)))) . 1 by A10, A13, SCMFSA8A:14 .= goto 2 by SCMFSA7B:2 ; ::_thesis: verum end; theorem Th12: :: SCMFSA_9:12 for a being Int-Location for I being Program of for k being Element of NAT st k < 6 holds k in dom (while=0 (a,I)) proof let a be Int-Location; ::_thesis: for I being Program of for k being Element of NAT st k < 6 holds k in dom (while=0 (a,I)) let I be Program of ; ::_thesis: for k being Element of NAT st k < 6 holds k in dom (while=0 (a,I)) let k be Element of NAT ; ::_thesis: ( k < 6 implies k in dom (while=0 (a,I)) ) A1: 6 <= (card I) + 6 by NAT_1:11; A2: card (while=0 (a,I)) = (card I) + 6 by Th4; assume k < 6 ; ::_thesis: k in dom (while=0 (a,I)) then k < (card I) + 6 by A1, XXREAL_0:2; hence k in dom (while=0 (a,I)) by A2, AFINSQ_1:66; ::_thesis: verum end; theorem Th13: :: SCMFSA_9:13 for a being Int-Location for I being Program of for k being Element of NAT st k < 6 holds (card I) + k in dom (while=0 (a,I)) proof let a be Int-Location; ::_thesis: for I being Program of for k being Element of NAT st k < 6 holds (card I) + k in dom (while=0 (a,I)) let I be Program of ; ::_thesis: for k being Element of NAT st k < 6 holds (card I) + k in dom (while=0 (a,I)) let k be Element of NAT ; ::_thesis: ( k < 6 implies (card I) + k in dom (while=0 (a,I)) ) assume k < 6 ; ::_thesis: (card I) + k in dom (while=0 (a,I)) then A1: (card I) + k < (card I) + 6 by XREAL_1:6; card (while=0 (a,I)) = (card I) + 6 by Th4; hence (card I) + k in dom (while=0 (a,I)) by A1, AFINSQ_1:66; ::_thesis: verum end; theorem Th14: :: SCMFSA_9:14 for a being Int-Location for I being Program of holds (while=0 (a,I)) . ((card I) + 5) = halt SCM+FSA proof set J1 = Stop SCM+FSA; set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of holds (while=0 (a,I)) . ((card I) + 5) = halt SCM+FSA let I be Program of ; ::_thesis: (while=0 (a,I)) . ((card I) + 5) = halt SCM+FSA set I1 = I ";" (Goto 0); set f = ((card I) + 4) .--> (goto 0); set i = a =0_goto ((card (Stop SCM+FSA)) + 3); set c5 = (card I) + 5; set Lc5 = (card I) + 5; set Mi = (((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0)); ( dom (((card I) + 4) .--> (goto 0)) = {((card I) + 4)} & (card I) + 5 <> (card I) + 4 ) by FUNCOP_1:13; then A1: not (card I) + 5 in dom (((card I) + 4) .--> (goto 0)) by TARSKI:def_1; 0 + ((card I) + 5) in { (il + ((card I) + 5)) where il is Element of NAT : il in dom (Stop SCM+FSA) } by Lm3; then A2: (card I) + 5 in dom (Shift ((Stop SCM+FSA),((card I) + 5))) by VALUED_1:def_12; then A3: (Shift ((Stop SCM+FSA),((card I) + 5))) /. ((card I) + 5) = (Shift ((Stop SCM+FSA),((card I) + 5))) . (0 + ((card I) + 5)) by PARTFUN1:def_6 .= halt SCM+FSA by Lm2, Lm3, VALUED_1:def_12 ; A4: ( (card I) + 5 in dom (while=0 (a,I)) & dom (while=0 (a,I)) = (dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) ) by Th13, FUNCT_4:def_1; then A5: (card I) + 5 in dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A1, XBOOLE_0:def_3; A6: if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_1 .= ((((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) ; then card (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (card ((((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0)))) + (card (Stop SCM+FSA)) by SCMFSA6A:21; then A7: card ((((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) = (card (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) - (card (Stop SCM+FSA)) .= ((card I) + 6) - 1 by Th1, Lm1 .= (card I) + 5 ; then A8: not (card I) + 5 in dom ((((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ; A9: dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (Directed ((((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))))) \/ (dom (Reloc ((Stop SCM+FSA),((card I) + 5)))) by A6, A7, FUNCT_4:def_1; then dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom ((((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0)))) \/ (dom (Reloc ((Stop SCM+FSA),((card I) + 5)))) by FUNCT_4:99; then A10: (card I) + 5 in dom (Reloc ((Stop SCM+FSA),((card I) + 5))) by A5, A8, XBOOLE_0:def_3; A11: Reloc ((Stop SCM+FSA),((card I) + 5)) = IncAddr ((Shift ((Stop SCM+FSA),((card I) + 5))),((card I) + 5)) by COMPOS_1:34; thus (while=0 (a,I)) . ((card I) + 5) = ((Directed ((((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0)))) +* (Reloc ((Stop SCM+FSA),((card I) + 5)))) . ((card I) + 5) by A1, A4, A6, A7, FUNCT_4:def_1 .= (Reloc ((Stop SCM+FSA),((card I) + 5))) . ((card I) + 5) by A5, A9, A10, FUNCT_4:def_1 .= IncAddr ((halt SCM+FSA),((card I) + 5)) by A2, A3, A11, COMPOS_1:def_21 .= halt SCM+FSA by COMPOS_0:4 ; ::_thesis: verum end; theorem Th15: :: SCMFSA_9:15 for a being Int-Location for I being Program of holds (while=0 (a,I)) . 3 = goto ((card I) + 5) proof set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of holds (while=0 (a,I)) . 3 = goto ((card I) + 5) let I be Program of ; ::_thesis: (while=0 (a,I)) . 3 = goto ((card I) + 5) set I1 = I ";" (Goto 0); set f = ((card I) + 4) .--> (goto 0); set i = a =0_goto ((card (Stop SCM+FSA)) + 3); set Mi = (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA); set G = Goto ((card (I ";" (Goto 0))) + 1); set J2 = (I ";" (Goto 0)) ";" (Stop SCM+FSA); set J1 = (Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)); A1: 0 in dom (Goto ((card (I ";" (Goto 0))) + 1)) by SCMFSA8A:31; A2: (Goto ((card (I ";" (Goto 0))) + 1)) . 0 = goto ((card (I ";" (Goto 0))) + 1) by SCMFSA8A:31 .= goto (((card I) + (card (Goto 0))) + 1) by SCMFSA6A:21 .= goto (((card I) + 1) + 1) by SCMFSA8A:15 .= goto ((card I) + (1 + 1)) ; dom ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) = (dom (Directed (Goto ((card (I ";" (Goto 0))) + 1)))) \/ (dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),(card (Goto ((card (I ";" (Goto 0))) + 1)))))) by FUNCT_4:def_1 .= (dom (Goto ((card (I ";" (Goto 0))) + 1))) \/ (dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),(card (Goto ((card (I ";" (Goto 0))) + 1)))))) by FUNCT_4:99 ; then A3: 0 in dom ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) by A1, XBOOLE_0:def_3; then 0 + 3 in { (il + 3) where il is Element of NAT : il in dom ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) } ; then A4: 3 in dom (Shift (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)) by VALUED_1:def_12; then A5: (Shift (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)) /. 3 = (Shift (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)) . (0 + 3) by PARTFUN1:def_6 .= ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) . 0 by A3, VALUED_1:def_12 .= (Directed (Goto ((card (I ";" (Goto 0))) + 1))) . 0 by A1, SCMFSA8A:14 .= goto ((card I) + 2) by A1, A2, SCMFSA8A:16 ; ( dom (((card I) + 4) .--> (goto 0)) = {((card I) + 4)} & 3 <> (card I) + 4 ) by FUNCOP_1:13, NAT_1:11; then A6: not 3 in dom (((card I) + 4) .--> (goto 0)) by TARSKI:def_1; A7: card ((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) = (card (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3)))) + (card (Stop SCM+FSA)) by SCMFSA6A:21 .= 2 + 1 by Lm1, COMPOS_1:56 ; then A8: not 3 in dom ((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ; A9: ( 3 in dom (while=0 (a,I)) & dom (while=0 (a,I)) = (dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) ) by Th12, FUNCT_4:def_1; then A10: 3 in dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A6, XBOOLE_0:def_3; A11: CutLastLoc (stop ((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA))) = (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA) ; A12: if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_1 .= (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by SCMFSA6A:25 .= ((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) by SCMFSA6A:25 .= (Directed ((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA))) +* (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)) by A7, A11 ; then A13: dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (Directed ((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)))) \/ (dom (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3))) by FUNCT_4:def_1; then dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom ((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA))) \/ (dom (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3))) by FUNCT_4:99; then A14: 3 in dom (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)) by A10, A8, XBOOLE_0:def_3; A15: Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3) = IncAddr ((Shift (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)),3) by COMPOS_1:34; thus (while=0 (a,I)) . 3 = ((Directed ((Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA))) +* (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3))) . 3 by A6, A9, A12, FUNCT_4:def_1 .= (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)) . 3 by A10, A13, A14, FUNCT_4:def_1 .= IncAddr ((goto ((card I) + 2)),3) by A4, A5, A15, COMPOS_1:def_21 .= goto (((card I) + 2) + 3) by SCMFSA_4:1 .= goto ((card I) + 5) ; ::_thesis: verum end; theorem Th16: :: SCMFSA_9:16 for a being Int-Location for I being Program of holds (while=0 (a,I)) . 2 = goto 3 proof set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of holds (while=0 (a,I)) . 2 = goto 3 let I be Program of ; ::_thesis: (while=0 (a,I)) . 2 = goto 3 set I1 = I ";" (Goto 0); set f = ((card I) + 4) .--> (goto 0); set i = a =0_goto ((card (Stop SCM+FSA)) + 3); set Mi = Macro (a =0_goto ((card (Stop SCM+FSA)) + 3)); set J2 = (Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)); set J1 = (Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))); ( dom (((card I) + 4) .--> (goto 0)) = {((card I) + 4)} & 2 <> (card I) + 4 ) by FUNCOP_1:13, NAT_1:11; then A1: not 2 in dom (((card I) + 4) .--> (goto 0)) by TARSKI:def_1; dom ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) = (dom (Directed (Stop SCM+FSA))) \/ (dom (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),(card (Stop SCM+FSA))))) by FUNCT_4:def_1 .= (dom (Stop SCM+FSA)) \/ (dom (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),(card (Stop SCM+FSA))))) by FUNCT_4:99 ; then A2: 0 in dom ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) by Lm3, XBOOLE_0:def_3; then 0 + 2 in { (il + 2) where il is Element of NAT : il in dom ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) } ; then A3: 2 in dom (Shift (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)) by VALUED_1:def_12; then A4: (Shift (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)) /. 2 = (Shift (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)) . (0 + 2) by PARTFUN1:def_6 .= ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) . 0 by A2, VALUED_1:def_12 .= (Directed (Stop SCM+FSA)) . 0 by Lm3, SCMFSA8A:14 .= goto (card (Stop SCM+FSA)) by Lm2, Lm3, SCMFSA8A:16 ; card (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) = 2 by COMPOS_1:56; then A5: not 2 in dom (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))) ; A6: ( 2 in dom (while=0 (a,I)) & dom (while=0 (a,I)) = (dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) ) by Th12, FUNCT_4:def_1; then A7: 2 in dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A1, XBOOLE_0:def_3; A8: if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_1 .= (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by SCMFSA6A:25 .= ((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) by SCMFSA6A:25 .= (a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) by SCMFSA6A:29 .= (Directed (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3)))) +* (Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)) by COMPOS_1:56 ; then A9: dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (Directed (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3))))) \/ (dom (Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2))) by FUNCT_4:def_1; then dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3)))) \/ (dom (Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2))) by FUNCT_4:99; then A10: 2 in dom (Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)) by A7, A5, XBOOLE_0:def_3; A11: Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2) = IncAddr ((Shift (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)),2) by COMPOS_1:34; thus (while=0 (a,I)) . 2 = ((Directed (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3)))) +* (Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2))) . 2 by A1, A6, A8, FUNCT_4:def_1 .= (Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)) . 2 by A7, A9, A10, FUNCT_4:def_1 .= IncAddr ((goto (card (Stop SCM+FSA))),2) by A3, A4, A11, COMPOS_1:def_21 .= goto (1 + 2) by Lm1, SCMFSA_4:1 .= goto 3 ; ::_thesis: verum end; theorem :: SCMFSA_9:17 for a being Int-Location for I being Program of for k being Element of NAT st k < (card I) + 6 holds k in dom (while=0 (a,I)) proof let a be Int-Location; ::_thesis: for I being Program of for k being Element of NAT st k < (card I) + 6 holds k in dom (while=0 (a,I)) let I be Program of ; ::_thesis: for k being Element of NAT st k < (card I) + 6 holds k in dom (while=0 (a,I)) let k be Element of NAT ; ::_thesis: ( k < (card I) + 6 implies k in dom (while=0 (a,I)) ) assume A1: k < (card I) + 6 ; ::_thesis: k in dom (while=0 (a,I)) card (while=0 (a,I)) = (card I) + 6 by Th4; hence k in dom (while=0 (a,I)) by A1, AFINSQ_1:66; ::_thesis: verum end; theorem Th18: :: SCMFSA_9:18 for P being Instruction-Sequence of SCM+FSA for s being State of SCM+FSA for I being Program of for a being read-write Int-Location st s . a <> 0 holds ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for s being State of SCM+FSA for I being Program of for a being read-write Int-Location st s . a <> 0 holds ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) let s be State of SCM+FSA; ::_thesis: for I being Program of for a being read-write Int-Location st s . a <> 0 holds ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) let I be Program of ; ::_thesis: for a being read-write Int-Location st s . a <> 0 holds ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) let a be read-write Int-Location; ::_thesis: ( s . a <> 0 implies ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) ) assume A1: s . a <> 0 ; ::_thesis: ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) set i = a =0_goto 4; set s1 = Initialize s; set P1 = P +* (while=0 (a,I)); A2: IC in dom (Start-At (0,SCM+FSA)) by MEMSTR_0:15; A3: IC (Initialize s) = IC (Start-At (0,SCM+FSA)) by A2, FUNCT_4:13 .= 0 by FUNCOP_1:72 ; set loc5 = (card I) + 5; set s5 = Comput ((P +* (while=0 (a,I))),(Initialize s),4); set s4 = Comput ((P +* (while=0 (a,I))),(Initialize s),3); set s3 = Comput ((P +* (while=0 (a,I))),(Initialize s),2); set s2 = Comput ((P +* (while=0 (a,I))),(Initialize s),1); A4: 1 in dom (while=0 (a,I)) by Th10; A5: 2 in dom (while=0 (a,I)) by Th12; not a in dom (Start-At (0,SCM+FSA)) by SCMFSA_2:102; then A6: (Initialize s) . a = s . a by FUNCT_4:11; A7: (P +* (while=0 (a,I))) /. (IC (Initialize s)) = (P +* (while=0 (a,I))) . (IC (Initialize s)) by PBOOLE:143; A8: 0 in dom (while=0 (a,I)) by Th10; then (P +* (while=0 (a,I))) . 0 = (while=0 (a,I)) . 0 by FUNCT_4:13 .= a =0_goto 4 by Th11 ; then A9: CurInstr ((P +* (while=0 (a,I))),(Initialize s)) = a =0_goto 4 by A3, A7; A10: Comput ((P +* (while=0 (a,I))),(Initialize s),(0 + 1)) = Following ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),0))) by EXTPRO_1:3 .= Following ((P +* (while=0 (a,I))),(Initialize s)) .= Exec ((a =0_goto 4),(Initialize s)) by A9 ; A11: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),1)) = succ 0 by A1, A3, A10, A6, SCMFSA_2:70 .= 0 + 1 ; A12: (P +* (while=0 (a,I))) /. (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),1))) = (P +* (while=0 (a,I))) . (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),1))) by PBOOLE:143; (P +* (while=0 (a,I))) . 1 = (while=0 (a,I)) . 1 by A4, FUNCT_4:13 .= goto 2 by Th11 ; then A13: CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),1))) = goto 2 by A11, A12; A14: Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + 1)) = Following ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),1))) by EXTPRO_1:3 .= Exec ((goto 2),(Comput ((P +* (while=0 (a,I))),(Initialize s),1))) by A13 ; A15: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),2)) = 2 by A14, SCMFSA_2:69; A16: (P +* (while=0 (a,I))) /. (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),2))) = (P +* (while=0 (a,I))) . (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),2))) by PBOOLE:143; (P +* (while=0 (a,I))) . 2 = (while=0 (a,I)) . 2 by A5, FUNCT_4:13 .= goto 3 by Th16 ; then A17: CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),2))) = goto 3 by A15, A16; A18: Comput ((P +* (while=0 (a,I))),(Initialize s),(2 + 1)) = Following ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),2))) by EXTPRO_1:3 .= Exec ((goto 3),(Comput ((P +* (while=0 (a,I))),(Initialize s),2))) by A17 ; A19: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),3)) = 3 by A18, SCMFSA_2:69; A20: 3 in dom (while=0 (a,I)) by Th12; A21: (card I) + 5 in dom (while=0 (a,I)) by Th13; A22: (P +* (while=0 (a,I))) /. (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),3))) = (P +* (while=0 (a,I))) . (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),3))) by PBOOLE:143; (P +* (while=0 (a,I))) . 3 = (while=0 (a,I)) . 3 by A20, FUNCT_4:13 .= goto ((card I) + 5) by Th15 ; then A23: CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),3))) = goto ((card I) + 5) by A19, A22; A24: Comput ((P +* (while=0 (a,I))),(Initialize s),(3 + 1)) = Following ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),3))) by EXTPRO_1:3 .= Exec ((goto ((card I) + 5)),(Comput ((P +* (while=0 (a,I))),(Initialize s),3))) by A23 ; A25: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),4)) = (card I) + 5 by A24, SCMFSA_2:69; A26: (P +* (while=0 (a,I))) /. (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),4))) = (P +* (while=0 (a,I))) . (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),4))) by PBOOLE:143; (P +* (while=0 (a,I))) . ((card I) + 5) = (while=0 (a,I)) . ((card I) + 5) by A21, FUNCT_4:13 .= halt SCM+FSA by Th14 ; then A27: CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),4))) = halt SCM+FSA by A25, A26; then P +* (while=0 (a,I)) halts_on Initialize s by EXTPRO_1:29; hence while=0 (a,I) is_halting_on s,P by SCMFSA7B:def_7; ::_thesis: while=0 (a,I) is_closed_on s,P now__::_thesis:_for_k_being_Element_of_NAT_holds_IC_(Comput_((P_+*_(while=0_(a,I))),(Initialize_s),k))_in_dom_(while=0_(a,I)) let k be Element of NAT ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) A28: ( k <= 3 or k >= 3 + 1 ) by NAT_1:13; percases ( k = 0 or k = 1 or k = 2 or k = 3 or k >= 4 ) by A28, NAT_1:27; suppose k = 0 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) by A8, A3, EXTPRO_1:2; ::_thesis: verum end; suppose k = 1 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) by A11, Th10; ::_thesis: verum end; suppose k = 2 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) by A15, Th12; ::_thesis: verum end; suppose k = 3 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) by A19, Th12; ::_thesis: verum end; suppose k >= 4 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) by A21, A25, A27, EXTPRO_1:5; ::_thesis: verum end; end; end; hence while=0 (a,I) is_closed_on s,P by SCMFSA7B:def_6; ::_thesis: verum end; theorem Th19: :: SCMFSA_9:19 for P being Instruction-Sequence of SCM+FSA for a being Int-Location for I being Program of for s being State of SCM+FSA for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* I),(Initialize s)) & IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) holds ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for a being Int-Location for I being Program of for s being State of SCM+FSA for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* I),(Initialize s)) & IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) holds ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) set J3 = (Goto 0) ";" (Stop SCM+FSA); set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of for s being State of SCM+FSA for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* I),(Initialize s)) & IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) holds ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) set D = Int-Locations \/ FinSeq-Locations; let I be Program of ; ::_thesis: for s being State of SCM+FSA for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* I),(Initialize s)) & IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) holds ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) let s be State of SCM+FSA; ::_thesis: for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* I),(Initialize s)) & IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) holds ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) let k be Element of NAT ; ::_thesis: ( I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* I),(Initialize s)) & IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) implies ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) ) set s1 = Initialize s; set P1 = P +* (while=0 (a,I)); set sI = Initialize s; set PI = P +* I; A1: I c= P +* I by FUNCT_4:25; set sK1 = Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k)); set sK2 = Comput ((P +* I),(Initialize s),k); set l3 = IC (Comput ((P +* I),(Initialize s),k)); set I1 = I ";" (Goto 0); set i = a =0_goto ((card (Stop SCM+FSA)) + 3); reconsider n = IC (Comput ((P +* I),(Initialize s),k)) as Element of NAT ; set Mi = ((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)); set J2 = (I ";" (Goto 0)) ";" (Stop SCM+FSA); A2: rng I c= the InstructionsF of SCM+FSA by RELAT_1:def_19; assume I is_closed_on s,P ; ::_thesis: ( not I is_halting_on s,P or not k < LifeSpan ((P +* I),(Initialize s)) or not IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 or not DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) or ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) ) then A3: n in dom I by SCMFSA7B:def_6; then n < card I by AFINSQ_1:66; then A4: n + 4 < (card I) + 6 by XREAL_1:8; A5: (P +* I) /. (IC (Comput ((P +* I),(Initialize s),k))) = (P +* I) . (IC (Comput ((P +* I),(Initialize s),k))) by PBOOLE:143; A6: CurInstr ((P +* I),(Comput ((P +* I),(Initialize s),k))) = (P +* I) . n by A5 .= I . n by A3, A1, GRFUNC_1:2 ; assume I is_halting_on s,P ; ::_thesis: ( not k < LifeSpan ((P +* I),(Initialize s)) or not IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 or not DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) or ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) ) then A7: P +* I halts_on Initialize s by SCMFSA7B:def_7; assume k < LifeSpan ((P +* I),(Initialize s)) ; ::_thesis: ( not IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 or not DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) or ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) ) then A8: I . n <> halt SCM+FSA by A6, A7, EXTPRO_1:def_15; A9: (I ";" (Goto 0)) ";" (Stop SCM+FSA) = I ";" ((Goto 0) ";" (Stop SCM+FSA)) by SCMFSA6A:25; then dom ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) = (dom (Directed I)) \/ (dom (Reloc (((Goto 0) ";" (Stop SCM+FSA)),(card I)))) by FUNCT_4:def_1 .= (dom I) \/ (dom (Reloc (((Goto 0) ";" (Stop SCM+FSA)),(card I)))) by FUNCT_4:99 ; then A10: n in dom ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by A3, XBOOLE_0:def_3; then n + 4 in { (il + 4) where il is Element of NAT : il in dom ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) } ; then A11: n + 4 in dom (Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) by VALUED_1:def_12; then A12: (Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) /. (n + 4) = (Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) . (n + 4) by PARTFUN1:def_6 .= ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) . n by A10, VALUED_1:def_12 .= (Directed I) . n by A3, A9, SCMFSA8A:14 .= I . n by A3, A8, SCMFSA8A:16 ; card (while=0 (a,I)) = (card I) + 6 by Th4; then A13: n + 4 in dom (while=0 (a,I)) by A4, AFINSQ_1:66; I . n in rng I by A3, FUNCT_1:def_3; then reconsider j = I . n as Instruction of SCM+FSA by A2; A14: card (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) = (card ((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA))) + (card (Goto ((card (I ";" (Goto 0))) + 1))) by SCMFSA6A:21 .= (card ((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA))) + 1 by SCMFSA8A:15 .= ((card (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3)))) + (card (Stop SCM+FSA))) + 1 by SCMFSA6A:21 .= (2 + 1) + 1 by Lm1, COMPOS_1:56 .= 3 + 1 ; then n + 4 >= card (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) by NAT_1:11; then A15: not n + 4 in dom (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) by AFINSQ_1:66; A16: Comput ((P +* I),(Initialize s),(k + 1)) = Following ((P +* I),(Comput ((P +* I),(Initialize s),k))) by EXTPRO_1:3 .= Exec (j,(Comput ((P +* I),(Initialize s),k))) by A6 ; set f = ((card I) + 4) .--> (goto 0); assume A17: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 ; ::_thesis: ( not DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) or ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) ) ( dom (((card I) + 4) .--> (goto 0)) = {((card I) + 4)} & n + 4 <> (card I) + 4 ) by A3, FUNCOP_1:13; then A18: not n + 4 in dom (((card I) + 4) .--> (goto 0)) by TARSKI:def_1; A19: dom (while=0 (a,I)) = (dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1; then A20: n + 4 in dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A18, A13, XBOOLE_0:def_3; A21: CutLastLoc (stop (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) = ((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)) ; A22: if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_1 .= (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by SCMFSA6A:25 .= (Directed (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) +* (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) by A14, A21 ; then A23: dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (Directed (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))))) \/ (dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4))) by FUNCT_4:def_1; then dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) \/ (dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4))) by FUNCT_4:99; then A24: n + 4 in dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) by A20, A15, XBOOLE_0:def_3; A25: (P +* (while=0 (a,I))) /. (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k)))) = (P +* (while=0 (a,I))) . (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k)))) by PBOOLE:143; A26: Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4) = IncAddr ((Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)),4) by COMPOS_1:34; (P +* (while=0 (a,I))) . (n + 4) = (while=0 (a,I)) . (n + 4) by A13, FUNCT_4:13 .= ((Directed (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) +* (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4))) . (n + 4) by A18, A13, A19, A22, FUNCT_4:def_1 .= (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) . (n + 4) by A20, A23, A24, FUNCT_4:def_1 .= IncAddr (j,4) by A11, A12, A26, COMPOS_1:def_21 ; then A27: CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k)))) = IncAddr (j,4) by A17, A25; assume A28: DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) ; ::_thesis: ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1)) = Following ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k)))) by EXTPRO_1:3 .= Exec ((IncAddr (j,4)),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + k)))) by A27 ; hence ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) by A17, A28, A16, SCMFSA6A:8; ::_thesis: verum end; theorem Th20: :: SCMFSA_9:20 for P being Instruction-Sequence of SCM+FSA for a being Int-Location for I being Program of for s being State of SCM+FSA st I is_closed_on s,P & I is_halting_on s,P & IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 holds CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for a being Int-Location for I being Program of for s being State of SCM+FSA st I is_closed_on s,P & I is_halting_on s,P & IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 holds CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) set J3 = (Goto 0) ";" (Stop SCM+FSA); set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of for s being State of SCM+FSA st I is_closed_on s,P & I is_halting_on s,P & IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 holds CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) let I be Program of ; ::_thesis: for s being State of SCM+FSA st I is_closed_on s,P & I is_halting_on s,P & IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 holds CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) let s be State of SCM+FSA; ::_thesis: ( I is_closed_on s,P & I is_halting_on s,P & IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 implies CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) ) set s1 = Initialize s; set P1 = P +* (while=0 (a,I)); set sI = Initialize s; set PI = P +* I; A1: I c= P +* I by FUNCT_4:25; set life = LifeSpan ((P +* I),(Initialize s)); set sK1 = Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))); set sK2 = Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))); set I1 = I ";" (Goto 0); set i = a =0_goto ((card (Stop SCM+FSA)) + 3); reconsider n = IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s))))) as Element of NAT ; set Mi = ((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)); set J2 = (I ";" (Goto 0)) ";" (Stop SCM+FSA); assume I is_closed_on s,P ; ::_thesis: ( not I is_halting_on s,P or not IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 or CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) ) then A2: n in dom I by SCMFSA7B:def_6; then n < card I by AFINSQ_1:66; then A3: n + 4 < (card I) + 6 by XREAL_1:8; assume I is_halting_on s,P ; ::_thesis: ( not IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 or CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) ) then A4: P +* I halts_on Initialize s by SCMFSA7B:def_7; A5: (P +* I) /. (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) = (P +* I) . (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) by PBOOLE:143; A6: (P +* (while=0 (a,I))) /. (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = (P +* (while=0 (a,I))) . (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) by PBOOLE:143; CurInstr ((P +* I),(Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) = (P +* I) . n by A5 .= I . n by A2, A1, GRFUNC_1:2 ; then A7: I . n = halt SCM+FSA by A4, EXTPRO_1:def_15; A8: (I ";" (Goto 0)) ";" (Stop SCM+FSA) = I ";" ((Goto 0) ";" (Stop SCM+FSA)) by SCMFSA6A:25; then dom ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) = (dom (Directed I)) \/ (dom (Reloc (((Goto 0) ";" (Stop SCM+FSA)),(card I)))) by FUNCT_4:def_1 .= (dom I) \/ (dom (Reloc (((Goto 0) ";" (Stop SCM+FSA)),(card I)))) by FUNCT_4:99 ; then A9: n in dom ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by A2, XBOOLE_0:def_3; then n + 4 in { (il + 4) where il is Element of NAT : il in dom ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) } ; then A10: n + 4 in dom (Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) by VALUED_1:def_12; then A11: (Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) /. (n + 4) = (Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) . (n + 4) by PARTFUN1:def_6 .= ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) . n by A9, VALUED_1:def_12 .= (Directed I) . n by A2, A8, SCMFSA8A:14 .= goto (card I) by A2, A7, SCMFSA8A:16 ; set f = ((card I) + 4) .--> (goto 0); assume A12: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 ; ::_thesis: CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) ( dom (((card I) + 4) .--> (goto 0)) = {((card I) + 4)} & n + 4 <> (card I) + 4 ) by A2, FUNCOP_1:13; then A13: not n + 4 in dom (((card I) + 4) .--> (goto 0)) by TARSKI:def_1; A14: card (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) = (card ((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA))) + (card (Goto ((card (I ";" (Goto 0))) + 1))) by SCMFSA6A:21 .= (card ((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA))) + 1 by SCMFSA8A:15 .= ((card (Macro (a =0_goto ((card (Stop SCM+FSA)) + 3)))) + (card (Stop SCM+FSA))) + 1 by SCMFSA6A:21 .= (2 + 1) + 1 by Lm1, COMPOS_1:56 .= 3 + 1 ; then n + 4 >= card (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) by NAT_1:11; then A15: not n + 4 in dom (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) by AFINSQ_1:66; card (while=0 (a,I)) = (card I) + 6 by Th4; then A16: n + 4 in dom (while=0 (a,I)) by A3, AFINSQ_1:66; A17: dom (while=0 (a,I)) = (dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1; then A18: n + 4 in dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A13, A16, XBOOLE_0:def_3; A19: CutLastLoc (stop (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) = ((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)) ; A20: if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_1 .= (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by SCMFSA6A:25 .= (Directed (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) +* (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) by A14, A19 ; then A21: dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (Directed (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))))) \/ (dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4))) by FUNCT_4:def_1; then dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) \/ (dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4))) by FUNCT_4:99; then A22: n + 4 in dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) by A18, A15, XBOOLE_0:def_3; A23: Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4) = IncAddr ((Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)),4) by COMPOS_1:34; (P +* (while=0 (a,I))) . (n + 4) = (while=0 (a,I)) . (n + 4) by A16, FUNCT_4:13 .= ((Directed (((a =0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) +* (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4))) . (n + 4) by A13, A16, A17, A20, FUNCT_4:def_1 .= (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) . (n + 4) by A18, A21, A22, FUNCT_4:def_1 .= IncAddr ((goto (card I)),4) by A10, A11, A23, COMPOS_1:def_21 .= goto ((card I) + 4) by SCMFSA_4:1 ; hence CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) by A12, A6; ::_thesis: verum end; theorem Th21: :: SCMFSA_9:21 for a being Int-Location for I being Program of holds (while=0 (a,I)) . ((card I) + 4) = goto 0 proof set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of holds (while=0 (a,I)) . ((card I) + 4) = goto 0 let I be Program of ; ::_thesis: (while=0 (a,I)) . ((card I) + 4) = goto 0 set I1 = I ";" (Goto 0); set f = ((card I) + 4) .--> (goto 0); set Lc4 = (card I) + 4; dom (((card I) + 4) .--> (goto 0)) = {((card I) + 4)} by FUNCOP_1:13; then A1: (card I) + 4 in dom (((card I) + 4) .--> (goto 0)) by TARSKI:def_1; ( (card I) + 4 in dom (while=0 (a,I)) & dom (while=0 (a,I)) = (dom (if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) ) by Th13, FUNCT_4:def_1; hence (while=0 (a,I)) . ((card I) + 4) = (((card I) + 4) .--> (goto 0)) . ((card I) + 4) by A1, FUNCT_4:def_1 .= goto 0 by FUNCOP_1:72 ; ::_thesis: verum end; theorem Th22: :: SCMFSA_9:22 for P being Instruction-Sequence of SCM+FSA for s being State of SCM+FSA for I being Program of for a being read-write Int-Location st I is_closed_on s,P & I is_halting_on s,P & s . a = 0 holds ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) ) ) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for s being State of SCM+FSA for I being Program of for a being read-write Int-Location st I is_closed_on s,P & I is_halting_on s,P & s . a = 0 holds ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) ) ) set D = Int-Locations \/ FinSeq-Locations; let s be State of SCM+FSA; ::_thesis: for I being Program of for a being read-write Int-Location st I is_closed_on s,P & I is_halting_on s,P & s . a = 0 holds ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) ) ) let I be Program of ; ::_thesis: for a being read-write Int-Location st I is_closed_on s,P & I is_halting_on s,P & s . a = 0 holds ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) ) ) let a be read-write Int-Location; ::_thesis: ( I is_closed_on s,P & I is_halting_on s,P & s . a = 0 implies ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) ) ) ) assume A1: I is_closed_on s,P ; ::_thesis: ( not I is_halting_on s,P or not s . a = 0 or ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) ) ) ) set sI = Initialize s; set PI = P +* I; set s1 = Initialize s; set P1 = P +* (while=0 (a,I)); defpred S1[ Nat] means ( $1 <= LifeSpan ((P +* I),(Initialize s)) implies ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + $1))) = (IC (Comput ((P +* I),(Initialize s),$1))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + $1))) = DataPart (Comput ((P +* I),(Initialize s),$1)) ) ); assume A2: I is_halting_on s,P ; ::_thesis: ( not s . a = 0 or ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) ) ) ) A3: now__::_thesis:_for_k_being_Element_of_NAT_st_S1[k]_holds_ S1[k_+_1] let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] ) assume A4: S1[k] ; ::_thesis: S1[k + 1] now__::_thesis:_(_k_+_1_<=_LifeSpan_((P_+*_I),(Initialize_s))_implies_(_IC_(Comput_((P_+*_(while=0_(a,I))),(Initialize_s),((1_+_k)_+_1)))_=_(IC_(Comput_((P_+*_I),(Initialize_s),(k_+_1))))_+_4_&_DataPart_(Comput_((P_+*_(while=0_(a,I))),(Initialize_s),((1_+_k)_+_1)))_=_DataPart_(Comput_((P_+*_I),(Initialize_s),(k_+_1)))_)_) A5: k + 0 < k + 1 by XREAL_1:6; assume k + 1 <= LifeSpan ((P +* I),(Initialize s)) ; ::_thesis: ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) then k < LifeSpan ((P +* I),(Initialize s)) by A5, XXREAL_0:2; hence ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) by A1, A2, A4, Th19; ::_thesis: verum end; hence S1[k + 1] ; ::_thesis: verum end; reconsider l = LifeSpan ((P +* I),(Initialize s)) as Element of NAT ; set loc4 = (card I) + 4; set i = a =0_goto 4; set s2 = Comput ((P +* (while=0 (a,I))),(Initialize s),1); IC in dom (Start-At (0,SCM+FSA)) by MEMSTR_0:15; then A6: IC (Initialize s) = IC (Start-At (0,SCM+FSA)) by FUNCT_4:13 .= 0 by FUNCOP_1:72 ; not a in dom (Start-At (0,SCM+FSA)) by SCMFSA_2:102; then A7: (Initialize s) . a = s . a by FUNCT_4:11; assume A8: s . a = 0 ; ::_thesis: ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) ) ) A9: 0 in dom (while=0 (a,I)) by Th10; A10: (P +* (while=0 (a,I))) /. (IC (Initialize s)) = (P +* (while=0 (a,I))) . (IC (Initialize s)) by PBOOLE:143; (P +* (while=0 (a,I))) . 0 = (while=0 (a,I)) . 0 by A9, FUNCT_4:13 .= a =0_goto 4 by Th11 ; then A11: CurInstr ((P +* (while=0 (a,I))),(Initialize s)) = a =0_goto 4 by A6, A10; A12: Comput ((P +* (while=0 (a,I))),(Initialize s),(0 + 1)) = Following ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),0))) by EXTPRO_1:3 .= Following ((P +* (while=0 (a,I))),(Initialize s)) .= Exec ((a =0_goto 4),(Initialize s)) by A11 ; then ( ( for c being Int-Location holds (Comput ((P +* (while=0 (a,I))),(Initialize s),1)) . c = (Initialize s) . c ) & ( for f being FinSeq-Location holds (Comput ((P +* (while=0 (a,I))),(Initialize s),1)) . f = (Initialize s) . f ) ) by SCMFSA_2:70; then A13: DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),1)) = DataPart (Initialize s) by SCMFSA_M:2 .= DataPart (Initialize s) ; A14: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),1)) = 4 by A8, A12, A7, SCMFSA_2:70; A15: S1[ 0 ] proof assume 0 <= LifeSpan ((P +* I),(Initialize s)) ; ::_thesis: ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + 0))) = (IC (Comput ((P +* I),(Initialize s),0))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + 0))) = DataPart (Comput ((P +* I),(Initialize s),0)) ) A16: IC in dom (Start-At (0,SCM+FSA)) by MEMSTR_0:15; IC (Comput ((P +* I),(Initialize s),0)) = IC (Initialize s) .= IC (Start-At (0,SCM+FSA)) by A16, FUNCT_4:13 .= 0 by FUNCOP_1:72 ; hence ( IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + 0))) = (IC (Comput ((P +* I),(Initialize s),0))) + 4 & DataPart (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + 0))) = DataPart (Comput ((P +* I),(Initialize s),0)) ) by A14, A13; ::_thesis: verum end; A17: for k being Element of NAT holds S1[k] from NAT_1:sch_1(A15, A3); set s4 = Comput ((P +* (while=0 (a,I))),(Initialize s),(((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1) + 1)); set s3 = Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)); A18: (card I) + 4 in dom (while=0 (a,I)) by Th13; set s2 = Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))); S1[l] by A17; then A19: CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) by A1, A2, Th20; A20: Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)) = Following ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) by EXTPRO_1:3 .= Exec ((goto ((card I) + 4)),(Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) by A19 ; A21: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1))) = (card I) + 4 by A20, SCMFSA_2:69; A22: (P +* (while=0 (a,I))) /. (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)))) = (P +* (while=0 (a,I))) . (IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)))) by PBOOLE:143; (P +* (while=0 (a,I))) . ((card I) + 4) = (while=0 (a,I)) . ((card I) + 4) by A18, FUNCT_4:13 .= goto 0 by Th21 ; then A23: CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)))) = goto 0 by A21, A22; A24: Comput ((P +* (while=0 (a,I))),(Initialize s),(((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1) + 1)) = Following ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)))) by EXTPRO_1:3 .= Exec ((goto 0),(Comput ((P +* (while=0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)))) by A23 ; A25: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1) + 1))) = 0 by A24, SCMFSA_2:69; hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 ; ::_thesis: for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) A26: (((LifeSpan ((P +* I),(Initialize s))) + 1) + 1) + 1 = (LifeSpan ((P +* I),(Initialize s))) + (2 + 1) ; A27: now__::_thesis:_for_k_being_Element_of_NAT_st_k_<=_(LifeSpan_((P_+*_I),(Initialize_s)))_+_3_&_k_<>_0_holds_ IC_(Comput_((P_+*_(while=0_(a,I))),(Initialize_s),k))_in_dom_(while=0_(a,I)) let k be Element of NAT ; ::_thesis: ( k <= (LifeSpan ((P +* I),(Initialize s))) + 3 & k <> 0 implies IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) ) assume A28: k <= (LifeSpan ((P +* I),(Initialize s))) + 3 ; ::_thesis: ( k <> 0 implies IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) ) assume k <> 0 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) then consider n being Nat such that A29: k = n + 1 by NAT_1:6; ( k <= (LifeSpan ((P +* I),(Initialize s))) + 1 or k >= ((LifeSpan ((P +* I),(Initialize s))) + 1) + 1 ) by NAT_1:13; then A30: ( k <= (LifeSpan ((P +* I),(Initialize s))) + 1 or k = ((LifeSpan ((P +* I),(Initialize s))) + 1) + 1 or k > ((LifeSpan ((P +* I),(Initialize s))) + 1) + 1 ) by XXREAL_0:1; reconsider n = n as Element of NAT by ORDINAL1:def_12; percases ( k <= (LifeSpan ((P +* I),(Initialize s))) + 1 or k = ((LifeSpan ((P +* I),(Initialize s))) + 1) + 1 or k >= (LifeSpan ((P +* I),(Initialize s))) + 3 ) by A26, A30, NAT_1:13; suppose k <= (LifeSpan ((P +* I),(Initialize s))) + 1 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) then n <= LifeSpan ((P +* I),(Initialize s)) by A29, XREAL_1:6; then A31: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),(1 + n))) = (IC (Comput ((P +* I),(Initialize s),n))) + 4 by A17; reconsider m = IC (Comput ((P +* I),(Initialize s),n)) as Element of NAT ; m in dom I by A1, SCMFSA7B:def_6; then m < card I by AFINSQ_1:66; then A32: m + 4 < (card I) + 6 by XREAL_1:8; card (while=0 (a,I)) = (card I) + 6 by Th4; hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) by A29, A31, A32, AFINSQ_1:66; ::_thesis: verum end; suppose k = ((LifeSpan ((P +* I),(Initialize s))) + 1) + 1 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) by A21, Th13; ::_thesis: verum end; suppose k >= (LifeSpan ((P +* I),(Initialize s))) + 3 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) then k = (LifeSpan ((P +* I),(Initialize s))) + 3 by A28, XXREAL_0:1; hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) by A25, Th10; ::_thesis: verum end; end; end; now__::_thesis:_for_k_being_Element_of_NAT_st_k_<=_(LifeSpan_((P_+*_I),(Initialize_s)))_+_3_holds_ IC_(Comput_((P_+*_(while=0_(a,I))),(Initialize_s),k))_in_dom_(while=0_(a,I)) let k be Element of NAT ; ::_thesis: ( k <= (LifeSpan ((P +* I),(Initialize s))) + 3 implies IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) ) assume A33: k <= (LifeSpan ((P +* I),(Initialize s))) + 3 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) percases ( k = 0 or k <> 0 ) ; suppose k = 0 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) by A9, A6, EXTPRO_1:2; ::_thesis: verum end; suppose k <> 0 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) by A27, A33; ::_thesis: verum end; end; end; hence for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while=0 (a,I))),(Initialize s),k)) in dom (while=0 (a,I)) ; ::_thesis: verum end; definition let s be State of SCM+FSA; let I be Program of ; let a be read-write Int-Location; let P be Instruction-Sequence of SCM+FSA; deffunc H1( Nat, State of SCM+FSA) -> set = Comput ((P +* (while=0 (a,I))),($2 +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while=0 (a,I))) +* I),($2 +* (Start-At (0,SCM+FSA))))) + 3)); deffunc H2( Nat, State of SCM+FSA) -> Element of product (the_Values_of SCM+FSA) = down H1($1,$2); func StepWhile=0 (a,I,P,s) -> Function of NAT,(product (the_Values_of SCM+FSA)) means :Def4: :: SCMFSA_9:def 4 ( it . 0 = s & ( for i being Nat holds it . (i + 1) = Comput ((P +* (while=0 (a,I))),((it . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while=0 (a,I))) +* I),((it . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) ); existence ex b1 being Function of NAT,(product (the_Values_of SCM+FSA)) st ( b1 . 0 = s & ( for i being Nat holds b1 . (i + 1) = Comput ((P +* (while=0 (a,I))),((b1 . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while=0 (a,I))) +* I),((b1 . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) ) proof reconsider ss = s as Element of product (the_Values_of SCM+FSA) by CARD_3:107; consider f being Function of NAT,(product (the_Values_of SCM+FSA)) such that A1: f . 0 = ss and A2: for i being Nat holds f . (i + 1) = H2(i,f . i) from NAT_1:sch_12(); take f ; ::_thesis: ( f . 0 = s & ( for i being Nat holds f . (i + 1) = Comput ((P +* (while=0 (a,I))),((f . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while=0 (a,I))) +* I),((f . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) ) thus f . 0 = s by A1; ::_thesis: for i being Nat holds f . (i + 1) = Comput ((P +* (while=0 (a,I))),((f . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while=0 (a,I))) +* I),((f . i) +* (Start-At (0,SCM+FSA))))) + 3)) let i be Nat; ::_thesis: f . (i + 1) = Comput ((P +* (while=0 (a,I))),((f . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while=0 (a,I))) +* I),((f . i) +* (Start-At (0,SCM+FSA))))) + 3)) f . (i + 1) = H2(i,f . i) by A2; hence f . (i + 1) = Comput ((P +* (while=0 (a,I))),((f . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while=0 (a,I))) +* I),((f . i) +* (Start-At (0,SCM+FSA))))) + 3)) ; ::_thesis: verum end; uniqueness for b1, b2 being Function of NAT,(product (the_Values_of SCM+FSA)) st b1 . 0 = s & ( for i being Nat holds b1 . (i + 1) = Comput ((P +* (while=0 (a,I))),((b1 . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while=0 (a,I))) +* I),((b1 . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) & b2 . 0 = s & ( for i being Nat holds b2 . (i + 1) = Comput ((P +* (while=0 (a,I))),((b2 . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while=0 (a,I))) +* I),((b2 . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) holds b1 = b2 proof let F1, F2 be Function of NAT,(product (the_Values_of SCM+FSA)); ::_thesis: ( F1 . 0 = s & ( for i being Nat holds F1 . (i + 1) = Comput ((P +* (while=0 (a,I))),((F1 . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while=0 (a,I))) +* I),((F1 . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) & F2 . 0 = s & ( for i being Nat holds F2 . (i + 1) = Comput ((P +* (while=0 (a,I))),((F2 . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while=0 (a,I))) +* I),((F2 . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) implies F1 = F2 ) assume that A3: F1 . 0 = s and A4: for i being Nat holds F1 . (i + 1) = H1(i,F1 . i) and A5: F2 . 0 = s and A6: for i being Nat holds F2 . (i + 1) = H1(i,F2 . i) ; ::_thesis: F1 = F2 reconsider s = s as Element of product (the_Values_of SCM+FSA) by CARD_3:107; A7: F1 . 0 = s by A3; A8: for i being Nat holds F1 . (i + 1) = H2(i,F1 . i) by A4; A9: F2 . 0 = s by A5; A10: for i being Nat holds F2 . (i + 1) = H2(i,F2 . i) by A6; thus F1 = F2 from NAT_1:sch_16(A7, A8, A9, A10); ::_thesis: verum end; end; :: deftheorem Def4 defines StepWhile=0 SCMFSA_9:def_4_:_ for s being State of SCM+FSA for I being Program of for a being read-write Int-Location for P being Instruction-Sequence of SCM+FSA for b5 being Function of NAT,(product (the_Values_of SCM+FSA)) holds ( b5 = StepWhile=0 (a,I,P,s) iff ( b5 . 0 = s & ( for i being Nat holds b5 . (i + 1) = Comput ((P +* (while=0 (a,I))),((b5 . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while=0 (a,I))) +* I),((b5 . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) ) ); theorem Th23: :: SCMFSA_9:23 for P being Instruction-Sequence of SCM+FSA for s being State of SCM+FSA for I being Program of for a being read-write Int-Location for k being Element of NAT holds (StepWhile=0 (a,I,P,s)) . (k + 1) = (StepWhile=0 (a,I,P,((StepWhile=0 (a,I,P,s)) . k))) . 1 proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for s being State of SCM+FSA for I being Program of for a being read-write Int-Location for k being Element of NAT holds (StepWhile=0 (a,I,P,s)) . (k + 1) = (StepWhile=0 (a,I,P,((StepWhile=0 (a,I,P,s)) . k))) . 1 let s be State of SCM+FSA; ::_thesis: for I being Program of for a being read-write Int-Location for k being Element of NAT holds (StepWhile=0 (a,I,P,s)) . (k + 1) = (StepWhile=0 (a,I,P,((StepWhile=0 (a,I,P,s)) . k))) . 1 let I be Program of ; ::_thesis: for a being read-write Int-Location for k being Element of NAT holds (StepWhile=0 (a,I,P,s)) . (k + 1) = (StepWhile=0 (a,I,P,((StepWhile=0 (a,I,P,s)) . k))) . 1 let a be read-write Int-Location; ::_thesis: for k being Element of NAT holds (StepWhile=0 (a,I,P,s)) . (k + 1) = (StepWhile=0 (a,I,P,((StepWhile=0 (a,I,P,s)) . k))) . 1 let k be Element of NAT ; ::_thesis: (StepWhile=0 (a,I,P,s)) . (k + 1) = (StepWhile=0 (a,I,P,((StepWhile=0 (a,I,P,s)) . k))) . 1 set sk = (StepWhile=0 (a,I,P,s)) . k; set sk0 = (StepWhile=0 (a,I,P,((StepWhile=0 (a,I,P,s)) . k))) . 0; (StepWhile=0 (a,I,P,((StepWhile=0 (a,I,P,s)) . k))) . 0 = (StepWhile=0 (a,I,P,s)) . k by Def4; hence (StepWhile=0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while=0 (a,I))),(((StepWhile=0 (a,I,P,((StepWhile=0 (a,I,P,s)) . k))) . 0) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while=0 (a,I))) +* I),(((StepWhile=0 (a,I,P,((StepWhile=0 (a,I,P,s)) . k))) . 0) +* (Start-At (0,SCM+FSA))))) + 3)) by Def4 .= (StepWhile=0 (a,I,P,((StepWhile=0 (a,I,P,s)) . k))) . (0 + 1) by Def4 .= (StepWhile=0 (a,I,P,((StepWhile=0 (a,I,P,s)) . k))) . 1 ; ::_thesis: verum end; theorem :: SCMFSA_9:24 canceled; theorem Th25: :: SCMFSA_9:25 for P being Instruction-Sequence of SCM+FSA for I being Program of for a being read-write Int-Location for s being State of SCM+FSA holds (StepWhile=0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize s))) + 3)) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for I being Program of for a being read-write Int-Location for s being State of SCM+FSA holds (StepWhile=0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize s))) + 3)) let I be Program of ; ::_thesis: for a being read-write Int-Location for s being State of SCM+FSA holds (StepWhile=0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize s))) + 3)) let a be read-write Int-Location; ::_thesis: for s being State of SCM+FSA holds (StepWhile=0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize s))) + 3)) let s be State of SCM+FSA; ::_thesis: (StepWhile=0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize s))) + 3)) A1: (StepWhile=0 (a,I,P,s)) . 0 = s by Def4; thus (StepWhile=0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize s))) + 3)) by A1, Def4; ::_thesis: verum end; theorem Th26: :: SCMFSA_9:26 for P being Instruction-Sequence of SCM+FSA for I being Program of for a being read-write Int-Location for s being State of SCM+FSA for k, n being Element of NAT st IC ((StepWhile=0 (a,I,P,s)) . k) = 0 & (StepWhile=0 (a,I,P,s)) . k = Comput ((P +* (while=0 (a,I))),(Initialize s),n) holds ( (StepWhile=0 (a,I,P,s)) . k = Initialize ((StepWhile=0 (a,I,P,s)) . k) & (StepWhile=0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . k)))) + 3))) ) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for I being Program of for a being read-write Int-Location for s being State of SCM+FSA for k, n being Element of NAT st IC ((StepWhile=0 (a,I,P,s)) . k) = 0 & (StepWhile=0 (a,I,P,s)) . k = Comput ((P +* (while=0 (a,I))),(Initialize s),n) holds ( (StepWhile=0 (a,I,P,s)) . k = Initialize ((StepWhile=0 (a,I,P,s)) . k) & (StepWhile=0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . k)))) + 3))) ) set D = Int-Locations \/ FinSeq-Locations; let I be Program of ; ::_thesis: for a being read-write Int-Location for s being State of SCM+FSA for k, n being Element of NAT st IC ((StepWhile=0 (a,I,P,s)) . k) = 0 & (StepWhile=0 (a,I,P,s)) . k = Comput ((P +* (while=0 (a,I))),(Initialize s),n) holds ( (StepWhile=0 (a,I,P,s)) . k = Initialize ((StepWhile=0 (a,I,P,s)) . k) & (StepWhile=0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . k)))) + 3))) ) let a be read-write Int-Location; ::_thesis: for s being State of SCM+FSA for k, n being Element of NAT st IC ((StepWhile=0 (a,I,P,s)) . k) = 0 & (StepWhile=0 (a,I,P,s)) . k = Comput ((P +* (while=0 (a,I))),(Initialize s),n) holds ( (StepWhile=0 (a,I,P,s)) . k = Initialize ((StepWhile=0 (a,I,P,s)) . k) & (StepWhile=0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . k)))) + 3))) ) let s be State of SCM+FSA; ::_thesis: for k, n being Element of NAT st IC ((StepWhile=0 (a,I,P,s)) . k) = 0 & (StepWhile=0 (a,I,P,s)) . k = Comput ((P +* (while=0 (a,I))),(Initialize s),n) holds ( (StepWhile=0 (a,I,P,s)) . k = Initialize ((StepWhile=0 (a,I,P,s)) . k) & (StepWhile=0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . k)))) + 3))) ) let k, n be Element of NAT ; ::_thesis: ( IC ((StepWhile=0 (a,I,P,s)) . k) = 0 & (StepWhile=0 (a,I,P,s)) . k = Comput ((P +* (while=0 (a,I))),(Initialize s),n) implies ( (StepWhile=0 (a,I,P,s)) . k = Initialize ((StepWhile=0 (a,I,P,s)) . k) & (StepWhile=0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . k)))) + 3))) ) ) set s1 = Initialize s; set P1 = P +* (while=0 (a,I)); set sk = (StepWhile=0 (a,I,P,s)) . k; set s2 = Initialize ((StepWhile=0 (a,I,P,s)) . k); assume A1: IC ((StepWhile=0 (a,I,P,s)) . k) = 0 ; ::_thesis: ( not (StepWhile=0 (a,I,P,s)) . k = Comput ((P +* (while=0 (a,I))),(Initialize s),n) or ( (StepWhile=0 (a,I,P,s)) . k = Initialize ((StepWhile=0 (a,I,P,s)) . k) & (StepWhile=0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . k)))) + 3))) ) ) assume A2: (StepWhile=0 (a,I,P,s)) . k = Comput ((P +* (while=0 (a,I))),(Initialize s),n) ; ::_thesis: ( (StepWhile=0 (a,I,P,s)) . k = Initialize ((StepWhile=0 (a,I,P,s)) . k) & (StepWhile=0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . k)))) + 3))) ) (StepWhile=0 (a,I,P,s)) . k is 0 -started by A1, MEMSTR_0:def_12; then Start-At (0,SCM+FSA) c= (StepWhile=0 (a,I,P,s)) . k by MEMSTR_0:29; hence Initialize ((StepWhile=0 (a,I,P,s)) . k) = (StepWhile=0 (a,I,P,s)) . k by FUNCT_4:98; ::_thesis: (StepWhile=0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . k)))) + 3))) hence (StepWhile=0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while=0 (a,I))),((StepWhile=0 (a,I,P,s)) . k),((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . k)))) + 3)) by Def4 .= Comput ((P +* (while=0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . k)))) + 3))) by A2, EXTPRO_1:4 ; ::_thesis: verum end; theorem Th27: :: SCMFSA_9:27 for P being Instruction-Sequence of SCM+FSA for I being Program of for a being read-write Int-Location for s being State of SCM+FSA st ( for k being Nat holds ( I is_closed_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) & I is_halting_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) ) ) & ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile=0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile=0 (a,I,P,s)) . k) or f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,P,s)) . k) = 0 implies ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) ) holds ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for I being Program of for a being read-write Int-Location for s being State of SCM+FSA st ( for k being Nat holds ( I is_closed_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) & I is_halting_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) ) ) & ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile=0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile=0 (a,I,P,s)) . k) or f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,P,s)) . k) = 0 implies ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) ) holds ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) let I be Program of ; ::_thesis: for a being read-write Int-Location for s being State of SCM+FSA st ( for k being Nat holds ( I is_closed_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) & I is_halting_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) ) ) & ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile=0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile=0 (a,I,P,s)) . k) or f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,P,s)) . k) = 0 implies ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) ) holds ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) let a be read-write Int-Location; ::_thesis: for s being State of SCM+FSA st ( for k being Nat holds ( I is_closed_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) & I is_halting_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) ) ) & ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile=0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile=0 (a,I,P,s)) . k) or f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,P,s)) . k) = 0 implies ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) ) holds ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) let s be State of SCM+FSA; ::_thesis: ( ( for k being Nat holds ( I is_closed_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) & I is_halting_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) ) ) & ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile=0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile=0 (a,I,P,s)) . k) or f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,P,s)) . k) = 0 implies ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) ) implies ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) ) assume A1: for k being Nat holds ( I is_closed_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) & I is_halting_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) ) ; ::_thesis: ( for f being Function of (product (the_Values_of SCM+FSA)),NAT holds not for k being Nat holds ( ( f . ((StepWhile=0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile=0 (a,I,P,s)) . k) or f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,P,s)) . k) = 0 implies ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) ) or ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) ) set s1 = Initialize s; set P1 = P +* (while=0 (a,I)); A2: (P +* (while=0 (a,I))) +* (while=0 (a,I)) = P +* (while=0 (a,I)) ; given f being Function of (product (the_Values_of SCM+FSA)),NAT such that A3: for k being Nat holds ( ( f . ((StepWhile=0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile=0 (a,I,P,s)) . k) or f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,P,s)) . k) = 0 implies ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) ) ; ::_thesis: ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) deffunc H1( Nat) -> Element of NAT = f . ((StepWhile=0 (a,I,P,s)) . $1); A4: for k being Nat holds ( H1(k + 1) < H1(k) or H1(k) = 0 ) by A3; consider m being Nat such that A5: H1(m) = 0 and A6: for n being Nat st H1(n) = 0 holds m <= n from NAT_1:sch_17(A4); defpred S1[ Nat] means ( $1 + 1 <= m implies ex k being Element of NAT st (StepWhile=0 (a,I,P,s)) . ($1 + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),k) ); A7: now__::_thesis:_for_k_being_Element_of_NAT_st_S1[k]_holds_ S1[k_+_1] let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] ) assume A8: S1[k] ; ::_thesis: S1[k + 1] now__::_thesis:_(_(k_+_1)_+_1_<=_m_implies_ex_m_being_Element_of_NAT_st_(StepWhile=0_(a,I,P,s))_._((k_+_1)_+_1)_=_Comput_((P_+*_(while=0_(a,I))),(Initialize_s),m)_) set sk1 = (StepWhile=0 (a,I,P,s)) . (k + 1); set sk = (StepWhile=0 (a,I,P,s)) . k; assume A9: (k + 1) + 1 <= m ; ::_thesis: ex m being Element of NAT st (StepWhile=0 (a,I,P,s)) . ((k + 1) + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),m) k + 0 < k + (1 + 1) by XREAL_1:6; then k < m by A9, XXREAL_0:2; then H1(k) <> 0 by A6; then A10: ((StepWhile=0 (a,I,P,s)) . k) . a = 0 by A3; A11: I is_halting_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) by A1; (k + 1) + 0 < (k + 1) + 1 by XREAL_1:6; then consider n being Element of NAT such that A12: (StepWhile=0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),n) by A8, A9, XXREAL_0:2; take m = n + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . (k + 1))))) + 3); ::_thesis: (StepWhile=0 (a,I,P,s)) . ((k + 1) + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),m) A13: (P +* (while=0 (a,I))) +* (while=0 (a,I)) = P +* (while=0 (a,I)) ; ( (StepWhile=0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while=0 (a,I))),(Initialize ((StepWhile=0 (a,I,P,s)) . k)),((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . k)))) + 3)) & I is_closed_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) ) by A1, Def4; then IC ((StepWhile=0 (a,I,P,s)) . (k + 1)) = 0 by A11, A10, Th22, A13; hence (StepWhile=0 (a,I,P,s)) . ((k + 1) + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),m) by A12, Th26; ::_thesis: verum end; hence S1[k + 1] ; ::_thesis: verum end; A14: S1[ 0 ] proof assume 0 + 1 <= m ; ::_thesis: ex k being Element of NAT st (StepWhile=0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),k) take n = (LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize s))) + 3; ::_thesis: (StepWhile=0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),n) thus (StepWhile=0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),n) by Th25; ::_thesis: verum end; A15: for k being Element of NAT holds S1[k] from NAT_1:sch_1(A14, A7); now__::_thesis:_(_while=0_(a,I)_is_halting_on_s,P_&_while=0_(a,I)_is_closed_on_s,P_) percases ( m = 0 or m <> 0 ) ; suppose m = 0 ; ::_thesis: ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) then ((StepWhile=0 (a,I,P,s)) . 0) . a <> 0 by A3, A5; then s . a <> 0 by Def4; hence ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) by Th18; ::_thesis: verum end; supposeA16: m <> 0 ; ::_thesis: ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) then consider i being Nat such that A17: m = i + 1 by NAT_1:6; reconsider m = m, i = i as Element of NAT by ORDINAL1:def_12; set sm = (StepWhile=0 (a,I,P,s)) . m; set si = (StepWhile=0 (a,I,P,s)) . i; i < m by A17, NAT_1:13; then H1(i) <> 0 by A6; then A18: ((StepWhile=0 (a,I,P,s)) . i) . a = 0 by A3; A19: ( I is_closed_on (StepWhile=0 (a,I,P,s)) . i,P +* (while=0 (a,I)) & I is_halting_on (StepWhile=0 (a,I,P,s)) . i,P +* (while=0 (a,I)) ) by A1; A20: IC in dom ((StepWhile=0 (a,I,P,s)) . m) by MEMSTR_0:2; (StepWhile=0 (a,I,P,s)) . m = Comput ((P +* (while=0 (a,I))),(Initialize ((StepWhile=0 (a,I,P,s)) . i)),((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . i)))) + 3)) by A17, Def4; then IC ((StepWhile=0 (a,I,P,s)) . m) = 0 by A19, A18, Th22, A2; then (StepWhile=0 (a,I,P,s)) . m is 0 -started by A20, MEMSTR_0:def_11; then A21: Start-At (0,SCM+FSA) c= (StepWhile=0 (a,I,P,s)) . m by MEMSTR_0:29; set p = (LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize s))) + 3; set sm1 = Initialize ((StepWhile=0 (a,I,P,s)) . m); m = i + 1 by A17; then consider n being Element of NAT such that A22: (StepWhile=0 (a,I,P,s)) . m = Comput ((P +* (while=0 (a,I))),(Initialize s),n) by A15; reconsider n = n as Element of NAT ; A23: Initialize ((StepWhile=0 (a,I,P,s)) . m) = (StepWhile=0 (a,I,P,s)) . m by A21, FUNCT_4:98; A24: ((StepWhile=0 (a,I,P,s)) . m) . a <> 0 by A3, A5; then while=0 (a,I) is_halting_on (StepWhile=0 (a,I,P,s)) . m,P by Th18; then P +* (while=0 (a,I)) halts_on Initialize ((StepWhile=0 (a,I,P,s)) . m) by SCMFSA7B:def_7; then P +* (while=0 (a,I)) halts_on Initialize ((StepWhile=0 (a,I,P,s)) . m) ; then P +* (while=0 (a,I)) halts_on Initialize ((StepWhile=0 (a,I,P,s)) . m) ; then consider j being Element of NAT such that A25: CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),((StepWhile=0 (a,I,P,s)) . m),j))) = halt SCM+FSA by A23, EXTPRO_1:29; A26: Comput ((P +* (while=0 (a,I))),(Initialize s),(n + j)) = Comput ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),n)),j) by EXTPRO_1:4; CurInstr ((P +* (while=0 (a,I))),(Comput ((P +* (while=0 (a,I))),(Initialize s),(n + j)))) = halt SCM+FSA by A22, A25, A26; then P +* (while=0 (a,I)) halts_on Initialize s by EXTPRO_1:29; hence while=0 (a,I) is_halting_on s,P by SCMFSA7B:def_7; ::_thesis: while=0 (a,I) is_closed_on s,P now__::_thesis:_for_q_being_Element_of_NAT_holds_IC_(Comput_((P_+*_(while=0_(a,I))),(Initialize_s),q))_in_dom_(while=0_(a,I)) let q be Element of NAT ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) A27: 0 < m by A16; percases ( q <= (LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize s))) + 3 or q > (LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize s))) + 3 ) ; supposeA28: q <= (LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize s))) + 3 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) A29: (StepWhile=0 (a,I,P,s)) . 0 = s by Def4; then A30: ( I is_closed_on s,P +* (while=0 (a,I)) & I is_halting_on s,P +* (while=0 (a,I)) ) by A1; H1( 0 ) <> 0 by A6, A27; then s . a = 0 by A3, A29; hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),q)) in dom (while=0 (a,I)) by A28, A30, Th22, A2; ::_thesis: verum end; supposeA31: q > (LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize s))) + 3 ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),b1)) in dom (while=0 (a,I)) A32: now__::_thesis:_ex_k_being_Element_of_NAT_st_ (_(StepWhile=0_(a,I,P,s))_._1_=_Comput_((P_+*_(while=0_(a,I))),(Initialize_s),k)_&_k_<=_q_) take k = (LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize s))) + 3; ::_thesis: ( (StepWhile=0 (a,I,P,s)) . 1 = Comput ((P +* (while=0 (a,I))),(Initialize s),k) & k <= q ) thus ( (StepWhile=0 (a,I,P,s)) . 1 = Comput ((P +* (while=0 (a,I))),(Initialize s),k) & k <= q ) by A31, Th25; ::_thesis: verum end; defpred S2[ Nat] means ( $1 <= m & $1 <> 0 & ex k being Element of NAT st ( (StepWhile=0 (a,I,P,s)) . $1 = Comput ((P +* (while=0 (a,I))),(Initialize s),k) & k <= q ) ); A33: for i being Nat st S2[i] holds i <= m ; 0 + 1 < m + 1 by A27, XREAL_1:6; then 1 <= m by NAT_1:13; then A34: ex t being Nat st S2[t] by A32; consider t being Nat such that A35: ( S2[t] & ( for i being Nat st S2[i] holds i <= t ) ) from NAT_1:sch_6(A33, A34); reconsider t = t as Element of NAT by ORDINAL1:def_12; now__::_thesis:_IC_(Comput_((P_+*_(while=0_(a,I))),(Initialize_s),q))_in_dom_(while=0_(a,I)) percases ( t = m or t <> m ) ; suppose t = m ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),q)) in dom (while=0 (a,I)) then consider r being Element of NAT such that A36: (StepWhile=0 (a,I,P,s)) . m = Comput ((P +* (while=0 (a,I))),(Initialize s),r) and A37: r <= q by A35; consider x being Nat such that A38: q = r + x by A37, NAT_1:10; A39: while=0 (a,I) is_closed_on (StepWhile=0 (a,I,P,s)) . m,P by A24, Th18; reconsider x = x as Element of NAT by ORDINAL1:def_12; Comput ((P +* (while=0 (a,I))),(Initialize s),q) = Comput ((P +* (while=0 (a,I))),(Initialize ((StepWhile=0 (a,I,P,s)) . m)),x) by A23, A36, A38, EXTPRO_1:4; hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),q)) in dom (while=0 (a,I)) by A39, SCMFSA7B:def_6; ::_thesis: verum end; supposeA40: t <> m ; ::_thesis: IC (Comput ((P +* (while=0 (a,I))),(Initialize s),q)) in dom (while=0 (a,I)) set Dt = (StepWhile=0 (a,I,P,s)) . t; A41: t < m by A35, A40, XXREAL_0:1; then H1(t) <> 0 by A6; then A42: ((StepWhile=0 (a,I,P,s)) . t) . a = 0 by A3; consider z being Element of NAT such that A43: (StepWhile=0 (a,I,P,s)) . t = Comput ((P +* (while=0 (a,I))),(Initialize s),z) and A44: z <= q by A35; set z2 = z + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . t)))) + 3); consider w being Nat such that A45: q = z + w by A44, NAT_1:10; A46: ( I is_closed_on (StepWhile=0 (a,I,P,s)) . t,P +* (while=0 (a,I)) & I is_halting_on (StepWhile=0 (a,I,P,s)) . t,P +* (while=0 (a,I)) ) by A1; consider y being Nat such that A47: t = y + 1 by A35, NAT_1:6; reconsider y = y as Element of NAT by ORDINAL1:def_12; set Dy = (StepWhile=0 (a,I,P,s)) . y; y + 0 < t by A47, XREAL_1:6; then y < m by A35, XXREAL_0:2; then H1(y) <> 0 by A6; then A48: ((StepWhile=0 (a,I,P,s)) . y) . a = 0 by A3; A49: ( I is_closed_on (StepWhile=0 (a,I,P,s)) . y,P +* (while=0 (a,I)) & I is_halting_on (StepWhile=0 (a,I,P,s)) . y,P +* (while=0 (a,I)) ) by A1; reconsider w = w as Element of NAT by ORDINAL1:def_12; (StepWhile=0 (a,I,P,s)) . t = Comput ((P +* (while=0 (a,I))),(Initialize ((StepWhile=0 (a,I,P,s)) . y)),((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . y)))) + 3)) by A47, Def4; then A50: IC ((StepWhile=0 (a,I,P,s)) . t) = 0 by A49, A48, Th22, A2; now__::_thesis:_not_z_+_((LifeSpan_(((P_+*_(while=0_(a,I)))_+*_I),(Initialize_((StepWhile=0_(a,I,P,s))_._t))))_+_3)_<=_q assume A51: z + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . t)))) + 3) <= q ; ::_thesis: contradiction A52: now__::_thesis:_ex_k_being_Element_of_NAT_st_ (_(StepWhile=0_(a,I,P,s))_._(t_+_1)_=_Comput_((P_+*_(while=0_(a,I))),(Initialize_s),k)_&_k_<=_q_) take k = z + ((LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . t)))) + 3); ::_thesis: ( (StepWhile=0 (a,I,P,s)) . (t + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),k) & k <= q ) thus ( (StepWhile=0 (a,I,P,s)) . (t + 1) = Comput ((P +* (while=0 (a,I))),(Initialize s),k) & k <= q ) by A43, A50, A51, Th26; ::_thesis: verum end; t + 1 <= m by A41, NAT_1:13; hence contradiction by A35, A52, XREAL_1:29; ::_thesis: verum end; then A53: w < (LifeSpan (((P +* (while=0 (a,I))) +* I),(Initialize ((StepWhile=0 (a,I,P,s)) . t)))) + 3 by A45, XREAL_1:6; A54: (StepWhile=0 (a,I,P,s)) . t = Initialize ((StepWhile=0 (a,I,P,s)) . t) by A43, A50, Th26; Comput ((P +* (while=0 (a,I))),(Initialize s),q) = Comput ((P +* (while=0 (a,I))),(((StepWhile=0 (a,I,P,s)) . t) +* (Start-At (0,SCM+FSA))),w) by A54, A43, A45, EXTPRO_1:4; hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),q)) in dom (while=0 (a,I)) by A53, A46, A42, Th22, A2; ::_thesis: verum end; end; end; hence IC (Comput ((P +* (while=0 (a,I))),(Initialize s),q)) in dom (while=0 (a,I)) ; ::_thesis: verum end; end; end; hence while=0 (a,I) is_closed_on s,P by SCMFSA7B:def_6; ::_thesis: verum end; end; end; hence ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) ; ::_thesis: verum end; theorem Th28: :: SCMFSA_9:28 for P being Instruction-Sequence of SCM+FSA for I being parahalting Program of for a being read-write Int-Location for s being State of SCM+FSA st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile=0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile=0 (a,I,P,s)) . k) or f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,P,s)) . k) = 0 implies ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) ) holds ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for I being parahalting Program of for a being read-write Int-Location for s being State of SCM+FSA st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile=0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile=0 (a,I,P,s)) . k) or f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,P,s)) . k) = 0 implies ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) ) holds ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) let I be parahalting Program of ; ::_thesis: for a being read-write Int-Location for s being State of SCM+FSA st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile=0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile=0 (a,I,P,s)) . k) or f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,P,s)) . k) = 0 implies ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) ) holds ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) let a be read-write Int-Location; ::_thesis: for s being State of SCM+FSA st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile=0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile=0 (a,I,P,s)) . k) or f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,P,s)) . k) = 0 implies ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) ) holds ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) let s be State of SCM+FSA; ::_thesis: ( ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile=0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile=0 (a,I,P,s)) . k) or f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,P,s)) . k) = 0 implies ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) ) implies ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) ) A1: for k being Nat holds ( I is_closed_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) & I is_halting_on (StepWhile=0 (a,I,P,s)) . k,P +* (while=0 (a,I)) ) by SCMFSA7B:18, SCMFSA7B:19; assume ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile=0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile=0 (a,I,P,s)) . k) or f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,P,s)) . k) = 0 implies ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,P,s)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,P,s)) . k) = 0 ) ) ; ::_thesis: ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) hence ( while=0 (a,I) is_halting_on s,P & while=0 (a,I) is_closed_on s,P ) by A1, Th27; ::_thesis: verum end; theorem :: SCMFSA_9:29 for I being parahalting Program of for a being read-write Int-Location st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for s being State of SCM+FSA for P being Instruction-Sequence of SCM+FSA holds ( ( f . ((StepWhile=0 (a,I,P,s)) . 1) < f . s or f . s = 0 ) & ( f . s = 0 implies s . a <> 0 ) & ( s . a <> 0 implies f . s = 0 ) ) holds while=0 (a,I) is parahalting proof let I be parahalting Program of ; ::_thesis: for a being read-write Int-Location st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for s being State of SCM+FSA for P being Instruction-Sequence of SCM+FSA holds ( ( f . ((StepWhile=0 (a,I,P,s)) . 1) < f . s or f . s = 0 ) & ( f . s = 0 implies s . a <> 0 ) & ( s . a <> 0 implies f . s = 0 ) ) holds while=0 (a,I) is parahalting let a be read-write Int-Location; ::_thesis: ( ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for s being State of SCM+FSA for P being Instruction-Sequence of SCM+FSA holds ( ( f . ((StepWhile=0 (a,I,P,s)) . 1) < f . s or f . s = 0 ) & ( f . s = 0 implies s . a <> 0 ) & ( s . a <> 0 implies f . s = 0 ) ) implies while=0 (a,I) is parahalting ) given f being Function of (product (the_Values_of SCM+FSA)),NAT such that A1: for s being State of SCM+FSA for P being Instruction-Sequence of SCM+FSA holds ( ( f . ((StepWhile=0 (a,I,P,s)) . 1) < f . s or f . s = 0 ) & ( f . s = 0 implies s . a <> 0 ) & ( s . a <> 0 implies f . s = 0 ) ) ; ::_thesis: while=0 (a,I) is parahalting now__::_thesis:_for_t_being_State_of_SCM+FSA for_Q_being_Instruction-Sequence_of_SCM+FSA_holds_while=0_(a,I)_is_halting_on_t,Q let t be State of SCM+FSA; ::_thesis: for Q being Instruction-Sequence of SCM+FSA holds while=0 (a,I) is_halting_on t,Q let Q be Instruction-Sequence of SCM+FSA; ::_thesis: while=0 (a,I) is_halting_on t,Q now__::_thesis:_for_k_being_Nat_holds_ (_(_f_._((StepWhile=0_(a,I,Q,t))_._(k_+_1))_<_f_._((StepWhile=0_(a,I,Q,t))_._k)_or_f_._((StepWhile=0_(a,I,Q,t))_._k)_=_0_)_&_(_f_._((StepWhile=0_(a,I,Q,t))_._k)_=_0_implies_((StepWhile=0_(a,I,Q,t))_._k)_._a_<>_0_)_&_(_((StepWhile=0_(a,I,Q,t))_._k)_._a_<>_0_implies_f_._((StepWhile=0_(a,I,Q,t))_._k)_=_0_)_) let k be Nat; ::_thesis: ( ( f . ((StepWhile=0 (a,I,Q,t)) . (k + 1)) < f . ((StepWhile=0 (a,I,Q,t)) . k) or f . ((StepWhile=0 (a,I,Q,t)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,Q,t)) . k) = 0 implies ((StepWhile=0 (a,I,Q,t)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,Q,t)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,Q,t)) . k) = 0 ) ) A2: k in NAT by ORDINAL1:def_12; ( f . ((StepWhile=0 (a,I,Q,((StepWhile=0 (a,I,Q,t)) . k))) . 1) < f . ((StepWhile=0 (a,I,Q,t)) . k) or f . ((StepWhile=0 (a,I,Q,t)) . k) = 0 ) by A1; hence ( ( f . ((StepWhile=0 (a,I,Q,t)) . (k + 1)) < f . ((StepWhile=0 (a,I,Q,t)) . k) or f . ((StepWhile=0 (a,I,Q,t)) . k) = 0 ) & ( f . ((StepWhile=0 (a,I,Q,t)) . k) = 0 implies ((StepWhile=0 (a,I,Q,t)) . k) . a <> 0 ) & ( ((StepWhile=0 (a,I,Q,t)) . k) . a <> 0 implies f . ((StepWhile=0 (a,I,Q,t)) . k) = 0 ) ) by A1, A2, Th23; ::_thesis: verum end; hence while=0 (a,I) is_halting_on t,Q by Th28; ::_thesis: verum end; hence while=0 (a,I) is parahalting by SCMFSA7B:19; ::_thesis: verum end; theorem Th30: :: SCMFSA_9:30 for l1, l2 being Element of NAT for a being Int-Location holds not l1 .--> (goto l2) destroys a proof let l1, l2 be Element of NAT ; ::_thesis: for a being Int-Location holds not l1 .--> (goto l2) destroys a let a be Int-Location; ::_thesis: not l1 .--> (goto l2) destroys a set I = l1 .--> (goto l2); A1: rng (l1 .--> (goto l2)) = {(goto l2)} by FUNCOP_1:8; now__::_thesis:_for_i_being_Instruction_of_SCM+FSA_st_i_in_rng_(l1_.-->_(goto_l2))_holds_ not_i_destroys_a let i be Instruction of SCM+FSA; ::_thesis: ( i in rng (l1 .--> (goto l2)) implies not i destroys a ) assume i in rng (l1 .--> (goto l2)) ; ::_thesis: not i destroys a then i = goto l2 by A1, TARSKI:def_1; hence not i destroys a by SCMFSA7B:11; ::_thesis: verum end; hence not l1 .--> (goto l2) destroys a by SCMFSA7B:def_4; ::_thesis: verum end; theorem Th31: :: SCMFSA_9:31 for i being Instruction of SCM+FSA st not i destroys intloc 0 holds Macro i is good proof let i be Instruction of SCM+FSA; ::_thesis: ( not i destroys intloc 0 implies Macro i is good ) set I = Macro i; A1: rng (Macro i) = {i,(halt SCM+FSA)} by COMPOS_1:67; assume A2: not i destroys intloc 0 ; ::_thesis: Macro i is good now__::_thesis:_for_x_being_Instruction_of_SCM+FSA_st_x_in_rng_(Macro_i)_holds_ not_x_destroys_intloc_0 let x be Instruction of SCM+FSA; ::_thesis: ( x in rng (Macro i) implies not b1 destroys intloc 0 ) assume A3: x in rng (Macro i) ; ::_thesis: not b1 destroys intloc 0 percases ( x = i or x = halt SCM+FSA ) by A1, A3, TARSKI:def_2; suppose x = i ; ::_thesis: not b1 destroys intloc 0 hence not x destroys intloc 0 by A2; ::_thesis: verum end; suppose x = halt SCM+FSA ; ::_thesis: not b1 destroys intloc 0 hence not x destroys intloc 0 by SCMFSA7B:5; ::_thesis: verum end; end; end; then not Macro i destroys intloc 0 by SCMFSA7B:def_4; hence Macro i is good by SCMFSA7B:def_5; ::_thesis: verum end; registration let I, J be good Program of ; let a be Int-Location; cluster if=0 (a,I,J) -> good ; correctness coherence if=0 (a,I,J) is good ; proof set i = a =0_goto ((card J) + 3); reconsider Mi = Macro (a =0_goto ((card J) + 3)) as good Program of by Th31, SCMFSA7B:12; if=0 (a,I,J) = ((((a =0_goto ((card J) + 3)) ";" J) ";" (Goto ((card I) + 1))) ";" I) ";" (Stop SCM+FSA) by SCMFSA8B:def_1 .= (((Mi ";" J) ";" (Goto ((card I) + 1))) ";" I) ";" (Stop SCM+FSA) ; hence if=0 (a,I,J) is good ; ::_thesis: verum end; end; registration let I be good Program of ; let a be Int-Location; cluster while=0 (a,I) -> good ; correctness coherence while=0 (a,I) is good ; proof set F = if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)); set J = ((card I) + 4) .--> (goto 0); ( not ((card I) + 4) .--> (goto 0) destroys intloc 0 & not if=0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) destroys intloc 0 ) by Th30, SCMFSA7B:def_5; then not while=0 (a,I) destroys intloc 0 by SCMFSA8A:11; hence while=0 (a,I) is good by SCMFSA7B:def_5; ::_thesis: verum end; end; theorem Th32: :: SCMFSA_9:32 for a being Int-Location for I being Program of for k being Element of NAT st k < 6 holds k in dom (while>0 (a,I)) proof let a be Int-Location; ::_thesis: for I being Program of for k being Element of NAT st k < 6 holds k in dom (while>0 (a,I)) let I be Program of ; ::_thesis: for k being Element of NAT st k < 6 holds k in dom (while>0 (a,I)) let k be Element of NAT ; ::_thesis: ( k < 6 implies k in dom (while>0 (a,I)) ) A1: 6 <= (card I) + 6 by NAT_1:11; A2: card (while>0 (a,I)) = (card I) + 6 by Th5; assume k < 6 ; ::_thesis: k in dom (while>0 (a,I)) then k < (card I) + 6 by A1, XXREAL_0:2; hence k in dom (while>0 (a,I)) by A2, AFINSQ_1:66; ::_thesis: verum end; theorem Th33: :: SCMFSA_9:33 for a being Int-Location for I being Program of for k being Element of NAT st k < 6 holds (card I) + k in dom (while>0 (a,I)) proof let a be Int-Location; ::_thesis: for I being Program of for k being Element of NAT st k < 6 holds (card I) + k in dom (while>0 (a,I)) let I be Program of ; ::_thesis: for k being Element of NAT st k < 6 holds (card I) + k in dom (while>0 (a,I)) let k be Element of NAT ; ::_thesis: ( k < 6 implies (card I) + k in dom (while>0 (a,I)) ) assume k < 6 ; ::_thesis: (card I) + k in dom (while>0 (a,I)) then A1: (card I) + k < (card I) + 6 by XREAL_1:6; card (while>0 (a,I)) = (card I) + 6 by Th5; hence (card I) + k in dom (while>0 (a,I)) by A1, AFINSQ_1:66; ::_thesis: verum end; theorem Th34: :: SCMFSA_9:34 for a being Int-Location for I being Program of holds (while>0 (a,I)) . ((card I) + 5) = halt SCM+FSA proof set J1 = Stop SCM+FSA; set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of holds (while>0 (a,I)) . ((card I) + 5) = halt SCM+FSA let I be Program of ; ::_thesis: (while>0 (a,I)) . ((card I) + 5) = halt SCM+FSA set I1 = I ";" (Goto 0); set f = ((card I) + 4) .--> (goto 0); set i = a >0_goto ((card (Stop SCM+FSA)) + 3); set c5 = (card I) + 5; set Lc5 = (card I) + 5; set Mi = (((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0)); ( dom (((card I) + 4) .--> (goto 0)) = {((card I) + 4)} & (card I) + 5 <> (card I) + 4 ) by FUNCOP_1:13; then A1: not (card I) + 5 in dom (((card I) + 4) .--> (goto 0)) by TARSKI:def_1; 0 + ((card I) + 5) in { (il + ((card I) + 5)) where il is Element of NAT : il in dom (Stop SCM+FSA) } by Lm3; then A2: (card I) + 5 in dom (Shift ((Stop SCM+FSA),((card I) + 5))) by VALUED_1:def_12; then A3: (Shift ((Stop SCM+FSA),((card I) + 5))) /. ((card I) + 5) = (Shift ((Stop SCM+FSA),((card I) + 5))) . (0 + ((card I) + 5)) by PARTFUN1:def_6 .= halt SCM+FSA by Lm2, Lm3, VALUED_1:def_12 ; A4: ( (card I) + 5 in dom (while>0 (a,I)) & dom (while>0 (a,I)) = (dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) ) by Th33, FUNCT_4:def_1; then A5: (card I) + 5 in dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A1, XBOOLE_0:def_3; A6: if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_2 .= ((((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) ; then card (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (card ((((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0)))) + (card (Stop SCM+FSA)) by SCMFSA6A:21; then A7: card ((((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) = (card (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) - (card (Stop SCM+FSA)) .= ((card I) + 6) - 1 by Th2, Lm1 .= (card I) + 5 ; then A8: not (card I) + 5 in dom ((((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ; A9: dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (Directed ((((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))))) \/ (dom (Reloc ((Stop SCM+FSA),((card I) + 5)))) by A6, A7, FUNCT_4:def_1; then dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom ((((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0)))) \/ (dom (Reloc ((Stop SCM+FSA),((card I) + 5)))) by FUNCT_4:99; then A10: (card I) + 5 in dom (Reloc ((Stop SCM+FSA),((card I) + 5))) by A5, A8, XBOOLE_0:def_3; A11: Reloc ((Stop SCM+FSA),((card I) + 5)) = IncAddr ((Shift ((Stop SCM+FSA),((card I) + 5))),((card I) + 5)) by COMPOS_1:34; thus (while>0 (a,I)) . ((card I) + 5) = ((Directed ((((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0)))) +* (Reloc ((Stop SCM+FSA),((card I) + 5)))) . ((card I) + 5) by A1, A4, A6, A7, FUNCT_4:def_1 .= (Reloc ((Stop SCM+FSA),((card I) + 5))) . ((card I) + 5) by A5, A9, A10, FUNCT_4:def_1 .= IncAddr ((halt SCM+FSA),((card I) + 5)) by A2, A3, A11, COMPOS_1:def_21 .= halt SCM+FSA by COMPOS_0:4 ; ::_thesis: verum end; theorem Th35: :: SCMFSA_9:35 for a being Int-Location for I being Program of holds (while>0 (a,I)) . 3 = goto ((card I) + 5) proof set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of holds (while>0 (a,I)) . 3 = goto ((card I) + 5) let I be Program of ; ::_thesis: (while>0 (a,I)) . 3 = goto ((card I) + 5) set I1 = I ";" (Goto 0); set f = ((card I) + 4) .--> (goto 0); set i = a >0_goto ((card (Stop SCM+FSA)) + 3); set Mi = (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA); set G = Goto ((card (I ";" (Goto 0))) + 1); set J2 = (I ";" (Goto 0)) ";" (Stop SCM+FSA); set J1 = (Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)); A1: 0 in dom (Goto ((card (I ";" (Goto 0))) + 1)) by SCMFSA8A:31; A2: (Goto ((card (I ";" (Goto 0))) + 1)) . 0 = goto ((card (I ";" (Goto 0))) + 1) by SCMFSA8A:31 .= goto (((card I) + (card (Goto 0))) + 1) by SCMFSA6A:21 .= goto (((card I) + 1) + 1) by SCMFSA8A:15 .= goto ((card I) + (1 + 1)) ; dom ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) = (dom (Directed (Goto ((card (I ";" (Goto 0))) + 1)))) \/ (dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),(card (Goto ((card (I ";" (Goto 0))) + 1)))))) by FUNCT_4:def_1 .= (dom (Goto ((card (I ";" (Goto 0))) + 1))) \/ (dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),(card (Goto ((card (I ";" (Goto 0))) + 1)))))) by FUNCT_4:99 ; then A3: 0 in dom ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) by A1, XBOOLE_0:def_3; then 0 + 3 in { (il + 3) where il is Element of NAT : il in dom ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) } ; then A4: 3 in dom (Shift (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)) by VALUED_1:def_12; then A5: (Shift (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)) /. 3 = (Shift (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)) . (0 + 3) by PARTFUN1:def_6 .= ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) . 0 by A3, VALUED_1:def_12 .= (Directed (Goto ((card (I ";" (Goto 0))) + 1))) . 0 by A1, SCMFSA8A:14 .= goto ((card I) + 2) by A1, A2, SCMFSA8A:16 ; ( dom (((card I) + 4) .--> (goto 0)) = {((card I) + 4)} & 3 <> (card I) + 4 ) by FUNCOP_1:13, NAT_1:11; then A6: not 3 in dom (((card I) + 4) .--> (goto 0)) by TARSKI:def_1; A7: card ((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) = (card (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3)))) + (card (Stop SCM+FSA)) by SCMFSA6A:21 .= 2 + 1 by Lm1, COMPOS_1:56 ; then A8: not 3 in dom ((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ; A9: ( 3 in dom (while>0 (a,I)) & dom (while>0 (a,I)) = (dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) ) by Th32, FUNCT_4:def_1; then A10: 3 in dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A6, XBOOLE_0:def_3; A11: CutLastLoc (stop ((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA))) = (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA) ; A12: if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_2 .= (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by SCMFSA6A:25 .= ((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) by SCMFSA6A:25 .= (Directed ((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA))) +* (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)) by A7, A11 ; then A13: dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (Directed ((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA)))) \/ (dom (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3))) by FUNCT_4:def_1; then dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom ((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA))) \/ (dom (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3))) by FUNCT_4:99; then A14: 3 in dom (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)) by A10, A8, XBOOLE_0:def_3; A15: Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3) = IncAddr ((Shift (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)),3) by COMPOS_1:34; thus (while>0 (a,I)) . 3 = ((Directed ((Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ";" (Stop SCM+FSA))) +* (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3))) . 3 by A6, A9, A12, FUNCT_4:def_1 .= (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),3)) . 3 by A10, A13, A14, FUNCT_4:def_1 .= IncAddr ((goto ((card I) + 2)),3) by A4, A5, A15, COMPOS_1:def_21 .= goto (((card I) + 2) + 3) by SCMFSA_4:1 .= goto ((card I) + 5) ; ::_thesis: verum end; theorem Th36: :: SCMFSA_9:36 for a being Int-Location for I being Program of holds (while>0 (a,I)) . 2 = goto 3 proof set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of holds (while>0 (a,I)) . 2 = goto 3 let I be Program of ; ::_thesis: (while>0 (a,I)) . 2 = goto 3 set I1 = I ";" (Goto 0); set f = ((card I) + 4) .--> (goto 0); set i = a >0_goto ((card (Stop SCM+FSA)) + 3); set Mi = Macro (a >0_goto ((card (Stop SCM+FSA)) + 3)); set J2 = (Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)); set J1 = (Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))); ( dom (((card I) + 4) .--> (goto 0)) = {((card I) + 4)} & 2 <> (card I) + 4 ) by FUNCOP_1:13, NAT_1:11; then A1: not 2 in dom (((card I) + 4) .--> (goto 0)) by TARSKI:def_1; dom ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) = (dom (Directed (Stop SCM+FSA))) \/ (dom (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),(card (Stop SCM+FSA))))) by FUNCT_4:def_1 .= (dom (Stop SCM+FSA)) \/ (dom (Reloc (((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))),(card (Stop SCM+FSA))))) by FUNCT_4:99 ; then A2: 0 in dom ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) by Lm3, XBOOLE_0:def_3; then 0 + 2 in { (il + 2) where il is Element of NAT : il in dom ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) } ; then A3: 2 in dom (Shift (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)) by VALUED_1:def_12; then A4: (Shift (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)) /. 2 = (Shift (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)) . (0 + 2) by PARTFUN1:def_6 .= ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) . 0 by A2, VALUED_1:def_12 .= (Directed (Stop SCM+FSA)) . 0 by Lm3, SCMFSA8A:14 .= goto (card (Stop SCM+FSA)) by Lm2, Lm3, SCMFSA8A:16 ; card (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) = 2 by COMPOS_1:56; then A5: not 2 in dom (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))) ; A6: ( 2 in dom (while>0 (a,I)) & dom (while>0 (a,I)) = (dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) ) by Th32, FUNCT_4:def_1; then A7: 2 in dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A1, XBOOLE_0:def_3; A8: if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_2 .= (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by SCMFSA6A:25 .= ((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA))) by SCMFSA6A:25 .= (a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" ((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))) by SCMFSA6A:29 .= (Directed (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3)))) +* (Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)) by COMPOS_1:56 ; then A9: dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (Directed (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3))))) \/ (dom (Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2))) by FUNCT_4:def_1; then dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3)))) \/ (dom (Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2))) by FUNCT_4:99; then A10: 2 in dom (Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)) by A7, A5, XBOOLE_0:def_3; A11: Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2) = IncAddr ((Shift (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)),2) by COMPOS_1:34; thus (while>0 (a,I)) . 2 = ((Directed (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3)))) +* (Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2))) . 2 by A1, A6, A8, FUNCT_4:def_1 .= (Reloc (((Stop SCM+FSA) ";" ((Goto ((card (I ";" (Goto 0))) + 1)) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)))),2)) . 2 by A7, A9, A10, FUNCT_4:def_1 .= IncAddr ((goto (card (Stop SCM+FSA))),2) by A3, A4, A11, COMPOS_1:def_21 .= goto (1 + 2) by Lm1, SCMFSA_4:1 .= goto 3 ; ::_thesis: verum end; theorem :: SCMFSA_9:37 for a being Int-Location for I being Program of for k being Element of NAT st k < (card I) + 6 holds k in dom (while>0 (a,I)) proof let a be Int-Location; ::_thesis: for I being Program of for k being Element of NAT st k < (card I) + 6 holds k in dom (while>0 (a,I)) let I be Program of ; ::_thesis: for k being Element of NAT st k < (card I) + 6 holds k in dom (while>0 (a,I)) let k be Element of NAT ; ::_thesis: ( k < (card I) + 6 implies k in dom (while>0 (a,I)) ) assume A1: k < (card I) + 6 ; ::_thesis: k in dom (while>0 (a,I)) card (while>0 (a,I)) = (card I) + 6 by Th5; hence k in dom (while>0 (a,I)) by A1, AFINSQ_1:66; ::_thesis: verum end; theorem Th38: :: SCMFSA_9:38 for P being Instruction-Sequence of SCM+FSA for s being State of SCM+FSA for I being Program of for a being read-write Int-Location st s . a <= 0 holds ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for s being State of SCM+FSA for I being Program of for a being read-write Int-Location st s . a <= 0 holds ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) let s be State of SCM+FSA; ::_thesis: for I being Program of for a being read-write Int-Location st s . a <= 0 holds ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) let I be Program of ; ::_thesis: for a being read-write Int-Location st s . a <= 0 holds ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) let a be read-write Int-Location; ::_thesis: ( s . a <= 0 implies ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) ) assume A1: s . a <= 0 ; ::_thesis: ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) set i = a >0_goto 4; set s1 = Initialize s; set P1 = P +* (while>0 (a,I)); IC in dom (Start-At (0,SCM+FSA)) by MEMSTR_0:15; then A2: IC in dom (Start-At (0,SCM+FSA)) ; A3: IC (Initialize s) = IC (Start-At (0,SCM+FSA)) by A2, FUNCT_4:13 .= 0 by FUNCOP_1:72 ; set loc5 = (card I) + 5; set s5 = Comput ((P +* (while>0 (a,I))),(Initialize s),4); set s4 = Comput ((P +* (while>0 (a,I))),(Initialize s),3); set s3 = Comput ((P +* (while>0 (a,I))),(Initialize s),2); set s2 = Comput ((P +* (while>0 (a,I))),(Initialize s),1); A4: 1 in dom (while>0 (a,I)) by Th10; A5: 2 in dom (while>0 (a,I)) by Th32; not a in dom (Start-At (0,SCM+FSA)) by SCMFSA_2:102; then A6: (Initialize s) . a = s . a by FUNCT_4:11; A7: (P +* (while>0 (a,I))) /. (IC (Initialize s)) = (P +* (while>0 (a,I))) . (IC (Initialize s)) by PBOOLE:143; A8: 0 in dom (while>0 (a,I)) by Th10; then (P +* (while>0 (a,I))) . 0 = (while>0 (a,I)) . 0 by FUNCT_4:13 .= a >0_goto 4 by Th11 ; then A9: CurInstr ((P +* (while>0 (a,I))),(Initialize s)) = a >0_goto 4 by A3, A7; A10: Comput ((P +* (while>0 (a,I))),(Initialize s),(0 + 1)) = Following ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),0))) by EXTPRO_1:3 .= Following ((P +* (while>0 (a,I))),(Initialize s)) .= Exec ((a >0_goto 4),(Initialize s)) by A9 ; A11: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),1)) = succ 0 by A1, A3, A10, A6, SCMFSA_2:71 .= 0 + 1 ; A12: (P +* (while>0 (a,I))) /. (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),1))) = (P +* (while>0 (a,I))) . (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),1))) by PBOOLE:143; (P +* (while>0 (a,I))) . 1 = (while>0 (a,I)) . 1 by A4, FUNCT_4:13 .= goto 2 by Th11 ; then A13: CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),1))) = goto 2 by A11, A12; A14: Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + 1)) = Following ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),1))) by EXTPRO_1:3 .= Exec ((goto 2),(Comput ((P +* (while>0 (a,I))),(Initialize s),1))) by A13 ; A15: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),2)) = 2 by A14, SCMFSA_2:69; A16: (P +* (while>0 (a,I))) /. (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),2))) = (P +* (while>0 (a,I))) . (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),2))) by PBOOLE:143; (P +* (while>0 (a,I))) . 2 = (while>0 (a,I)) . 2 by A5, FUNCT_4:13 .= goto 3 by Th36 ; then A17: CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),2))) = goto 3 by A15, A16; A18: Comput ((P +* (while>0 (a,I))),(Initialize s),(2 + 1)) = Following ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),2))) by EXTPRO_1:3 .= Exec ((goto 3),(Comput ((P +* (while>0 (a,I))),(Initialize s),2))) by A17 ; A19: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),3)) = 3 by A18, SCMFSA_2:69; A20: 3 in dom (while>0 (a,I)) by Th32; A21: (card I) + 5 in dom (while>0 (a,I)) by Th33; A22: (P +* (while>0 (a,I))) /. (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),3))) = (P +* (while>0 (a,I))) . (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),3))) by PBOOLE:143; (P +* (while>0 (a,I))) . 3 = (while>0 (a,I)) . 3 by A20, FUNCT_4:13 .= goto ((card I) + 5) by Th35 ; then A23: CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),3))) = goto ((card I) + 5) by A19, A22; A24: Comput ((P +* (while>0 (a,I))),(Initialize s),(3 + 1)) = Following ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),3))) by EXTPRO_1:3 .= Exec ((goto ((card I) + 5)),(Comput ((P +* (while>0 (a,I))),(Initialize s),3))) by A23 ; A25: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),4)) = (card I) + 5 by A24, SCMFSA_2:69; A26: (P +* (while>0 (a,I))) /. (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),4))) = (P +* (while>0 (a,I))) . (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),4))) by PBOOLE:143; (P +* (while>0 (a,I))) . ((card I) + 5) = (while>0 (a,I)) . ((card I) + 5) by A21, FUNCT_4:13 .= halt SCM+FSA by Th34 ; then A27: CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),4))) = halt SCM+FSA by A25, A26; then P +* (while>0 (a,I)) halts_on Initialize s by EXTPRO_1:29; hence while>0 (a,I) is_halting_on s,P by SCMFSA7B:def_7; ::_thesis: while>0 (a,I) is_closed_on s,P now__::_thesis:_for_k_being_Element_of_NAT_holds_IC_(Comput_((P_+*_(while>0_(a,I))),(Initialize_s),k))_in_dom_(while>0_(a,I)) let k be Element of NAT ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) A28: ( k <= 3 or k >= 3 + 1 ) by NAT_1:13; percases ( k = 0 or k = 1 or k = 2 or k = 3 or k >= 4 ) by A28, NAT_1:27; suppose k = 0 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A8, A3, EXTPRO_1:2; ::_thesis: verum end; suppose k = 1 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A11, Th10; ::_thesis: verum end; suppose k = 2 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A15, Th32; ::_thesis: verum end; suppose k = 3 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A19, Th32; ::_thesis: verum end; suppose k >= 4 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A21, A25, A27, EXTPRO_1:5; ::_thesis: verum end; end; end; hence while>0 (a,I) is_closed_on s,P by SCMFSA7B:def_6; ::_thesis: verum end; theorem Th39: :: SCMFSA_9:39 for P being Instruction-Sequence of SCM+FSA for a being Int-Location for I being Program of for s being State of SCM+FSA for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* I),(Initialize s)) & IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) holds ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Start-At (0,SCM+FSA))),(k + 1))) ) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for a being Int-Location for I being Program of for s being State of SCM+FSA for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* I),(Initialize s)) & IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) holds ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Start-At (0,SCM+FSA))),(k + 1))) ) set J3 = (Goto 0) ";" (Stop SCM+FSA); set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of for s being State of SCM+FSA for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* I),(Initialize s)) & IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) holds ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Start-At (0,SCM+FSA))),(k + 1))) ) set D = Int-Locations \/ FinSeq-Locations; let I be Program of ; ::_thesis: for s being State of SCM+FSA for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* I),(Initialize s)) & IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) holds ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Start-At (0,SCM+FSA))),(k + 1))) ) let s be State of SCM+FSA; ::_thesis: for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* I),(Initialize s)) & IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) holds ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Start-At (0,SCM+FSA))),(k + 1))) ) let k be Element of NAT ; ::_thesis: ( I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* I),(Initialize s)) & IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) implies ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Start-At (0,SCM+FSA))),(k + 1))) ) ) set s1 = Initialize s; set P1 = P +* (while>0 (a,I)); set sI = Initialize s; set PI = P +* I; A1: I c= P +* I by FUNCT_4:25; set sK1 = Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k)); set sK2 = Comput ((P +* I),(Initialize s),k); set l3 = IC (Comput ((P +* I),(Initialize s),k)); set I1 = I ";" (Goto 0); set i = a >0_goto ((card (Stop SCM+FSA)) + 3); reconsider n = IC (Comput ((P +* I),(Initialize s),k)) as Element of NAT ; set Mi = ((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)); set J2 = (I ";" (Goto 0)) ";" (Stop SCM+FSA); A2: rng I c= the InstructionsF of SCM+FSA by RELAT_1:def_19; assume I is_closed_on s,P ; ::_thesis: ( not I is_halting_on s,P or not k < LifeSpan ((P +* I),(Initialize s)) or not IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 or not DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) or ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Start-At (0,SCM+FSA))),(k + 1))) ) ) then A3: n in dom I by SCMFSA7B:def_6; then n < card I by AFINSQ_1:66; then A4: n + 4 < (card I) + 6 by XREAL_1:8; A5: (P +* I) /. (IC (Comput ((P +* I),(Initialize s),k))) = (P +* I) . (IC (Comput ((P +* I),(Initialize s),k))) by PBOOLE:143; A6: CurInstr ((P +* I),(Comput ((P +* I),(Initialize s),k))) = (P +* I) . n by A5 .= I . n by A3, A1, GRFUNC_1:2 ; assume I is_halting_on s,P ; ::_thesis: ( not k < LifeSpan ((P +* I),(Initialize s)) or not IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 or not DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) or ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Start-At (0,SCM+FSA))),(k + 1))) ) ) then A7: P +* I halts_on Initialize s by SCMFSA7B:def_7; assume k < LifeSpan ((P +* I),(Initialize s)) ; ::_thesis: ( not IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 or not DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) or ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Start-At (0,SCM+FSA))),(k + 1))) ) ) then A8: I . n <> halt SCM+FSA by A6, A7, EXTPRO_1:def_15; A9: (I ";" (Goto 0)) ";" (Stop SCM+FSA) = I ";" ((Goto 0) ";" (Stop SCM+FSA)) by SCMFSA6A:25; then dom ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) = (dom (Directed I)) \/ (dom (Reloc (((Goto 0) ";" (Stop SCM+FSA)),(card I)))) by FUNCT_4:def_1 .= (dom I) \/ (dom (Reloc (((Goto 0) ";" (Stop SCM+FSA)),(card I)))) by FUNCT_4:99 ; then A10: n in dom ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by A3, XBOOLE_0:def_3; then n + 4 in { (il + 4) where il is Element of NAT : il in dom ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) } ; then A11: n + 4 in dom (Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) by VALUED_1:def_12; then A12: (Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) /. (n + 4) = (Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) . (n + 4) by PARTFUN1:def_6 .= ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) . n by A10, VALUED_1:def_12 .= (Directed I) . n by A3, A9, SCMFSA8A:14 .= I . n by A3, A8, SCMFSA8A:16 ; card (while>0 (a,I)) = (card I) + 6 by Th5; then A13: n + 4 in dom (while>0 (a,I)) by A4, AFINSQ_1:66; I . n in rng I by A3, FUNCT_1:def_3; then reconsider j = I . n as Instruction of SCM+FSA by A2; A14: card (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) = (card ((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA))) + (card (Goto ((card (I ";" (Goto 0))) + 1))) by SCMFSA6A:21 .= (card ((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA))) + 1 by SCMFSA8A:15 .= ((card (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3)))) + (card (Stop SCM+FSA))) + 1 by SCMFSA6A:21 .= (2 + 1) + 1 by Lm1, COMPOS_1:56 .= 3 + 1 ; then n + 4 >= card (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) by NAT_1:11; then A15: not n + 4 in dom (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) by AFINSQ_1:66; A16: Comput ((P +* I),(Initialize s),(k + 1)) = Following ((P +* I),(Comput ((P +* I),(Initialize s),k))) by EXTPRO_1:3 .= Exec (j,(Comput ((P +* I),(Initialize s),k))) by A6 ; set f = ((card I) + 4) .--> (goto 0); assume A17: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = (IC (Comput ((P +* I),(Initialize s),k))) + 4 ; ::_thesis: ( not DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) or ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Start-At (0,SCM+FSA))),(k + 1))) ) ) ( dom (((card I) + 4) .--> (goto 0)) = {((card I) + 4)} & n + 4 <> (card I) + 4 ) by A3, FUNCOP_1:13; then A18: not n + 4 in dom (((card I) + 4) .--> (goto 0)) by TARSKI:def_1; A19: dom (while>0 (a,I)) = (dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1; then A20: n + 4 in dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A18, A13, XBOOLE_0:def_3; A21: CutLastLoc (stop (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) = ((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)) ; A22: if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_2 .= (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by SCMFSA6A:25 .= (Directed (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) +* (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) by A14, A21 ; then A23: dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (Directed (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))))) \/ (dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4))) by FUNCT_4:def_1; then dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) \/ (dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4))) by FUNCT_4:99; then A24: n + 4 in dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) by A20, A15, XBOOLE_0:def_3; A25: (P +* (while>0 (a,I))) /. (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k)))) = (P +* (while>0 (a,I))) . (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k)))) by PBOOLE:143; A26: Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4) = IncAddr ((Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)),4) by COMPOS_1:34; (P +* (while>0 (a,I))) . (n + 4) = (while>0 (a,I)) . (n + 4) by A13, FUNCT_4:13 .= ((Directed (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) +* (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4))) . (n + 4) by A18, A13, A19, A22, FUNCT_4:def_1 .= (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) . (n + 4) by A20, A23, A24, FUNCT_4:def_1 .= IncAddr (j,4) by A11, A12, A26, COMPOS_1:def_21 ; then A27: CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k)))) = IncAddr (j,4) by A17, A25; assume A28: DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k))) = DataPart (Comput ((P +* I),(Initialize s),k)) ; ::_thesis: ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Start-At (0,SCM+FSA))),(k + 1))) ) Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1)) = Following ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k)))) by EXTPRO_1:3 .= Exec ((IncAddr (j,4)),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + k)))) by A27 ; hence ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(s +* (Start-At (0,SCM+FSA))),(k + 1))) ) by A17, A28, A16, SCMFSA6A:8; ::_thesis: verum end; theorem Th40: :: SCMFSA_9:40 for P being Instruction-Sequence of SCM+FSA for a being Int-Location for I being Program of for s being State of SCM+FSA st I is_closed_on s,P & I is_halting_on s,P & IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 holds CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for a being Int-Location for I being Program of for s being State of SCM+FSA st I is_closed_on s,P & I is_halting_on s,P & IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 holds CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) set J3 = (Goto 0) ";" (Stop SCM+FSA); set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of for s being State of SCM+FSA st I is_closed_on s,P & I is_halting_on s,P & IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 holds CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) let I be Program of ; ::_thesis: for s being State of SCM+FSA st I is_closed_on s,P & I is_halting_on s,P & IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 holds CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) let s be State of SCM+FSA; ::_thesis: ( I is_closed_on s,P & I is_halting_on s,P & IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 implies CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) ) set s1 = Initialize s; set P1 = P +* (while>0 (a,I)); A1: while>0 (a,I) c= P +* (while>0 (a,I)) by FUNCT_4:25; set sI = Initialize s; set PI = P +* I; A2: I c= P +* I by FUNCT_4:25; set life = LifeSpan ((P +* I),(Initialize s)); set sK1 = Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))); set sK2 = Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))); set I1 = I ";" (Goto 0); set i = a >0_goto ((card (Stop SCM+FSA)) + 3); reconsider n = IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s))))) as Element of NAT ; set Mi = ((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)); set J2 = (I ";" (Goto 0)) ";" (Stop SCM+FSA); assume I is_closed_on s,P ; ::_thesis: ( not I is_halting_on s,P or not IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 or CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) ) then A3: n in dom I by SCMFSA7B:def_6; then n < card I by AFINSQ_1:66; then A4: n + 4 < (card I) + 6 by XREAL_1:8; A5: (P +* I) /. (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) = (P +* I) . (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) by PBOOLE:143; assume I is_halting_on s,P ; ::_thesis: ( not IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 or CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) ) then A6: P +* I halts_on Initialize s by SCMFSA7B:def_7; CurInstr ((P +* I),(Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) = I . n by A3, A2, A5, GRFUNC_1:2; then A7: I . n = halt SCM+FSA by A6, EXTPRO_1:def_15; A8: (I ";" (Goto 0)) ";" (Stop SCM+FSA) = I ";" ((Goto 0) ";" (Stop SCM+FSA)) by SCMFSA6A:25; then dom ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) = (dom (Directed I)) \/ (dom (Reloc (((Goto 0) ";" (Stop SCM+FSA)),(card I)))) by FUNCT_4:def_1 .= (dom I) \/ (dom (Reloc (((Goto 0) ";" (Stop SCM+FSA)),(card I)))) by FUNCT_4:99 ; then A9: n in dom ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by A3, XBOOLE_0:def_3; then n + 4 in { (il + 4) where il is Element of NAT : il in dom ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) } ; then A10: n + 4 in dom (Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) by VALUED_1:def_12; then A11: (Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) /. (n + 4) = (Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) . (n + 4) by PARTFUN1:def_6 .= ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) . n by A9, VALUED_1:def_12 .= (Directed I) . n by A3, A8, SCMFSA8A:14 .= goto (card I) by A3, A7, SCMFSA8A:16 ; set f = ((card I) + 4) .--> (goto 0); assume A12: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s)))))) = (IC (Comput ((P +* I),(Initialize s),(LifeSpan ((P +* I),(Initialize s)))))) + 4 ; ::_thesis: CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) ( dom (((card I) + 4) .--> (goto 0)) = {((card I) + 4)} & n + 4 <> (card I) + 4 ) by A3, FUNCOP_1:13; then A13: not n + 4 in dom (((card I) + 4) .--> (goto 0)) by TARSKI:def_1; A14: card (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) = (card ((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA))) + (card (Goto ((card (I ";" (Goto 0))) + 1))) by SCMFSA6A:21 .= (card ((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA))) + 1 by SCMFSA8A:15 .= ((card (Macro (a >0_goto ((card (Stop SCM+FSA)) + 3)))) + (card (Stop SCM+FSA))) + 1 by SCMFSA6A:21 .= (2 + 1) + 1 by Lm1, COMPOS_1:56 .= 3 + 1 ; then n + 4 >= card (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) by NAT_1:11; then A15: not n + 4 in dom (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) by AFINSQ_1:66; card (while>0 (a,I)) = (card I) + 6 by Th5; then A16: n + 4 in dom (while>0 (a,I)) by A4, AFINSQ_1:66; A17: dom (while>0 (a,I)) = (dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) by FUNCT_4:def_1; then A18: n + 4 in dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) by A13, A16, XBOOLE_0:def_3; A19: CutLastLoc (stop (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) = ((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)) ; A20: if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) = ((((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" (I ";" (Goto 0))) ";" (Stop SCM+FSA) by SCMFSA8B:def_2 .= (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))) ";" ((I ";" (Goto 0)) ";" (Stop SCM+FSA)) by SCMFSA6A:25 .= (Directed (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) +* (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) by A14, A19 ; then A21: dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (Directed (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1))))) \/ (dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4))) by FUNCT_4:def_1; then dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) = (dom (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) \/ (dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4))) by FUNCT_4:99; then A22: n + 4 in dom (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) by A18, A15, XBOOLE_0:def_3; A23: (P +* (while>0 (a,I))) /. (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = (P +* (while>0 (a,I))) . (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) by PBOOLE:143; A24: Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4) = IncAddr ((Shift (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)),4) by COMPOS_1:34; (P +* (while>0 (a,I))) . (n + 4) = ((if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA))) +* (((card I) + 4) .--> (goto 0))) . (n + 4) by A16, A1, GRFUNC_1:2 .= ((Directed (((a >0_goto ((card (Stop SCM+FSA)) + 3)) ";" (Stop SCM+FSA)) ";" (Goto ((card (I ";" (Goto 0))) + 1)))) +* (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4))) . (n + 4) by A13, A16, A17, A20, FUNCT_4:def_1 .= (Reloc (((I ";" (Goto 0)) ";" (Stop SCM+FSA)),4)) . (n + 4) by A18, A21, A22, FUNCT_4:def_1 .= IncAddr ((goto (card I)),4) by A10, A11, A24, COMPOS_1:def_21 .= goto ((card I) + 4) by SCMFSA_4:1 ; hence CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) by A12, A23; ::_thesis: verum end; theorem Th41: :: SCMFSA_9:41 for a being Int-Location for I being Program of holds (while>0 (a,I)) . ((card I) + 4) = goto 0 proof set J = Stop SCM+FSA; let a be Int-Location; ::_thesis: for I being Program of holds (while>0 (a,I)) . ((card I) + 4) = goto 0 let I be Program of ; ::_thesis: (while>0 (a,I)) . ((card I) + 4) = goto 0 set I1 = I ";" (Goto 0); set f = ((card I) + 4) .--> (goto 0); set Lc4 = (card I) + 4; dom (((card I) + 4) .--> (goto 0)) = {((card I) + 4)} by FUNCOP_1:13; then A1: (card I) + 4 in dom (((card I) + 4) .--> (goto 0)) by TARSKI:def_1; ( (card I) + 4 in dom (while>0 (a,I)) & dom (while>0 (a,I)) = (dom (if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)))) \/ (dom (((card I) + 4) .--> (goto 0))) ) by Th33, FUNCT_4:def_1; hence (while>0 (a,I)) . ((card I) + 4) = (((card I) + 4) .--> (goto 0)) . ((card I) + 4) by A1, FUNCT_4:def_1 .= goto 0 by FUNCOP_1:72 ; ::_thesis: verum end; theorem Th42: :: SCMFSA_9:42 for P being Instruction-Sequence of SCM+FSA for s being State of SCM+FSA for I being Program of for a being read-write Int-Location st I is_closed_on s,P & I is_halting_on s,P & s . a > 0 holds ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) ) ) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for s being State of SCM+FSA for I being Program of for a being read-write Int-Location st I is_closed_on s,P & I is_halting_on s,P & s . a > 0 holds ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) ) ) let s be State of SCM+FSA; ::_thesis: for I being Program of for a being read-write Int-Location st I is_closed_on s,P & I is_halting_on s,P & s . a > 0 holds ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) ) ) set D = Int-Locations \/ FinSeq-Locations; let I be Program of ; ::_thesis: for a being read-write Int-Location st I is_closed_on s,P & I is_halting_on s,P & s . a > 0 holds ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) ) ) let a be read-write Int-Location; ::_thesis: ( I is_closed_on s,P & I is_halting_on s,P & s . a > 0 implies ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) ) ) ) assume A1: I is_closed_on s,P ; ::_thesis: ( not I is_halting_on s,P or not s . a > 0 or ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) ) ) ) set sI = Initialize s; set PI = P +* I; set s1 = Initialize s; set P1 = P +* (while>0 (a,I)); A2: while>0 (a,I) c= P +* (while>0 (a,I)) by FUNCT_4:25; defpred S1[ Nat] means ( $1 <= LifeSpan ((P +* I),(Initialize s)) implies ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + $1))) = (IC (Comput ((P +* I),(Initialize s),$1))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + $1))) = DataPart (Comput ((P +* I),(Initialize s),$1)) ) ); assume A3: I is_halting_on s,P ; ::_thesis: ( not s . a > 0 or ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) ) ) ) A4: now__::_thesis:_for_k_being_Element_of_NAT_st_S1[k]_holds_ S1[k_+_1] let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] ) assume A5: S1[k] ; ::_thesis: S1[k + 1] now__::_thesis:_(_k_+_1_<=_LifeSpan_((P_+*_I),(Initialize_s))_implies_(_IC_(Comput_((P_+*_(while>0_(a,I))),(Initialize_s),((1_+_k)_+_1)))_=_(IC_(Comput_((P_+*_I),(Initialize_s),(k_+_1))))_+_4_&_DataPart_(Comput_((P_+*_(while>0_(a,I))),(Initialize_s),((1_+_k)_+_1)))_=_DataPart_(Comput_((P_+*_I),(Initialize_s),(k_+_1)))_)_) A6: k + 0 < k + 1 by XREAL_1:6; assume k + 1 <= LifeSpan ((P +* I),(Initialize s)) ; ::_thesis: ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) then k < LifeSpan ((P +* I),(Initialize s)) by A6, XXREAL_0:2; hence ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = (IC (Comput ((P +* I),(Initialize s),(k + 1)))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + k) + 1))) = DataPart (Comput ((P +* I),(Initialize s),(k + 1))) ) by A1, A3, A5, Th39; ::_thesis: verum end; hence S1[k + 1] ; ::_thesis: verum end; reconsider l = LifeSpan ((P +* I),(Initialize s)) as Element of NAT ; set loc4 = (card I) + 4; set i = a >0_goto 4; set s2 = Comput ((P +* (while>0 (a,I))),(Initialize s),1); IC in dom (Start-At (0,SCM+FSA)) by MEMSTR_0:15; then A7: IC in dom (Start-At (0,SCM+FSA)) ; A8: IC (Initialize s) = IC (Start-At (0,SCM+FSA)) by A7, FUNCT_4:13 .= 0 by FUNCOP_1:72 ; not a in dom (Start-At (0,SCM+FSA)) by SCMFSA_2:102; then A9: (Initialize s) . a = s . a by FUNCT_4:11; assume A10: s . a > 0 ; ::_thesis: ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 & ( for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) ) ) A11: 0 in dom (while>0 (a,I)) by Th10; A12: (P +* (while>0 (a,I))) /. (IC (Initialize s)) = (P +* (while>0 (a,I))) . (IC (Initialize s)) by PBOOLE:143; (P +* (while>0 (a,I))) . 0 = (while>0 (a,I)) . 0 by A11, FUNCT_4:13 .= a >0_goto 4 by Th11 ; then A13: CurInstr ((P +* (while>0 (a,I))),(Initialize s)) = a >0_goto 4 by A8, A12; A14: Comput ((P +* (while>0 (a,I))),(Initialize s),(0 + 1)) = Following ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),0))) by EXTPRO_1:3 .= Following ((P +* (while>0 (a,I))),(Initialize s)) .= Exec ((a >0_goto 4),(Initialize s)) by A13 ; then ( ( for c being Int-Location holds (Comput ((P +* (while>0 (a,I))),(Initialize s),1)) . c = (Initialize s) . c ) & ( for f being FinSeq-Location holds (Comput ((P +* (while>0 (a,I))),(Initialize s),1)) . f = (Initialize s) . f ) ) by SCMFSA_2:71; then A15: DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),1)) = DataPart (Initialize s) by SCMFSA_M:2 .= DataPart (Initialize s) ; A16: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),1)) = 4 by A10, A14, A9, SCMFSA_2:71; A17: S1[ 0 ] proof assume 0 <= LifeSpan ((P +* I),(Initialize s)) ; ::_thesis: ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + 0))) = (IC (Comput ((P +* I),(Initialize s),0))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + 0))) = DataPart (Comput ((P +* I),(Initialize s),0)) ) IC in dom (Start-At (0,SCM+FSA)) by MEMSTR_0:15; then A18: IC in dom (Start-At (0,SCM+FSA)) ; IC (Comput ((P +* I),(Initialize s),0)) = IC (Initialize s) .= IC (Start-At (0,SCM+FSA)) by A18, FUNCT_4:13 .= 0 by FUNCOP_1:72 ; hence ( IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + 0))) = (IC (Comput ((P +* I),(Initialize s),0))) + 4 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + 0))) = DataPart (Comput ((P +* I),(Initialize s),0)) ) by A16, A15; ::_thesis: verum end; A19: for k being Element of NAT holds S1[k] from NAT_1:sch_1(A17, A4); set s4 = Comput ((P +* (while>0 (a,I))),(Initialize s),(((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1) + 1)); set s3 = Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)); A20: (card I) + 4 in dom (while>0 (a,I)) by Th33; set s2 = Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))); S1[l] by A19; then A21: CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) = goto ((card I) + 4) by A1, A3, Th40; A22: Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)) = Following ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) by EXTPRO_1:3 .= Exec ((goto ((card I) + 4)),(Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + (LifeSpan ((P +* I),(Initialize s))))))) by A21 ; A23: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1))) = (card I) + 4 by A22, SCMFSA_2:69; A24: (P +* (while>0 (a,I))) /. (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)))) = (P +* (while>0 (a,I))) . (IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)))) by PBOOLE:143; (P +* (while>0 (a,I))) . ((card I) + 4) = (while>0 (a,I)) . ((card I) + 4) by A20, A2, GRFUNC_1:2 .= goto 0 by Th41 ; then A25: CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)))) = goto 0 by A23, A24; A26: Comput ((P +* (while>0 (a,I))),(Initialize s),(((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1) + 1)) = Following ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)))) by EXTPRO_1:3 .= Exec ((goto 0),(Comput ((P +* (while>0 (a,I))),(Initialize s),((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1)))) by A25 ; A27: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(((1 + (LifeSpan ((P +* I),(Initialize s)))) + 1) + 1))) = 0 by A26, SCMFSA_2:69; hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan ((P +* I),(Initialize s))) + 3))) = 0 ; ::_thesis: for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) A28: (((LifeSpan ((P +* I),(Initialize s))) + 1) + 1) + 1 = (LifeSpan ((P +* I),(Initialize s))) + (2 + 1) ; A29: now__::_thesis:_for_k_being_Element_of_NAT_st_k_<=_(LifeSpan_((P_+*_I),(Initialize_s)))_+_3_&_k_<>_0_holds_ IC_(Comput_((P_+*_(while>0_(a,I))),(Initialize_s),k))_in_dom_(while>0_(a,I)) let k be Element of NAT ; ::_thesis: ( k <= (LifeSpan ((P +* I),(Initialize s))) + 3 & k <> 0 implies IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) ) assume A30: k <= (LifeSpan ((P +* I),(Initialize s))) + 3 ; ::_thesis: ( k <> 0 implies IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) ) assume k <> 0 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) then consider n being Nat such that A31: k = n + 1 by NAT_1:6; ( k <= (LifeSpan ((P +* I),(Initialize s))) + 1 or k >= ((LifeSpan ((P +* I),(Initialize s))) + 1) + 1 ) by NAT_1:13; then A32: ( k <= (LifeSpan ((P +* I),(Initialize s))) + 1 or k = ((LifeSpan ((P +* I),(Initialize s))) + 1) + 1 or k > ((LifeSpan ((P +* I),(Initialize s))) + 1) + 1 ) by XXREAL_0:1; reconsider n = n as Element of NAT by ORDINAL1:def_12; percases ( k <= (LifeSpan ((P +* I),(Initialize s))) + 1 or k = ((LifeSpan ((P +* I),(Initialize s))) + 1) + 1 or k >= (LifeSpan ((P +* I),(Initialize s))) + 3 ) by A28, A32, NAT_1:13; suppose k <= (LifeSpan ((P +* I),(Initialize s))) + 1 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) then n <= LifeSpan ((P +* I),(Initialize s)) by A31, XREAL_1:6; then A33: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),(1 + n))) = (IC (Comput ((P +* I),(Initialize s),n))) + 4 by A19; reconsider m = IC (Comput ((P +* I),(Initialize s),n)) as Element of NAT ; m in dom I by A1, SCMFSA7B:def_6; then m < card I by AFINSQ_1:66; then A34: m + 4 < (card I) + 6 by XREAL_1:8; card (while>0 (a,I)) = (card I) + 6 by Th5; hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A31, A33, A34, AFINSQ_1:66; ::_thesis: verum end; suppose k = ((LifeSpan ((P +* I),(Initialize s))) + 1) + 1 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A23, Th33; ::_thesis: verum end; suppose k >= (LifeSpan ((P +* I),(Initialize s))) + 3 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) then k = (LifeSpan ((P +* I),(Initialize s))) + 3 by A30, XXREAL_0:1; hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A27, Th10; ::_thesis: verum end; end; end; now__::_thesis:_for_k_being_Element_of_NAT_st_k_<=_(LifeSpan_((P_+*_I),(Initialize_s)))_+_3_holds_ IC_(Comput_((P_+*_(while>0_(a,I))),(Initialize_s),k))_in_dom_(while>0_(a,I)) let k be Element of NAT ; ::_thesis: ( k <= (LifeSpan ((P +* I),(Initialize s))) + 3 implies IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) ) assume A35: k <= (LifeSpan ((P +* I),(Initialize s))) + 3 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) percases ( k = 0 or k <> 0 ) ; suppose k = 0 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A11, A8, EXTPRO_1:2; ::_thesis: verum end; suppose k <> 0 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) by A29, A35; ::_thesis: verum end; end; end; hence for k being Element of NAT st k <= (LifeSpan ((P +* I),(Initialize s))) + 3 holds IC (Comput ((P +* (while>0 (a,I))),(Initialize s),k)) in dom (while>0 (a,I)) ; ::_thesis: verum end; definition let s be State of SCM+FSA; let I be Program of ; let a be read-write Int-Location; let P be Instruction-Sequence of SCM+FSA; deffunc H1( Nat, State of SCM+FSA) -> set = Comput ((P +* (while>0 (a,I))),($2 +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while>0 (a,I))) +* I),($2 +* (Start-At (0,SCM+FSA))))) + 3)); deffunc H2( Nat, State of SCM+FSA) -> Element of product (the_Values_of SCM+FSA) = down H1($1,$2); func StepWhile>0 (a,I,P,s) -> Function of NAT,(product (the_Values_of SCM+FSA)) means :Def5: :: SCMFSA_9:def 5 ( it . 0 = s & ( for i being Nat holds it . (i + 1) = Comput ((P +* (while>0 (a,I))),((it . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while>0 (a,I))) +* I),((it . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) ); existence ex b1 being Function of NAT,(product (the_Values_of SCM+FSA)) st ( b1 . 0 = s & ( for i being Nat holds b1 . (i + 1) = Comput ((P +* (while>0 (a,I))),((b1 . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while>0 (a,I))) +* I),((b1 . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) ) proof reconsider ss = s as Element of product (the_Values_of SCM+FSA) by CARD_3:107; consider f being Function of NAT,(product (the_Values_of SCM+FSA)) such that A1: f . 0 = ss and A2: for i being Nat holds f . (i + 1) = H2(i,f . i) from NAT_1:sch_12(); take f ; ::_thesis: ( f . 0 = s & ( for i being Nat holds f . (i + 1) = Comput ((P +* (while>0 (a,I))),((f . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while>0 (a,I))) +* I),((f . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) ) thus f . 0 = s by A1; ::_thesis: for i being Nat holds f . (i + 1) = Comput ((P +* (while>0 (a,I))),((f . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while>0 (a,I))) +* I),((f . i) +* (Start-At (0,SCM+FSA))))) + 3)) let i be Nat; ::_thesis: f . (i + 1) = Comput ((P +* (while>0 (a,I))),((f . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while>0 (a,I))) +* I),((f . i) +* (Start-At (0,SCM+FSA))))) + 3)) f . (i + 1) = H2(i,f . i) by A2; hence f . (i + 1) = Comput ((P +* (while>0 (a,I))),((f . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while>0 (a,I))) +* I),((f . i) +* (Start-At (0,SCM+FSA))))) + 3)) ; ::_thesis: verum end; uniqueness for b1, b2 being Function of NAT,(product (the_Values_of SCM+FSA)) st b1 . 0 = s & ( for i being Nat holds b1 . (i + 1) = Comput ((P +* (while>0 (a,I))),((b1 . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while>0 (a,I))) +* I),((b1 . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) & b2 . 0 = s & ( for i being Nat holds b2 . (i + 1) = Comput ((P +* (while>0 (a,I))),((b2 . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while>0 (a,I))) +* I),((b2 . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) holds b1 = b2 proof let F1, F2 be Function of NAT,(product (the_Values_of SCM+FSA)); ::_thesis: ( F1 . 0 = s & ( for i being Nat holds F1 . (i + 1) = Comput ((P +* (while>0 (a,I))),((F1 . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while>0 (a,I))) +* I),((F1 . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) & F2 . 0 = s & ( for i being Nat holds F2 . (i + 1) = Comput ((P +* (while>0 (a,I))),((F2 . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while>0 (a,I))) +* I),((F2 . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) implies F1 = F2 ) assume that A3: F1 . 0 = s and A4: for i being Nat holds F1 . (i + 1) = H1(i,F1 . i) and A5: F2 . 0 = s and A6: for i being Nat holds F2 . (i + 1) = H1(i,F2 . i) ; ::_thesis: F1 = F2 reconsider s = s as Element of product (the_Values_of SCM+FSA) by CARD_3:107; A7: F1 . 0 = s by A3; A8: for i being Nat holds F1 . (i + 1) = H2(i,F1 . i) by A4; A9: F2 . 0 = s by A5; A10: for i being Nat holds F2 . (i + 1) = H2(i,F2 . i) by A6; F1 = F2 from NAT_1:sch_16(A7, A8, A9, A10); hence F1 = F2 ; ::_thesis: verum end; end; :: deftheorem Def5 defines StepWhile>0 SCMFSA_9:def_5_:_ for s being State of SCM+FSA for I being Program of for a being read-write Int-Location for P being Instruction-Sequence of SCM+FSA for b5 being Function of NAT,(product (the_Values_of SCM+FSA)) holds ( b5 = StepWhile>0 (a,I,P,s) iff ( b5 . 0 = s & ( for i being Nat holds b5 . (i + 1) = Comput ((P +* (while>0 (a,I))),((b5 . i) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while>0 (a,I))) +* I),((b5 . i) +* (Start-At (0,SCM+FSA))))) + 3)) ) ) ); theorem Th43: :: SCMFSA_9:43 for P being Instruction-Sequence of SCM+FSA for k being Element of NAT for s being State of SCM+FSA for I being Program of for a being read-write Int-Location holds (StepWhile>0 (a,I,P,s)) . (k + 1) = (StepWhile>0 (a,I,P,((StepWhile>0 (a,I,P,s)) . k))) . 1 proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for k being Element of NAT for s being State of SCM+FSA for I being Program of for a being read-write Int-Location holds (StepWhile>0 (a,I,P,s)) . (k + 1) = (StepWhile>0 (a,I,P,((StepWhile>0 (a,I,P,s)) . k))) . 1 let k be Element of NAT ; ::_thesis: for s being State of SCM+FSA for I being Program of for a being read-write Int-Location holds (StepWhile>0 (a,I,P,s)) . (k + 1) = (StepWhile>0 (a,I,P,((StepWhile>0 (a,I,P,s)) . k))) . 1 let s be State of SCM+FSA; ::_thesis: for I being Program of for a being read-write Int-Location holds (StepWhile>0 (a,I,P,s)) . (k + 1) = (StepWhile>0 (a,I,P,((StepWhile>0 (a,I,P,s)) . k))) . 1 let I be Program of ; ::_thesis: for a being read-write Int-Location holds (StepWhile>0 (a,I,P,s)) . (k + 1) = (StepWhile>0 (a,I,P,((StepWhile>0 (a,I,P,s)) . k))) . 1 let a be read-write Int-Location; ::_thesis: (StepWhile>0 (a,I,P,s)) . (k + 1) = (StepWhile>0 (a,I,P,((StepWhile>0 (a,I,P,s)) . k))) . 1 set sk = (StepWhile>0 (a,I,P,s)) . k; set sk0 = (StepWhile>0 (a,I,P,((StepWhile>0 (a,I,P,s)) . k))) . 0; (StepWhile>0 (a,I,P,((StepWhile>0 (a,I,P,s)) . k))) . 0 = (StepWhile>0 (a,I,P,s)) . k by Def5; hence (StepWhile>0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while>0 (a,I))),(((StepWhile>0 (a,I,P,((StepWhile>0 (a,I,P,s)) . k))) . 0) +* (Start-At (0,SCM+FSA))),((LifeSpan (((P +* (while>0 (a,I))) +* I),(((StepWhile>0 (a,I,P,((StepWhile>0 (a,I,P,s)) . k))) . 0) +* (Start-At (0,SCM+FSA))))) + 3)) by Def5 .= (StepWhile>0 (a,I,P,((StepWhile>0 (a,I,P,s)) . k))) . (0 + 1) by Def5 .= (StepWhile>0 (a,I,P,((StepWhile>0 (a,I,P,s)) . k))) . 1 ; ::_thesis: verum end; theorem Th44: :: SCMFSA_9:44 for P being Instruction-Sequence of SCM+FSA for I being Program of for a being read-write Int-Location for s being State of SCM+FSA holds (StepWhile>0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize s))) + 3)) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for I being Program of for a being read-write Int-Location for s being State of SCM+FSA holds (StepWhile>0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize s))) + 3)) let I be Program of ; ::_thesis: for a being read-write Int-Location for s being State of SCM+FSA holds (StepWhile>0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize s))) + 3)) let a be read-write Int-Location; ::_thesis: for s being State of SCM+FSA holds (StepWhile>0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize s))) + 3)) let s be State of SCM+FSA; ::_thesis: (StepWhile>0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize s))) + 3)) A1: (StepWhile>0 (a,I,P,s)) . 0 = s by Def5; thus (StepWhile>0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize s))) + 3)) by A1, Def5; ::_thesis: verum end; theorem Th45: :: SCMFSA_9:45 for P being Instruction-Sequence of SCM+FSA for I being Program of for a being read-write Int-Location for s being State of SCM+FSA for k, n being Element of NAT st IC ((StepWhile>0 (a,I,P,s)) . k) = 0 & (StepWhile>0 (a,I,P,s)) . k = Comput ((P +* (while>0 (a,I))),(Initialize s),n) holds ( (StepWhile>0 (a,I,P,s)) . k = Initialize ((StepWhile>0 (a,I,P,s)) . k) & (StepWhile>0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . k)))) + 3))) ) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for I being Program of for a being read-write Int-Location for s being State of SCM+FSA for k, n being Element of NAT st IC ((StepWhile>0 (a,I,P,s)) . k) = 0 & (StepWhile>0 (a,I,P,s)) . k = Comput ((P +* (while>0 (a,I))),(Initialize s),n) holds ( (StepWhile>0 (a,I,P,s)) . k = Initialize ((StepWhile>0 (a,I,P,s)) . k) & (StepWhile>0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . k)))) + 3))) ) let I be Program of ; ::_thesis: for a being read-write Int-Location for s being State of SCM+FSA for k, n being Element of NAT st IC ((StepWhile>0 (a,I,P,s)) . k) = 0 & (StepWhile>0 (a,I,P,s)) . k = Comput ((P +* (while>0 (a,I))),(Initialize s),n) holds ( (StepWhile>0 (a,I,P,s)) . k = Initialize ((StepWhile>0 (a,I,P,s)) . k) & (StepWhile>0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . k)))) + 3))) ) let a be read-write Int-Location; ::_thesis: for s being State of SCM+FSA for k, n being Element of NAT st IC ((StepWhile>0 (a,I,P,s)) . k) = 0 & (StepWhile>0 (a,I,P,s)) . k = Comput ((P +* (while>0 (a,I))),(Initialize s),n) holds ( (StepWhile>0 (a,I,P,s)) . k = Initialize ((StepWhile>0 (a,I,P,s)) . k) & (StepWhile>0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . k)))) + 3))) ) let s be State of SCM+FSA; ::_thesis: for k, n being Element of NAT st IC ((StepWhile>0 (a,I,P,s)) . k) = 0 & (StepWhile>0 (a,I,P,s)) . k = Comput ((P +* (while>0 (a,I))),(Initialize s),n) holds ( (StepWhile>0 (a,I,P,s)) . k = Initialize ((StepWhile>0 (a,I,P,s)) . k) & (StepWhile>0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . k)))) + 3))) ) let k, n be Element of NAT ; ::_thesis: ( IC ((StepWhile>0 (a,I,P,s)) . k) = 0 & (StepWhile>0 (a,I,P,s)) . k = Comput ((P +* (while>0 (a,I))),(Initialize s),n) implies ( (StepWhile>0 (a,I,P,s)) . k = Initialize ((StepWhile>0 (a,I,P,s)) . k) & (StepWhile>0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . k)))) + 3))) ) ) set D = Int-Locations \/ FinSeq-Locations; set s1 = Initialize s; set P1 = P +* (while>0 (a,I)); set sk = (StepWhile>0 (a,I,P,s)) . k; set s2 = Initialize ((StepWhile>0 (a,I,P,s)) . k); assume A1: IC ((StepWhile>0 (a,I,P,s)) . k) = 0 ; ::_thesis: ( not (StepWhile>0 (a,I,P,s)) . k = Comput ((P +* (while>0 (a,I))),(Initialize s),n) or ( (StepWhile>0 (a,I,P,s)) . k = Initialize ((StepWhile>0 (a,I,P,s)) . k) & (StepWhile>0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . k)))) + 3))) ) ) assume A2: (StepWhile>0 (a,I,P,s)) . k = Comput ((P +* (while>0 (a,I))),(Initialize s),n) ; ::_thesis: ( (StepWhile>0 (a,I,P,s)) . k = Initialize ((StepWhile>0 (a,I,P,s)) . k) & (StepWhile>0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . k)))) + 3))) ) (StepWhile>0 (a,I,P,s)) . k is 0 -started by A1, MEMSTR_0:def_12; then Start-At (0,SCM+FSA) c= (StepWhile>0 (a,I,P,s)) . k by MEMSTR_0:29; hence Initialize ((StepWhile>0 (a,I,P,s)) . k) = (StepWhile>0 (a,I,P,s)) . k by FUNCT_4:98; ::_thesis: (StepWhile>0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . k)))) + 3))) hence (StepWhile>0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while>0 (a,I))),((StepWhile>0 (a,I,P,s)) . k),((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . k)))) + 3)) by Def5 .= Comput ((P +* (while>0 (a,I))),(Initialize s),(n + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . k)))) + 3))) by A2, EXTPRO_1:4 ; ::_thesis: verum end; theorem Th46: :: SCMFSA_9:46 for P being Instruction-Sequence of SCM+FSA for I being Program of for a being read-write Int-Location for s being State of SCM+FSA st ( for k being Nat holds ( I is_closed_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) & I is_halting_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) ) ) & ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile>0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile>0 (a,I,P,s)) . k) or f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,P,s)) . k) = 0 implies ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) ) holds ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for I being Program of for a being read-write Int-Location for s being State of SCM+FSA st ( for k being Nat holds ( I is_closed_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) & I is_halting_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) ) ) & ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile>0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile>0 (a,I,P,s)) . k) or f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,P,s)) . k) = 0 implies ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) ) holds ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) let I be Program of ; ::_thesis: for a being read-write Int-Location for s being State of SCM+FSA st ( for k being Nat holds ( I is_closed_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) & I is_halting_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) ) ) & ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile>0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile>0 (a,I,P,s)) . k) or f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,P,s)) . k) = 0 implies ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) ) holds ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) let a be read-write Int-Location; ::_thesis: for s being State of SCM+FSA st ( for k being Nat holds ( I is_closed_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) & I is_halting_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) ) ) & ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile>0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile>0 (a,I,P,s)) . k) or f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,P,s)) . k) = 0 implies ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) ) holds ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) let s be State of SCM+FSA; ::_thesis: ( ( for k being Nat holds ( I is_closed_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) & I is_halting_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) ) ) & ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile>0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile>0 (a,I,P,s)) . k) or f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,P,s)) . k) = 0 implies ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) ) implies ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) ) set D = Int-Locations \/ FinSeq-Locations; assume A1: for k being Nat holds ( I is_closed_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) & I is_halting_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) ) ; ::_thesis: ( for f being Function of (product (the_Values_of SCM+FSA)),NAT holds not for k being Nat holds ( ( f . ((StepWhile>0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile>0 (a,I,P,s)) . k) or f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,P,s)) . k) = 0 implies ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) ) or ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) ) set s1 = Initialize s; set P1 = P +* (while>0 (a,I)); A2: (P +* (while>0 (a,I))) +* (while>0 (a,I)) = P +* (while>0 (a,I)) ; A3: (P +* (while>0 (a,I))) +* (while>0 (a,I)) = P +* (while>0 (a,I)) ; given f being Function of (product (the_Values_of SCM+FSA)),NAT such that A4: for k being Nat holds ( ( f . ((StepWhile>0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile>0 (a,I,P,s)) . k) or f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,P,s)) . k) = 0 implies ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) ) ; ::_thesis: ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) deffunc H1( Nat) -> Element of NAT = f . ((StepWhile>0 (a,I,P,s)) . $1); A5: for k being Nat holds ( H1(k + 1) < H1(k) or H1(k) = 0 ) by A4; consider m being Nat such that A6: H1(m) = 0 and A7: for n being Nat st H1(n) = 0 holds m <= n from NAT_1:sch_17(A5); defpred S1[ Nat] means ( $1 + 1 <= m implies ex k being Element of NAT st (StepWhile>0 (a,I,P,s)) . ($1 + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),k) ); A8: now__::_thesis:_for_k_being_Element_of_NAT_st_S1[k]_holds_ S1[k_+_1] let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] ) assume A9: S1[k] ; ::_thesis: S1[k + 1] now__::_thesis:_(_(k_+_1)_+_1_<=_m_implies_ex_m_being_Element_of_NAT_st_(StepWhile>0_(a,I,P,s))_._((k_+_1)_+_1)_=_Comput_((P_+*_(while>0_(a,I))),(Initialize_s),m)_) set sk1 = (StepWhile>0 (a,I,P,s)) . (k + 1); set sk = (StepWhile>0 (a,I,P,s)) . k; assume A10: (k + 1) + 1 <= m ; ::_thesis: ex m being Element of NAT st (StepWhile>0 (a,I,P,s)) . ((k + 1) + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),m) k + 0 < k + (1 + 1) by XREAL_1:6; then k < m by A10, XXREAL_0:2; then H1(k) <> 0 by A7; then A11: ((StepWhile>0 (a,I,P,s)) . k) . a > 0 by A4; A12: I is_halting_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) by A1; (k + 1) + 0 < (k + 1) + 1 by XREAL_1:6; then consider n being Element of NAT such that A13: (StepWhile>0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),n) by A9, A10, XXREAL_0:2; take m = n + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . (k + 1))))) + 3); ::_thesis: (StepWhile>0 (a,I,P,s)) . ((k + 1) + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),m) ( (StepWhile>0 (a,I,P,s)) . (k + 1) = Comput ((P +* (while>0 (a,I))),(Initialize ((StepWhile>0 (a,I,P,s)) . k)),((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . k)))) + 3)) & I is_closed_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) ) by A1, Def5; then IC ((StepWhile>0 (a,I,P,s)) . (k + 1)) = 0 by A12, A11, Th42, A2; hence (StepWhile>0 (a,I,P,s)) . ((k + 1) + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),m) by A13, Th45; ::_thesis: verum end; hence S1[k + 1] ; ::_thesis: verum end; A14: S1[ 0 ] proof assume 0 + 1 <= m ; ::_thesis: ex k being Element of NAT st (StepWhile>0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),k) take n = (LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize s))) + 3; ::_thesis: (StepWhile>0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),n) thus (StepWhile>0 (a,I,P,s)) . (0 + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),n) by Th44; ::_thesis: verum end; A15: for k being Element of NAT holds S1[k] from NAT_1:sch_1(A14, A8); now__::_thesis:_(_while>0_(a,I)_is_halting_on_s,P_&_while>0_(a,I)_is_closed_on_s,P_) percases ( m = 0 or m <> 0 ) ; suppose m = 0 ; ::_thesis: ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) then ((StepWhile>0 (a,I,P,s)) . 0) . a <= 0 by A4, A6; then s . a <= 0 by Def5; hence ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) by Th38; ::_thesis: verum end; supposeA16: m <> 0 ; ::_thesis: ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) set p = (LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize s))) + 3; set sm = (StepWhile>0 (a,I,P,s)) . m; set sm1 = Initialize ((StepWhile>0 (a,I,P,s)) . m); consider i being Nat such that A17: m = i + 1 by A16, NAT_1:6; reconsider i = i as Element of NAT by ORDINAL1:def_12; m = i + 1 by A17; then consider n being Element of NAT such that A18: (StepWhile>0 (a,I,P,s)) . m = Comput ((P +* (while>0 (a,I))),(Initialize s),n) by A15; set si = (StepWhile>0 (a,I,P,s)) . i; i < m by A17, NAT_1:13; then H1(i) <> 0 by A7; then A19: ((StepWhile>0 (a,I,P,s)) . i) . a > 0 by A4; A20: ( I is_closed_on (StepWhile>0 (a,I,P,s)) . i,P +* (while>0 (a,I)) & I is_halting_on (StepWhile>0 (a,I,P,s)) . i,P +* (while>0 (a,I)) ) by A1; (StepWhile>0 (a,I,P,s)) . m = Comput ((P +* (while>0 (a,I))),(Initialize ((StepWhile>0 (a,I,P,s)) . i)),((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . i)))) + 3)) by A17, Def5; then A21: IC ((StepWhile>0 (a,I,P,s)) . m) = 0 by A20, A19, Th42, A2; (StepWhile>0 (a,I,P,s)) . m is 0 -started by A21, MEMSTR_0:def_12; then Start-At (0,SCM+FSA) c= (StepWhile>0 (a,I,P,s)) . m by MEMSTR_0:29; then A22: Initialize ((StepWhile>0 (a,I,P,s)) . m) = (StepWhile>0 (a,I,P,s)) . m by FUNCT_4:98; A23: ((StepWhile>0 (a,I,P,s)) . m) . a <= 0 by A4, A6; then while>0 (a,I) is_halting_on (StepWhile>0 (a,I,P,s)) . m,P +* (while>0 (a,I)) by Th38; then (P +* (while>0 (a,I))) +* (while>0 (a,I)) halts_on Initialize ((StepWhile>0 (a,I,P,s)) . m) by SCMFSA7B:def_7; then P +* (while>0 (a,I)) halts_on Initialize ((StepWhile>0 (a,I,P,s)) . m) ; then consider j being Element of NAT such that A24: CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),((StepWhile>0 (a,I,P,s)) . m),j))) = halt SCM+FSA by A22, EXTPRO_1:29; A25: Comput ((P +* (while>0 (a,I))),(Initialize s),(n + j)) = Comput ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),n)),j) by EXTPRO_1:4; CurInstr ((P +* (while>0 (a,I))),(Comput ((P +* (while>0 (a,I))),(Initialize s),(n + j)))) = halt SCM+FSA by A18, A24, A25; then P +* (while>0 (a,I)) halts_on Initialize s by EXTPRO_1:29; hence while>0 (a,I) is_halting_on s,P by SCMFSA7B:def_7; ::_thesis: while>0 (a,I) is_closed_on s,P now__::_thesis:_for_q_being_Element_of_NAT_holds_IC_(Comput_((P_+*_(while>0_(a,I))),(Initialize_s),q))_in_dom_(while>0_(a,I)) let q be Element of NAT ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) A26: 0 < m by A16; percases ( q <= (LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize s))) + 3 or q > (LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize s))) + 3 ) ; supposeA27: q <= (LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize s))) + 3 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) A28: (StepWhile>0 (a,I,P,s)) . 0 = s by Def5; then A29: ( I is_closed_on s,P +* (while>0 (a,I)) & I is_halting_on s,P +* (while>0 (a,I)) ) by A1; H1( 0 ) <> 0 by A7, A26; then s . a > 0 by A4, A28; hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),q)) in dom (while>0 (a,I)) by A27, A29, Th42, A2; ::_thesis: verum end; supposeA30: q > (LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize s))) + 3 ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),b1)) in dom (while>0 (a,I)) A31: now__::_thesis:_ex_k_being_Element_of_NAT_st_ (_(StepWhile>0_(a,I,P,s))_._1_=_Comput_((P_+*_(while>0_(a,I))),(Initialize_s),k)_&_k_<=_q_) take k = (LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize s))) + 3; ::_thesis: ( (StepWhile>0 (a,I,P,s)) . 1 = Comput ((P +* (while>0 (a,I))),(Initialize s),k) & k <= q ) thus ( (StepWhile>0 (a,I,P,s)) . 1 = Comput ((P +* (while>0 (a,I))),(Initialize s),k) & k <= q ) by A30, Th44; ::_thesis: verum end; defpred S2[ Nat] means ( $1 <= m & $1 <> 0 & ex k being Element of NAT st ( (StepWhile>0 (a,I,P,s)) . $1 = Comput ((P +* (while>0 (a,I))),(Initialize s),k) & k <= q ) ); A32: for i being Nat st S2[i] holds i <= m ; 0 + 1 < m + 1 by A26, XREAL_1:6; then 1 <= m by NAT_1:13; then A33: ex t being Nat st S2[t] by A31; consider t being Nat such that A34: ( S2[t] & ( for i being Nat st S2[i] holds i <= t ) ) from NAT_1:sch_6(A32, A33); reconsider t = t as Element of NAT by ORDINAL1:def_12; now__::_thesis:_IC_(Comput_((P_+*_(while>0_(a,I))),(Initialize_s),q))_in_dom_(while>0_(a,I)) percases ( t = m or t <> m ) ; suppose t = m ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),q)) in dom (while>0 (a,I)) then consider r being Element of NAT such that A35: (StepWhile>0 (a,I,P,s)) . m = Comput ((P +* (while>0 (a,I))),(Initialize s),r) and A36: r <= q by A34; consider x being Nat such that A37: q = r + x by A36, NAT_1:10; A38: while>0 (a,I) is_closed_on (StepWhile>0 (a,I,P,s)) . m,P +* (while>0 (a,I)) by A23, Th38; reconsider x = x as Element of NAT by ORDINAL1:def_12; A39: Comput ((P +* (while>0 (a,I))),(Initialize s),q) = Comput ((P +* (while>0 (a,I))),(Initialize ((StepWhile>0 (a,I,P,s)) . m)),x) by A22, A35, A37, EXTPRO_1:4; thus IC (Comput ((P +* (while>0 (a,I))),(Initialize s),q)) in dom (while>0 (a,I)) by A38, A39, A3, SCMFSA7B:def_6; ::_thesis: verum end; supposeA40: t <> m ; ::_thesis: IC (Comput ((P +* (while>0 (a,I))),(Initialize s),q)) in dom (while>0 (a,I)) set Dt = (StepWhile>0 (a,I,P,s)) . t; A41: t < m by A34, A40, XXREAL_0:1; then H1(t) <> 0 by A7; then A42: ((StepWhile>0 (a,I,P,s)) . t) . a > 0 by A4; consider z being Element of NAT such that A43: (StepWhile>0 (a,I,P,s)) . t = Comput ((P +* (while>0 (a,I))),(Initialize s),z) and A44: z <= q by A34; set z2 = z + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . t)))) + 3); consider w being Nat such that A45: q = z + w by A44, NAT_1:10; A46: ( I is_closed_on (StepWhile>0 (a,I,P,s)) . t,P +* (while>0 (a,I)) & I is_halting_on (StepWhile>0 (a,I,P,s)) . t,P +* (while>0 (a,I)) ) by A1; consider y being Nat such that A47: t = y + 1 by A34, NAT_1:6; reconsider y = y as Element of NAT by ORDINAL1:def_12; set Dy = (StepWhile>0 (a,I,P,s)) . y; y + 0 < t by A47, XREAL_1:6; then y < m by A34, XXREAL_0:2; then H1(y) <> 0 by A7; then A48: ((StepWhile>0 (a,I,P,s)) . y) . a > 0 by A4; A49: ( I is_closed_on (StepWhile>0 (a,I,P,s)) . y,P +* (while>0 (a,I)) & I is_halting_on (StepWhile>0 (a,I,P,s)) . y,P +* (while>0 (a,I)) ) by A1; reconsider w = w as Element of NAT by ORDINAL1:def_12; (StepWhile>0 (a,I,P,s)) . t = Comput ((P +* (while>0 (a,I))),(Initialize ((StepWhile>0 (a,I,P,s)) . y)),((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . y)))) + 3)) by A47, Def5; then A50: IC ((StepWhile>0 (a,I,P,s)) . t) = 0 by A49, A48, Th42, A2; now__::_thesis:_not_z_+_((LifeSpan_(((P_+*_(while>0_(a,I)))_+*_I),(Initialize_((StepWhile>0_(a,I,P,s))_._t))))_+_3)_<=_q assume A51: z + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . t)))) + 3) <= q ; ::_thesis: contradiction A52: now__::_thesis:_ex_k_being_Element_of_NAT_st_ (_(StepWhile>0_(a,I,P,s))_._(t_+_1)_=_Comput_((P_+*_(while>0_(a,I))),(Initialize_s),k)_&_k_<=_q_) take k = z + ((LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . t)))) + 3); ::_thesis: ( (StepWhile>0 (a,I,P,s)) . (t + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),k) & k <= q ) thus ( (StepWhile>0 (a,I,P,s)) . (t + 1) = Comput ((P +* (while>0 (a,I))),(Initialize s),k) & k <= q ) by A43, A50, A51, Th45; ::_thesis: verum end; t + 1 <= m by A41, NAT_1:13; hence contradiction by A34, A52, XREAL_1:29; ::_thesis: verum end; then A53: w < (LifeSpan (((P +* (while>0 (a,I))) +* I),(Initialize ((StepWhile>0 (a,I,P,s)) . t)))) + 3 by A45, XREAL_1:6; A54: Initialize ((StepWhile>0 (a,I,P,s)) . t) = (StepWhile>0 (a,I,P,s)) . t by A43, A50, Th45; Comput ((P +* (while>0 (a,I))),(Initialize s),q) = Comput ((P +* (while>0 (a,I))),(Initialize ((StepWhile>0 (a,I,P,s)) . t)),w) by A54, A43, A45, EXTPRO_1:4; hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),q)) in dom (while>0 (a,I)) by A53, A46, A42, Th42, A2; ::_thesis: verum end; end; end; hence IC (Comput ((P +* (while>0 (a,I))),(Initialize s),q)) in dom (while>0 (a,I)) ; ::_thesis: verum end; end; end; hence while>0 (a,I) is_closed_on s,P by SCMFSA7B:def_6; ::_thesis: verum end; end; end; hence ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) ; ::_thesis: verum end; theorem Th47: :: SCMFSA_9:47 for P being Instruction-Sequence of SCM+FSA for I being parahalting Program of for a being read-write Int-Location for s being State of SCM+FSA st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile>0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile>0 (a,I,P,s)) . k) or f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,P,s)) . k) = 0 implies ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) ) holds ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) proof let P be Instruction-Sequence of SCM+FSA; ::_thesis: for I being parahalting Program of for a being read-write Int-Location for s being State of SCM+FSA st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile>0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile>0 (a,I,P,s)) . k) or f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,P,s)) . k) = 0 implies ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) ) holds ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) let I be parahalting Program of ; ::_thesis: for a being read-write Int-Location for s being State of SCM+FSA st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile>0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile>0 (a,I,P,s)) . k) or f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,P,s)) . k) = 0 implies ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) ) holds ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) let a be read-write Int-Location; ::_thesis: for s being State of SCM+FSA st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile>0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile>0 (a,I,P,s)) . k) or f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,P,s)) . k) = 0 implies ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) ) holds ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) let s be State of SCM+FSA; ::_thesis: ( ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile>0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile>0 (a,I,P,s)) . k) or f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,P,s)) . k) = 0 implies ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) ) implies ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) ) A1: for k being Nat holds ( I is_closed_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) & I is_halting_on (StepWhile>0 (a,I,P,s)) . k,P +* (while>0 (a,I)) ) by SCMFSA7B:18, SCMFSA7B:19; assume ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for k being Nat holds ( ( f . ((StepWhile>0 (a,I,P,s)) . (k + 1)) < f . ((StepWhile>0 (a,I,P,s)) . k) or f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,P,s)) . k) = 0 implies ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,P,s)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,P,s)) . k) = 0 ) ) ; ::_thesis: ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) hence ( while>0 (a,I) is_halting_on s,P & while>0 (a,I) is_closed_on s,P ) by A1, Th46; ::_thesis: verum end; theorem :: SCMFSA_9:48 for I being parahalting Program of for a being read-write Int-Location st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for s being State of SCM+FSA for P being Instruction-Sequence of SCM+FSA holds ( ( f . ((StepWhile>0 (a,I,P,s)) . 1) < f . s or f . s = 0 ) & ( f . s = 0 implies s . a <= 0 ) & ( s . a <= 0 implies f . s = 0 ) ) holds while>0 (a,I) is parahalting proof let I be parahalting Program of ; ::_thesis: for a being read-write Int-Location st ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for s being State of SCM+FSA for P being Instruction-Sequence of SCM+FSA holds ( ( f . ((StepWhile>0 (a,I,P,s)) . 1) < f . s or f . s = 0 ) & ( f . s = 0 implies s . a <= 0 ) & ( s . a <= 0 implies f . s = 0 ) ) holds while>0 (a,I) is parahalting let a be read-write Int-Location; ::_thesis: ( ex f being Function of (product (the_Values_of SCM+FSA)),NAT st for s being State of SCM+FSA for P being Instruction-Sequence of SCM+FSA holds ( ( f . ((StepWhile>0 (a,I,P,s)) . 1) < f . s or f . s = 0 ) & ( f . s = 0 implies s . a <= 0 ) & ( s . a <= 0 implies f . s = 0 ) ) implies while>0 (a,I) is parahalting ) given f being Function of (product (the_Values_of SCM+FSA)),NAT such that A1: for s being State of SCM+FSA for P being Instruction-Sequence of SCM+FSA holds ( ( f . ((StepWhile>0 (a,I,P,s)) . 1) < f . s or f . s = 0 ) & ( f . s = 0 implies s . a <= 0 ) & ( s . a <= 0 implies f . s = 0 ) ) ; ::_thesis: while>0 (a,I) is parahalting now__::_thesis:_for_t_being_State_of_SCM+FSA for_Q_being_Instruction-Sequence_of_SCM+FSA_holds_while>0_(a,I)_is_halting_on_t,Q let t be State of SCM+FSA; ::_thesis: for Q being Instruction-Sequence of SCM+FSA holds while>0 (a,I) is_halting_on t,Q let Q be Instruction-Sequence of SCM+FSA; ::_thesis: while>0 (a,I) is_halting_on t,Q now__::_thesis:_for_k_being_Nat_holds_ (_(_f_._((StepWhile>0_(a,I,Q,t))_._(k_+_1))_<_f_._((StepWhile>0_(a,I,Q,t))_._k)_or_f_._((StepWhile>0_(a,I,Q,t))_._k)_=_0_)_&_(_f_._((StepWhile>0_(a,I,Q,t))_._k)_=_0_implies_((StepWhile>0_(a,I,Q,t))_._k)_._a_<=_0_)_&_(_((StepWhile>0_(a,I,Q,t))_._k)_._a_<=_0_implies_f_._((StepWhile>0_(a,I,Q,t))_._k)_=_0_)_) let k be Nat; ::_thesis: ( ( f . ((StepWhile>0 (a,I,Q,t)) . (k + 1)) < f . ((StepWhile>0 (a,I,Q,t)) . k) or f . ((StepWhile>0 (a,I,Q,t)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,Q,t)) . k) = 0 implies ((StepWhile>0 (a,I,Q,t)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,Q,t)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,Q,t)) . k) = 0 ) ) A2: k in NAT by ORDINAL1:def_12; ( f . ((StepWhile>0 (a,I,Q,((StepWhile>0 (a,I,Q,t)) . k))) . 1) < f . ((StepWhile>0 (a,I,Q,t)) . k) or f . ((StepWhile>0 (a,I,Q,t)) . k) = 0 ) by A1; hence ( ( f . ((StepWhile>0 (a,I,Q,t)) . (k + 1)) < f . ((StepWhile>0 (a,I,Q,t)) . k) or f . ((StepWhile>0 (a,I,Q,t)) . k) = 0 ) & ( f . ((StepWhile>0 (a,I,Q,t)) . k) = 0 implies ((StepWhile>0 (a,I,Q,t)) . k) . a <= 0 ) & ( ((StepWhile>0 (a,I,Q,t)) . k) . a <= 0 implies f . ((StepWhile>0 (a,I,Q,t)) . k) = 0 ) ) by A1, A2, Th43; ::_thesis: verum end; hence while>0 (a,I) is_halting_on t,Q by Th47; ::_thesis: verum end; hence while>0 (a,I) is parahalting by SCMFSA7B:19; ::_thesis: verum end; registration let I, J be good Program of ; let a be Int-Location; cluster if>0 (a,I,J) -> good ; coherence if>0 (a,I,J) is good proof set i = a >0_goto ((card J) + 3); reconsider Mi = Macro (a >0_goto ((card J) + 3)) as good Program of by Th31, SCMFSA7B:13; if>0 (a,I,J) = ((((a >0_goto ((card J) + 3)) ";" J) ";" (Goto ((card I) + 1))) ";" I) ";" (Stop SCM+FSA) by SCMFSA8B:def_2 .= (((Mi ";" J) ";" (Goto ((card I) + 1))) ";" I) ";" (Stop SCM+FSA) ; hence if>0 (a,I,J) is good ; ::_thesis: verum end; end; registration let I be good Program of ; let a be Int-Location; cluster while>0 (a,I) -> good ; correctness coherence while>0 (a,I) is good ; proof set F = if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)); set J = ((card I) + 4) .--> (goto 0); ( not ((card I) + 4) .--> (goto 0) destroys intloc 0 & not if>0 (a,(I ";" (Goto 0)),(Stop SCM+FSA)) destroys intloc 0 ) by Th30, SCMFSA7B:def_5; then not while>0 (a,I) destroys intloc 0 by SCMFSA8A:11; hence while>0 (a,I) is good by SCMFSA7B:def_5; ::_thesis: verum end; end;