:: SCMPDS_7 semantic presentation begin set A = NAT ; set D = SCM-Data-Loc ; theorem Th1: :: SCMPDS_7:1 for s being State of SCMPDS for m, n being Element of NAT st IC s = m holds ICplusConst (s,(n - m)) = n proof let s be State of SCMPDS; ::_thesis: for m, n being Element of NAT st IC s = m holds ICplusConst (s,(n - m)) = n let m, n be Element of NAT ; ::_thesis: ( IC s = m implies ICplusConst (s,(n - m)) = n ) ex k being Element of NAT st ( k = IC s & ICplusConst (s,(n - m)) = abs (k + (n - m)) ) by SCMPDS_2:def_18; hence ( IC s = m implies ICplusConst (s,(n - m)) = n ) by ABSVALUE:def_1; ::_thesis: verum end; theorem Th15: :: SCMPDS_7:2 for i, j, k being Instruction of SCMPDS for I being Program of SCMPDS holds ((i ';' I) ';' j) ';' k = i ';' ((I ';' j) ';' k) proof let i, j, k be Instruction of SCMPDS; ::_thesis: for I being Program of SCMPDS holds ((i ';' I) ';' j) ';' k = i ';' ((I ';' j) ';' k) let I be Program of SCMPDS; ::_thesis: ((i ';' I) ';' j) ';' k = i ';' ((I ';' j) ';' k) thus ((i ';' I) ';' j) ';' k = (i ';' (I ';' j)) ';' k by SCMPDS_4:15 .= i ';' ((I ';' j) ';' k) by SCMPDS_4:15 ; ::_thesis: verum end; theorem Th16: :: SCMPDS_7:3 for J, I, K being Program of SCMPDS holds Shift (J,(card I)) c= (I ';' J) ';' K proof let J, I, K be Program of SCMPDS; ::_thesis: Shift (J,(card I)) c= (I ';' J) ';' K set IJ = I ';' J; dom (I ';' J) misses dom (Shift (K,(card (I ';' J)))) by AFINSQ_1:72; then A1: I ';' J c= (I ';' J) ';' K by FUNCT_4:32; Shift (J,(card I)) c= I ';' J by FUNCT_4:25; hence Shift (J,(card I)) c= (I ';' J) ';' K by A1, XBOOLE_1:1; ::_thesis: verum end; theorem Th17: :: SCMPDS_7:4 for I, J being Program of SCMPDS holds I c= stop (I ';' J) proof let I, J be Program of SCMPDS; ::_thesis: I c= stop (I ';' J) stop (I ';' J) = I ';' (J ';' (Stop SCMPDS)) by AFINSQ_1:27; hence I c= stop (I ';' J) by AFINSQ_1:74; ::_thesis: verum end; theorem :: SCMPDS_7:5 canceled; theorem :: SCMPDS_7:6 canceled; theorem :: SCMPDS_7:7 for s being State of SCMPDS for i being Instruction of SCMPDS st InsCode i in {0,4,5,6,14} holds DataPart (Exec (i,s)) = DataPart s proof let s be State of SCMPDS; ::_thesis: for i being Instruction of SCMPDS st InsCode i in {0,4,5,6,14} holds DataPart (Exec (i,s)) = DataPart s let i be Instruction of SCMPDS; ::_thesis: ( InsCode i in {0,4,5,6,14} implies DataPart (Exec (i,s)) = DataPart s ) assume A1: InsCode i in {0,4,5,6,14} ; ::_thesis: DataPart (Exec (i,s)) = DataPart s now__::_thesis:_for_a_being_Int_position_holds_(Exec_(i,s))_._a_=_s_._a let a be Int_position; ::_thesis: (Exec (i,s)) . b1 = s . b1 percases ( InsCode i = 0 or InsCode i = 14 or InsCode i = 4 or InsCode i = 5 or InsCode i = 6 ) by A1, ENUMSET1:def_3; suppose InsCode i = 0 ; ::_thesis: (Exec (i,s)) . b1 = s . b1 hence (Exec (i,s)) . a = s . a by SCMPDS_2:86; ::_thesis: verum end; suppose InsCode i = 14 ; ::_thesis: (Exec (i,s)) . b1 = s . b1 then ex k1 being Integer st i = goto k1 by SCMPDS_2:26; hence (Exec (i,s)) . a = s . a by SCMPDS_2:54; ::_thesis: verum end; suppose InsCode i = 4 ; ::_thesis: (Exec (i,s)) . b1 = s . b1 then ex b being Int_position ex k1, k2 being Integer st i = (b,k1) <>0_goto k2 by SCMPDS_2:30; hence (Exec (i,s)) . a = s . a by SCMPDS_2:55; ::_thesis: verum end; suppose InsCode i = 5 ; ::_thesis: (Exec (i,s)) . b1 = s . b1 then ex b being Int_position ex k1, k2 being Integer st i = (b,k1) <=0_goto k2 by SCMPDS_2:31; hence (Exec (i,s)) . a = s . a by SCMPDS_2:56; ::_thesis: verum end; suppose InsCode i = 6 ; ::_thesis: (Exec (i,s)) . b1 = s . b1 then ex b being Int_position ex k1, k2 being Integer st i = (b,k1) >=0_goto k2 by SCMPDS_2:32; hence (Exec (i,s)) . a = s . a by SCMPDS_2:57; ::_thesis: verum end; end; end; hence DataPart (Exec (i,s)) = DataPart s by SCMPDS_4:8; ::_thesis: verum end; theorem Th25: :: SCMPDS_7:8 for P1, P2 being Instruction-Sequence of SCMPDS for s1, s2 being State of SCMPDS for I being Program of SCMPDS st I is_closed_on s1,P1 & DataPart s1 = DataPart s2 holds for k being Element of NAT holds ( Comput ((P1 +* (stop I)),(Initialize s1),k) = Comput ((P2 +* (stop I)),(Initialize s2),k) & CurInstr ((P1 +* (stop I)),(Comput ((P1 +* (stop I)),(Initialize s1),k))) = CurInstr ((P2 +* (stop I)),(Comput ((P2 +* (stop I)),(Initialize s2),k))) ) proof let P1, P2 be Instruction-Sequence of SCMPDS; ::_thesis: for s1, s2 being State of SCMPDS for I being Program of SCMPDS st I is_closed_on s1,P1 & DataPart s1 = DataPart s2 holds for k being Element of NAT holds ( Comput ((P1 +* (stop I)),(Initialize s1),k) = Comput ((P2 +* (stop I)),(Initialize s2),k) & CurInstr ((P1 +* (stop I)),(Comput ((P1 +* (stop I)),(Initialize s1),k))) = CurInstr ((P2 +* (stop I)),(Comput ((P2 +* (stop I)),(Initialize s2),k))) ) let s1, s2 be State of SCMPDS; ::_thesis: for I being Program of SCMPDS st I is_closed_on s1,P1 & DataPart s1 = DataPart s2 holds for k being Element of NAT holds ( Comput ((P1 +* (stop I)),(Initialize s1),k) = Comput ((P2 +* (stop I)),(Initialize s2),k) & CurInstr ((P1 +* (stop I)),(Comput ((P1 +* (stop I)),(Initialize s1),k))) = CurInstr ((P2 +* (stop I)),(Comput ((P2 +* (stop I)),(Initialize s2),k))) ) let I be Program of SCMPDS; ::_thesis: ( I is_closed_on s1,P1 & DataPart s1 = DataPart s2 implies for k being Element of NAT holds ( Comput ((P1 +* (stop I)),(Initialize s1),k) = Comput ((P2 +* (stop I)),(Initialize s2),k) & CurInstr ((P1 +* (stop I)),(Comput ((P1 +* (stop I)),(Initialize s1),k))) = CurInstr ((P2 +* (stop I)),(Comput ((P2 +* (stop I)),(Initialize s2),k))) ) ) assume A1: I is_closed_on s1,P1 ; ::_thesis: ( not DataPart s1 = DataPart s2 or for k being Element of NAT holds ( Comput ((P1 +* (stop I)),(Initialize s1),k) = Comput ((P2 +* (stop I)),(Initialize s2),k) & CurInstr ((P1 +* (stop I)),(Comput ((P1 +* (stop I)),(Initialize s1),k))) = CurInstr ((P2 +* (stop I)),(Comput ((P2 +* (stop I)),(Initialize s2),k))) ) ) set pI = stop I; set ss1 = Initialize s1; set PP1 = P1 +* (stop I); set ss2 = Initialize s2; set PP2 = P2 +* (stop I); A5: stop I c= P2 +* (stop I) by FUNCT_4:25; A6: stop I c= P1 +* (stop I) by FUNCT_4:25; assume A7: DataPart s1 = DataPart s2 ; ::_thesis: for k being Element of NAT holds ( Comput ((P1 +* (stop I)),(Initialize s1),k) = Comput ((P2 +* (stop I)),(Initialize s2),k) & CurInstr ((P1 +* (stop I)),(Comput ((P1 +* (stop I)),(Initialize s1),k))) = CurInstr ((P2 +* (stop I)),(Comput ((P2 +* (stop I)),(Initialize s2),k))) ) let k be Element of NAT ; ::_thesis: ( Comput ((P1 +* (stop I)),(Initialize s1),k) = Comput ((P2 +* (stop I)),(Initialize s2),k) & CurInstr ((P1 +* (stop I)),(Comput ((P1 +* (stop I)),(Initialize s1),k))) = CurInstr ((P2 +* (stop I)),(Comput ((P2 +* (stop I)),(Initialize s2),k))) ) A8: IC (Comput ((P1 +* (stop I)),(Initialize s1),k)) in dom (stop I) by A1, SCMPDS_6:def_2; A9: I is_closed_on s2,P2 by A1, A7, SCMPDS_6:22; then A10: for m being Element of NAT st m < k holds IC (Comput ((P2 +* (stop I)),(Initialize s2),m)) in dom (stop I) by SCMPDS_6:def_2; Initialize s1 = Initialize s2 by A7, MEMSTR_0:80; hence K: Comput ((P1 +* (stop I)),(Initialize s1),k) = Comput ((P2 +* (stop I)),(Initialize s2),k) by A6, A5, A10, SCMPDS_4:21; ::_thesis: CurInstr ((P1 +* (stop I)),(Comput ((P1 +* (stop I)),(Initialize s1),k))) = CurInstr ((P2 +* (stop I)),(Comput ((P2 +* (stop I)),(Initialize s2),k))) A12: IC (Comput ((P2 +* (stop I)),(Initialize s2),k)) in dom (stop I) by A9, SCMPDS_6:def_2; thus CurInstr ((P2 +* (stop I)),(Comput ((P2 +* (stop I)),(Initialize s2),k))) = (P2 +* (stop I)) . (IC (Comput ((P2 +* (stop I)),(Initialize s2),k))) by PBOOLE:143 .= (stop I) . (IC (Comput ((P2 +* (stop I)),(Initialize s2),k))) by A5, A12, GRFUNC_1:2 .= (P1 +* (stop I)) . (IC (Comput ((P1 +* (stop I)),(Initialize s1),k))) by A6, K, A8, GRFUNC_1:2 .= CurInstr ((P1 +* (stop I)),(Comput ((P1 +* (stop I)),(Initialize s1),k))) by PBOOLE:143 ; ::_thesis: verum end; theorem Th26: :: SCMPDS_7:9 for P1, P2 being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for I being Program of SCMPDS st I is_closed_on s,P1 & stop I c= P1 & stop I c= P2 holds for k being Element of NAT holds ( Comput (P1,s,k) = Comput (P2,s,k) & CurInstr (P1,(Comput (P1,s,k))) = CurInstr (P2,(Comput (P2,s,k))) ) proof let P1, P2 be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for I being Program of SCMPDS st I is_closed_on s,P1 & stop I c= P1 & stop I c= P2 holds for k being Element of NAT holds ( Comput (P1,s,k) = Comput (P2,s,k) & CurInstr (P1,(Comput (P1,s,k))) = CurInstr (P2,(Comput (P2,s,k))) ) let s be 0 -started State of SCMPDS; ::_thesis: for I being Program of SCMPDS st I is_closed_on s,P1 & stop I c= P1 & stop I c= P2 holds for k being Element of NAT holds ( Comput (P1,s,k) = Comput (P2,s,k) & CurInstr (P1,(Comput (P1,s,k))) = CurInstr (P2,(Comput (P2,s,k))) ) let I be Program of SCMPDS; ::_thesis: ( I is_closed_on s,P1 & stop I c= P1 & stop I c= P2 implies for k being Element of NAT holds ( Comput (P1,s,k) = Comput (P2,s,k) & CurInstr (P1,(Comput (P1,s,k))) = CurInstr (P2,(Comput (P2,s,k))) ) ) set iI = stop I; assume that A3: I is_closed_on s,P1 and A4: stop I c= P1 and A5: stop I c= P2 ; ::_thesis: for k being Element of NAT holds ( Comput (P1,s,k) = Comput (P2,s,k) & CurInstr (P1,(Comput (P1,s,k))) = CurInstr (P2,(Comput (P2,s,k))) ) B4: Start-At (0,SCMPDS) c= s by MEMSTR_0:29; A1: s = Initialize s by B4, FUNCT_4:98; A7: P2 = P2 +* (stop I) by A5, FUNCT_4:98; A8: DataPart s = DataPart s ; P1 = P1 +* (stop I) by A4, FUNCT_4:98; hence for k being Element of NAT holds ( Comput (P1,s,k) = Comput (P2,s,k) & CurInstr (P1,(Comput (P1,s,k))) = CurInstr (P2,(Comput (P2,s,k))) ) by A3, A7, A8, Th25, A1; ::_thesis: verum end; theorem Th28: :: SCMPDS_7:10 for P1, P2 being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for I being Program of SCMPDS st I is_closed_on s,P1 & I is_halting_on s,P1 & stop I c= P1 & stop I c= P2 holds ( LifeSpan (P1,s) = LifeSpan (P2,s) & Result (P1,s) = Result (P2,s) ) proof let P1, P2 be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for I being Program of SCMPDS st I is_closed_on s,P1 & I is_halting_on s,P1 & stop I c= P1 & stop I c= P2 holds ( LifeSpan (P1,s) = LifeSpan (P2,s) & Result (P1,s) = Result (P2,s) ) let s be 0 -started State of SCMPDS; ::_thesis: for I being Program of SCMPDS st I is_closed_on s,P1 & I is_halting_on s,P1 & stop I c= P1 & stop I c= P2 holds ( LifeSpan (P1,s) = LifeSpan (P2,s) & Result (P1,s) = Result (P2,s) ) let I be Program of SCMPDS; ::_thesis: ( I is_closed_on s,P1 & I is_halting_on s,P1 & stop I c= P1 & stop I c= P2 implies ( LifeSpan (P1,s) = LifeSpan (P2,s) & Result (P1,s) = Result (P2,s) ) ) assume that A1: I is_closed_on s,P1 and A2: I is_halting_on s,P1 and A3: stop I c= P1 and A4: stop I c= P2 ; ::_thesis: ( LifeSpan (P1,s) = LifeSpan (P2,s) & Result (P1,s) = Result (P2,s) ) B3: Start-At (0,SCMPDS) c= s by MEMSTR_0:29; B4: Start-At (0,SCMPDS) c= s by MEMSTR_0:29; DataPart s = DataPart s ; then A6: I is_halting_on s,P2 by A1, A2, SCMPDS_6:23; A7: Initialize s = s by B3, FUNCT_4:98; A8: Initialize s = s by B4, FUNCT_4:98; P2 = P2 +* (stop I) by A4, FUNCT_4:98; then A9: P2 halts_on s by A6, A8, SCMPDS_6:def_3; P1 = P1 +* (stop I) by A3, FUNCT_4:98; then A10: P1 halts_on s by A2, A7, SCMPDS_6:def_3; A11: now__::_thesis:_for_l_being_Element_of_NAT_st_CurInstr_(P2,(Comput_(P2,s,l)))_=_halt_SCMPDS_holds_ LifeSpan_(P1,s)_<=_l let l be Element of NAT ; ::_thesis: ( CurInstr (P2,(Comput (P2,s,l))) = halt SCMPDS implies LifeSpan (P1,s) <= l ) assume A12: CurInstr (P2,(Comput (P2,s,l))) = halt SCMPDS ; ::_thesis: LifeSpan (P1,s) <= l CurInstr (P1,(Comput (P1,s,l))) = CurInstr (P2,(Comput (P2,s,l))) by A1, A3, A4, Th26; hence LifeSpan (P1,s) <= l by A10, A12, EXTPRO_1:def_15; ::_thesis: verum end; CurInstr (P2,(Comput (P2,s,(LifeSpan (P1,s))))) = CurInstr (P1,(Comput (P1,s,(LifeSpan (P1,s))))) by A1, A3, A4, Th26 .= halt SCMPDS by A10, EXTPRO_1:def_15 ; hence LifeSpan (P1,s) = LifeSpan (P2,s) by A11, A9, EXTPRO_1:def_15; ::_thesis: Result (P1,s) = Result (P2,s) then A13: Result (P2,s) = Comput (P2,s,(LifeSpan (P1,s))) by A9, EXTPRO_1:23; Result (P1,s) = Comput (P1,s,(LifeSpan (P1,s))) by A10, EXTPRO_1:23; hence Result (P1,s) = Result (P2,s) by A1, A3, A4, A13, Th26; ::_thesis: verum end; theorem Th29: :: SCMPDS_7:11 for P1, P2 being Instruction-Sequence of SCMPDS for s1, s2 being State of SCMPDS for I being Program of SCMPDS st I is_closed_on s1,P1 & I is_halting_on s1,P1 & DataPart s1 = DataPart s2 holds ( LifeSpan ((P1 +* (stop I)),(Initialize s1)) = LifeSpan ((P2 +* (stop I)),(Initialize s2)) & Result ((P1 +* (stop I)),(Initialize s1)) = Result ((P2 +* (stop I)),(Initialize s2)) ) proof let P1, P2 be Instruction-Sequence of SCMPDS; ::_thesis: for s1, s2 being State of SCMPDS for I being Program of SCMPDS st I is_closed_on s1,P1 & I is_halting_on s1,P1 & DataPart s1 = DataPart s2 holds ( LifeSpan ((P1 +* (stop I)),(Initialize s1)) = LifeSpan ((P2 +* (stop I)),(Initialize s2)) & Result ((P1 +* (stop I)),(Initialize s1)) = Result ((P2 +* (stop I)),(Initialize s2)) ) let s1, s2 be State of SCMPDS; ::_thesis: for I being Program of SCMPDS st I is_closed_on s1,P1 & I is_halting_on s1,P1 & DataPart s1 = DataPart s2 holds ( LifeSpan ((P1 +* (stop I)),(Initialize s1)) = LifeSpan ((P2 +* (stop I)),(Initialize s2)) & Result ((P1 +* (stop I)),(Initialize s1)) = Result ((P2 +* (stop I)),(Initialize s2)) ) let I be Program of SCMPDS; ::_thesis: ( I is_closed_on s1,P1 & I is_halting_on s1,P1 & DataPart s1 = DataPart s2 implies ( LifeSpan ((P1 +* (stop I)),(Initialize s1)) = LifeSpan ((P2 +* (stop I)),(Initialize s2)) & Result ((P1 +* (stop I)),(Initialize s1)) = Result ((P2 +* (stop I)),(Initialize s2)) ) ) assume A1: I is_closed_on s1,P1 ; ::_thesis: ( not I is_halting_on s1,P1 or not DataPart s1 = DataPart s2 or ( LifeSpan ((P1 +* (stop I)),(Initialize s1)) = LifeSpan ((P2 +* (stop I)),(Initialize s2)) & Result ((P1 +* (stop I)),(Initialize s1)) = Result ((P2 +* (stop I)),(Initialize s2)) ) ) set ss1 = Initialize s1; set PP1 = P1 +* (stop I); set ss2 = Initialize s2; set PP2 = P2 +* (stop I); assume A2: I is_halting_on s1,P1 ; ::_thesis: ( not DataPart s1 = DataPart s2 or ( LifeSpan ((P1 +* (stop I)),(Initialize s1)) = LifeSpan ((P2 +* (stop I)),(Initialize s2)) & Result ((P1 +* (stop I)),(Initialize s1)) = Result ((P2 +* (stop I)),(Initialize s2)) ) ) then A3: P1 +* (stop I) halts_on Initialize s1 by SCMPDS_6:def_3; then A4: Result ((P1 +* (stop I)),(Initialize s1)) = Comput ((P1 +* (stop I)),(Initialize s1),(LifeSpan ((P1 +* (stop I)),(Initialize s1)))) by EXTPRO_1:23; assume A5: DataPart s1 = DataPart s2 ; ::_thesis: ( LifeSpan ((P1 +* (stop I)),(Initialize s1)) = LifeSpan ((P2 +* (stop I)),(Initialize s2)) & Result ((P1 +* (stop I)),(Initialize s1)) = Result ((P2 +* (stop I)),(Initialize s2)) ) then I is_halting_on s2,P2 by A1, A2, SCMPDS_6:23; then A6: P2 +* (stop I) halts_on Initialize s2 by SCMPDS_6:def_3; A7: now__::_thesis:_for_l_being_Element_of_NAT_st_CurInstr_((P2_+*_(stop_I)),(Comput_((P2_+*_(stop_I)),(Initialize_s2),l)))_=_halt_SCMPDS_holds_ LifeSpan_((P1_+*_(stop_I)),(Initialize_s1))_<=_l let l be Element of NAT ; ::_thesis: ( CurInstr ((P2 +* (stop I)),(Comput ((P2 +* (stop I)),(Initialize s2),l))) = halt SCMPDS implies LifeSpan ((P1 +* (stop I)),(Initialize s1)) <= l ) assume A8: CurInstr ((P2 +* (stop I)),(Comput ((P2 +* (stop I)),(Initialize s2),l))) = halt SCMPDS ; ::_thesis: LifeSpan ((P1 +* (stop I)),(Initialize s1)) <= l CurInstr ((P1 +* (stop I)),(Comput ((P1 +* (stop I)),(Initialize s1),l))) = CurInstr ((P2 +* (stop I)),(Comput ((P2 +* (stop I)),(Initialize s2),l))) by A1, A5, Th25; hence LifeSpan ((P1 +* (stop I)),(Initialize s1)) <= l by A3, A8, EXTPRO_1:def_15; ::_thesis: verum end; CurInstr ((P2 +* (stop I)),(Comput ((P2 +* (stop I)),(Initialize s2),(LifeSpan ((P1 +* (stop I)),(Initialize s1)))))) = CurInstr ((P1 +* (stop I)),(Comput ((P1 +* (stop I)),(Initialize s1),(LifeSpan ((P1 +* (stop I)),(Initialize s1)))))) by A1, A5, Th25 .= halt SCMPDS by A3, EXTPRO_1:def_15 ; hence LifeSpan ((P1 +* (stop I)),(Initialize s1)) = LifeSpan ((P2 +* (stop I)),(Initialize s2)) by A7, A6, EXTPRO_1:def_15; ::_thesis: Result ((P1 +* (stop I)),(Initialize s1)) = Result ((P2 +* (stop I)),(Initialize s2)) then Result ((P2 +* (stop I)),(Initialize s2)) = Comput ((P2 +* (stop I)),(Initialize s2),(LifeSpan ((P1 +* (stop I)),(Initialize s1)))) by A6, EXTPRO_1:23; hence Result ((P1 +* (stop I)),(Initialize s1)) = Result ((P2 +* (stop I)),(Initialize s2)) by A1, A5, A4, Th25; ::_thesis: verum end; theorem :: SCMPDS_7:12 for P1, P2 being Instruction-Sequence of SCMPDS for s1, s2 being 0 -started State of SCMPDS for I being Program of SCMPDS st I is_closed_on s1,P1 & I is_halting_on s1,P1 & stop I c= P1 & stop I c= P2 & ex k being Element of NAT st Comput (P1,s1,k) = s2 holds Result (P1,s1) = Result (P2,s2) proof let P1, P2 be Instruction-Sequence of SCMPDS; ::_thesis: for s1, s2 being 0 -started State of SCMPDS for I being Program of SCMPDS st I is_closed_on s1,P1 & I is_halting_on s1,P1 & stop I c= P1 & stop I c= P2 & ex k being Element of NAT st Comput (P1,s1,k) = s2 holds Result (P1,s1) = Result (P2,s2) let s1, s2 be 0 -started State of SCMPDS; ::_thesis: for I being Program of SCMPDS st I is_closed_on s1,P1 & I is_halting_on s1,P1 & stop I c= P1 & stop I c= P2 & ex k being Element of NAT st Comput (P1,s1,k) = s2 holds Result (P1,s1) = Result (P2,s2) let I be Program of SCMPDS; ::_thesis: ( I is_closed_on s1,P1 & I is_halting_on s1,P1 & stop I c= P1 & stop I c= P2 & ex k being Element of NAT st Comput (P1,s1,k) = s2 implies Result (P1,s1) = Result (P2,s2) ) set pI = stop I; assume A1: I is_closed_on s1,P1 ; ::_thesis: ( not I is_halting_on s1,P1 or not stop I c= P1 or not stop I c= P2 or for k being Element of NAT holds not Comput (P1,s1,k) = s2 or Result (P1,s1) = Result (P2,s2) ) assume A3: I is_halting_on s1,P1 ; ::_thesis: ( not stop I c= P1 or not stop I c= P2 or for k being Element of NAT holds not Comput (P1,s1,k) = s2 or Result (P1,s1) = Result (P2,s2) ) assume stop I c= P1 ; ::_thesis: ( not stop I c= P2 or for k being Element of NAT holds not Comput (P1,s1,k) = s2 or Result (P1,s1) = Result (P2,s2) ) then A5: P1 = P1 +* (stop I) by FUNCT_4:98; assume stop I c= P2 ; ::_thesis: ( for k being Element of NAT holds not Comput (P1,s1,k) = s2 or Result (P1,s1) = Result (P2,s2) ) then XX: P2 = P2 +* (stop I) by FUNCT_4:98; A2: s1 = Initialize s1 by MEMSTR_0:44; then A6: P1 halts_on s1 by A3, A5, SCMPDS_6:def_3; then consider n being Element of NAT such that A7: CurInstr (P1,(Comput (P1,s1,n))) = halt SCMPDS by EXTPRO_1:29; A9: s2 = Initialize s2 by MEMSTR_0:44; given k being Element of NAT such that A10: Comput (P1,s1,k) = s2 ; ::_thesis: Result (P1,s1) = Result (P2,s2) set s3 = Comput (P1,s1,k); set P3 = P1; A11: IC in dom (Comput (P1,s1,k)) by MEMSTR_0:2; IC (Comput (P1,s1,k)) = 0 by A10, MEMSTR_0:def_11; then Start-At (0,SCMPDS) c= Comput (P1,s1,k) by A11, FUNCOP_1:73; then A14: Comput (P1,s1,k) = Initialize (Comput (P1,s1,k)) by FUNCT_4:98; A15: now__::_thesis:_for_n_being_Element_of_NAT_holds_IC_(Comput_(P1,(Comput_(P1,s1,k)),n))_in_dom_(stop_I) let n be Element of NAT ; ::_thesis: IC (Comput (P1,(Comput (P1,s1,k)),n)) in dom (stop I) IC (Comput (P1,(Comput (P1,s1,k)),n)) = IC (Comput (P1,s1,(k + n))) by EXTPRO_1:4; hence IC (Comput (P1,(Comput (P1,s1,k)),n)) in dom (stop I) by A1, A5, A2, SCMPDS_6:def_2; ::_thesis: verum end; CurInstr (P1,(Comput (P1,(Comput (P1,s1,k)),n))) = CurInstr (P1,(Comput (P1,s1,(k + n)))) by EXTPRO_1:4 .= CurInstr (P1,(Comput (P1,s1,n))) by A7, EXTPRO_1:5, NAT_1:11 ; then P1 halts_on Comput (P1,s1,k) by A7, EXTPRO_1:29; then A20: I is_halting_on Comput (P1,s1,k),P1 by A14, A5, SCMPDS_6:def_3; A21: DataPart (Comput (P1,s1,k)) = DataPart s2 by A10; consider k being Element of NAT such that A22: CurInstr (P1,(Comput (P1,s1,k))) = halt SCMPDS by A6, EXTPRO_1:29; A25: P1 . (IC (Comput (P1,s1,k))) = halt SCMPDS by A22, PBOOLE:143; I is_closed_on Comput (P1,s1,k),P1 by A14, A15, A5, SCMPDS_6:def_2; then Result (P1,(Comput (P1,s1,k))) = Result (P2,s2) by A9, A21, A14, A20, Th29, XX, A5; hence Result (P1,s1) = Result (P2,s2) by A25, EXTPRO_1:8; ::_thesis: verum end; theorem Th31: :: SCMPDS_7:13 for P being Instruction-Sequence of SCMPDS for s being State of SCMPDS for I being Program of SCMPDS for a being Int_position st I is_halting_on s,P holds (IExec (I,P,(Initialize s))) . a = (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) . a proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being State of SCMPDS for I being Program of SCMPDS for a being Int_position st I is_halting_on s,P holds (IExec (I,P,(Initialize s))) . a = (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) . a let s be State of SCMPDS; ::_thesis: for I being Program of SCMPDS for a being Int_position st I is_halting_on s,P holds (IExec (I,P,(Initialize s))) . a = (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) . a let I be Program of SCMPDS; ::_thesis: for a being Int_position st I is_halting_on s,P holds (IExec (I,P,(Initialize s))) . a = (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) . a let a be Int_position; ::_thesis: ( I is_halting_on s,P implies (IExec (I,P,(Initialize s))) . a = (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) . a ) set s1 = Initialize s; set P1 = P +* (stop I); assume I is_halting_on s,P ; ::_thesis: (IExec (I,P,(Initialize s))) . a = (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) . a then A1: P +* (stop I) halts_on Initialize s by SCMPDS_6:def_3; thus (IExec (I,P,(Initialize s))) . a = (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) . a by A1, EXTPRO_1:23; ::_thesis: verum end; theorem :: SCMPDS_7:14 for P being Instruction-Sequence of SCMPDS for s being State of SCMPDS for I being parahalting Program of SCMPDS for a being Int_position holds (IExec (I,P,(Initialize s))) . a = (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) . a proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being State of SCMPDS for I being parahalting Program of SCMPDS for a being Int_position holds (IExec (I,P,(Initialize s))) . a = (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) . a let s be State of SCMPDS; ::_thesis: for I being parahalting Program of SCMPDS for a being Int_position holds (IExec (I,P,(Initialize s))) . a = (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) . a let I be parahalting Program of SCMPDS; ::_thesis: for a being Int_position holds (IExec (I,P,(Initialize s))) . a = (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) . a let a be Int_position; ::_thesis: (IExec (I,P,(Initialize s))) . a = (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) . a I is_halting_on s,P by SCMPDS_6:21; hence (IExec (I,P,(Initialize s))) . a = (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) . a by Th31; ::_thesis: verum end; theorem Th33: :: SCMPDS_7:15 for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for I being Program of SCMPDS for i being Element of NAT st stop I c= P & I is_closed_on s,P & I is_halting_on s,P & i < LifeSpan (P,s) holds IC (Comput (P,s,i)) in dom I proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for I being Program of SCMPDS for i being Element of NAT st stop I c= P & I is_closed_on s,P & I is_halting_on s,P & i < LifeSpan (P,s) holds IC (Comput (P,s,i)) in dom I let s be 0 -started State of SCMPDS; ::_thesis: for I being Program of SCMPDS for i being Element of NAT st stop I c= P & I is_closed_on s,P & I is_halting_on s,P & i < LifeSpan (P,s) holds IC (Comput (P,s,i)) in dom I let I be Program of SCMPDS; ::_thesis: for i being Element of NAT st stop I c= P & I is_closed_on s,P & I is_halting_on s,P & i < LifeSpan (P,s) holds IC (Comput (P,s,i)) in dom I let i be Element of NAT ; ::_thesis: ( stop I c= P & I is_closed_on s,P & I is_halting_on s,P & i < LifeSpan (P,s) implies IC (Comput (P,s,i)) in dom I ) set sI = stop I; set Ci = Comput (P,s,i); set Lc = IC (Comput (P,s,i)); assume that A1: stop I c= P and A2: I is_closed_on s,P and A3: I is_halting_on s,P and A4: i < LifeSpan (P,s) ; ::_thesis: IC (Comput (P,s,i)) in dom I B1: Start-At (0,SCMPDS) c= s by MEMSTR_0:29; A5: P +* (stop I) = P by A1, FUNCT_4:98; A6: s = Initialize s by B1, FUNCT_4:98; then A7: IC (Comput (P,s,i)) in dom (stop I) by A2, A5, SCMPDS_6:def_2; A9: P halts_on s by A3, A6, A5, SCMPDS_6:def_3; now__::_thesis:_not_(stop_I)_._(IC_(Comput_(P,s,i)))_=_halt_SCMPDS assume A10: (stop I) . (IC (Comput (P,s,i))) = halt SCMPDS ; ::_thesis: contradiction CurInstr (P,(Comput (P,s,i))) = P . (IC (Comput (P,s,i))) by PBOOLE:143 .= halt SCMPDS by A7, A1, A10, GRFUNC_1:2 ; hence contradiction by A4, A9, EXTPRO_1:def_15; ::_thesis: verum end; hence IC (Comput (P,s,i)) in dom I by A7, COMPOS_1:51; ::_thesis: verum end; theorem Th34: :: SCMPDS_7:16 for s2 being State of SCMPDS for P1, P2 being Instruction-Sequence of SCMPDS for s1 being 0 -started State of SCMPDS for I being shiftable Program of SCMPDS st stop I c= P1 & I is_closed_on s1,P1 & I is_halting_on s1,P1 holds for n being Element of NAT st Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 holds for i being Element of NAT st i < LifeSpan (P1,s1) holds ( (IC (Comput (P1,s1,i))) + n = IC (Comput (P2,s2,i)) & CurInstr (P1,(Comput (P1,s1,i))) = CurInstr (P2,(Comput (P2,s2,i))) & DataPart (Comput (P1,s1,i)) = DataPart (Comput (P2,s2,i)) ) proof let s2 be State of SCMPDS; ::_thesis: for P1, P2 being Instruction-Sequence of SCMPDS for s1 being 0 -started State of SCMPDS for I being shiftable Program of SCMPDS st stop I c= P1 & I is_closed_on s1,P1 & I is_halting_on s1,P1 holds for n being Element of NAT st Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 holds for i being Element of NAT st i < LifeSpan (P1,s1) holds ( (IC (Comput (P1,s1,i))) + n = IC (Comput (P2,s2,i)) & CurInstr (P1,(Comput (P1,s1,i))) = CurInstr (P2,(Comput (P2,s2,i))) & DataPart (Comput (P1,s1,i)) = DataPart (Comput (P2,s2,i)) ) let P1, P2 be Instruction-Sequence of SCMPDS; ::_thesis: for s1 being 0 -started State of SCMPDS for I being shiftable Program of SCMPDS st stop I c= P1 & I is_closed_on s1,P1 & I is_halting_on s1,P1 holds for n being Element of NAT st Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 holds for i being Element of NAT st i < LifeSpan (P1,s1) holds ( (IC (Comput (P1,s1,i))) + n = IC (Comput (P2,s2,i)) & CurInstr (P1,(Comput (P1,s1,i))) = CurInstr (P2,(Comput (P2,s2,i))) & DataPart (Comput (P1,s1,i)) = DataPart (Comput (P2,s2,i)) ) let s1 be 0 -started State of SCMPDS; ::_thesis: for I being shiftable Program of SCMPDS st stop I c= P1 & I is_closed_on s1,P1 & I is_halting_on s1,P1 holds for n being Element of NAT st Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 holds for i being Element of NAT st i < LifeSpan (P1,s1) holds ( (IC (Comput (P1,s1,i))) + n = IC (Comput (P2,s2,i)) & CurInstr (P1,(Comput (P1,s1,i))) = CurInstr (P2,(Comput (P2,s2,i))) & DataPart (Comput (P1,s1,i)) = DataPart (Comput (P2,s2,i)) ) let I be shiftable Program of SCMPDS; ::_thesis: ( stop I c= P1 & I is_closed_on s1,P1 & I is_halting_on s1,P1 implies for n being Element of NAT st Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 holds for i being Element of NAT st i < LifeSpan (P1,s1) holds ( (IC (Comput (P1,s1,i))) + n = IC (Comput (P2,s2,i)) & CurInstr (P1,(Comput (P1,s1,i))) = CurInstr (P2,(Comput (P2,s2,i))) & DataPart (Comput (P1,s1,i)) = DataPart (Comput (P2,s2,i)) ) ) set SI = stop I; assume that A1: stop I c= P1 and A2: I is_closed_on s1,P1 and A3: I is_halting_on s1,P1 ; ::_thesis: for n being Element of NAT st Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 holds for i being Element of NAT st i < LifeSpan (P1,s1) holds ( (IC (Comput (P1,s1,i))) + n = IC (Comput (P2,s2,i)) & CurInstr (P1,(Comput (P1,s1,i))) = CurInstr (P2,(Comput (P2,s2,i))) & DataPart (Comput (P1,s1,i)) = DataPart (Comput (P2,s2,i)) ) B1: Start-At (0,SCMPDS) c= s1 by MEMSTR_0:29; let n be Element of NAT ; ::_thesis: ( Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 implies for i being Element of NAT st i < LifeSpan (P1,s1) holds ( (IC (Comput (P1,s1,i))) + n = IC (Comput (P2,s2,i)) & CurInstr (P1,(Comput (P1,s1,i))) = CurInstr (P2,(Comput (P2,s2,i))) & DataPart (Comput (P1,s1,i)) = DataPart (Comput (P2,s2,i)) ) ) A7: card I > 0 ; assume that A6: Shift (I,n) c= P2 and A8: IC s2 = n and A9: DataPart s1 = DataPart s2 ; ::_thesis: for i being Element of NAT st i < LifeSpan (P1,s1) holds ( (IC (Comput (P1,s1,i))) + n = IC (Comput (P2,s2,i)) & CurInstr (P1,(Comput (P1,s1,i))) = CurInstr (P2,(Comput (P2,s2,i))) & DataPart (Comput (P1,s1,i)) = DataPart (Comput (P2,s2,i)) ) defpred S1[ Element of NAT ] means ( $1 < LifeSpan (P1,s1) implies ( (IC (Comput (P1,s1,$1))) + n = IC (Comput (P2,s2,$1)) & CurInstr (P1,(Comput (P1,s1,$1))) = CurInstr (P2,(Comput (P2,s2,$1))) & DataPart (Comput (P1,s1,$1)) = DataPart (Comput (P2,s2,$1)) ) ); A11: s1 = Initialize s1 by B1, FUNCT_4:98; A12: for k being Element of NAT st S1[k] holds S1[k + 1] proof let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] ) assume A13: S1[k] ; ::_thesis: S1[k + 1] now__::_thesis:_(_k_+_1_<_LifeSpan_(P1,s1)_implies_(_(IC_(Comput_(P1,s1,(k_+_1))))_+_n_=_IC_(Comput_(P2,s2,(k_+_1)))_&_CurInstr_(P1,(Comput_(P1,s1,(k_+_1))))_=_CurInstr_(P2,(Comput_(P2,s2,(k_+_1))))_&_DataPart_(Comput_(P1,s1,(k_+_1)))_=_DataPart_(Comput_(P2,s2,(k_+_1)))_)_) reconsider m = IC (Comput (P1,s1,k)) as Element of NAT ; set i = CurInstr (P1,(Comput (P1,s1,k))); A14: k <= k + 1 by NAT_1:11; reconsider l = IC (Comput (P1,s1,(k + 1))) as Element of NAT ; A16: Comput (P1,s1,(k + 1)) = Following (P1,(Comput (P1,s1,k))) by EXTPRO_1:3 .= Exec ((CurInstr (P1,(Comput (P1,s1,k)))),(Comput (P1,s1,k))) ; assume A17: k + 1 < LifeSpan (P1,s1) ; ::_thesis: ( (IC (Comput (P1,s1,(k + 1)))) + n = IC (Comput (P2,s2,(k + 1))) & CurInstr (P1,(Comput (P1,s1,(k + 1)))) = CurInstr (P2,(Comput (P2,s2,(k + 1)))) & DataPart (Comput (P1,s1,(k + 1))) = DataPart (Comput (P2,s2,(k + 1))) ) then A19: l + n in dom (Shift (I,n)) by A1, A2, A3, Th33, VALUED_1:24; A21: Comput (P2,s2,(k + 1)) = Following (P2,(Comput (P2,s2,k))) by EXTPRO_1:3 .= Exec ((CurInstr (P2,(Comput (P2,s2,k)))),(Comput (P2,s2,k))) ; XX: P1 +* (stop I) = P1 by A1, FUNCT_4:98; then A22: IC (Comput (P1,s1,k)) in dom (stop I) by A2, A11, SCMPDS_6:def_2; A24: CurInstr (P1,(Comput (P1,s1,k))) = P1 . (IC (Comput (P1,s1,k))) by PBOOLE:143 .= (stop I) . (IC (Comput (P1,s1,k))) by A1, A22, GRFUNC_1:2 ; then A25: InsCode (CurInstr (P1,(Comput (P1,s1,k)))) <> 3 by A22, SCMPDS_4:def_9; A26: IC (Comput (P1,s1,(k + 1))) in dom (stop I) by A2, A11, XX, SCMPDS_6:def_2; A27: CurInstr (P1,(Comput (P1,s1,k))) valid_at m by A22, A24, SCMPDS_4:def_9; A28: InsCode (CurInstr (P1,(Comput (P1,s1,k)))) <> 1 by A22, A24, SCMPDS_4:def_9; hence A29: (IC (Comput (P1,s1,(k + 1)))) + n = IC (Comput (P2,s2,(k + 1))) by A13, A17, A14, A16, A21, A25, A27, SCMPDS_4:28, XXREAL_0:2; ::_thesis: ( CurInstr (P1,(Comput (P1,s1,(k + 1)))) = CurInstr (P2,(Comput (P2,s2,(k + 1)))) & DataPart (Comput (P1,s1,(k + 1))) = DataPart (Comput (P2,s2,(k + 1))) ) CurInstr (P1,(Comput (P1,s1,(k + 1)))) = P1 . l by PBOOLE:143 .= (stop I) . l by A1, A26, GRFUNC_1:2 ; hence CurInstr (P1,(Comput (P1,s1,(k + 1)))) = (Shift ((stop I),n)) . (l + n) by A26, VALUED_1:def_12 .= (Shift (I,n)) . (IC (Comput (P2,s2,(k + 1)))) by A29, A17, A1, A2, A3, Th33, COMPOS_1:65 .= P2 . (IC (Comput (P2,s2,(k + 1)))) by A6, A29, A19, GRFUNC_1:2 .= CurInstr (P2,(Comput (P2,s2,(k + 1)))) by PBOOLE:143 ; ::_thesis: DataPart (Comput (P1,s1,(k + 1))) = DataPart (Comput (P2,s2,(k + 1))) thus DataPart (Comput (P1,s1,(k + 1))) = DataPart (Comput (P2,s2,(k + 1))) by A13, A17, A14, A16, A21, A28, A25, A27, SCMPDS_4:28, XXREAL_0:2; ::_thesis: verum end; hence S1[k + 1] ; ::_thesis: verum end; let i be Element of NAT ; ::_thesis: ( i < LifeSpan (P1,s1) implies ( (IC (Comput (P1,s1,i))) + n = IC (Comput (P2,s2,i)) & CurInstr (P1,(Comput (P1,s1,i))) = CurInstr (P2,(Comput (P2,s2,i))) & DataPart (Comput (P1,s1,i)) = DataPart (Comput (P2,s2,i)) ) ) A32: 0 in dom (stop I) by COMPOS_1:36; A33: 0 in dom I by A7, AFINSQ_1:66; A34: S1[ 0 ] proof assume 0 < LifeSpan (P1,s1) ; ::_thesis: ( (IC (Comput (P1,s1,0))) + n = IC (Comput (P2,s2,0)) & CurInstr (P1,(Comput (P1,s1,0))) = CurInstr (P2,(Comput (P2,s2,0))) & DataPart (Comput (P1,s1,0)) = DataPart (Comput (P2,s2,0)) ) A35: 0 + n in dom (Shift (I,n)) by A33, VALUED_1:24; A37: P1 . (IC s1) = P1 . 0 by MEMSTR_0:def_11 .= (stop I) . 0 by A1, A32, GRFUNC_1:2 ; IC (Comput (P1,s1,0)) = IC s1 .= 0 by MEMSTR_0:def_11 ; hence (IC (Comput (P1,s1,0))) + n = IC (Comput (P2,s2,0)) by A8; ::_thesis: ( CurInstr (P1,(Comput (P1,s1,0))) = CurInstr (P2,(Comput (P2,s2,0))) & DataPart (Comput (P1,s1,0)) = DataPart (Comput (P2,s2,0)) ) A40: P1 /. (IC s1) = P1 . (IC s1) by PBOOLE:143; A41: P2 /. (IC s2) = P2 . (IC s2) by PBOOLE:143; thus CurInstr (P1,(Comput (P1,s1,0))) = CurInstr (P1,s1) .= (Shift ((stop I),n)) . (0 + n) by A32, A37, A40, VALUED_1:def_12 .= (Shift (I,n)) . n by COMPOS_1:66 .= CurInstr (P2,s2) by A6, A8, A35, A41, GRFUNC_1:2 .= CurInstr (P2,(Comput (P2,s2,0))) ; ::_thesis: DataPart (Comput (P1,s1,0)) = DataPart (Comput (P2,s2,0)) thus DataPart (Comput (P1,s1,0)) = DataPart s2 by A9 .= DataPart (Comput (P2,s2,0)) ; ::_thesis: verum end; for k being Element of NAT holds S1[k] from NAT_1:sch_1(A34, A12); hence ( i < LifeSpan (P1,s1) implies ( (IC (Comput (P1,s1,i))) + n = IC (Comput (P2,s2,i)) & CurInstr (P1,(Comput (P1,s1,i))) = CurInstr (P2,(Comput (P2,s2,i))) & DataPart (Comput (P1,s1,i)) = DataPart (Comput (P2,s2,i)) ) ) ; ::_thesis: verum end; theorem Th35: :: SCMPDS_7:17 for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for I being halt-free Program of SCMPDS st stop I c= P & I is_halting_on s,P holds LifeSpan (P,s) > 0 proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for I being halt-free Program of SCMPDS st stop I c= P & I is_halting_on s,P holds LifeSpan (P,s) > 0 let s be 0 -started State of SCMPDS; ::_thesis: for I being halt-free Program of SCMPDS st stop I c= P & I is_halting_on s,P holds LifeSpan (P,s) > 0 let I be halt-free Program of SCMPDS; ::_thesis: ( stop I c= P & I is_halting_on s,P implies LifeSpan (P,s) > 0 ) set si = Initialize s; set Pi = P +* (stop I); A3: card I > 0 ; assume that A1: stop I c= P and A2: I is_halting_on s,P ; ::_thesis: LifeSpan (P,s) > 0 B1: Start-At (0,SCMPDS) c= s by MEMSTR_0:29; A4: P = P +* (stop I) by A1, FUNCT_4:98; A5: s = Initialize s by B1, FUNCT_4:98; assume LifeSpan (P,s) <= 0 ; ::_thesis: contradiction then A6: LifeSpan (P,s) = 0 ; A7: I c= stop I by AFINSQ_1:74; then A8: dom I c= dom (stop I) by RELAT_1:11; A9: 0 in dom I by A3, AFINSQ_1:66; A11: (P +* (stop I)) /. (IC (Initialize s)) = (P +* (stop I)) . (IC (Initialize s)) by PBOOLE:143; XX: stop I c= P +* (stop I) by FUNCT_4:25; P +* (stop I) halts_on Initialize s by A2, SCMPDS_6:def_3; then halt SCMPDS = CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),0))) by A5, A6, A4, EXTPRO_1:def_15 .= CurInstr ((P +* (stop I)),(Initialize s)) .= (P +* (stop I)) . 0 by A11, MEMSTR_0:def_11 .= (stop I) . 0 by A9, A8, XX, GRFUNC_1:2 .= I . 0 by A9, A7, GRFUNC_1:2 ; hence contradiction by A9, COMPOS_1:def_27; ::_thesis: verum end; theorem Th36: :: SCMPDS_7:18 for s2 being State of SCMPDS for P1, P2 being Instruction-Sequence of SCMPDS for s1 being 0 -started State of SCMPDS for I being halt-free shiftable Program of SCMPDS st stop I c= P1 & I is_closed_on s1,P1 & I is_halting_on s1,P1 holds for n being Element of NAT st Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 holds ( IC (Comput (P2,s2,(LifeSpan (P1,s1)))) = (card I) + n & DataPart (Comput (P1,s1,(LifeSpan (P1,s1)))) = DataPart (Comput (P2,s2,(LifeSpan (P1,s1)))) ) proof let s2 be State of SCMPDS; ::_thesis: for P1, P2 being Instruction-Sequence of SCMPDS for s1 being 0 -started State of SCMPDS for I being halt-free shiftable Program of SCMPDS st stop I c= P1 & I is_closed_on s1,P1 & I is_halting_on s1,P1 holds for n being Element of NAT st Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 holds ( IC (Comput (P2,s2,(LifeSpan (P1,s1)))) = (card I) + n & DataPart (Comput (P1,s1,(LifeSpan (P1,s1)))) = DataPart (Comput (P2,s2,(LifeSpan (P1,s1)))) ) let P1, P2 be Instruction-Sequence of SCMPDS; ::_thesis: for s1 being 0 -started State of SCMPDS for I being halt-free shiftable Program of SCMPDS st stop I c= P1 & I is_closed_on s1,P1 & I is_halting_on s1,P1 holds for n being Element of NAT st Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 holds ( IC (Comput (P2,s2,(LifeSpan (P1,s1)))) = (card I) + n & DataPart (Comput (P1,s1,(LifeSpan (P1,s1)))) = DataPart (Comput (P2,s2,(LifeSpan (P1,s1)))) ) let s1 be 0 -started State of SCMPDS; ::_thesis: for I being halt-free shiftable Program of SCMPDS st stop I c= P1 & I is_closed_on s1,P1 & I is_halting_on s1,P1 holds for n being Element of NAT st Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 holds ( IC (Comput (P2,s2,(LifeSpan (P1,s1)))) = (card I) + n & DataPart (Comput (P1,s1,(LifeSpan (P1,s1)))) = DataPart (Comput (P2,s2,(LifeSpan (P1,s1)))) ) let I be halt-free shiftable Program of SCMPDS; ::_thesis: ( stop I c= P1 & I is_closed_on s1,P1 & I is_halting_on s1,P1 implies for n being Element of NAT st Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 holds ( IC (Comput (P2,s2,(LifeSpan (P1,s1)))) = (card I) + n & DataPart (Comput (P1,s1,(LifeSpan (P1,s1)))) = DataPart (Comput (P2,s2,(LifeSpan (P1,s1)))) ) ) assume that A1: stop I c= P1 and A2: I is_closed_on s1,P1 and A3: I is_halting_on s1,P1 ; ::_thesis: for n being Element of NAT st Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 holds ( IC (Comput (P2,s2,(LifeSpan (P1,s1)))) = (card I) + n & DataPart (Comput (P1,s1,(LifeSpan (P1,s1)))) = DataPart (Comput (P2,s2,(LifeSpan (P1,s1)))) ) B1: Start-At (0,SCMPDS) c= s1 by MEMSTR_0:29; XX: P1 +* (stop I) = P1 by A1, FUNCT_4:98; let n be Element of NAT ; ::_thesis: ( Shift (I,n) c= P2 & IC s2 = n & DataPart s1 = DataPart s2 implies ( IC (Comput (P2,s2,(LifeSpan (P1,s1)))) = (card I) + n & DataPart (Comput (P1,s1,(LifeSpan (P1,s1)))) = DataPart (Comput (P2,s2,(LifeSpan (P1,s1)))) ) ) assume that A4: Shift (I,n) c= P2 and A6: IC s2 = n and A7: DataPart s1 = DataPart s2 ; ::_thesis: ( IC (Comput (P2,s2,(LifeSpan (P1,s1)))) = (card I) + n & DataPart (Comput (P1,s1,(LifeSpan (P1,s1)))) = DataPart (Comput (P2,s2,(LifeSpan (P1,s1)))) ) 1 + 0 <= LifeSpan (P1,s1) by A1, A3, Th35, INT_1:7; then consider i being Nat such that A8: 1 + i = LifeSpan (P1,s1) by NAT_1:10; A9: Initialize s1 = s1 by B1, FUNCT_4:98; reconsider i = i as Element of NAT by ORDINAL1:def_12; A10: i < LifeSpan (P1,s1) by A8, XREAL_1:29; then A11: (IC (Comput (P1,s1,i))) + n = IC (Comput (P2,s2,i)) by A1, A2, A3, A4, A6, A7, Th34; set L1 = IC (Comput (P1,s1,i)); A12: IC (Comput (P1,s1,i)) in dom I by A1, A2, A3, A8, Th33, XREAL_1:29; set i2 = CurInstr (P2,(Comput (P2,s2,i))); A14: Comput (P1,s1,(i + 1)) = Following (P1,(Comput (P1,s1,i))) by EXTPRO_1:3 .= Exec ((CurInstr (P2,(Comput (P2,s2,i)))),(Comput (P1,s1,i))) by A1, A2, A3, A4, A6, A7, A10, Th34 ; A15: I c= stop I by AFINSQ_1:74; then A16: dom I c= dom (stop I) by RELAT_1:11; A18: Comput (P2,s2,(i + 1)) = Following (P2,(Comput (P2,s2,i))) by EXTPRO_1:3 .= Exec ((CurInstr (P2,(Comput (P2,s2,i)))),(Comput (P2,s2,i))) ; reconsider m = IC (Comput (P1,s1,i)) as Element of NAT ; CurInstr (P2,(Comput (P2,s2,i))) = CurInstr (P1,(Comput (P1,s1,i))) by A1, A2, A3, A4, A6, A7, A10, Th34; then A20: CurInstr (P2,(Comput (P2,s2,i))) = P1 . (IC (Comput (P1,s1,i))) by PBOOLE:143 .= (stop I) . (IC (Comput (P1,s1,i))) by A1, A12, A16, GRFUNC_1:2 .= I . (IC (Comput (P1,s1,i))) by A12, A15, GRFUNC_1:2 ; then A21: InsCode (CurInstr (P2,(Comput (P2,s2,i)))) <> 1 by A12, SCMPDS_4:def_9; A22: DataPart (Comput (P1,s1,i)) = DataPart (Comput (P2,s2,i)) by A1, A2, A3, A4, A6, A7, A10, Th34; A23: CurInstr (P2,(Comput (P2,s2,i))) valid_at m by A12, A20, SCMPDS_4:def_9; A24: InsCode (CurInstr (P2,(Comput (P2,s2,i)))) <> 3 by A12, A20, SCMPDS_4:def_9; IC (Comput (P1,s1,(i + 1))) = card I by A2, A3, A8, XX, A9, SCMPDS_6:29; hence IC (Comput (P2,s2,(LifeSpan (P1,s1)))) = (card I) + n by A8, A11, A21, A24, A23, A14, A22, A18, SCMPDS_4:28; ::_thesis: DataPart (Comput (P1,s1,(LifeSpan (P1,s1)))) = DataPart (Comput (P2,s2,(LifeSpan (P1,s1)))) thus DataPart (Comput (P1,s1,(LifeSpan (P1,s1)))) = DataPart (Comput (P2,s2,(LifeSpan (P1,s1)))) by A8, A11, A21, A24, A23, A14, A22, A18, SCMPDS_4:28; ::_thesis: verum end; theorem Th38: :: SCMPDS_7:19 for s being State of SCMPDS for P being Instruction-Sequence of SCMPDS for I, J being Program of SCMPDS for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k <= LifeSpan ((P +* (stop I)),(Initialize s)) holds Comput ((P +* (stop I)),(Initialize s),k) = Comput ((P +* (I ';' J)),(Initialize s),k) proof let s be State of SCMPDS; ::_thesis: for P being Instruction-Sequence of SCMPDS for I, J being Program of SCMPDS for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k <= LifeSpan ((P +* (stop I)),(Initialize s)) holds Comput ((P +* (stop I)),(Initialize s),k) = Comput ((P +* (I ';' J)),(Initialize s),k) let P be Instruction-Sequence of SCMPDS; ::_thesis: for I, J being Program of SCMPDS for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k <= LifeSpan ((P +* (stop I)),(Initialize s)) holds Comput ((P +* (stop I)),(Initialize s),k) = Comput ((P +* (I ';' J)),(Initialize s),k) let I, J be Program of SCMPDS; ::_thesis: for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k <= LifeSpan ((P +* (stop I)),(Initialize s)) holds Comput ((P +* (stop I)),(Initialize s),k) = Comput ((P +* (I ';' J)),(Initialize s),k) let k be Element of NAT ; ::_thesis: ( I is_closed_on s,P & I is_halting_on s,P & k <= LifeSpan ((P +* (stop I)),(Initialize s)) implies Comput ((P +* (stop I)),(Initialize s),k) = Comput ((P +* (I ';' J)),(Initialize s),k) ) set spI = stop I; set s1 = Initialize s; set P1 = P +* (stop I); set s2 = Initialize s; set P2 = P +* (I ';' J); set n = LifeSpan ((P +* (stop I)),(Initialize s)); assume that A1: I is_closed_on s,P and A2: I is_halting_on s,P ; ::_thesis: ( not k <= LifeSpan ((P +* (stop I)),(Initialize s)) or Comput ((P +* (stop I)),(Initialize s),k) = Comput ((P +* (I ';' J)),(Initialize s),k) ) assume A3: k <= LifeSpan ((P +* (stop I)),(Initialize s)) ; ::_thesis: Comput ((P +* (stop I)),(Initialize s),k) = Comput ((P +* (I ';' J)),(Initialize s),k) defpred S1[ Element of NAT ] means ( $1 <= LifeSpan ((P +* (stop I)),(Initialize s)) implies Comput ((P +* (stop I)),(Initialize s),$1) = Comput ((P +* (I ';' J)),(Initialize s),$1) ); A4: for m being Element of NAT st S1[m] holds S1[m + 1] proof let m be Element of NAT ; ::_thesis: ( S1[m] implies S1[m + 1] ) assume A5: ( m <= LifeSpan ((P +* (stop I)),(Initialize s)) implies Comput ((P +* (stop I)),(Initialize s),m) = Comput ((P +* (I ';' J)),(Initialize s),m) ) ; ::_thesis: S1[m + 1] A7: Comput ((P +* (stop I)),(Initialize s),(m + 1)) = Following ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),m))) by EXTPRO_1:3 .= Exec ((CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),m)))),(Comput ((P +* (stop I)),(Initialize s),m))) ; A8: IC (Comput ((P +* (stop I)),(Initialize s),m)) in dom (stop I) by A1, SCMPDS_6:def_2; A10: Comput ((P +* (I ';' J)),(Initialize s),(m + 1)) = Following ((P +* (I ';' J)),(Comput ((P +* (I ';' J)),(Initialize s),m))) by EXTPRO_1:3 .= Exec ((CurInstr ((P +* (I ';' J)),(Comput ((P +* (I ';' J)),(Initialize s),m)))),(Comput ((P +* (I ';' J)),(Initialize s),m))) ; assume A11: m + 1 <= LifeSpan ((P +* (stop I)),(Initialize s)) ; ::_thesis: Comput ((P +* (stop I)),(Initialize s),(m + 1)) = Comput ((P +* (I ';' J)),(Initialize s),(m + 1)) then m < LifeSpan ((P +* (stop I)),(Initialize s)) by NAT_1:13; then A12: IC (Comput ((P +* (stop I)),(Initialize s),m)) in dom I by A1, A2, SCMPDS_6:26; then A13: IC (Comput ((P +* (stop I)),(Initialize s),m)) in dom (I ';' J) by FUNCT_4:12; CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),m))) = (P +* (stop I)) . (IC (Comput ((P +* (stop I)),(Initialize s),m))) by PBOOLE:143 .= (stop I) . (IC (Comput ((P +* (stop I)),(Initialize s),m))) by A8, FUNCT_4:13 .= I . (IC (Comput ((P +* (stop I)),(Initialize s),m))) by A12, AFINSQ_1:def_3 .= (I ';' J) . (IC (Comput ((P +* (stop I)),(Initialize s),m))) by A12, AFINSQ_1:def_3 .= (P +* (I ';' J)) . (IC (Comput ((P +* (stop I)),(Initialize s),m))) by A13, FUNCT_4:13 .= CurInstr ((P +* (I ';' J)),(Comput ((P +* (I ';' J)),(Initialize s),m))) by A5, A11, NAT_1:13, PBOOLE:143 ; hence Comput ((P +* (stop I)),(Initialize s),(m + 1)) = Comput ((P +* (I ';' J)),(Initialize s),(m + 1)) by A5, A11, A10, A7, NAT_1:13; ::_thesis: verum end; A19: S1[ 0 ] ; for k being Element of NAT holds S1[k] from NAT_1:sch_1(A19, A4); hence Comput ((P +* (stop I)),(Initialize s),k) = Comput ((P +* (I ';' J)),(Initialize s),k) by A3; ::_thesis: verum end; theorem Th39: :: SCMPDS_7:20 for s being State of SCMPDS for P being Instruction-Sequence of SCMPDS for I, J being Program of SCMPDS for k being Element of NAT st I c= J & I is_closed_on s,P & I is_halting_on s,P & k <= LifeSpan ((P +* (stop I)),(Initialize s)) holds Comput ((P +* J),(Initialize s),k) = Comput ((P +* (stop I)),(Initialize s),k) proof let s be State of SCMPDS; ::_thesis: for P being Instruction-Sequence of SCMPDS for I, J being Program of SCMPDS for k being Element of NAT st I c= J & I is_closed_on s,P & I is_halting_on s,P & k <= LifeSpan ((P +* (stop I)),(Initialize s)) holds Comput ((P +* J),(Initialize s),k) = Comput ((P +* (stop I)),(Initialize s),k) let P be Instruction-Sequence of SCMPDS; ::_thesis: for I, J being Program of SCMPDS for k being Element of NAT st I c= J & I is_closed_on s,P & I is_halting_on s,P & k <= LifeSpan ((P +* (stop I)),(Initialize s)) holds Comput ((P +* J),(Initialize s),k) = Comput ((P +* (stop I)),(Initialize s),k) let I, J be Program of SCMPDS; ::_thesis: for k being Element of NAT st I c= J & I is_closed_on s,P & I is_halting_on s,P & k <= LifeSpan ((P +* (stop I)),(Initialize s)) holds Comput ((P +* J),(Initialize s),k) = Comput ((P +* (stop I)),(Initialize s),k) let k be Element of NAT ; ::_thesis: ( I c= J & I is_closed_on s,P & I is_halting_on s,P & k <= LifeSpan ((P +* (stop I)),(Initialize s)) implies Comput ((P +* J),(Initialize s),k) = Comput ((P +* (stop I)),(Initialize s),k) ) set m = LifeSpan ((P +* (stop I)),(Initialize s)); assume that A1: I c= J and A2: I is_closed_on s,P and A3: I is_halting_on s,P and A4: k <= LifeSpan ((P +* (stop I)),(Initialize s)) ; ::_thesis: Comput ((P +* J),(Initialize s),k) = Comput ((P +* (stop I)),(Initialize s),k) set s1 = Initialize s; set s2 = Initialize s; set P1 = P +* J; set P2 = P +* (stop I); defpred S1[ Element of NAT ] means ( $1 <= LifeSpan ((P +* (stop I)),(Initialize s)) implies Comput ((P +* J),(Initialize s),$1) = Comput ((P +* (stop I)),(Initialize s),$1) ); 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_<=_LifeSpan_((P_+*_(stop_I)),(Initialize_s))_implies_Comput_((P_+*_J),(Initialize_s),(k_+_1))_=_Comput_((P_+*_(stop_I)),(Initialize_s),(k_+_1))_) A11: Comput ((P +* (stop I)),(Initialize s),(k + 1)) = Following ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),k))) by EXTPRO_1:3 .= Exec ((CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),k)))),(Comput ((P +* (stop I)),(Initialize s),k))) ; A13: Comput ((P +* J),(Initialize s),(k + 1)) = Following ((P +* J),(Comput ((P +* J),(Initialize s),k))) by EXTPRO_1:3 .= Exec ((CurInstr ((P +* J),(Comput ((P +* J),(Initialize s),k)))),(Comput ((P +* J),(Initialize s),k))) ; A14: k < k + 1 by XREAL_1:29; assume A15: k + 1 <= LifeSpan ((P +* (stop I)),(Initialize s)) ; ::_thesis: Comput ((P +* J),(Initialize s),(k + 1)) = Comput ((P +* (stop I)),(Initialize s),(k + 1)) then k < LifeSpan ((P +* (stop I)),(Initialize s)) by A14, XXREAL_0:2; then A16: IC (Comput ((P +* (stop I)),(Initialize s),k)) in dom I by A2, A3, SCMPDS_6:26; then A17: IC (Comput ((P +* (stop I)),(Initialize s),k)) in dom (stop I) by FUNCT_4:12; X1: J c= P +* J by FUNCT_4:25; X2: dom I c= dom J by A1, RELAT_1:11; CurInstr ((P +* J),(Comput ((P +* J),(Initialize s),k))) = (P +* J) . (IC (Comput ((P +* (stop I)),(Initialize s),k))) by A9, A15, A14, PBOOLE:143, XXREAL_0:2 .= J . (IC (Comput ((P +* (stop I)),(Initialize s),k))) by X1, X2, A16, GRFUNC_1:2 .= I . (IC (Comput ((P +* (stop I)),(Initialize s),k))) by A1, A16, GRFUNC_1:2 .= (stop I) . (IC (Comput ((P +* (stop I)),(Initialize s),k))) by A16, AFINSQ_1:def_3 .= (P +* (stop I)) . (IC (Comput ((P +* (stop I)),(Initialize s),k))) by A17, FUNCT_4:13 .= CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),k))) by PBOOLE:143 ; hence Comput ((P +* J),(Initialize s),(k + 1)) = Comput ((P +* (stop I)),(Initialize s),(k + 1)) by A9, A15, A14, A13, A11, XXREAL_0:2; ::_thesis: verum end; hence S1[k + 1] ; ::_thesis: verum end; A20: S1[ 0 ] ; for k being Element of NAT holds S1[k] from NAT_1:sch_1(A20, A8); hence Comput ((P +* J),(Initialize s),k) = Comput ((P +* (stop I)),(Initialize s),k) by A4; ::_thesis: verum end; theorem Th40: :: SCMPDS_7:21 for s being State of SCMPDS for P being Instruction-Sequence of SCMPDS for I, J being Program of SCMPDS for k being Element of NAT st k <= LifeSpan ((P +* (stop I)),(Initialize s)) & I c= J & I is_closed_on s,P & I is_halting_on s,P holds IC (Comput ((P +* J),(Initialize s),k)) in dom (stop I) proof let s be State of SCMPDS; ::_thesis: for P being Instruction-Sequence of SCMPDS for I, J being Program of SCMPDS for k being Element of NAT st k <= LifeSpan ((P +* (stop I)),(Initialize s)) & I c= J & I is_closed_on s,P & I is_halting_on s,P holds IC (Comput ((P +* J),(Initialize s),k)) in dom (stop I) let P be Instruction-Sequence of SCMPDS; ::_thesis: for I, J being Program of SCMPDS for k being Element of NAT st k <= LifeSpan ((P +* (stop I)),(Initialize s)) & I c= J & I is_closed_on s,P & I is_halting_on s,P holds IC (Comput ((P +* J),(Initialize s),k)) in dom (stop I) let I, J be Program of SCMPDS; ::_thesis: for k being Element of NAT st k <= LifeSpan ((P +* (stop I)),(Initialize s)) & I c= J & I is_closed_on s,P & I is_halting_on s,P holds IC (Comput ((P +* J),(Initialize s),k)) in dom (stop I) let k be Element of NAT ; ::_thesis: ( k <= LifeSpan ((P +* (stop I)),(Initialize s)) & I c= J & I is_closed_on s,P & I is_halting_on s,P implies IC (Comput ((P +* J),(Initialize s),k)) in dom (stop I) ) set ss = Initialize s; set PP = P +* (stop I); set s1 = Comput ((P +* J),(Initialize s),k); set s2 = Comput ((P +* (stop I)),(Initialize s),k); assume that A1: k <= LifeSpan ((P +* (stop I)),(Initialize s)) and A2: I c= J and A3: I is_closed_on s,P and A4: I is_halting_on s,P ; ::_thesis: IC (Comput ((P +* J),(Initialize s),k)) in dom (stop I) Comput ((P +* J),(Initialize s),k) = Comput ((P +* (stop I)),(Initialize s),k) by A1, A2, A3, A4, Th39; hence IC (Comput ((P +* J),(Initialize s),k)) in dom (stop I) by A3, SCMPDS_6:def_2; ::_thesis: verum end; theorem Th41: :: SCMPDS_7:22 for s being State of SCMPDS for P being Instruction-Sequence of SCMPDS for I, J being Program of SCMPDS st I c= J & I is_closed_on s,P & I is_halting_on s,P & not CurInstr ((P +* J),(Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) = halt SCMPDS holds IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I proof let s be State of SCMPDS; ::_thesis: for P being Instruction-Sequence of SCMPDS for I, J being Program of SCMPDS st I c= J & I is_closed_on s,P & I is_halting_on s,P & not CurInstr ((P +* J),(Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) = halt SCMPDS holds IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I let P be Instruction-Sequence of SCMPDS; ::_thesis: for I, J being Program of SCMPDS st I c= J & I is_closed_on s,P & I is_halting_on s,P & not CurInstr ((P +* J),(Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) = halt SCMPDS holds IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I let I, J be Program of SCMPDS; ::_thesis: ( I c= J & I is_closed_on s,P & I is_halting_on s,P & not CurInstr ((P +* J),(Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) = halt SCMPDS implies IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I ) set ss = Initialize s; set PP = P +* (stop I); set m = LifeSpan ((P +* (stop I)),(Initialize s)); set s0 = Initialize s; set P0 = P +* J; set s1 = Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))); set s2 = Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))); set P1 = P +* J; set P2 = P +* (stop I); set Ik = IC (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))); assume that A2: I c= J and A3: I is_closed_on s,P and A4: I is_halting_on s,P ; ::_thesis: ( CurInstr ((P +* J),(Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) = halt SCMPDS or IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I ) A5: dom I c= dom J by A2, GRFUNC_1:2; reconsider n = IC (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) as Element of NAT ; A7: stop I c= P +* (stop I) by FUNCT_4:25; A8: P +* (stop I) halts_on Initialize s by A4, SCMPDS_6:def_3; A9: IC (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) in dom (stop I) by A3, SCMPDS_6:def_2; card (stop I) = (card I) + 1 by COMPOS_1:55; then n < (card I) + 1 by A9, AFINSQ_1:66; then A10: n <= card I by INT_1:7; A11: IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = IC (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) by A2, A3, A4, Th39; now__::_thesis:_(_(_n_<_card_I_&_halt_SCMPDS_=_CurInstr_((P_+*_J),(Comput_((P_+*_J),(Initialize_s),(LifeSpan_((P_+*_(stop_I)),(Initialize_s))))))_)_or_(_n_=_card_I_&_IC_(Comput_((P_+*_J),(Initialize_s),(LifeSpan_((P_+*_(stop_I)),(Initialize_s)))))_=_card_I_)_) percases ( n < card I or n = card I ) by A10, XXREAL_0:1; case n < card I ; ::_thesis: halt SCMPDS = CurInstr ((P +* J),(Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) then A12: n in dom I by AFINSQ_1:66; thus halt SCMPDS = CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) by A8, EXTPRO_1:def_15 .= (P +* (stop I)) . (IC (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) by PBOOLE:143 .= (stop I) . (IC (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) by A9, A7, GRFUNC_1:2 .= I . (IC (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) by A12, AFINSQ_1:def_3 .= J . (IC (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) by A2, A12, GRFUNC_1:2 .= (P +* J) . (IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) by A5, A11, A12, FUNCT_4:13 .= CurInstr ((P +* J),(Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) by PBOOLE:143 ; ::_thesis: verum end; case n = card I ; ::_thesis: IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I hence IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I by A2, A3, A4, Th39; ::_thesis: verum end; end; end; hence ( CurInstr ((P +* J),(Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) = halt SCMPDS or IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I ) ; ::_thesis: verum end; theorem Th42: :: SCMPDS_7:23 for s being State of SCMPDS for P being Instruction-Sequence of SCMPDS for I, J being Program of SCMPDS st I is_halting_on s,P & J is_closed_on IExec (I,P,(Initialize s)),P & J is_halting_on IExec (I,P,(Initialize s)),P holds ( J is_closed_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) & J is_halting_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) ) proof let s be State of SCMPDS; ::_thesis: for P being Instruction-Sequence of SCMPDS for I, J being Program of SCMPDS st I is_halting_on s,P & J is_closed_on IExec (I,P,(Initialize s)),P & J is_halting_on IExec (I,P,(Initialize s)),P holds ( J is_closed_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) & J is_halting_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) ) let P be Instruction-Sequence of SCMPDS; ::_thesis: for I, J being Program of SCMPDS st I is_halting_on s,P & J is_closed_on IExec (I,P,(Initialize s)),P & J is_halting_on IExec (I,P,(Initialize s)),P holds ( J is_closed_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) & J is_halting_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) ) let I, J be Program of SCMPDS; ::_thesis: ( I is_halting_on s,P & J is_closed_on IExec (I,P,(Initialize s)),P & J is_halting_on IExec (I,P,(Initialize s)),P implies ( J is_closed_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) & J is_halting_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) ) ) set s1 = Initialize s; set P1 = P +* (stop I); set sm = Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))); set sE = IExec (I,P,(Initialize s)); assume that A1: I is_halting_on s,P and A2: J is_closed_on IExec (I,P,(Initialize s)),P and A3: J is_halting_on IExec (I,P,(Initialize s)),P ; ::_thesis: ( J is_closed_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) & J is_halting_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) ) A4: P +* (stop I) halts_on Initialize s by A1, SCMPDS_6:def_3; DataPart (IExec (I,P,(Initialize s))) = DataPart (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) by A4, EXTPRO_1:23; hence ( J is_closed_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) & J is_halting_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) ) by A2, A3, SCMPDS_6:23; ::_thesis: verum end; theorem Th43: :: SCMPDS_7:24 for s being State of SCMPDS for P being Instruction-Sequence of SCMPDS for I being Program of SCMPDS for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,(Initialize s)),P & J is_halting_on IExec (I,P,(Initialize s)),P holds ( I ';' J is_closed_on s,P & I ';' J is_halting_on s,P ) proof let s be State of SCMPDS; ::_thesis: for P being Instruction-Sequence of SCMPDS for I being Program of SCMPDS for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,(Initialize s)),P & J is_halting_on IExec (I,P,(Initialize s)),P holds ( I ';' J is_closed_on s,P & I ';' J is_halting_on s,P ) let P be Instruction-Sequence of SCMPDS; ::_thesis: for I being Program of SCMPDS for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,(Initialize s)),P & J is_halting_on IExec (I,P,(Initialize s)),P holds ( I ';' J is_closed_on s,P & I ';' J is_halting_on s,P ) let I be Program of SCMPDS; ::_thesis: for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,(Initialize s)),P & J is_halting_on IExec (I,P,(Initialize s)),P holds ( I ';' J is_closed_on s,P & I ';' J is_halting_on s,P ) let J be shiftable Program of SCMPDS; ::_thesis: ( I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,(Initialize s)),P & J is_halting_on IExec (I,P,(Initialize s)),P implies ( I ';' J is_closed_on s,P & I ';' J is_halting_on s,P ) ) set sE = IExec (I,P,(Initialize s)); assume that A1: I is_closed_on s,P and A2: I is_halting_on s,P and A3: J is_closed_on IExec (I,P,(Initialize s)),P and A4: J is_halting_on IExec (I,P,(Initialize s)),P ; ::_thesis: ( I ';' J is_closed_on s,P & I ';' J is_halting_on s,P ) set IJ = I ';' J; set sIJ = stop (I ';' J); set spI = stop I; set ss = Initialize s; set PP = P +* (stop (I ';' J)); set spJ = stop J; set s1 = Initialize s; set P1 = P +* (stop I); set m1 = LifeSpan ((P +* (stop I)),(Initialize s)); set sm = Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))); set s3 = Initialize (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))); set P3 = (P +* (stop I)) +* (stop J); set m3 = LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))))); J is_halting_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) by A2, A3, A4, Th42; then A7: (P +* (stop I)) +* (stop J) halts_on Initialize (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) by SCMPDS_6:def_3; A8: J is_closed_on Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))),P +* (stop I) by A2, A3, A4, Th42; then A9: J is_closed_on Initialize (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))),(P +* (stop I)) +* (stop J) by SCMPDS_6:24; set s4 = Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))); set P4 = P +* (stop (I ';' J)); A16: stop J c= (P +* (stop I)) +* (stop J) by FUNCT_4:25; A17: DataPart (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = DataPart (Initialize (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) by MEMSTR_0:45; XX: I ';' (J ';' (Stop SCMPDS)) = stop (I ';' J) by AFINSQ_1:27; B18: Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))) = Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))) by A1, A2, Th38, XX; stop (I ';' J) = I ';' (J ';' (Stop SCMPDS)) by AFINSQ_1:27 .= I +* (Shift ((stop J),(card I))) ; then A19: Shift ((stop J),(card I)) c= stop (I ';' J) by FUNCT_4:25; stop (I ';' J) c= P +* (stop (I ';' J)) by FUNCT_4:25; then A20: Shift ((stop J),(card I)) c= P +* (stop (I ';' J)) by A19, XBOOLE_1:1; A21: dom (stop I) c= dom (stop (I ';' J)) by SCMPDS_5:13; now__::_thesis:_for_k_being_Element_of_NAT_holds_IC_(Comput_((P_+*_(stop_(I_';'_J))),(Initialize_s),k))_in_dom_(stop_(I_';'_J)) let k be Element of NAT ; ::_thesis: IC (Comput ((P +* (stop (I ';' J))),(Initialize s),b1)) in dom (stop (I ';' J)) percases ( k <= LifeSpan ((P +* (stop I)),(Initialize s)) or k > LifeSpan ((P +* (stop I)),(Initialize s)) ) ; suppose k <= LifeSpan ((P +* (stop I)),(Initialize s)) ; ::_thesis: IC (Comput ((P +* (stop (I ';' J))),(Initialize s),b1)) in dom (stop (I ';' J)) then IC (Comput ((P +* (stop (I ';' J))),(Initialize s),k)) in dom (stop I) by A1, A2, Th17, Th40; hence IC (Comput ((P +* (stop (I ';' J))),(Initialize s),k)) in dom (stop (I ';' J)) by A21; ::_thesis: verum end; supposeA23: k > LifeSpan ((P +* (stop I)),(Initialize s)) ; ::_thesis: IC (Comput ((P +* (stop (I ';' J))),(Initialize s),b1)) in dom (stop (I ';' J)) A24: IC (Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) in dom (stop I) by A1, A2, Th17, Th40; hereby ::_thesis: verum percases ( IC (Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I or CurInstr ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) = halt SCMPDS ) by A1, A2, Th17, Th41; supposeA25: IC (Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I ; ::_thesis: IC (Comput ((P +* (stop (I ';' J))),(Initialize s),k)) in dom (stop (I ';' J)) consider ii being Nat such that A26: k = (LifeSpan ((P +* (stop I)),(Initialize s))) + ii by A23, NAT_1:10; reconsider ii = ii as Element of NAT by ORDINAL1:def_12; reconsider nn = IC (Comput (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))),ii)) as Element of NAT ; (IC (Comput (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))),ii))) + (card I) = IC (Comput ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))),ii)) by A16, B18, A17, A9, A20, A25, SCMPDS_6:31; then A27: IC (Comput ((P +* (stop (I ';' J))),(Initialize s),k)) = nn + (card I) by A26, EXTPRO_1:4; nn in dom (stop J) by A8, SCMPDS_6:def_2; then nn < card (stop J) by AFINSQ_1:66; then nn < (card J) + 1 by COMPOS_1:55; then A28: (card I) + nn < (card I) + ((card J) + 1) by XREAL_1:6; card (stop (I ';' J)) = (card (I ';' J)) + 1 by COMPOS_1:55 .= ((card I) + (card J)) + 1 by AFINSQ_1:17 ; hence IC (Comput ((P +* (stop (I ';' J))),(Initialize s),k)) in dom (stop (I ';' J)) by A28, A27, AFINSQ_1:66; ::_thesis: verum end; suppose CurInstr ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) = halt SCMPDS ; ::_thesis: IC (Comput ((P +* (stop (I ';' J))),(Initialize s),k)) in dom (stop (I ';' J)) then IC (Comput ((P +* (stop (I ';' J))),(Initialize s),k)) = IC (Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) by A23, EXTPRO_1:5; hence IC (Comput ((P +* (stop (I ';' J))),(Initialize s),k)) in dom (stop (I ';' J)) by A21, A24; ::_thesis: verum end; end; end; end; end; end; hence I ';' J is_closed_on s,P by SCMPDS_6:def_2; ::_thesis: I ';' J is_halting_on s,P A32: Comput ((P +* (stop (I ';' J))),(Initialize s),((LifeSpan ((P +* (stop I)),(Initialize s))) + (LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))))))) = Comput ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))),(LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))))))) by EXTPRO_1:4; percases ( CurInstr ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) = halt SCMPDS or IC (Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I ) by A1, A2, Th17, Th41; suppose CurInstr ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))) = halt SCMPDS ; ::_thesis: I ';' J is_halting_on s,P then P +* (stop (I ';' J)) halts_on Initialize s by EXTPRO_1:29; hence I ';' J is_halting_on s,P by SCMPDS_6:def_3; ::_thesis: verum end; suppose IC (Comput ((P +* (stop (I ';' J))),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I ; ::_thesis: I ';' J is_halting_on s,P then CurInstr ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),(Initialize s),((LifeSpan ((P +* (stop I)),(Initialize s))) + (LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))))))))) = CurInstr (((P +* (stop I)) +* (stop J)),(Comput (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s)))))),(LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))))))))) by A32, A16, B18, A17, A9, A20, SCMPDS_6:31 .= halt SCMPDS by A7, EXTPRO_1:def_15 ; then P +* (stop (I ';' J)) halts_on Initialize s by EXTPRO_1:29; hence I ';' J is_halting_on s,P by SCMPDS_6:def_3; ::_thesis: verum end; end; end; theorem Th44: :: SCMPDS_7:25 for s being State of SCMPDS for P being Instruction-Sequence of SCMPDS for I being halt-free Program of SCMPDS for J being Program of SCMPDS st I c= J & I is_closed_on s,P & I is_halting_on s,P holds IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I proof let s be State of SCMPDS; ::_thesis: for P being Instruction-Sequence of SCMPDS for I being halt-free Program of SCMPDS for J being Program of SCMPDS st I c= J & I is_closed_on s,P & I is_halting_on s,P holds IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I let P be Instruction-Sequence of SCMPDS; ::_thesis: for I being halt-free Program of SCMPDS for J being Program of SCMPDS st I c= J & I is_closed_on s,P & I is_halting_on s,P holds IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I let I be halt-free Program of SCMPDS; ::_thesis: for J being Program of SCMPDS st I c= J & I is_closed_on s,P & I is_halting_on s,P holds IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I let J be Program of SCMPDS; ::_thesis: ( I c= J & I is_closed_on s,P & I is_halting_on s,P implies IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I ) set s1 = Initialize s; set P1 = P +* J; set ss = Initialize s; set PP = P +* (stop I); set m = LifeSpan ((P +* (stop I)),(Initialize s)); assume that A2: I c= J and A3: I is_closed_on s,P and A4: I is_halting_on s,P ; ::_thesis: IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = card I thus IC (Comput ((P +* J),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) = IC (Comput ((P +* (stop I)),(Initialize s),(LifeSpan ((P +* (stop I)),(Initialize s))))) by A2, A3, A4, Th39 .= card I by A3, A4, SCMPDS_6:29 ; ::_thesis: verum end; theorem :: SCMPDS_7:26 for P being Instruction-Sequence of SCMPDS for I being Program of SCMPDS for s being State of SCMPDS for k being Element of NAT st I is_halting_on s,P & k < LifeSpan ((P +* (stop I)),(Initialize s)) holds CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),k))) <> halt SCMPDS proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for I being Program of SCMPDS for s being State of SCMPDS for k being Element of NAT st I is_halting_on s,P & k < LifeSpan ((P +* (stop I)),(Initialize s)) holds CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),k))) <> halt SCMPDS let I be Program of SCMPDS; ::_thesis: for s being State of SCMPDS for k being Element of NAT st I is_halting_on s,P & k < LifeSpan ((P +* (stop I)),(Initialize s)) holds CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),k))) <> halt SCMPDS let s be State of SCMPDS; ::_thesis: for k being Element of NAT st I is_halting_on s,P & k < LifeSpan ((P +* (stop I)),(Initialize s)) holds CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),k))) <> halt SCMPDS let k be Element of NAT ; ::_thesis: ( I is_halting_on s,P & k < LifeSpan ((P +* (stop I)),(Initialize s)) implies CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),k))) <> halt SCMPDS ) set ss = Initialize s; set PP = P +* (stop I); set m = LifeSpan ((P +* (stop I)),(Initialize s)); assume that A1: I is_halting_on s,P and A2: k < LifeSpan ((P +* (stop I)),(Initialize s)) ; ::_thesis: CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),k))) <> halt SCMPDS assume A3: CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),(Initialize s),k))) = halt SCMPDS ; ::_thesis: contradiction P +* (stop I) halts_on Initialize s by A1, SCMPDS_6:def_3; hence contradiction by A2, A3, EXTPRO_1:def_15; ::_thesis: verum end; theorem Th46: :: SCMPDS_7:27 for P being Instruction-Sequence of SCMPDS for I, J being Program of SCMPDS for s being 0 -started State of SCMPDS for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* (stop I)),s) holds CurInstr ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),s,k))) <> halt SCMPDS proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for I, J being Program of SCMPDS for s being 0 -started State of SCMPDS for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* (stop I)),s) holds CurInstr ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),s,k))) <> halt SCMPDS let I, J be Program of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* (stop I)),s) holds CurInstr ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),s,k))) <> halt SCMPDS let s be 0 -started State of SCMPDS; ::_thesis: for k being Element of NAT st I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* (stop I)),s) holds CurInstr ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),s,k))) <> halt SCMPDS let k be Element of NAT ; ::_thesis: ( I is_closed_on s,P & I is_halting_on s,P & k < LifeSpan ((P +* (stop I)),s) implies CurInstr ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),s,k))) <> halt SCMPDS ) set P1 = P +* (stop I); set P2 = P +* (stop (I ';' J)); set m = LifeSpan ((P +* (stop I)),s); set s3 = Comput ((P +* (stop (I ';' J))),s,k); set P3 = P +* (stop (I ';' J)); assume that A1: I is_closed_on s,P and A2: I is_halting_on s,P and A3: k < LifeSpan ((P +* (stop I)),s) ; ::_thesis: CurInstr ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),s,k))) <> halt SCMPDS assume CurInstr ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),s,k))) = halt SCMPDS ; ::_thesis: contradiction then A5: CurInstr ((P +* (stop I)),(Comput ((P +* (stop I)),s,k))) = halt SCMPDS by A1, A2, A3, SCMPDS_6:27; Initialize s = s by MEMSTR_0:44; then P +* (stop I) halts_on s by A2, SCMPDS_6:def_3; hence contradiction by A3, A5, EXTPRO_1:def_15; ::_thesis: verum end; Lm1: for P, P2, P1 being Instruction-Sequence of SCMPDS for I being halt-free Program of SCMPDS for J being shiftable Program of SCMPDS for s being 0 -started State of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P & P2 = P +* (stop (I ';' J)) & P1 = P +* (stop I) holds ( IC (Comput (P2,s,(LifeSpan (P1,s)))) = card I & DataPart (Comput (P2,s,(LifeSpan (P1,s)))) = DataPart (Initialize (Comput (P1,s,(LifeSpan (P1,s))))) & Shift ((stop J),(card I)) c= P2 & LifeSpan (P2,s) = (LifeSpan (P1,s)) + (LifeSpan ((P1 +* (stop J)),(Initialize (Result (P1,s))))) ) proof let P, P2, P1 be Instruction-Sequence of SCMPDS; ::_thesis: for I being halt-free Program of SCMPDS for J being shiftable Program of SCMPDS for s being 0 -started State of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P & P2 = P +* (stop (I ';' J)) & P1 = P +* (stop I) holds ( IC (Comput (P2,s,(LifeSpan (P1,s)))) = card I & DataPart (Comput (P2,s,(LifeSpan (P1,s)))) = DataPart (Initialize (Comput (P1,s,(LifeSpan (P1,s))))) & Shift ((stop J),(card I)) c= P2 & LifeSpan (P2,s) = (LifeSpan (P1,s)) + (LifeSpan ((P1 +* (stop J)),(Initialize (Result (P1,s))))) ) let I be halt-free Program of SCMPDS; ::_thesis: for J being shiftable Program of SCMPDS for s being 0 -started State of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P & P2 = P +* (stop (I ';' J)) & P1 = P +* (stop I) holds ( IC (Comput (P2,s,(LifeSpan (P1,s)))) = card I & DataPart (Comput (P2,s,(LifeSpan (P1,s)))) = DataPart (Initialize (Comput (P1,s,(LifeSpan (P1,s))))) & Shift ((stop J),(card I)) c= P2 & LifeSpan (P2,s) = (LifeSpan (P1,s)) + (LifeSpan ((P1 +* (stop J)),(Initialize (Result (P1,s))))) ) let J be shiftable Program of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P & P2 = P +* (stop (I ';' J)) & P1 = P +* (stop I) holds ( IC (Comput (P2,s,(LifeSpan (P1,s)))) = card I & DataPart (Comput (P2,s,(LifeSpan (P1,s)))) = DataPart (Initialize (Comput (P1,s,(LifeSpan (P1,s))))) & Shift ((stop J),(card I)) c= P2 & LifeSpan (P2,s) = (LifeSpan (P1,s)) + (LifeSpan ((P1 +* (stop J)),(Initialize (Result (P1,s))))) ) let s be 0 -started State of SCMPDS; ::_thesis: ( I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P & P2 = P +* (stop (I ';' J)) & P1 = P +* (stop I) implies ( IC (Comput (P2,s,(LifeSpan (P1,s)))) = card I & DataPart (Comput (P2,s,(LifeSpan (P1,s)))) = DataPart (Initialize (Comput (P1,s,(LifeSpan (P1,s))))) & Shift ((stop J),(card I)) c= P2 & LifeSpan (P2,s) = (LifeSpan (P1,s)) + (LifeSpan ((P1 +* (stop J)),(Initialize (Result (P1,s))))) ) ) set spJ = stop J; set IJ = I ';' J; set sIJ = stop (I ';' J); set m1 = LifeSpan (P1,s); set sm = Comput (P1,s,(LifeSpan (P1,s))); set s3 = Initialize (Comput (P1,s,(LifeSpan (P1,s)))); set P3 = P1 +* (stop J); set m3 = LifeSpan ((P1 +* (stop J)),(Initialize (Comput (P1,s,(LifeSpan (P1,s)))))); set sE = IExec (I,P,s); assume that A2: I is_closed_on s,P and A3: I is_halting_on s,P and A4: J is_closed_on IExec (I,P,s),P and A5: J is_halting_on IExec (I,P,s),P and B6: P2 = P +* (stop (I ';' J)) and B7: P1 = P +* (stop I) ; ::_thesis: ( IC (Comput (P2,s,(LifeSpan (P1,s)))) = card I & DataPart (Comput (P2,s,(LifeSpan (P1,s)))) = DataPart (Initialize (Comput (P1,s,(LifeSpan (P1,s))))) & Shift ((stop J),(card I)) c= P2 & LifeSpan (P2,s) = (LifeSpan (P1,s)) + (LifeSpan ((P1 +* (stop J)),(Initialize (Result (P1,s))))) ) set s4 = Comput (P2,s,(LifeSpan (P1,s))); set P4 = P2; I: Initialize s = s by MEMSTR_0:44; hence A10: IC (Comput (P2,s,(LifeSpan (P1,s)))) = card I by A2, A3, Th17, Th44, B6, B7; ::_thesis: ( DataPart (Comput (P2,s,(LifeSpan (P1,s)))) = DataPart (Initialize (Comput (P1,s,(LifeSpan (P1,s))))) & Shift ((stop J),(card I)) c= P2 & LifeSpan (P2,s) = (LifeSpan (P1,s)) + (LifeSpan ((P1 +* (stop J)),(Initialize (Result (P1,s))))) ) A17: stop J c= P1 +* (stop J) by FUNCT_4:25; A18: DataPart (Comput (P1,s,(LifeSpan (P1,s)))) = DataPart (Initialize (Comput (P1,s,(LifeSpan (P1,s))))) by MEMSTR_0:45; I ';' (J ';' (Stop SCMPDS)) = stop (I ';' J) by AFINSQ_1:27; hence A19: DataPart (Comput (P2,s,(LifeSpan (P1,s)))) = DataPart (Initialize (Comput (P1,s,(LifeSpan (P1,s))))) by A18, A2, A3, Th38, B7, I, B6; ::_thesis: ( Shift ((stop J),(card I)) c= P2 & LifeSpan (P2,s) = (LifeSpan (P1,s)) + (LifeSpan ((P1 +* (stop J)),(Initialize (Result (P1,s))))) ) reconsider m = (LifeSpan (P1,s)) + (LifeSpan ((P1 +* (stop J)),(Initialize (Comput (P1,s,(LifeSpan (P1,s))))))) as Element of NAT ; stop (I ';' J) = I ';' (J ';' (Stop SCMPDS)) by AFINSQ_1:27 .= I +* (Shift ((stop J),(card I))) ; then A21: Shift ((stop J),(card I)) c= stop (I ';' J) by FUNCT_4:25; stop (I ';' J) c= P2 by B6, FUNCT_4:25; hence A22: Shift ((stop J),(card I)) c= P2 by A21, XBOOLE_1:1; ::_thesis: LifeSpan (P2,s) = (LifeSpan (P1,s)) + (LifeSpan ((P1 +* (stop J)),(Initialize (Result (P1,s))))) J is_halting_on Comput (P1,s,(LifeSpan (P1,s))),P1 by A3, A4, A5, Th42, B7, I; then A23: P1 +* (stop J) halts_on Initialize (Comput (P1,s,(LifeSpan (P1,s)))) by SCMPDS_6:def_3; A25: Comput (P2,s,((LifeSpan (P1,s)) + (LifeSpan ((P1 +* (stop J)),(Initialize (Comput (P1,s,(LifeSpan (P1,s))))))))) = Comput (P2,(Comput (P2,s,(LifeSpan (P1,s)))),(LifeSpan ((P1 +* (stop J)),(Initialize (Comput (P1,s,(LifeSpan (P1,s)))))))) by EXTPRO_1:4; J is_closed_on Comput (P1,s,(LifeSpan (P1,s))),P1 by A3, A4, A5, Th42, B7, I; then A28: J is_closed_on Initialize (Comput (P1,s,(LifeSpan (P1,s)))),P1 +* (stop J) by SCMPDS_6:24; then CurInstr ((P1 +* (stop J)),(Comput ((P1 +* (stop J)),(Initialize (Comput (P1,s,(LifeSpan (P1,s))))),(LifeSpan ((P1 +* (stop J)),(Initialize (Comput (P1,s,(LifeSpan (P1,s)))))))))) = CurInstr (P2,(Comput (P2,s,((LifeSpan (P1,s)) + (LifeSpan ((P1 +* (stop J)),(Initialize (Comput (P1,s,(LifeSpan (P1,s))))))))))) by A25, A17, A10, A19, A22, SCMPDS_6:31; then A29: CurInstr (P2,(Comput (P2,s,m))) = halt SCMPDS by A23, EXTPRO_1:def_15; A30: now__::_thesis:_for_k_being_Element_of_NAT_st_(LifeSpan_(P1,s))_+_k_<_m_holds_ not_CurInstr_(P2,(Comput_(P2,s,((LifeSpan_(P1,s))_+_k))))_=_halt_SCMPDS let k be Element of NAT ; ::_thesis: ( (LifeSpan (P1,s)) + k < m implies not CurInstr (P2,(Comput (P2,s,((LifeSpan (P1,s)) + k)))) = halt SCMPDS ) assume (LifeSpan (P1,s)) + k < m ; ::_thesis: not CurInstr (P2,(Comput (P2,s,((LifeSpan (P1,s)) + k)))) = halt SCMPDS then A31: k < LifeSpan ((P1 +* (stop J)),(Initialize (Comput (P1,s,(LifeSpan (P1,s)))))) by XREAL_1:6; assume A32: CurInstr (P2,(Comput (P2,s,((LifeSpan (P1,s)) + k)))) = halt SCMPDS ; ::_thesis: contradiction CurInstr ((P1 +* (stop J)),(Comput ((P1 +* (stop J)),(Initialize (Comput (P1,s,(LifeSpan (P1,s))))),k))) = CurInstr (P2,(Comput (P2,(Comput (P2,s,(LifeSpan (P1,s)))),k))) by A17, A28, A10, A19, A22, SCMPDS_6:31 .= halt SCMPDS by A32, EXTPRO_1:4 ; hence contradiction by A23, A31, EXTPRO_1:def_15; ::_thesis: verum end; now__::_thesis:_for_k_being_Element_of_NAT_st_k_<_m_holds_ CurInstr_(P2,(Comput_(P2,s,k)))_<>_halt_SCMPDS let k be Element of NAT ; ::_thesis: ( k < m implies CurInstr (P2,(Comput (P2,s,b1))) <> halt SCMPDS ) assume A37: k < m ; ::_thesis: CurInstr (P2,(Comput (P2,s,b1))) <> halt SCMPDS percases ( k < LifeSpan (P1,s) or LifeSpan (P1,s) <= k ) ; suppose k < LifeSpan (P1,s) ; ::_thesis: CurInstr (P2,(Comput (P2,s,b1))) <> halt SCMPDS hence CurInstr (P2,(Comput (P2,s,k))) <> halt SCMPDS by A2, A3, Th46, B6, B7; ::_thesis: verum end; suppose LifeSpan (P1,s) <= k ; ::_thesis: CurInstr (P2,(Comput (P2,s,b1))) <> halt SCMPDS then consider kk being Nat such that A39: (LifeSpan (P1,s)) + kk = k by NAT_1:10; reconsider kk = kk as Element of NAT by ORDINAL1:def_12; (LifeSpan (P1,s)) + kk = k by A39; hence CurInstr (P2,(Comput (P2,s,k))) <> halt SCMPDS by A30, A37; ::_thesis: verum end; end; end; then A40: for k being Element of NAT st CurInstr (P2,(Comput (P2,s,k))) = halt SCMPDS holds m <= k ; A41: P1 halts_on s by A3, B7, I, SCMPDS_6:def_3; A42: Result (P1,s) = Comput (P1,s,(LifeSpan (P1,s))) by A41, EXTPRO_1:23; I ';' J is_halting_on s,P by A2, A3, A4, A5, Th43, I; then P2 halts_on s by B6, I, SCMPDS_6:def_3; hence LifeSpan (P2,s) = (LifeSpan (P1,s)) + (LifeSpan ((P1 +* (stop J)),(Initialize (Result (P1,s))))) by A42, A29, A40, EXTPRO_1:def_15; ::_thesis: verum end; theorem :: SCMPDS_7:28 for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for I being halt-free Program of SCMPDS for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P holds LifeSpan ((P +* (stop (I ';' J))),s) = (LifeSpan ((P +* (stop I)),s)) + (LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Result ((P +* (stop I)),s))))) by Lm1; theorem Th48: :: SCMPDS_7:29 for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for I being halt-free Program of SCMPDS for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P holds IExec ((I ';' J),P,s) = IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I)) proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for I being halt-free Program of SCMPDS for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P holds IExec ((I ';' J),P,s) = IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I)) let s be 0 -started State of SCMPDS; ::_thesis: for I being halt-free Program of SCMPDS for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P holds IExec ((I ';' J),P,s) = IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I)) let I be halt-free Program of SCMPDS; ::_thesis: for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P holds IExec ((I ';' J),P,s) = IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I)) let J be shiftable Program of SCMPDS; ::_thesis: ( I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P implies IExec ((I ';' J),P,s) = IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I)) ) set IJ = I ';' J; set s1 = s; set P1 = P +* (stop I); set m1 = LifeSpan ((P +* (stop I)),s); set P2 = P +* (stop (I ';' J)); set s3 = Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))); set P3 = (P +* (stop I)) +* (stop J); set m3 = LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))))); set sE = IExec (I,P,s); assume that A2: I is_closed_on s,P and A3: I is_halting_on s,P and A4: J is_closed_on IExec (I,P,s),P and A5: J is_halting_on IExec (I,P,s),P ; ::_thesis: IExec ((I ';' J),P,s) = IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I)) I: Initialize s = s by MEMSTR_0:44; A6: DataPart (Comput ((P +* (stop (I ';' J))),s,(LifeSpan ((P +* (stop I)),s)))) = DataPart (Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s))))) by A2, A3, A4, A5, Lm1; J is_closed_on Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s))),P +* (stop I) by A3, A4, A5, Th42, I; then A7: J is_closed_on Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))),(P +* (stop I)) +* (stop J) by SCMPDS_6:24; A8: stop J c= (P +* (stop I)) +* (stop J) by FUNCT_4:25; A9: Shift ((stop J),(card I)) c= P +* (stop (I ';' J)) by A2, A3, A4, A5, Lm1; A10: IC (Comput ((P +* (stop (I ';' J))),s,(LifeSpan ((P +* (stop I)),s)))) = card I by A2, A3, A4, A5, Lm1; then A11: IC (Comput ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),s,(LifeSpan ((P +* (stop I)),s)))),(LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s))))))))) = (IC (Comput (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s))))),(LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))))))))) + (card I) by A8, A6, A9, A7, SCMPDS_6:31; A12: DataPart (Comput ((P +* (stop (I ';' J))),(Comput ((P +* (stop (I ';' J))),s,(LifeSpan ((P +* (stop I)),s)))),(LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s))))))))) = DataPart (Comput (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s))))),(LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s))))))))) by A8, A10, A6, A9, A7, SCMPDS_6:31; set R1 = Initialize (IExec (I,P,s)); set R2 = Initialize (Result ((P +* (stop I)),s)); B18: stop J c= P +* (stop J) by FUNCT_4:25; B19: stop J c= (P +* (stop I)) +* (stop J) by FUNCT_4:25; A22: P +* (stop I) halts_on s by A3, I, SCMPDS_6:def_3; then A23: Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))) = Initialize (Result ((P +* (stop I)),s)) by EXTPRO_1:23; A24: DataPart (IExec (I,P,s)) = DataPart (Initialize (IExec (I,P,s))) by MEMSTR_0:45; then A25: J is_closed_on Initialize (IExec (I,P,s)),P +* (stop J) by A4, A5, SCMPDS_6:23; A26: J is_halting_on Initialize (IExec (I,P,s)),P +* (stop J) by A4, A5, A24, SCMPDS_6:23; I ';' J is_halting_on s,P by A2, A3, A4, A5, Th43, I; then A30: P +* (stop (I ';' J)) halts_on s by I, SCMPDS_6:def_3; J is_halting_on Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s))),P +* (stop I) by A3, A4, A5, Th42, I; then A31: (P +* (stop I)) +* (stop J) halts_on Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))) by SCMPDS_6:def_3; TT: IExec (I,P,s) = Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s))) by A22, EXTPRO_1:23; Result ((P +* (stop J)),(Initialize (IExec (I,P,s)))) = Result (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))))) by B18, B19, A25, A26, Th28, TT; then A32: IExec (J,P,(Initialize (IExec (I,P,s)))) = Comput (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s))))),(LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))))))) by A31, EXTPRO_1:23; A35: IC (IExec ((I ';' J),P,s)) = IC (Comput ((P +* (stop (I ';' J))),s,(LifeSpan ((P +* (stop (I ';' J))),s)))) by A30, EXTPRO_1:23 .= IC (Comput ((P +* (stop (I ';' J))),s,((LifeSpan ((P +* (stop I)),s)) + (LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))))))))) by A2, A3, A4, A5, A23, Lm1 .= (IC (Comput (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s))))),(LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))))))))) + (card I) by A11, EXTPRO_1:4 .= (IC (Result (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))))))) + (card I) by A31, EXTPRO_1:23 .= (IC (Result (((P +* (stop I)) +* (stop J)),(Initialize (Result ((P +* (stop I)),s)))))) + (card I) by A22, EXTPRO_1:23 .= (IC (IExec (J,P,(Initialize (IExec (I,P,s)))))) + (card I) by B18, B19, A25, A26, Th28 ; IExec ((I ';' J),P,s) = Comput ((P +* (stop (I ';' J))),s,(LifeSpan ((P +* (stop (I ';' J))),s))) by A30, EXTPRO_1:23 .= Comput ((P +* (stop (I ';' J))),s,((LifeSpan ((P +* (stop I)),s)) + (LifeSpan (((P +* (stop I)) +* (stop J)),(Initialize (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s))))))))) by A2, A3, A4, A5, A23, Lm1 ; then A36: DataPart (IExec ((I ';' J),P,s)) = DataPart (IExec (J,P,(Initialize (IExec (I,P,s))))) by A32, A12, EXTPRO_1:4; hereby ::_thesis: verum reconsider l = (IC (IExec (J,P,(Initialize (IExec (I,P,s)))))) + (card I) as Element of NAT ; A37: dom (Start-At (l,SCMPDS)) = {(IC )} by FUNCOP_1:13; A38: now__::_thesis:_for_x_being_set_st_x_in_dom_(IExec_((I_';'_J),P,s))_holds_ (IExec_((I_';'_J),P,s))_._x_=_(IncIC_((IExec_(J,P,(Initialize_(IExec_(I,P,s))))),(card_I)))_._x let x be set ; ::_thesis: ( x in dom (IExec ((I ';' J),P,s)) implies (IExec ((I ';' J),P,s)) . b1 = (IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I))) . b1 ) assume A39: x in dom (IExec ((I ';' J),P,s)) ; ::_thesis: (IExec ((I ';' J),P,s)) . b1 = (IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I))) . b1 percases ( x is Int_position or x = IC ) by A39, SCMPDS_4:6; supposeA40: x is Int_position ; ::_thesis: (IExec ((I ';' J),P,s)) . b1 = (IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I))) . b1 then x <> IC by SCMPDS_2:43; then A41: not x in dom (Start-At (l,SCMPDS)) by A37, TARSKI:def_1; (IExec ((I ';' J),P,s)) . x = (IExec (J,P,(Initialize (IExec (I,P,s))))) . x by A36, A40, SCMPDS_4:8; hence (IExec ((I ';' J),P,s)) . x = (IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I))) . x by A41, FUNCT_4:11; ::_thesis: verum end; supposeA42: x = IC ; ::_thesis: (IExec ((I ';' J),P,s)) . b1 = (IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I))) . b1 then x in {(IC )} by TARSKI:def_1; then A43: x in dom (Start-At (l,SCMPDS)) by FUNCOP_1:13; thus (IExec ((I ';' J),P,s)) . x = (Start-At (l,SCMPDS)) . (IC ) by A35, A42, FUNCOP_1:72 .= (IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I))) . x by A42, A43, FUNCT_4:13 ; ::_thesis: verum end; end; end; dom (IExec ((I ';' J),P,s)) = the carrier of SCMPDS by PARTFUN1:def_2 .= dom (IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I))) by PARTFUN1:def_2 ; hence IExec ((I ';' J),P,s) = IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I)) by A38, FUNCT_1:2; ::_thesis: verum end; end; theorem Th49: :: SCMPDS_7:30 for a being Int_position for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for I being halt-free Program of SCMPDS for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P holds (IExec ((I ';' J),P,s)) . a = (IExec (J,P,(Initialize (IExec (I,P,s))))) . a proof let a be Int_position; ::_thesis: for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for I being halt-free Program of SCMPDS for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P holds (IExec ((I ';' J),P,s)) . a = (IExec (J,P,(Initialize (IExec (I,P,s))))) . a let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for I being halt-free Program of SCMPDS for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P holds (IExec ((I ';' J),P,s)) . a = (IExec (J,P,(Initialize (IExec (I,P,s))))) . a let s be 0 -started State of SCMPDS; ::_thesis: for I being halt-free Program of SCMPDS for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P holds (IExec ((I ';' J),P,s)) . a = (IExec (J,P,(Initialize (IExec (I,P,s))))) . a let I be halt-free Program of SCMPDS; ::_thesis: for J being shiftable Program of SCMPDS st I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P holds (IExec ((I ';' J),P,s)) . a = (IExec (J,P,(Initialize (IExec (I,P,s))))) . a let J be shiftable Program of SCMPDS; ::_thesis: ( I is_closed_on s,P & I is_halting_on s,P & J is_closed_on IExec (I,P,s),P & J is_halting_on IExec (I,P,s),P implies (IExec ((I ';' J),P,s)) . a = (IExec (J,P,(Initialize (IExec (I,P,s))))) . a ) assume that A1: I is_closed_on s,P and A2: I is_halting_on s,P and A3: J is_closed_on IExec (I,P,s),P and A4: J is_halting_on IExec (I,P,s),P ; ::_thesis: (IExec ((I ';' J),P,s)) . a = (IExec (J,P,(Initialize (IExec (I,P,s))))) . a A5: not a in dom (Start-At (((IC (IExec (J,P,(Initialize (IExec (I,P,s)))))) + (card I)),SCMPDS)) by SCMPDS_4:18; IExec ((I ';' J),P,s) = IncIC ((IExec (J,P,(Initialize (IExec (I,P,s))))),(card I)) by A1, A2, A3, A4, Th48; hence (IExec ((I ';' J),P,s)) . a = (IExec (J,P,(Initialize (IExec (I,P,s))))) . a by A5, FUNCT_4:11; ::_thesis: verum end; theorem Th50: :: SCMPDS_7:31 for a being Int_position for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for I being halt-free Program of SCMPDS for j being shiftable parahalting Instruction of SCMPDS st I is_closed_on s,P & I is_halting_on s,P holds (IExec ((I ';' j),P,s)) . a = (Exec (j,(IExec (I,P,s)))) . a proof let a be Int_position; ::_thesis: for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for I being halt-free Program of SCMPDS for j being shiftable parahalting Instruction of SCMPDS st I is_closed_on s,P & I is_halting_on s,P holds (IExec ((I ';' j),P,s)) . a = (Exec (j,(IExec (I,P,s)))) . a let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for I being halt-free Program of SCMPDS for j being shiftable parahalting Instruction of SCMPDS st I is_closed_on s,P & I is_halting_on s,P holds (IExec ((I ';' j),P,s)) . a = (Exec (j,(IExec (I,P,s)))) . a let s be 0 -started State of SCMPDS; ::_thesis: for I being halt-free Program of SCMPDS for j being shiftable parahalting Instruction of SCMPDS st I is_closed_on s,P & I is_halting_on s,P holds (IExec ((I ';' j),P,s)) . a = (Exec (j,(IExec (I,P,s)))) . a let I be halt-free Program of SCMPDS; ::_thesis: for j being shiftable parahalting Instruction of SCMPDS st I is_closed_on s,P & I is_halting_on s,P holds (IExec ((I ';' j),P,s)) . a = (Exec (j,(IExec (I,P,s)))) . a let j be shiftable parahalting Instruction of SCMPDS; ::_thesis: ( I is_closed_on s,P & I is_halting_on s,P implies (IExec ((I ';' j),P,s)) . a = (Exec (j,(IExec (I,P,s)))) . a ) assume that A1: I is_closed_on s,P and A2: I is_halting_on s,P ; ::_thesis: (IExec ((I ';' j),P,s)) . a = (Exec (j,(IExec (I,P,s)))) . a set Mj = Load j; A3: a in SCM-Data-Loc by AMI_2:def_16; for a being Int_position holds (Initialize (IExec (I,P,s))) . a = (IExec (I,P,s)) . a by SCMPDS_5:15; then A4: DataPart (Initialize (IExec (I,P,s))) = DataPart (IExec (I,P,s)) by SCMPDS_4:8; A5: Load j is_halting_on IExec (I,P,s),P by SCMPDS_6:21; Load j is_closed_on IExec (I,P,s),P by SCMPDS_6:20; hence (IExec ((I ';' j),P,s)) . a = (IExec ((Load j),P,(Initialize (IExec (I,P,s))))) . a by A1, A2, A5, Th49 .= (Exec (j,(Initialize (IExec (I,P,s))))) . a by SCMPDS_5:40 .= (DataPart (Exec (j,(Initialize (IExec (I,P,s)))))) . a by A3, FUNCT_1:49, SCMPDS_2:84 .= (DataPart (Exec (j,(IExec (I,P,s))))) . a by A4, SCMPDS_5:39 .= (Exec (j,(IExec (I,P,s)))) . a by A3, FUNCT_1:49, SCMPDS_2:84 ; ::_thesis: verum end; begin definition let a be Int_position; let i be Integer; let n be Element of NAT ; let I be Program of SCMPDS; func for-up (a,i,n,I) -> Program of SCMPDS equals :: SCMPDS_7:def 1 ((((a,i) >=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,n))) ';' (goto (- ((card I) + 2))); coherence ((((a,i) >=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,n))) ';' (goto (- ((card I) + 2))) is Program of SCMPDS ; end; :: deftheorem defines for-up SCMPDS_7:def_1_:_ for a being Int_position for i being Integer for n being Element of NAT for I being Program of SCMPDS holds for-up (a,i,n,I) = ((((a,i) >=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,n))) ';' (goto (- ((card I) + 2))); begin theorem Th51: :: SCMPDS_7:32 for a being Int_position for i being Integer for n being Element of NAT for I being Program of SCMPDS holds card (for-up (a,i,n,I)) = (card I) + 3 proof let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT for I being Program of SCMPDS holds card (for-up (a,i,n,I)) = (card I) + 3 let i be Integer; ::_thesis: for n being Element of NAT for I being Program of SCMPDS holds card (for-up (a,i,n,I)) = (card I) + 3 let n be Element of NAT ; ::_thesis: for I being Program of SCMPDS holds card (for-up (a,i,n,I)) = (card I) + 3 let I be Program of SCMPDS; ::_thesis: card (for-up (a,i,n,I)) = (card I) + 3 set i1 = (a,i) >=0_goto ((card I) + 3); set i2 = AddTo (a,i,n); set I4 = ((a,i) >=0_goto ((card I) + 3)) ';' I; set I5 = (((a,i) >=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,n)); card (((a,i) >=0_goto ((card I) + 3)) ';' I) = (card I) + 1 by SCMPDS_6:6; then card ((((a,i) >=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,n))) = ((card I) + 1) + 1 by SCMP_GCD:4 .= (card I) + (1 + 1) ; hence card (for-up (a,i,n,I)) = ((card I) + 2) + 1 by SCMP_GCD:4 .= (card I) + 3 ; ::_thesis: verum end; Lm2: for a being Int_position for i being Integer for n being Element of NAT for I being Program of SCMPDS holds card (stop (for-up (a,i,n,I))) = (card I) + 4 proof let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT for I being Program of SCMPDS holds card (stop (for-up (a,i,n,I))) = (card I) + 4 let i be Integer; ::_thesis: for n being Element of NAT for I being Program of SCMPDS holds card (stop (for-up (a,i,n,I))) = (card I) + 4 let n be Element of NAT ; ::_thesis: for I being Program of SCMPDS holds card (stop (for-up (a,i,n,I))) = (card I) + 4 let I be Program of SCMPDS; ::_thesis: card (stop (for-up (a,i,n,I))) = (card I) + 4 thus card (stop (for-up (a,i,n,I))) = (card (for-up (a,i,n,I))) + 1 by COMPOS_1:55 .= ((card I) + 3) + 1 by Th51 .= (card I) + 4 ; ::_thesis: verum end; theorem Th52: :: SCMPDS_7:33 for a being Int_position for i being Integer for n, m being Element of NAT for I being Program of SCMPDS holds ( m < (card I) + 3 iff m in dom (for-up (a,i,n,I)) ) proof let a be Int_position; ::_thesis: for i being Integer for n, m being Element of NAT for I being Program of SCMPDS holds ( m < (card I) + 3 iff m in dom (for-up (a,i,n,I)) ) let i be Integer; ::_thesis: for n, m being Element of NAT for I being Program of SCMPDS holds ( m < (card I) + 3 iff m in dom (for-up (a,i,n,I)) ) let n, m be Element of NAT ; ::_thesis: for I being Program of SCMPDS holds ( m < (card I) + 3 iff m in dom (for-up (a,i,n,I)) ) let I be Program of SCMPDS; ::_thesis: ( m < (card I) + 3 iff m in dom (for-up (a,i,n,I)) ) card (for-up (a,i,n,I)) = (card I) + 3 by Th51; hence ( m < (card I) + 3 iff m in dom (for-up (a,i,n,I)) ) by AFINSQ_1:66; ::_thesis: verum end; theorem Th53: :: SCMPDS_7:34 for a being Int_position for i being Integer for n being Element of NAT for I being Program of SCMPDS holds ( (for-up (a,i,n,I)) . 0 = (a,i) >=0_goto ((card I) + 3) & (for-up (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,n) & (for-up (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) ) proof let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT for I being Program of SCMPDS holds ( (for-up (a,i,n,I)) . 0 = (a,i) >=0_goto ((card I) + 3) & (for-up (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,n) & (for-up (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) ) let i be Integer; ::_thesis: for n being Element of NAT for I being Program of SCMPDS holds ( (for-up (a,i,n,I)) . 0 = (a,i) >=0_goto ((card I) + 3) & (for-up (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,n) & (for-up (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) ) let n be Element of NAT ; ::_thesis: for I being Program of SCMPDS holds ( (for-up (a,i,n,I)) . 0 = (a,i) >=0_goto ((card I) + 3) & (for-up (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,n) & (for-up (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) ) let I be Program of SCMPDS; ::_thesis: ( (for-up (a,i,n,I)) . 0 = (a,i) >=0_goto ((card I) + 3) & (for-up (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,n) & (for-up (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) ) set i1 = (a,i) >=0_goto ((card I) + 3); set i2 = AddTo (a,i,n); set i3 = goto (- ((card I) + 2)); set I4 = ((a,i) >=0_goto ((card I) + 3)) ';' I; set I5 = (((a,i) >=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,n)); set J6 = (AddTo (a,i,n)) ';' (goto (- ((card I) + 2))); set J5 = I ';' ((AddTo (a,i,n)) ';' (goto (- ((card I) + 2)))); set FLOOP = for-up (a,i,n,I); for-up (a,i,n,I) = (((a,i) >=0_goto ((card I) + 3)) ';' I) ';' ((AddTo (a,i,n)) ';' (goto (- ((card I) + 2)))) by SCMPDS_4:13; then for-up (a,i,n,I) = ((a,i) >=0_goto ((card I) + 3)) ';' (I ';' ((AddTo (a,i,n)) ';' (goto (- ((card I) + 2))))) by SCMPDS_4:14; hence (for-up (a,i,n,I)) . 0 = (a,i) >=0_goto ((card I) + 3) by SCMPDS_6:7; ::_thesis: ( (for-up (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,n) & (for-up (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) ) A1: card (((a,i) >=0_goto ((card I) + 3)) ';' I) = (card I) + 1 by SCMPDS_6:6; hence (for-up (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,n) by SCMP_GCD:7; ::_thesis: (for-up (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) card ((((a,i) >=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,n))) = ((card I) + 1) + 1 by A1, SCMP_GCD:4 .= (card I) + (1 + 1) ; hence (for-up (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) by SCMP_GCD:6; ::_thesis: verum end; theorem Th54: :: SCMPDS_7:35 for P being Instruction-Sequence of SCMPDS for s being State of SCMPDS for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being State of SCMPDS for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) let s be State of SCMPDS; ::_thesis: for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) let I be Program of SCMPDS; ::_thesis: for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) let i be Integer; ::_thesis: for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) let n be Element of NAT ; ::_thesis: ( s . (DataLoc ((s . a),i)) >= 0 implies ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) ) set d1 = DataLoc ((s . a),i); assume A1: s . (DataLoc ((s . a),i)) >= 0 ; ::_thesis: ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) set i1 = (a,i) >=0_goto ((card I) + 3); set i2 = AddTo (a,i,n); set i3 = goto (- ((card I) + 2)); set FOR = for-up (a,i,n,I); set pFOR = stop (for-up (a,i,n,I)); set s3 = Initialize s; set P3 = P +* (stop (for-up (a,i,n,I))); set s4 = Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),1); set P4 = P +* (stop (for-up (a,i,n,I))); A3: IC (Initialize s) = 0 by MEMSTR_0:def_11; A4: not DataLoc ((s . a),i) in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; not a in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; then A5: (Initialize s) . (DataLoc (((Initialize s) . a),i)) = (Initialize s) . (DataLoc ((s . a),i)) by FUNCT_4:11 .= s . (DataLoc ((s . a),i)) by A4, FUNCT_4:11 ; A6: for-up (a,i,n,I) = ((a,i) >=0_goto ((card I) + 3)) ';' ((I ';' (AddTo (a,i,n))) ';' (goto (- ((card I) + 2)))) by Th15; Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),(0 + 1)) = Following ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),0))) by EXTPRO_1:3 .= Following ((P +* (stop (for-up (a,i,n,I)))),(Initialize s)) .= Exec (((a,i) >=0_goto ((card I) + 3)),(Initialize s)) by A6, SCMPDS_6:11 ; then A7: IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),1)) = ICplusConst ((Initialize s),((card I) + 3)) by A1, A5, SCMPDS_2:57 .= 0 + ((card I) + 3) by A3, SCMPDS_6:12 ; A8: card (for-up (a,i,n,I)) = (card I) + 3 by Th51; then A9: (card I) + 3 in dom (stop (for-up (a,i,n,I))) by COMPOS_1:64; stop (for-up (a,i,n,I)) c= P +* (stop (for-up (a,i,n,I))) by FUNCT_4:25; then (P +* (stop (for-up (a,i,n,I)))) . ((card I) + 3) = (stop (for-up (a,i,n,I))) . ((card I) + 3) by A9, GRFUNC_1:2 .= halt SCMPDS by A8, COMPOS_1:64 ; then A11: CurInstr ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),1))) = halt SCMPDS by A7, PBOOLE:143; now__::_thesis:_for_k_being_Element_of_NAT_holds_IC_(Comput_((P_+*_(stop_(for-up_(a,i,n,I)))),(Initialize_s),k))_in_dom_(stop_(for-up_(a,i,n,I))) let k be Element of NAT ; ::_thesis: IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),b1)) in dom (stop (for-up (a,i,n,I))) percases ( 0 < k or k = 0 ) ; suppose 0 < k ; ::_thesis: IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),b1)) in dom (stop (for-up (a,i,n,I))) then 1 + 0 <= k by INT_1:7; hence IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),k)) in dom (stop (for-up (a,i,n,I))) by A9, A7, A11, EXTPRO_1:5; ::_thesis: verum end; suppose k = 0 ; ::_thesis: IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),b1)) in dom (stop (for-up (a,i,n,I))) then Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),k) = Initialize s by EXTPRO_1:2; hence IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),k)) in dom (stop (for-up (a,i,n,I))) by A3, COMPOS_1:36; ::_thesis: verum end; end; end; hence for-up (a,i,n,I) is_closed_on s,P by SCMPDS_6:def_2; ::_thesis: for-up (a,i,n,I) is_halting_on s,P P +* (stop (for-up (a,i,n,I))) halts_on Initialize s by A11, EXTPRO_1:29; hence for-up (a,i,n,I) is_halting_on s,P by SCMPDS_6:def_3; ::_thesis: verum end; theorem Th55: :: SCMPDS_7:36 for P being Instruction-Sequence of SCMPDS for s being State of SCMPDS for I being Program of SCMPDS for a, c being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds IExec ((for-up (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being State of SCMPDS for I being Program of SCMPDS for a, c being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds IExec ((for-up (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) let s be State of SCMPDS; ::_thesis: for I being Program of SCMPDS for a, c being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds IExec ((for-up (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) let I be Program of SCMPDS; ::_thesis: for a, c being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds IExec ((for-up (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) let a, c be Int_position; ::_thesis: for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds IExec ((for-up (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) let i be Integer; ::_thesis: for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds IExec ((for-up (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) let n be Element of NAT ; ::_thesis: ( s . (DataLoc ((s . a),i)) >= 0 implies IExec ((for-up (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) ) set d1 = DataLoc ((s . a),i); set FOR = for-up (a,i,n,I); set pFOR = stop (for-up (a,i,n,I)); set s3 = Initialize s; set P3 = P +* (stop (for-up (a,i,n,I))); set s4 = Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),1); set P4 = P +* (stop (for-up (a,i,n,I))); set i1 = (a,i) >=0_goto ((card I) + 3); set i2 = AddTo (a,i,n); set i3 = goto (- ((card I) + 2)); set SAl = Start-At (((card I) + 3),SCMPDS); A2: IC (Initialize s) = 0 by MEMSTR_0:def_11; A3: not DataLoc ((s . a),i) in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; A4: stop (for-up (a,i,n,I)) c= P +* (stop (for-up (a,i,n,I))) by FUNCT_4:25; not a in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; then A5: (Initialize s) . (DataLoc (((Initialize s) . a),i)) = (Initialize s) . (DataLoc ((s . a),i)) by FUNCT_4:11 .= s . (DataLoc ((s . a),i)) by A3, FUNCT_4:11 ; A6: for-up (a,i,n,I) = ((a,i) >=0_goto ((card I) + 3)) ';' ((I ';' (AddTo (a,i,n))) ';' (goto (- ((card I) + 2)))) by Th15; A7: Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),(0 + 1)) = Following ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),0))) by EXTPRO_1:3 .= Following ((P +* (stop (for-up (a,i,n,I)))),(Initialize s)) .= Exec (((a,i) >=0_goto ((card I) + 3)),(Initialize s)) by A6, SCMPDS_6:11 ; assume s . (DataLoc ((s . a),i)) >= 0 ; ::_thesis: IExec ((for-up (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) then A8: IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),1)) = ICplusConst ((Initialize s),((card I) + 3)) by A7, A5, SCMPDS_2:57 .= 0 + ((card I) + 3) by A2, SCMPDS_6:12 ; A11: card (for-up (a,i,n,I)) = (card I) + 3 by Th51; then (card I) + 3 in dom (stop (for-up (a,i,n,I))) by COMPOS_1:64; then (P +* (stop (for-up (a,i,n,I)))) . ((card I) + 3) = (stop (for-up (a,i,n,I))) . ((card I) + 3) by A4, GRFUNC_1:2 .= halt SCMPDS by A11, COMPOS_1:64 ; then A12: CurInstr ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),1))) = halt SCMPDS by A8, PBOOLE:143; then A13: P +* (stop (for-up (a,i,n,I))) halts_on Initialize s by EXTPRO_1:29; A14: CurInstr ((P +* (stop (for-up (a,i,n,I)))),(Initialize s)) = (a,i) >=0_goto ((card I) + 3) by A6, SCMPDS_6:11; now__::_thesis:_for_l_being_Element_of_NAT_st_l_<_0_+_1_holds_ CurInstr_((P_+*_(stop_(for-up_(a,i,n,I)))),(Comput_((P_+*_(stop_(for-up_(a,i,n,I)))),(Initialize_s),l)))_<>_halt_SCMPDS let l be Element of NAT ; ::_thesis: ( l < 0 + 1 implies CurInstr ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),l))) <> halt SCMPDS ) assume l < 0 + 1 ; ::_thesis: CurInstr ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),l))) <> halt SCMPDS then l = 0 by NAT_1:13; hence CurInstr ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),l))) <> halt SCMPDS by A14, EXTPRO_1:2; ::_thesis: verum end; then for l being Element of NAT st CurInstr ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),l))) = halt SCMPDS holds 1 <= l ; then B17: LifeSpan ((P +* (stop (for-up (a,i,n,I)))),(Initialize s)) = 1 by A12, A13, EXTPRO_1:def_15; A19: now__::_thesis:_for_x_being_set_st_x_in_dom_(IExec_((for-up_(a,i,n,I)),P,(Initialize_s)))_holds_ (IExec_((for-up_(a,i,n,I)),P,(Initialize_s)))_._x_=_(s_+*_(Start-At_(((card_I)_+_3),SCMPDS)))_._x let x be set ; ::_thesis: ( x in dom (IExec ((for-up (a,i,n,I)),P,(Initialize s))) implies (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . b1 = (s +* (Start-At (((card I) + 3),SCMPDS))) . b1 ) A20: dom (Start-At (((card I) + 3),SCMPDS)) = {(IC )} by FUNCOP_1:13; assume A21: x in dom (IExec ((for-up (a,i,n,I)),P,(Initialize s))) ; ::_thesis: (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . b1 = (s +* (Start-At (((card I) + 3),SCMPDS))) . b1 percases ( x is Int_position or x = IC ) by A21, SCMPDS_4:6; supposeA22: x is Int_position ; ::_thesis: (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . b1 = (s +* (Start-At (((card I) + 3),SCMPDS))) . b1 then x <> IC by SCMPDS_2:43; then A23: not x in dom (Start-At (((card I) + 3),SCMPDS)) by A20, TARSKI:def_1; TT: not x in dom (Start-At (0,SCMPDS)) by A22, SCMPDS_4:18; thus (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . x = (Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize s),1)) . x by B17, A13, EXTPRO_1:23 .= (Initialize s) . x by A7, A22, SCMPDS_2:57 .= s . x by TT, FUNCT_4:11 .= (s +* (Start-At (((card I) + 3),SCMPDS))) . x by A23, FUNCT_4:11 ; ::_thesis: verum end; supposeA24: x = IC ; ::_thesis: (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . b1 = (s +* (Start-At (((card I) + 3),SCMPDS))) . b1 thus (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . x = (card I) + 3 by A8, B17, A24, A13, EXTPRO_1:23 .= (s +* (Start-At (((card I) + 3),SCMPDS))) . x by A24, FUNCT_4:113 ; ::_thesis: verum end; end; end; dom (IExec ((for-up (a,i,n,I)),P,(Initialize s))) = the carrier of SCMPDS by PARTFUN1:def_2 .= dom (s +* (Start-At (((card I) + 3),SCMPDS))) by PARTFUN1:def_2 ; hence IExec ((for-up (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) by A19, FUNCT_1:2; ::_thesis: verum end; theorem :: SCMPDS_7:37 for P being Instruction-Sequence of SCMPDS for s being State of SCMPDS for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds IC (IExec ((for-up (a,i,n,I)),P,(Initialize s))) = (card I) + 3 proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being State of SCMPDS for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds IC (IExec ((for-up (a,i,n,I)),P,(Initialize s))) = (card I) + 3 let s be State of SCMPDS; ::_thesis: for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds IC (IExec ((for-up (a,i,n,I)),P,(Initialize s))) = (card I) + 3 let I be Program of SCMPDS; ::_thesis: for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds IC (IExec ((for-up (a,i,n,I)),P,(Initialize s))) = (card I) + 3 let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds IC (IExec ((for-up (a,i,n,I)),P,(Initialize s))) = (card I) + 3 let i be Integer; ::_thesis: for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds IC (IExec ((for-up (a,i,n,I)),P,(Initialize s))) = (card I) + 3 let n be Element of NAT ; ::_thesis: ( s . (DataLoc ((s . a),i)) >= 0 implies IC (IExec ((for-up (a,i,n,I)),P,(Initialize s))) = (card I) + 3 ) assume s . (DataLoc ((s . a),i)) >= 0 ; ::_thesis: IC (IExec ((for-up (a,i,n,I)),P,(Initialize s))) = (card I) + 3 then IExec ((for-up (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) by Th55; hence IC (IExec ((for-up (a,i,n,I)),P,(Initialize s))) = (card I) + 3 by FUNCT_4:113; ::_thesis: verum end; theorem :: SCMPDS_7:38 for P being Instruction-Sequence of SCMPDS for s being State of SCMPDS for I being Program of SCMPDS for a, b being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . b = s . b proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being State of SCMPDS for I being Program of SCMPDS for a, b being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . b = s . b let s be State of SCMPDS; ::_thesis: for I being Program of SCMPDS for a, b being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . b = s . b let I be Program of SCMPDS; ::_thesis: for a, b being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . b = s . b let a, b be Int_position; ::_thesis: for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . b = s . b let i be Integer; ::_thesis: for n being Element of NAT st s . (DataLoc ((s . a),i)) >= 0 holds (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . b = s . b let n be Element of NAT ; ::_thesis: ( s . (DataLoc ((s . a),i)) >= 0 implies (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . b = s . b ) assume s . (DataLoc ((s . a),i)) >= 0 ; ::_thesis: (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . b = s . b then A1: IExec ((for-up (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) by Th55; not b in dom (Start-At (((card I) + 3),SCMPDS)) by SCMPDS_4:18; hence (IExec ((for-up (a,i,n,I)),P,(Initialize s))) . b = s . b by A1, FUNCT_4:11; ::_thesis: verum end; Lm3: for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT holds Shift (I,1) c= for-up (a,i,n,I) proof let I be Program of SCMPDS; ::_thesis: for a being Int_position for i being Integer for n being Element of NAT holds Shift (I,1) c= for-up (a,i,n,I) let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT holds Shift (I,1) c= for-up (a,i,n,I) let i be Integer; ::_thesis: for n being Element of NAT holds Shift (I,1) c= for-up (a,i,n,I) let n be Element of NAT ; ::_thesis: Shift (I,1) c= for-up (a,i,n,I) set i1 = (a,i) >=0_goto ((card I) + 3); set i2 = AddTo (a,i,n); set i3 = goto (- ((card I) + 2)); A1: for-up (a,i,n,I) = ((Load ((a,i) >=0_goto ((card I) + 3))) ';' I) ';' ((AddTo (a,i,n)) ';' (goto (- ((card I) + 2)))) by SCMPDS_4:13; card (Load ((a,i) >=0_goto ((card I) + 3))) = 1 by COMPOS_1:54; hence Shift (I,1) c= for-up (a,i,n,I) by A1, Th16; ::_thesis: verum end; theorem Th58: :: SCMPDS_7:39 for P being Instruction-Sequence of SCMPDS for s being State of SCMPDS for I being halt-free shiftable Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being State of SCMPDS for I being halt-free shiftable Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) let s be State of SCMPDS; ::_thesis: for I being halt-free shiftable Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) let I be halt-free shiftable Program of SCMPDS; ::_thesis: for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) let i be Integer; ::_thesis: for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) let n be Element of NAT ; ::_thesis: for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) let X be set ; ::_thesis: ( s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) implies ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) ) set b = DataLoc ((s . a),i); set FOR = for-up (a,i,n,I); set pFOR = stop (for-up (a,i,n,I)); set pI = stop I; set i1 = (a,i) >=0_goto ((card I) + 3); set i2 = AddTo (a,i,n); set i3 = goto (- ((card I) + 2)); assume A1: s . (DataLoc ((s . a),i)) < 0 ; ::_thesis: ( DataLoc ((s . a),i) in X or not n > 0 or not a <> DataLoc ((s . a),i) or ex t being State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) or ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) ) defpred S1[ Element of NAT ] means for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st - (t . (DataLoc ((s . a),i))) <= $1 & ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ); assume A2: not DataLoc ((s . a),i) in X ; ::_thesis: ( not n > 0 or not a <> DataLoc ((s . a),i) or ex t being State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) or ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) ) assume A3: n > 0 ; ::_thesis: ( not a <> DataLoc ((s . a),i) or ex t being State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) or ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) ) assume A5: a <> DataLoc ((s . a),i) ; ::_thesis: ( ex t being State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) or ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) ) assume A6: for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ; ::_thesis: ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) A7: for k being Element of NAT st S1[k] holds S1[k + 1] proof let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] ) assume A8: S1[k] ; ::_thesis: S1[k + 1] let t be State of SCMPDS; ::_thesis: for Q being Instruction-Sequence of SCMPDS st - (t . (DataLoc ((s . a),i))) <= k + 1 & ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) let Q be Instruction-Sequence of SCMPDS; ::_thesis: ( - (t . (DataLoc ((s . a),i))) <= k + 1 & ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a implies ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) ) assume A9: - (t . (DataLoc ((s . a),i))) <= k + 1 ; ::_thesis: ( ex x being Int_position st ( x in X & not t . x = s . x ) or not t . a = s . a or ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) ) assume A10: for x being Int_position st x in X holds t . x = s . x ; ::_thesis: ( not t . a = s . a or ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) ) assume A11: t . a = s . a ; ::_thesis: ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) percases ( t . (DataLoc ((s . a),i)) >= 0 or t . (DataLoc ((s . a),i)) < 0 ) ; suppose t . (DataLoc ((s . a),i)) >= 0 ; ::_thesis: ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) hence ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) by A11, Th54; ::_thesis: verum end; supposeA12: t . (DataLoc ((s . a),i)) < 0 ; ::_thesis: ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) set t2 = Initialize t; set t3 = Initialize t; set Q2 = Q +* (stop I); set Q3 = Q +* (stop (for-up (a,i,n,I))); set t4 = Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),1); set Q4 = Q +* (stop (for-up (a,i,n,I))); A15: stop I c= Q +* (stop I) by FUNCT_4:25; A18: for-up (a,i,n,I) = ((a,i) >=0_goto ((card I) + 3)) ';' ((I ';' (AddTo (a,i,n))) ';' (goto (- ((card I) + 2)))) by Th15; A19: Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),(0 + 1)) = Following ((Q +* (stop (for-up (a,i,n,I)))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),0))) by EXTPRO_1:3 .= Following ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t)) .= Exec (((a,i) >=0_goto ((card I) + 3)),(Initialize t)) by A18, SCMPDS_6:11 ; for a being Int_position holds (Initialize t) . a = (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),1)) . a by A19, SCMPDS_2:57; then A21: DataPart (Initialize t) = DataPart (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),1)) by SCMPDS_4:8; A23: (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) by A6, A10, A11; - (- n) > 0 by A3; then - n < 0 ; then - n <= - 1 by INT_1:8; then A24: (- n) - (t . (DataLoc ((s . a),i))) <= (- 1) - (t . (DataLoc ((s . a),i))) by XREAL_1:9; (- (t . (DataLoc ((s . a),i)))) - 1 <= k by A9, XREAL_1:20; then A25: (- n) - (t . (DataLoc ((s . a),i))) <= k by A24, XXREAL_0:2; A26: I is_closed_on t,Q by A6, A10, A11; then A27: I is_closed_on Initialize t,Q +* (stop I) by SCMPDS_6:24; A28: not DataLoc ((s . a),i) in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; set m2 = LifeSpan ((Q +* (stop I)),(Initialize t)); set t5 = Comput ((Q +* (stop (for-up (a,i,n,I)))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t)))); set Q5 = Q +* (stop (for-up (a,i,n,I))); set l1 = (card I) + 1; A29: IC (Initialize t) = 0 by MEMSTR_0:def_11; set m3 = (LifeSpan ((Q +* (stop I)),(Initialize t))) + 1; set t6 = Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)); set Q6 = Q +* (stop (for-up (a,i,n,I))); (card I) + 1 < (card I) + 3 by XREAL_1:6; then A30: (card I) + 1 in dom (for-up (a,i,n,I)) by Th52; set m5 = (((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1; set t8 = Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)); set Q8 = Q +* (stop (for-up (a,i,n,I))); set t7 = Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)); set Q7 = Q +* (stop (for-up (a,i,n,I))); A31: (IExec (I,Q,(Initialize t))) . a = t . a by A6, A10, A11; set l2 = (card I) + 2; A32: 0 in dom (stop (for-up (a,i,n,I))) by COMPOS_1:36; (card I) + 2 < (card I) + 3 by XREAL_1:6; then A33: (card I) + 2 in dom (for-up (a,i,n,I)) by Th52; A34: stop (for-up (a,i,n,I)) c= Q +* (stop (for-up (a,i,n,I))) by FUNCT_4:25; for-up (a,i,n,I) c= stop (for-up (a,i,n,I)) by AFINSQ_1:74; then A35: for-up (a,i,n,I) c= Q +* (stop (for-up (a,i,n,I))) by A34, XBOOLE_1:1; Shift (I,1) c= for-up (a,i,n,I) by Lm3; then A36: Shift (I,1) c= Q +* (stop (for-up (a,i,n,I))) by A35, XBOOLE_1:1; I is_halting_on t,Q by A6, A10, A11; then A37: Q +* (stop I) halts_on Initialize t by SCMPDS_6:def_3; (Q +* (stop I)) +* (stop I) halts_on Initialize (Initialize t) by A37; then A39: I is_halting_on Initialize t,Q +* (stop I) by SCMPDS_6:def_3; not a in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; then (Initialize t) . (DataLoc (((Initialize t) . a),i)) = (Initialize t) . (DataLoc ((s . a),i)) by A11, FUNCT_4:11 .= t . (DataLoc ((s . a),i)) by A28, FUNCT_4:11 ; then A40: IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),1)) = succ (IC (Initialize t)) by A12, A19, SCMPDS_2:57 .= 0 + 1 by A29 ; then A41: IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) = (card I) + 1 by A15, A39, A27, A21, A36, Th36; A42: (Q +* (stop (for-up (a,i,n,I)))) /. (IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) = (Q +* (stop (for-up (a,i,n,I)))) . (IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) by PBOOLE:143; A43: Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)) = Comput ((Q +* (stop (for-up (a,i,n,I)))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t)))) by EXTPRO_1:4; then A44: CurInstr ((Q +* (stop (for-up (a,i,n,I)))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) = (Q +* (stop (for-up (a,i,n,I)))) . ((card I) + 1) by A15, A39, A27, A40, A21, A36, Th36, A42 .= (for-up (a,i,n,I)) . ((card I) + 1) by A30, A35, GRFUNC_1:2 .= AddTo (a,i,n) by Th53 ; A47: Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)) = Following ((Q +* (stop (for-up (a,i,n,I)))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) by EXTPRO_1:3 .= Exec ((AddTo (a,i,n)),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) by A44 ; then A48: IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) = succ (IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) by SCMPDS_2:48 .= ((card I) + 1) + 1 by A41, A43, NAT_1:38 .= (card I) + (1 + 1) ; then A49: CurInstr ((Q +* (stop (for-up (a,i,n,I)))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)))) = (Q +* (stop (for-up (a,i,n,I)))) . ((card I) + 2) by PBOOLE:143 .= (for-up (a,i,n,I)) . ((card I) + 2) by A35, A33, GRFUNC_1:2 .= goto (- ((card I) + 2)) by Th53 ; A51: Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)) = Following ((Q +* (stop (for-up (a,i,n,I)))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)))) by EXTPRO_1:3 .= Exec ((goto (- ((card I) + 2))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)))) by A49 ; then IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) = ICplusConst ((Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))),(0 - ((card I) + 2))) by SCMPDS_2:54 .= 0 by A48, Th1 ; then A52: Initialize (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) = Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)) by MEMSTR_0:46; A54: DataPart (Comput ((Q +* (stop I)),(Initialize t),(LifeSpan ((Q +* (stop I)),(Initialize t))))) = DataPart (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) by A15, A39, A27, A40, A21, A36, Th36; then A55: (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . a = (Comput ((Q +* (stop I)),(Initialize t),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . a by SCMPDS_4:8 .= s . a by A11, A31, A37, EXTPRO_1:23 ; then DataLoc (((Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1))) . a),i) = DataLoc ((s . a),i) by EXTPRO_1:4; then (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . a = (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1))) . a by A5, A47, SCMPDS_2:48 .= s . a by A55, EXTPRO_1:4 ; then A56: (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) . a = s . a by A51, SCMPDS_2:54; A57: now__::_thesis:_for_x_being_Int_position_st_x_in_X_holds_ (Comput_((Q_+*_(stop_(for-up_(a,i,n,I)))),(Initialize_t),((((LifeSpan_((Q_+*_(stop_I)),(Initialize_t)))_+_1)_+_1)_+_1)))_._x_=_s_._x let x be Int_position; ::_thesis: ( x in X implies (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) . x = s . x ) assume A58: x in X ; ::_thesis: (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) . x = s . x (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . x = (Comput ((Q +* (stop I)),(Initialize t),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . x by A54, SCMPDS_4:8 .= (IExec (I,Q,(Initialize t))) . x by A37, EXTPRO_1:23 .= t . x by A6, A10, A11, A58 .= s . x by A10, A58 ; then (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . x = s . x by A2, A55, A43, A47, A58, SCMPDS_2:48; hence (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) . x = s . x by A51, SCMPDS_2:54; ::_thesis: verum end; A60: (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . (DataLoc ((s . a),i)) = (Comput ((Q +* (stop I)),(Initialize t),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . (DataLoc ((s . a),i)) by A54, SCMPDS_4:8 .= t . (DataLoc ((s . a),i)) by A23, A37, EXTPRO_1:23 ; (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) . (DataLoc ((s . a),i)) = (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . (DataLoc ((s . a),i)) by A51, SCMPDS_2:54 .= (t . (DataLoc ((s . a),i))) + n by A55, A60, A43, A47, SCMPDS_2:48 ; then A61: - ((Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) . (DataLoc ((s . a),i))) = (- n) - (t . (DataLoc ((s . a),i))) ; then A62: for-up (a,i,n,I) is_closed_on Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)),Q +* (stop (for-up (a,i,n,I))) by A8, A56, A57, A25; now__::_thesis:_for_k_being_Element_of_NAT_holds_IC_(Comput_((Q_+*_(stop_(for-up_(a,i,n,I)))),(Initialize_t),k))_in_dom_(stop_(for-up_(a,i,n,I))) let k be Element of NAT ; ::_thesis: IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),b1)) in dom (stop (for-up (a,i,n,I))) percases ( k < (((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1 or k >= (((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1 ) ; suppose k < (((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1 ; ::_thesis: IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),b1)) in dom (stop (for-up (a,i,n,I))) then k <= ((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1 by INT_1:7; then A63: ( k <= (LifeSpan ((Q +* (stop I)),(Initialize t))) + 1 or k = ((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1 ) by NAT_1:8; hereby ::_thesis: verum percases ( k <= LifeSpan ((Q +* (stop I)),(Initialize t)) or k = (LifeSpan ((Q +* (stop I)),(Initialize t))) + 1 or k = ((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1 ) by A63, NAT_1:8; supposeA64: k <= LifeSpan ((Q +* (stop I)),(Initialize t)) ; ::_thesis: IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-up (a,i,n,I))) hereby ::_thesis: verum percases ( k = 0 or k <> 0 ) ; suppose k = 0 ; ::_thesis: IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-up (a,i,n,I))) hence IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-up (a,i,n,I))) by A32, A29, EXTPRO_1:2; ::_thesis: verum end; suppose k <> 0 ; ::_thesis: IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-up (a,i,n,I))) then consider kn being Nat such that A65: k = kn + 1 by NAT_1:6; reconsider kn = kn as Element of NAT by ORDINAL1:def_12; reconsider lm = IC (Comput ((Q +* (stop I)),(Initialize t),kn)) as Element of NAT ; kn < k by A65, XREAL_1:29; then kn < LifeSpan ((Q +* (stop I)),(Initialize t)) by A64, XXREAL_0:2; then (IC (Comput ((Q +* (stop I)),(Initialize t),kn))) + 1 = IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),1)),kn)) by A15, A39, A27, A40, A21, A36, Th34; then A66: IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),k)) = lm + 1 by A65, EXTPRO_1:4; IC (Comput ((Q +* (stop I)),(Initialize t),kn)) in dom (stop I) by A26, SCMPDS_6:def_2; then lm < card (stop I) by AFINSQ_1:66; then lm < (card I) + 1 by COMPOS_1:55; then A67: lm + 1 <= (card I) + 1 by INT_1:7; (card I) + 1 < (card I) + 4 by XREAL_1:6; then lm + 1 < (card I) + 4 by A67, XXREAL_0:2; then lm + 1 < card (stop (for-up (a,i,n,I))) by Lm2; hence IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-up (a,i,n,I))) by A66, AFINSQ_1:66; ::_thesis: verum end; end; end; end; supposeA68: k = (LifeSpan ((Q +* (stop I)),(Initialize t))) + 1 ; ::_thesis: IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-up (a,i,n,I))) (card I) + 1 in dom (stop (for-up (a,i,n,I))) by A30, COMPOS_1:62; hence IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-up (a,i,n,I))) by A15, A39, A27, A40, A21, A36, A43, A68, Th36; ::_thesis: verum end; suppose k = ((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1 ; ::_thesis: IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-up (a,i,n,I))) hence IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-up (a,i,n,I))) by A48, A33, COMPOS_1:62; ::_thesis: verum end; end; end; end; suppose k >= (((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1 ; ::_thesis: IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),b1)) in dom (stop (for-up (a,i,n,I))) then consider nn being Nat such that A69: k = ((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1) + nn by NAT_1:10; reconsider nn = nn as Element of NAT by ORDINAL1:def_12; Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),k) = Comput (((Q +* (stop (for-up (a,i,n,I)))) +* (stop (for-up (a,i,n,I)))),(Initialize (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)))),nn) by A52, A69, EXTPRO_1:4; hence IC (Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-up (a,i,n,I))) by A62, SCMPDS_6:def_2; ::_thesis: verum end; end; end; hence for-up (a,i,n,I) is_closed_on t,Q by SCMPDS_6:def_2; ::_thesis: for-up (a,i,n,I) is_halting_on t,Q RR: (Q +* (stop (for-up (a,i,n,I)))) +* (stop (for-up (a,i,n,I))) = Q +* (stop (for-up (a,i,n,I))) ; for-up (a,i,n,I) is_halting_on Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)),Q +* (stop (for-up (a,i,n,I))) by A8, A56, A57, A25, A61; then Q +* (stop (for-up (a,i,n,I))) halts_on Comput ((Q +* (stop (for-up (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)) by A52, RR, SCMPDS_6:def_3; then Q +* (stop (for-up (a,i,n,I))) halts_on Initialize t by EXTPRO_1:22; hence for-up (a,i,n,I) is_halting_on t,Q by SCMPDS_6:def_3; ::_thesis: verum end; end; end; reconsider nn = - (s . (DataLoc ((s . a),i))) as Element of NAT by A1, INT_1:3; A70: S1[ 0 ] proof let t be State of SCMPDS; ::_thesis: for Q being Instruction-Sequence of SCMPDS st - (t . (DataLoc ((s . a),i))) <= 0 & ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) let Q be Instruction-Sequence of SCMPDS; ::_thesis: ( - (t . (DataLoc ((s . a),i))) <= 0 & ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a implies ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) ) assume - (t . (DataLoc ((s . a),i))) <= 0 ; ::_thesis: ( ex x being Int_position st ( x in X & not t . x = s . x ) or not t . a = s . a or ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) ) then - (t . (DataLoc ((s . a),i))) <= - 0 ; then A71: t . (DataLoc ((s . a),i)) >= 0 by XREAL_1:24; assume for x being Int_position st x in X holds t . x = s . x ; ::_thesis: ( not t . a = s . a or ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) ) assume t . a = s . a ; ::_thesis: ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) hence ( for-up (a,i,n,I) is_closed_on t,Q & for-up (a,i,n,I) is_halting_on t,Q ) by A71, Th54; ::_thesis: verum end; for k being Element of NAT holds S1[k] from NAT_1:sch_1(A70, A7); then A72: S1[nn] ; for x being Int_position st x in X holds s . x = s . x ; hence ( for-up (a,i,n,I) is_closed_on s,P & for-up (a,i,n,I) is_halting_on s,P ) by A72; ::_thesis: verum end; theorem :: SCMPDS_7:40 for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for I being halt-free shiftable Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for I being halt-free shiftable Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) let s be 0 -started State of SCMPDS; ::_thesis: for I being halt-free shiftable Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) let I be halt-free shiftable Program of SCMPDS; ::_thesis: for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) let i be Integer; ::_thesis: for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) let n be Element of NAT ; ::_thesis: for X being set st s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) holds IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) let X be set ; ::_thesis: ( s . (DataLoc ((s . a),i)) < 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) implies IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) ) set b = DataLoc ((s . a),i); set FOR = for-up (a,i,n,I); set pFOR = stop (for-up (a,i,n,I)); set s1 = s; set P1 = P +* (stop (for-up (a,i,n,I))); set i1 = (a,i) >=0_goto ((card I) + 3); set i2 = AddTo (a,i,n); set i3 = goto (- ((card I) + 2)); assume A2: s . (DataLoc ((s . a),i)) < 0 ; ::_thesis: ( DataLoc ((s . a),i) in X or not n > 0 or not a <> DataLoc ((s . a),i) or ex t being State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) or IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) ) set s4 = Comput ((P +* (stop (for-up (a,i,n,I)))),s,1); set P4 = P +* (stop (for-up (a,i,n,I))); A3: IC s = 0 by MEMSTR_0:def_11; set m0 = LifeSpan ((P +* (stop (for-up (a,i,n,I)))),s); set l2 = (card I) + 2; set sI = s; set PI = P +* (stop I); set m1 = (LifeSpan ((P +* (stop I)),s)) + 3; set J = I ';' (AddTo (a,i,n)); set sJ = s; set PJ = P +* (stop (I ';' (AddTo (a,i,n)))); set s2 = Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)); set P2 = P +* (stop (for-up (a,i,n,I))); set m2 = LifeSpan ((P +* (stop (for-up (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))); set Es = IExec ((I ';' (AddTo (a,i,n))),P,s); set bj = DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i); A7: stop I c= P +* (stop I) by FUNCT_4:25; A11: for-up (a,i,n,I) = ((a,i) >=0_goto ((card I) + 3)) ';' ((I ';' (AddTo (a,i,n))) ';' (goto (- ((card I) + 2)))) by Th15; set mI = LifeSpan ((P +* (stop I)),s); set s5 = Comput ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s))); set P5 = P +* (stop (for-up (a,i,n,I))); set l1 = (card I) + 1; set m3 = (LifeSpan ((P +* (stop I)),s)) + 1; set s6 = Comput ((P +* (stop (for-up (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)); set P6 = P +* (stop (for-up (a,i,n,I))); set s7 = Comput ((P +* (stop (for-up (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1)); set P7 = P +* (stop (for-up (a,i,n,I))); A12: stop (for-up (a,i,n,I)) c= P +* (stop (for-up (a,i,n,I))) by FUNCT_4:25; for-up (a,i,n,I) c= stop (for-up (a,i,n,I)) by AFINSQ_1:74; then A13: for-up (a,i,n,I) c= P +* (stop (for-up (a,i,n,I))) by A12, XBOOLE_1:1; Shift (I,1) c= for-up (a,i,n,I) by Lm3; then A14: Shift (I,1) c= P +* (stop (for-up (a,i,n,I))) by A13, XBOOLE_1:1; (card I) + 2 < (card I) + 3 by XREAL_1:6; then A15: (card I) + 2 in dom (for-up (a,i,n,I)) by Th52; set m5 = (((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1; set s8 = Comput ((P +* (stop (for-up (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1)); (card I) + 1 < (card I) + 3 by XREAL_1:6; then A17: (card I) + 1 in dom (for-up (a,i,n,I)) by Th52; assume A18: not DataLoc ((s . a),i) in X ; ::_thesis: ( not n > 0 or not a <> DataLoc ((s . a),i) or ex t being State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) or IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) ) assume A19: n > 0 ; ::_thesis: ( not a <> DataLoc ((s . a),i) or ex t being State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) or IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) ) assume A21: a <> DataLoc ((s . a),i) ; ::_thesis: ( ex t being State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) or IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) ) I: Initialize s = s by MEMSTR_0:44; assume A22: for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ; ::_thesis: IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) then for-up (a,i,n,I) is_halting_on s,P by A2, A18, A19, A21, Th58; then A23: P +* (stop (for-up (a,i,n,I))) halts_on s by I, SCMPDS_6:def_3; A24: for x being Int_position st x in X holds s . x = s . x ; then A25: (IExec (I,P,s)) . (DataLoc ((s . a),i)) = s . (DataLoc ((s . a),i)) by A22, I; A26: (IExec (I,P,s)) . a = s . a by A22, A24, I; A27: DataLoc ((s . a),i) = DataLoc (((IExec (I,P,s)) . a),i) by A22, A24, I; A28: (IExec (I,P,s)) . a = s . a by A22, A24, I; A29: Comput ((P +* (stop (for-up (a,i,n,I)))),s,(0 + 1)) = Following ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,0))) by EXTPRO_1:3 .= Following ((P +* (stop (for-up (a,i,n,I)))),s) .= Exec (((a,i) >=0_goto ((card I) + 3)),s) by A11, I, SCMPDS_6:11 ; A30: IC (Comput ((P +* (stop (for-up (a,i,n,I)))),s,1)) = succ (IC s) by A2, A29, SCMPDS_2:57 .= 0 + 1 by A3 ; for a being Int_position holds s . a = (Comput ((P +* (stop (for-up (a,i,n,I)))),s,1)) . a by A29, SCMPDS_2:57; then A32: DataPart s = DataPart (Comput ((P +* (stop (for-up (a,i,n,I)))),s,1)) by SCMPDS_4:8; A33: I is_halting_on s,P by A22, A24; then A34: P +* (stop I) halts_on s by I, SCMPDS_6:def_3; (P +* (stop I)) +* (stop I) halts_on s by A34; then A36: I is_halting_on s,P +* (stop I) by I, SCMPDS_6:def_3; A37: I is_closed_on s,P by A22, A24; then A38: (IExec ((I ';' (AddTo (a,i,n))),P,s)) . (DataLoc ((s . a),i)) = (Exec ((AddTo (a,i,n)),(IExec (I,P,s)))) . (DataLoc ((s . a),i)) by A33, Th50 .= ((IExec (I,P,s)) . (DataLoc ((s . a),i))) + n by A26, SCMPDS_2:48 .= (s . (DataLoc ((s . a),i))) + n by A22, A24, I ; A39: I is_closed_on s,P +* (stop I) by A22, A24; then A40: IC (Comput ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s)))) = (card I) + 1 by A7, A36, A30, A32, A14, Th36; A41: (P +* (stop (for-up (a,i,n,I)))) /. (IC (Comput ((P +* (stop (for-up (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)))) = (P +* (stop (for-up (a,i,n,I)))) . (IC (Comput ((P +* (stop (for-up (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)))) by PBOOLE:143; A42: Comput ((P +* (stop (for-up (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)) = Comput ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s))) by EXTPRO_1:4; then A43: CurInstr ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)))) = (P +* (stop (for-up (a,i,n,I)))) . ((card I) + 1) by A7, A36, A39, A30, A32, A14, Th36, A41 .= (for-up (a,i,n,I)) . ((card I) + 1) by A17, A13, GRFUNC_1:2 .= AddTo (a,i,n) by Th53 ; A44: DataPart (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))) = DataPart (Comput ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s)))) by A7, A36, A39, A30, A32, A14, Th36; then A45: (Comput ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s)))) . a = (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))) . a by SCMPDS_4:8 .= s . a by A28, A34, EXTPRO_1:23 ; A46: (IExec ((I ';' (AddTo (a,i,n))),P,s)) . a = (Exec ((AddTo (a,i,n)),(IExec (I,P,s)))) . a by A37, A33, Th50 .= s . a by A21, A26, SCMPDS_2:48 ; now__::_thesis:_for-up_(a,i,n,I)_is_halting_on_IExec_((I_';'_(AddTo_(a,i,n))),P,s),P percases ( (IExec ((I ';' (AddTo (a,i,n))),P,s)) . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) >= 0 or (IExec ((I ';' (AddTo (a,i,n))),P,s)) . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) < 0 ) ; suppose (IExec ((I ';' (AddTo (a,i,n))),P,s)) . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) >= 0 ; ::_thesis: for-up (a,i,n,I) is_halting_on IExec ((I ';' (AddTo (a,i,n))),P,s),P hence for-up (a,i,n,I) is_halting_on IExec ((I ';' (AddTo (a,i,n))),P,s),P by Th54; ::_thesis: verum end; supposeA47: (IExec ((I ';' (AddTo (a,i,n))),P,s)) . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) < 0 ; ::_thesis: for-up (a,i,n,I) is_halting_on IExec ((I ';' (AddTo (a,i,n))),P,s),P now__::_thesis:_for_t_being_State_of_SCMPDS for_Q_being_Instruction-Sequence_of_SCMPDS_st_(_for_x_being_Int_position_st_x_in_X_holds_ t_._x_=_(IExec_((I_';'_(AddTo_(a,i,n))),P,s))_._x_)_&_t_._a_=_(IExec_((I_';'_(AddTo_(a,i,n))),P,s))_._a_holds_ (_(IExec_(I,Q,(Initialize_t)))_._a_=_t_._a_&_(IExec_(I,Q,(Initialize_t)))_._(DataLoc_(((IExec_((I_';'_(AddTo_(a,i,n))),P,s))_._a),i))_=_t_._(DataLoc_(((IExec_((I_';'_(AddTo_(a,i,n))),P,s))_._a),i))_&_I_is_closed_on_t,Q_&_I_is_halting_on_t,Q_&_(_for_y_being_Int_position_st_y_in_X_holds_ (IExec_(I,Q,(Initialize_t)))_._y_=_t_._y_)_) let t be State of SCMPDS; ::_thesis: for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = (IExec ((I ';' (AddTo (a,i,n))),P,s)) . x ) & t . a = (IExec ((I ';' (AddTo (a,i,n))),P,s)) . a holds ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) = t . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) let Q be Instruction-Sequence of SCMPDS; ::_thesis: ( ( for x being Int_position st x in X holds t . x = (IExec ((I ';' (AddTo (a,i,n))),P,s)) . x ) & t . a = (IExec ((I ';' (AddTo (a,i,n))),P,s)) . a implies ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) = t . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) ) assume that A48: for x being Int_position st x in X holds t . x = (IExec ((I ';' (AddTo (a,i,n))),P,s)) . x and A49: t . a = (IExec ((I ';' (AddTo (a,i,n))),P,s)) . a ; ::_thesis: ( (IExec (I,Q,(Initialize t))) . a = t . a & (IExec (I,Q,(Initialize t))) . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) = t . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) A50: now__::_thesis:_for_x_being_Int_position_st_x_in_X_holds_ t_._x_=_s_._x let x be Int_position; ::_thesis: ( x in X implies t . x = s . x ) assume A51: x in X ; ::_thesis: t . x = s . x hence t . x = (IExec ((I ';' (AddTo (a,i,n))),P,s)) . x by A48 .= (Exec ((AddTo (a,i,n)),(IExec (I,P,s)))) . x by A37, A33, Th50 .= (IExec (I,P,s)) . x by A18, A26, A51, SCMPDS_2:48 .= s . x by A22, A24, A51, I ; ::_thesis: verum end; hence (IExec (I,Q,(Initialize t))) . a = t . a by A22, A46, A49; ::_thesis: ( (IExec (I,Q,(Initialize t))) . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) = t . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) thus (IExec (I,Q,(Initialize t))) . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) = t . (DataLoc (((IExec ((I ';' (AddTo (a,i,n))),P,s)) . a),i)) by A22, A46, A49, A50; ::_thesis: ( I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) thus ( I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,(Initialize t))) . y = t . y ) ) by A22, A46, A49, A50; ::_thesis: verum end; hence for-up (a,i,n,I) is_halting_on IExec ((I ';' (AddTo (a,i,n))),P,s),P by A18, A19, A21, A46, A47, Th58; ::_thesis: verum end; end; end; then A52: P +* (stop (for-up (a,i,n,I))) halts_on Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)) by SCMPDS_6:def_3; A55: Comput ((P +* (stop (for-up (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1)) = Following ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)))) by EXTPRO_1:3 .= Exec ((AddTo (a,i,n)),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)))) by A43 ; then A56: IC (Comput ((P +* (stop (for-up (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1))) = succ (IC (Comput ((P +* (stop (for-up (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)))) by SCMPDS_2:48 .= ((card I) + 1) + 1 by A40, A42, NAT_1:38 .= (card I) + (1 + 1) ; then A57: CurInstr ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1)))) = (P +* (stop (for-up (a,i,n,I)))) . ((card I) + 2) by PBOOLE:143 .= (for-up (a,i,n,I)) . ((card I) + 2) by A13, A15, GRFUNC_1:2 .= goto (- ((card I) + 2)) by Th53 ; A59: Comput ((P +* (stop (for-up (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1)) = Following ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1)))) by EXTPRO_1:3 .= Exec ((goto (- ((card I) + 2))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1)))) by A57 ; then IC (Comput ((P +* (stop (for-up (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) = ICplusConst ((Comput ((P +* (stop (for-up (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1))),(0 - ((card I) + 2))) by SCMPDS_2:54 .= 0 by A56, Th1 ; then A60: IC (Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))) = IC (Comput ((P +* (stop (for-up (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 3))) by MEMSTR_0:def_11; A61: (Comput ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s)))) . (DataLoc ((s . a),i)) = (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))) . (DataLoc ((s . a),i)) by A44, SCMPDS_4:8 .= s . (DataLoc ((s . a),i)) by A25, A34, EXTPRO_1:23 ; A62: (Comput ((P +* (stop (for-up (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) . (DataLoc ((s . a),i)) = (Comput ((P +* (stop (for-up (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1))) . (DataLoc ((s . a),i)) by A59, SCMPDS_2:54 .= (s . (DataLoc ((s . a),i))) + n by A45, A61, A42, A55, SCMPDS_2:48 ; now__::_thesis:_for_x_being_Int_position_holds_(Comput_((P_+*_(stop_(for-up_(a,i,n,I)))),s,((((LifeSpan_((P_+*_(stop_I)),s))_+_1)_+_1)_+_1)))_._x_=_(Initialize_(IExec_((I_';'_(AddTo_(a,i,n))),P,s)))_._x let x be Int_position; ::_thesis: (Comput ((P +* (stop (for-up (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) . b1 = (Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))) . b1 A63: not x in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; then A64: (Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))) . x = (IExec ((I ';' (AddTo (a,i,n))),P,s)) . x by FUNCT_4:11; percases ( x = DataLoc ((s . a),i) or x <> DataLoc ((s . a),i) ) ; suppose x = DataLoc ((s . a),i) ; ::_thesis: (Comput ((P +* (stop (for-up (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) . b1 = (Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))) . b1 hence (Comput ((P +* (stop (for-up (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) . x = (Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))) . x by A62, A38, A63, FUNCT_4:11; ::_thesis: verum end; supposeA65: x <> DataLoc ((s . a),i) ; ::_thesis: (Comput ((P +* (stop (for-up (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) . b1 = (Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))) . b1 A67: (Comput ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s)))) . x = (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))) . x by A44, SCMPDS_4:8 .= (IExec (I,P,s)) . x by A34, EXTPRO_1:23 ; A68: (Comput ((P +* (stop (for-up (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1))) . x = (Comput ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s)))) . x by A45, A42, A55, A65, SCMPDS_2:48; (IExec ((I ';' (AddTo (a,i,n))),P,s)) . x = (Exec ((AddTo (a,i,n)),(IExec (I,P,s)))) . x by A37, A33, Th50 .= (IExec (I,P,s)) . x by A27, A65, SCMPDS_2:48 ; hence (Comput ((P +* (stop (for-up (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) . x = (Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))) . x by A59, A64, A67, A68, SCMPDS_2:54; ::_thesis: verum end; end; end; then A69: DataPart (Comput ((P +* (stop (for-up (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) = DataPart (Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))) by SCMPDS_4:8; A71: Comput ((P +* (stop (for-up (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 3)) = Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)) by A69, A60, MEMSTR_0:78; then CurInstr ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 3)))) = (a,i) >=0_goto ((card I) + 3) by A11, SCMPDS_6:11; then LifeSpan ((P +* (stop (for-up (a,i,n,I)))),s) > (LifeSpan ((P +* (stop I)),s)) + 3 by A23, EXTPRO_1:36; then consider nn being Nat such that A72: LifeSpan ((P +* (stop (for-up (a,i,n,I)))),s) = ((LifeSpan ((P +* (stop I)),s)) + 3) + nn by NAT_1:10; reconsider nn = nn as Element of NAT by ORDINAL1:def_12; Comput ((P +* (stop (for-up (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 3) + (LifeSpan ((P +* (stop (for-up (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))))))) = Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))),(LifeSpan ((P +* (stop (for-up (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))))) by A71, EXTPRO_1:4; then CurInstr ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 3) + (LifeSpan ((P +* (stop (for-up (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))))))))) = halt SCMPDS by A52, EXTPRO_1:def_15; then ((LifeSpan ((P +* (stop I)),s)) + 3) + (LifeSpan ((P +* (stop (for-up (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))))) >= LifeSpan ((P +* (stop (for-up (a,i,n,I)))),s) by A23, EXTPRO_1:def_15; then A74: LifeSpan ((P +* (stop (for-up (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) >= nn by A72, XREAL_1:6; A75: Comput ((P +* (stop (for-up (a,i,n,I)))),s,(LifeSpan ((P +* (stop (for-up (a,i,n,I)))),s))) = Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))),nn) by A71, A72, EXTPRO_1:4; then CurInstr ((P +* (stop (for-up (a,i,n,I)))),(Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))),nn))) = halt SCMPDS by A23, EXTPRO_1:def_15; then nn >= LifeSpan ((P +* (stop (for-up (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) by A52, EXTPRO_1:def_15; then nn = LifeSpan ((P +* (stop (for-up (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) by A74, XXREAL_0:1; then Result ((P +* (stop (for-up (a,i,n,I)))),s) = Comput ((P +* (stop (for-up (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s))),(LifeSpan ((P +* (stop (for-up (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))))) by A23, A75, EXTPRO_1:23; hence IExec ((for-up (a,i,n,I)),P,s) = IExec ((for-up (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,n))),P,s)))) by A52, EXTPRO_1:23; ::_thesis: verum end; registration let I be shiftable Program of SCMPDS; let a be Int_position; let i be Integer; let n be Element of NAT ; cluster for-up (a,i,n,I) -> shiftable ; correctness coherence for-up (a,i,n,I) is shiftable ; proof set FOR = for-up (a,i,n,I); set i1 = (a,i) >=0_goto ((card I) + 3); set i2 = AddTo (a,i,n); set PF = ((Load ((a,i) >=0_goto ((card I) + 3))) ';' I) ';' (AddTo (a,i,n)); card (((Load ((a,i) >=0_goto ((card I) + 3))) ';' I) ';' (AddTo (a,i,n))) = (card (((a,i) >=0_goto ((card I) + 3)) ';' I)) + 1 by SCMP_GCD:4 .= ((card I) + 1) + 1 by SCMPDS_6:6 .= (card I) + (1 + 1) ; then (card (((Load ((a,i) >=0_goto ((card I) + 3))) ';' I) ';' (AddTo (a,i,n)))) + (- ((card I) + 2)) = 0 ; hence for-up (a,i,n,I) is shiftable by SCMPDS_4:23; ::_thesis: verum end; end; registration let I be halt-free Program of SCMPDS; let a be Int_position; let i be Integer; let n be Element of NAT ; cluster for-up (a,i,n,I) -> halt-free ; correctness coherence for-up (a,i,n,I) is halt-free ; proof reconsider i3 = goto (- ((card I) + 2)) as No-StopCode Instruction of SCMPDS by SCMPDS_5:21; for-up (a,i,n,I) = ((((a,i) >=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,n))) ';' i3 ; hence for-up (a,i,n,I) is halt-free ; ::_thesis: verum end; end; begin definition let a be Int_position; let i be Integer; let n be Element of NAT ; let I be Program of SCMPDS; func for-down (a,i,n,I) -> Program of SCMPDS equals :: SCMPDS_7:def 2 ((((a,i) <=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,(- n)))) ';' (goto (- ((card I) + 2))); coherence ((((a,i) <=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,(- n)))) ';' (goto (- ((card I) + 2))) is Program of SCMPDS ; end; :: deftheorem defines for-down SCMPDS_7:def_2_:_ for a being Int_position for i being Integer for n being Element of NAT for I being Program of SCMPDS holds for-down (a,i,n,I) = ((((a,i) <=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,(- n)))) ';' (goto (- ((card I) + 2))); begin theorem Th60: :: SCMPDS_7:41 for a being Int_position for i being Integer for n being Element of NAT for I being Program of SCMPDS holds card (for-down (a,i,n,I)) = (card I) + 3 proof let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT for I being Program of SCMPDS holds card (for-down (a,i,n,I)) = (card I) + 3 let i be Integer; ::_thesis: for n being Element of NAT for I being Program of SCMPDS holds card (for-down (a,i,n,I)) = (card I) + 3 let n be Element of NAT ; ::_thesis: for I being Program of SCMPDS holds card (for-down (a,i,n,I)) = (card I) + 3 let I be Program of SCMPDS; ::_thesis: card (for-down (a,i,n,I)) = (card I) + 3 set i1 = (a,i) <=0_goto ((card I) + 3); set i2 = AddTo (a,i,(- n)); set I4 = ((a,i) <=0_goto ((card I) + 3)) ';' I; set I5 = (((a,i) <=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,(- n))); card (((a,i) <=0_goto ((card I) + 3)) ';' I) = (card I) + 1 by SCMPDS_6:6; then card ((((a,i) <=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,(- n)))) = ((card I) + 1) + 1 by SCMP_GCD:4 .= (card I) + (1 + 1) ; hence card (for-down (a,i,n,I)) = ((card I) + 2) + 1 by SCMP_GCD:4 .= (card I) + 3 ; ::_thesis: verum end; Lm4: for a being Int_position for i being Integer for n being Element of NAT for I being Program of SCMPDS holds card (stop (for-down (a,i,n,I))) = (card I) + 4 proof let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT for I being Program of SCMPDS holds card (stop (for-down (a,i,n,I))) = (card I) + 4 let i be Integer; ::_thesis: for n being Element of NAT for I being Program of SCMPDS holds card (stop (for-down (a,i,n,I))) = (card I) + 4 let n be Element of NAT ; ::_thesis: for I being Program of SCMPDS holds card (stop (for-down (a,i,n,I))) = (card I) + 4 let I be Program of SCMPDS; ::_thesis: card (stop (for-down (a,i,n,I))) = (card I) + 4 thus card (stop (for-down (a,i,n,I))) = (card (for-down (a,i,n,I))) + 1 by COMPOS_1:55 .= ((card I) + 3) + 1 by Th60 .= (card I) + 4 ; ::_thesis: verum end; theorem Th61: :: SCMPDS_7:42 for a being Int_position for i being Integer for n, m being Element of NAT for I being Program of SCMPDS holds ( m < (card I) + 3 iff m in dom (for-down (a,i,n,I)) ) proof let a be Int_position; ::_thesis: for i being Integer for n, m being Element of NAT for I being Program of SCMPDS holds ( m < (card I) + 3 iff m in dom (for-down (a,i,n,I)) ) let i be Integer; ::_thesis: for n, m being Element of NAT for I being Program of SCMPDS holds ( m < (card I) + 3 iff m in dom (for-down (a,i,n,I)) ) let n, m be Element of NAT ; ::_thesis: for I being Program of SCMPDS holds ( m < (card I) + 3 iff m in dom (for-down (a,i,n,I)) ) let I be Program of SCMPDS; ::_thesis: ( m < (card I) + 3 iff m in dom (for-down (a,i,n,I)) ) card (for-down (a,i,n,I)) = (card I) + 3 by Th60; hence ( m < (card I) + 3 iff m in dom (for-down (a,i,n,I)) ) by AFINSQ_1:66; ::_thesis: verum end; theorem Th62: :: SCMPDS_7:43 for a being Int_position for i being Integer for n being Element of NAT for I being Program of SCMPDS holds ( (for-down (a,i,n,I)) . 0 = (a,i) <=0_goto ((card I) + 3) & (for-down (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,(- n)) & (for-down (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) ) proof let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT for I being Program of SCMPDS holds ( (for-down (a,i,n,I)) . 0 = (a,i) <=0_goto ((card I) + 3) & (for-down (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,(- n)) & (for-down (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) ) let i be Integer; ::_thesis: for n being Element of NAT for I being Program of SCMPDS holds ( (for-down (a,i,n,I)) . 0 = (a,i) <=0_goto ((card I) + 3) & (for-down (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,(- n)) & (for-down (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) ) let n be Element of NAT ; ::_thesis: for I being Program of SCMPDS holds ( (for-down (a,i,n,I)) . 0 = (a,i) <=0_goto ((card I) + 3) & (for-down (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,(- n)) & (for-down (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) ) let I be Program of SCMPDS; ::_thesis: ( (for-down (a,i,n,I)) . 0 = (a,i) <=0_goto ((card I) + 3) & (for-down (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,(- n)) & (for-down (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) ) set i1 = (a,i) <=0_goto ((card I) + 3); set i2 = AddTo (a,i,(- n)); set i3 = goto (- ((card I) + 2)); set I4 = ((a,i) <=0_goto ((card I) + 3)) ';' I; set I5 = (((a,i) <=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,(- n))); set J6 = (AddTo (a,i,(- n))) ';' (goto (- ((card I) + 2))); set J5 = I ';' ((AddTo (a,i,(- n))) ';' (goto (- ((card I) + 2)))); set FLOOP = for-down (a,i,n,I); for-down (a,i,n,I) = (((a,i) <=0_goto ((card I) + 3)) ';' I) ';' ((AddTo (a,i,(- n))) ';' (goto (- ((card I) + 2)))) by SCMPDS_4:13; then for-down (a,i,n,I) = ((a,i) <=0_goto ((card I) + 3)) ';' (I ';' ((AddTo (a,i,(- n))) ';' (goto (- ((card I) + 2))))) by SCMPDS_4:14; hence (for-down (a,i,n,I)) . 0 = (a,i) <=0_goto ((card I) + 3) by SCMPDS_6:7; ::_thesis: ( (for-down (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,(- n)) & (for-down (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) ) A1: card (((a,i) <=0_goto ((card I) + 3)) ';' I) = (card I) + 1 by SCMPDS_6:6; hence (for-down (a,i,n,I)) . ((card I) + 1) = AddTo (a,i,(- n)) by SCMP_GCD:7; ::_thesis: (for-down (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) card ((((a,i) <=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,(- n)))) = ((card I) + 1) + 1 by A1, SCMP_GCD:4 .= (card I) + (1 + 1) ; hence (for-down (a,i,n,I)) . ((card I) + 2) = goto (- ((card I) + 2)) by SCMP_GCD:6; ::_thesis: verum end; theorem Th63: :: SCMPDS_7:44 for P being Instruction-Sequence of SCMPDS for s being State of SCMPDS for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being State of SCMPDS for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) let s be State of SCMPDS; ::_thesis: for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) let I be Program of SCMPDS; ::_thesis: for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) let i be Integer; ::_thesis: for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) let n be Element of NAT ; ::_thesis: ( s . (DataLoc ((s . a),i)) <= 0 implies ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) ) set d1 = DataLoc ((s . a),i); assume A1: s . (DataLoc ((s . a),i)) <= 0 ; ::_thesis: ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) set i1 = (a,i) <=0_goto ((card I) + 3); set i2 = AddTo (a,i,(- n)); set i3 = goto (- ((card I) + 2)); set FOR = for-down (a,i,n,I); set pFOR = stop (for-down (a,i,n,I)); set s3 = Initialize s; set P3 = P +* (stop (for-down (a,i,n,I))); set s4 = Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),1); set P4 = P +* (stop (for-down (a,i,n,I))); A3: IC (Initialize s) = 0 by MEMSTR_0:def_11; A4: not DataLoc ((s . a),i) in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; not a in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; then A5: (Initialize s) . (DataLoc (((Initialize s) . a),i)) = (Initialize s) . (DataLoc ((s . a),i)) by FUNCT_4:11 .= s . (DataLoc ((s . a),i)) by A4, FUNCT_4:11 ; A6: for-down (a,i,n,I) = ((a,i) <=0_goto ((card I) + 3)) ';' ((I ';' (AddTo (a,i,(- n)))) ';' (goto (- ((card I) + 2)))) by Th15; Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),(0 + 1)) = Following ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),0))) by EXTPRO_1:3 .= Following ((P +* (stop (for-down (a,i,n,I)))),(Initialize s)) .= Exec (((a,i) <=0_goto ((card I) + 3)),(Initialize s)) by A6, SCMPDS_6:11 ; then A7: IC (Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),1)) = ICplusConst ((Initialize s),((card I) + 3)) by A1, A5, SCMPDS_2:56 .= 0 + ((card I) + 3) by A3, SCMPDS_6:12 ; A8: card (for-down (a,i,n,I)) = (card I) + 3 by Th60; then A9: (card I) + 3 in dom (stop (for-down (a,i,n,I))) by COMPOS_1:64; stop (for-down (a,i,n,I)) c= P +* (stop (for-down (a,i,n,I))) by FUNCT_4:25; then (P +* (stop (for-down (a,i,n,I)))) . ((card I) + 3) = (stop (for-down (a,i,n,I))) . ((card I) + 3) by A9, GRFUNC_1:2 .= halt SCMPDS by A8, COMPOS_1:64 ; then A11: CurInstr ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),1))) = halt SCMPDS by A7, PBOOLE:143; now__::_thesis:_for_k_being_Element_of_NAT_holds_IC_(Comput_((P_+*_(stop_(for-down_(a,i,n,I)))),(Initialize_s),k))_in_dom_(stop_(for-down_(a,i,n,I))) let k be Element of NAT ; ::_thesis: IC (Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),b1)) in dom (stop (for-down (a,i,n,I))) percases ( 0 < k or k = 0 ) ; suppose 0 < k ; ::_thesis: IC (Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),b1)) in dom (stop (for-down (a,i,n,I))) then 1 + 0 <= k by INT_1:7; hence IC (Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),k)) in dom (stop (for-down (a,i,n,I))) by A9, A7, A11, EXTPRO_1:5; ::_thesis: verum end; suppose k = 0 ; ::_thesis: IC (Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),b1)) in dom (stop (for-down (a,i,n,I))) then Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),k) = Initialize s by EXTPRO_1:2; hence IC (Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),k)) in dom (stop (for-down (a,i,n,I))) by A3, COMPOS_1:36; ::_thesis: verum end; end; end; hence for-down (a,i,n,I) is_closed_on s,P by SCMPDS_6:def_2; ::_thesis: for-down (a,i,n,I) is_halting_on s,P P +* (stop (for-down (a,i,n,I))) halts_on Initialize s by A11, EXTPRO_1:29; hence for-down (a,i,n,I) is_halting_on s,P by SCMPDS_6:def_3; ::_thesis: verum end; theorem Th64: :: SCMPDS_7:45 for P being Instruction-Sequence of SCMPDS for s being State of SCMPDS for I being Program of SCMPDS for a, c being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds IExec ((for-down (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being State of SCMPDS for I being Program of SCMPDS for a, c being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds IExec ((for-down (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) let s be State of SCMPDS; ::_thesis: for I being Program of SCMPDS for a, c being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds IExec ((for-down (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) let I be Program of SCMPDS; ::_thesis: for a, c being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds IExec ((for-down (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) let a, c be Int_position; ::_thesis: for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds IExec ((for-down (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) let i be Integer; ::_thesis: for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds IExec ((for-down (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) let n be Element of NAT ; ::_thesis: ( s . (DataLoc ((s . a),i)) <= 0 implies IExec ((for-down (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) ) set d1 = DataLoc ((s . a),i); set FOR = for-down (a,i,n,I); set pFOR = stop (for-down (a,i,n,I)); set s3 = Initialize s; set P3 = P +* (stop (for-down (a,i,n,I))); set s4 = Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),1); set P4 = P +* (stop (for-down (a,i,n,I))); set i1 = (a,i) <=0_goto ((card I) + 3); set i2 = AddTo (a,i,(- n)); set i3 = goto (- ((card I) + 2)); set SAl = Start-At (((card I) + 3),SCMPDS); A2: IC (Initialize s) = 0 by MEMSTR_0:def_11; A3: not DataLoc ((s . a),i) in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; A4: stop (for-down (a,i,n,I)) c= P +* (stop (for-down (a,i,n,I))) by FUNCT_4:25; not a in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; then A5: (Initialize s) . (DataLoc (((Initialize s) . a),i)) = (Initialize s) . (DataLoc ((s . a),i)) by FUNCT_4:11 .= s . (DataLoc ((s . a),i)) by A3, FUNCT_4:11 ; A6: for-down (a,i,n,I) = ((a,i) <=0_goto ((card I) + 3)) ';' ((I ';' (AddTo (a,i,(- n)))) ';' (goto (- ((card I) + 2)))) by Th15; A7: Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),(0 + 1)) = Following ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),0))) by EXTPRO_1:3 .= Following ((P +* (stop (for-down (a,i,n,I)))),(Initialize s)) .= Exec (((a,i) <=0_goto ((card I) + 3)),(Initialize s)) by A6, SCMPDS_6:11 ; assume s . (DataLoc ((s . a),i)) <= 0 ; ::_thesis: IExec ((for-down (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) then A8: IC (Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),1)) = ICplusConst ((Initialize s),((card I) + 3)) by A7, A5, SCMPDS_2:56 .= 0 + ((card I) + 3) by A2, SCMPDS_6:12 ; A11: card (for-down (a,i,n,I)) = (card I) + 3 by Th60; then (card I) + 3 in dom (stop (for-down (a,i,n,I))) by COMPOS_1:64; then (P +* (stop (for-down (a,i,n,I)))) . ((card I) + 3) = (stop (for-down (a,i,n,I))) . ((card I) + 3) by A4, GRFUNC_1:2 .= halt SCMPDS by A11, COMPOS_1:64 ; then A12: CurInstr ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),1))) = halt SCMPDS by A8, PBOOLE:143; then A13: P +* (stop (for-down (a,i,n,I))) halts_on Initialize s by EXTPRO_1:29; A14: CurInstr ((P +* (stop (for-down (a,i,n,I)))),(Initialize s)) = (a,i) <=0_goto ((card I) + 3) by A6, SCMPDS_6:11; now__::_thesis:_for_l_being_Element_of_NAT_st_l_<_0_+_1_holds_ CurInstr_((P_+*_(stop_(for-down_(a,i,n,I)))),(Comput_((P_+*_(stop_(for-down_(a,i,n,I)))),(Initialize_s),l)))_<>_halt_SCMPDS let l be Element of NAT ; ::_thesis: ( l < 0 + 1 implies CurInstr ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),l))) <> halt SCMPDS ) assume l < 0 + 1 ; ::_thesis: CurInstr ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),l))) <> halt SCMPDS then l = 0 by NAT_1:13; hence CurInstr ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),l))) <> halt SCMPDS by A14, EXTPRO_1:2; ::_thesis: verum end; then for l being Element of NAT st CurInstr ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),l))) = halt SCMPDS holds 1 <= l ; then B17: LifeSpan ((P +* (stop (for-down (a,i,n,I)))),(Initialize s)) = 1 by A12, A13, EXTPRO_1:def_15; A19: now__::_thesis:_for_x_being_set_st_x_in_dom_(IExec_((for-down_(a,i,n,I)),P,(Initialize_s)))_holds_ (IExec_((for-down_(a,i,n,I)),P,(Initialize_s)))_._x_=_(s_+*_(Start-At_(((card_I)_+_3),SCMPDS)))_._x let x be set ; ::_thesis: ( x in dom (IExec ((for-down (a,i,n,I)),P,(Initialize s))) implies (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . b1 = (s +* (Start-At (((card I) + 3),SCMPDS))) . b1 ) A20: dom (Start-At (((card I) + 3),SCMPDS)) = {(IC )} by FUNCOP_1:13; assume A21: x in dom (IExec ((for-down (a,i,n,I)),P,(Initialize s))) ; ::_thesis: (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . b1 = (s +* (Start-At (((card I) + 3),SCMPDS))) . b1 percases ( x is Int_position or x = IC ) by A21, SCMPDS_4:6; supposeA22: x is Int_position ; ::_thesis: (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . b1 = (s +* (Start-At (((card I) + 3),SCMPDS))) . b1 then x <> IC by SCMPDS_2:43; then A23: not x in dom (Start-At (((card I) + 3),SCMPDS)) by A20, TARSKI:def_1; TT: not x in dom (Start-At (0,SCMPDS)) by A22, SCMPDS_4:18; thus (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . x = (Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize s),1)) . x by B17, A13, EXTPRO_1:23 .= (Initialize s) . x by A7, A22, SCMPDS_2:56 .= s . x by TT, FUNCT_4:11 .= (s +* (Start-At (((card I) + 3),SCMPDS))) . x by A23, FUNCT_4:11 ; ::_thesis: verum end; supposeA24: x = IC ; ::_thesis: (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . b1 = (s +* (Start-At (((card I) + 3),SCMPDS))) . b1 thus (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . x = (card I) + 3 by A8, B17, A24, A13, EXTPRO_1:23 .= (s +* (Start-At (((card I) + 3),SCMPDS))) . x by A24, FUNCT_4:113 ; ::_thesis: verum end; end; end; dom (IExec ((for-down (a,i,n,I)),P,(Initialize s))) = the carrier of SCMPDS by PARTFUN1:def_2 .= dom (s +* (Start-At (((card I) + 3),SCMPDS))) by PARTFUN1:def_2 ; hence IExec ((for-down (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) by A19, FUNCT_1:2; ::_thesis: verum end; theorem :: SCMPDS_7:46 for P being Instruction-Sequence of SCMPDS for s being State of SCMPDS for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds IC (IExec ((for-down (a,i,n,I)),P,(Initialize s))) = (card I) + 3 proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being State of SCMPDS for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds IC (IExec ((for-down (a,i,n,I)),P,(Initialize s))) = (card I) + 3 let s be State of SCMPDS; ::_thesis: for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds IC (IExec ((for-down (a,i,n,I)),P,(Initialize s))) = (card I) + 3 let I be Program of SCMPDS; ::_thesis: for a being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds IC (IExec ((for-down (a,i,n,I)),P,(Initialize s))) = (card I) + 3 let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds IC (IExec ((for-down (a,i,n,I)),P,(Initialize s))) = (card I) + 3 let i be Integer; ::_thesis: for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds IC (IExec ((for-down (a,i,n,I)),P,(Initialize s))) = (card I) + 3 let n be Element of NAT ; ::_thesis: ( s . (DataLoc ((s . a),i)) <= 0 implies IC (IExec ((for-down (a,i,n,I)),P,(Initialize s))) = (card I) + 3 ) assume s . (DataLoc ((s . a),i)) <= 0 ; ::_thesis: IC (IExec ((for-down (a,i,n,I)),P,(Initialize s))) = (card I) + 3 then IExec ((for-down (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) by Th64; hence IC (IExec ((for-down (a,i,n,I)),P,(Initialize s))) = (card I) + 3 by FUNCT_4:113; ::_thesis: verum end; theorem Th66: :: SCMPDS_7:47 for P being Instruction-Sequence of SCMPDS for s being State of SCMPDS for I being Program of SCMPDS for a, b being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . b = s . b proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being State of SCMPDS for I being Program of SCMPDS for a, b being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . b = s . b let s be State of SCMPDS; ::_thesis: for I being Program of SCMPDS for a, b being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . b = s . b let I be Program of SCMPDS; ::_thesis: for a, b being Int_position for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . b = s . b let a, b be Int_position; ::_thesis: for i being Integer for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . b = s . b let i be Integer; ::_thesis: for n being Element of NAT st s . (DataLoc ((s . a),i)) <= 0 holds (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . b = s . b let n be Element of NAT ; ::_thesis: ( s . (DataLoc ((s . a),i)) <= 0 implies (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . b = s . b ) assume s . (DataLoc ((s . a),i)) <= 0 ; ::_thesis: (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . b = s . b then A1: IExec ((for-down (a,i,n,I)),P,(Initialize s)) = s +* (Start-At (((card I) + 3),SCMPDS)) by Th64; not b in dom (Start-At (((card I) + 3),SCMPDS)) by SCMPDS_4:18; hence (IExec ((for-down (a,i,n,I)),P,(Initialize s))) . b = s . b by A1, FUNCT_4:11; ::_thesis: verum end; Lm5: for I being Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT holds Shift (I,1) c= for-down (a,i,n,I) proof let I be Program of SCMPDS; ::_thesis: for a being Int_position for i being Integer for n being Element of NAT holds Shift (I,1) c= for-down (a,i,n,I) let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT holds Shift (I,1) c= for-down (a,i,n,I) let i be Integer; ::_thesis: for n being Element of NAT holds Shift (I,1) c= for-down (a,i,n,I) let n be Element of NAT ; ::_thesis: Shift (I,1) c= for-down (a,i,n,I) set i1 = (a,i) <=0_goto ((card I) + 3); set i2 = AddTo (a,i,(- n)); set i3 = goto (- ((card I) + 2)); A1: for-down (a,i,n,I) = ((Load ((a,i) <=0_goto ((card I) + 3))) ';' I) ';' ((AddTo (a,i,(- n))) ';' (goto (- ((card I) + 2)))) by SCMPDS_4:13; card (Load ((a,i) <=0_goto ((card I) + 3))) = 1 by COMPOS_1:54; hence Shift (I,1) c= for-down (a,i,n,I) by A1, Th16; ::_thesis: verum end; theorem Th67: :: SCMPDS_7:48 for P being Instruction-Sequence of SCMPDS for s being State of SCMPDS for I being halt-free shiftable Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being State of SCMPDS for I being halt-free shiftable Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) let s be State of SCMPDS; ::_thesis: for I being halt-free shiftable Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) let I be halt-free shiftable Program of SCMPDS; ::_thesis: for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) let i be Integer; ::_thesis: for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) let n be Element of NAT ; ::_thesis: for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) let X be set ; ::_thesis: ( s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) implies ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) ) set b = DataLoc ((s . a),i); set FOR = for-down (a,i,n,I); set pFOR = stop (for-down (a,i,n,I)); set pI = stop I; set i1 = (a,i) <=0_goto ((card I) + 3); set i2 = AddTo (a,i,(- n)); set i3 = goto (- ((card I) + 2)); assume A1: s . (DataLoc ((s . a),i)) > 0 ; ::_thesis: ( DataLoc ((s . a),i) in X or not n > 0 or not a <> DataLoc ((s . a),i) or ex t being 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) or ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) ) defpred S1[ Element of NAT ] means for t being State of SCMPDS for Q being Instruction-Sequence of SCMPDS st t . (DataLoc ((s . a),i)) <= $1 & ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( for-down (a,i,n,I) is_closed_on t,Q & for-down (a,i,n,I) is_halting_on t,Q ); assume A2: not DataLoc ((s . a),i) in X ; ::_thesis: ( not n > 0 or not a <> DataLoc ((s . a),i) or ex t being 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) or ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) ) assume A3: n > 0 ; ::_thesis: ( not a <> DataLoc ((s . a),i) or ex t being 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) or ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) ) assume A5: a <> DataLoc ((s . a),i) ; ::_thesis: ( ex t being 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) or ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) ) assume A6: for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ; ::_thesis: ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) A7: for k being Element of NAT st S1[k] holds S1[k + 1] proof let k be Element of NAT ; ::_thesis: ( S1[k] implies S1[k + 1] ) assume A8: S1[k] ; ::_thesis: S1[k + 1] let t be State of SCMPDS; ::_thesis: for Q being Instruction-Sequence of SCMPDS st t . (DataLoc ((s . a),i)) <= k + 1 & ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( for-down (a,i,n,I) is_closed_on t,Q & for-down (a,i,n,I) is_halting_on t,Q ) let Q be Instruction-Sequence of SCMPDS; ::_thesis: ( t . (DataLoc ((s . a),i)) <= k + 1 & ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a implies ( for-down (a,i,n,I) is_closed_on t,Q & for-down (a,i,n,I) is_halting_on t,Q ) ) assume A9: t . (DataLoc ((s . a),i)) <= k + 1 ; ::_thesis: ( ex x being Int_position st ( x in X & not t . x = s . x ) or not t . a = s . a or ( for-down (a,i,n,I) is_closed_on t,Q & for-down (a,i,n,I) is_halting_on t,Q ) ) assume A10: for x being Int_position st x in X holds t . x = s . x ; ::_thesis: ( not t . a = s . a or ( for-down (a,i,n,I) is_closed_on t,Q & for-down (a,i,n,I) is_halting_on t,Q ) ) A11: for x being Int_position st x in X holds (Initialize t) . x = s . x proof let x be Int_position; ::_thesis: ( x in X implies (Initialize t) . x = s . x ) assume x in X ; ::_thesis: (Initialize t) . x = s . x then t . x = s . x by A10; hence (Initialize t) . x = s . x by SCMPDS_5:15; ::_thesis: verum end; assume A12: t . a = s . a ; ::_thesis: ( for-down (a,i,n,I) is_closed_on t,Q & for-down (a,i,n,I) is_halting_on t,Q ) then A13: (Initialize t) . a = s . a by SCMPDS_5:15; percases ( t . (DataLoc ((s . a),i)) <= 0 or t . (DataLoc ((s . a),i)) > 0 ) ; suppose t . (DataLoc ((s . a),i)) <= 0 ; ::_thesis: ( for-down (a,i,n,I) is_closed_on t,Q & for-down (a,i,n,I) is_halting_on t,Q ) hence ( for-down (a,i,n,I) is_closed_on t,Q & for-down (a,i,n,I) is_halting_on t,Q ) by A12, Th63; ::_thesis: verum end; supposeA14: t . (DataLoc ((s . a),i)) > 0 ; ::_thesis: ( for-down (a,i,n,I) is_closed_on t,Q & for-down (a,i,n,I) is_halting_on t,Q ) set t2 = Initialize t; set t3 = Initialize t; set Q2 = Q +* (stop I); set Q3 = Q +* (stop (for-down (a,i,n,I))); set t4 = Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),1); set Q4 = Q +* (stop (for-down (a,i,n,I))); A17: stop I c= Q +* (stop I) by FUNCT_4:25; A20: for-down (a,i,n,I) = ((a,i) <=0_goto ((card I) + 3)) ';' ((I ';' (AddTo (a,i,(- n)))) ';' (goto (- ((card I) + 2)))) by Th15; A21: Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),(0 + 1)) = Following ((Q +* (stop (for-down (a,i,n,I)))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),0))) by EXTPRO_1:3 .= Following ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t)) .= Exec (((a,i) <=0_goto ((card I) + 3)),(Initialize t)) by A20, SCMPDS_6:11 ; for a being Int_position holds (Initialize t) . a = (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),1)) . a by A21, SCMPDS_2:56; then A23: DataPart (Initialize t) = DataPart (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),1)) by SCMPDS_4:8; A26: (IExec (I,Q,(Initialize t))) . (DataLoc ((s . a),i)) = (Initialize t) . (DataLoc ((s . a),i)) by A6, A11, A13 .= t . (DataLoc ((s . a),i)) by SCMPDS_5:15 ; - (- n) > 0 by A3; then - n < 0 ; then - n <= - 1 by INT_1:8; then A27: (- n) + (t . (DataLoc ((s . a),i))) <= (- 1) + (t . (DataLoc ((s . a),i))) by XREAL_1:6; (t . (DataLoc ((s . a),i))) - 1 <= k by A9, XREAL_1:20; then A28: (- n) + (t . (DataLoc ((s . a),i))) <= k by A27, XXREAL_0:2; I is_closed_on Initialize t,Q by A6, A11, A13; then A29: I is_closed_on t,Q by SCMPDS_6:125; then A30: I is_closed_on Initialize t,Q +* (stop I) by SCMPDS_6:24; A31: not DataLoc ((s . a),i) in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; set m2 = LifeSpan ((Q +* (stop I)),(Initialize t)); set t5 = Comput ((Q +* (stop (for-down (a,i,n,I)))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t)))); set Q5 = Q +* (stop (for-down (a,i,n,I))); set l1 = (card I) + 1; A32: IC (Initialize t) = 0 by MEMSTR_0:def_11; set m3 = (LifeSpan ((Q +* (stop I)),(Initialize t))) + 1; set t6 = Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)); set Q6 = Q +* (stop (for-down (a,i,n,I))); (card I) + 1 < (card I) + 3 by XREAL_1:6; then A33: (card I) + 1 in dom (for-down (a,i,n,I)) by Th61; set m5 = (((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1; set t8 = Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)); set Q8 = Q +* (stop (for-down (a,i,n,I))); set t7 = Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)); set Q7 = Q +* (stop (for-down (a,i,n,I))); A34: (IExec (I,Q,(Initialize t))) . a = (Initialize t) . a by A6, A11, A13 .= t . a by SCMPDS_5:15 ; set l2 = (card I) + 2; A35: 0 in dom (stop (for-down (a,i,n,I))) by COMPOS_1:36; (card I) + 2 < (card I) + 3 by XREAL_1:6; then A36: (card I) + 2 in dom (for-down (a,i,n,I)) by Th61; A37: stop (for-down (a,i,n,I)) c= Q +* (stop (for-down (a,i,n,I))) by FUNCT_4:25; for-down (a,i,n,I) c= stop (for-down (a,i,n,I)) by AFINSQ_1:74; then A38: for-down (a,i,n,I) c= Q +* (stop (for-down (a,i,n,I))) by A37, XBOOLE_1:1; Shift (I,1) c= for-down (a,i,n,I) by Lm5; then A39: Shift (I,1) c= Q +* (stop (for-down (a,i,n,I))) by A38, XBOOLE_1:1; I is_halting_on Initialize t,Q by A6, A11, A13; then I is_halting_on t,Q by SCMPDS_6:126; then A40: Q +* (stop I) halts_on Initialize t by SCMPDS_6:def_3; (Q +* (stop I)) +* (stop I) halts_on Initialize (Initialize t) by A40; then A42: I is_halting_on Initialize t,Q +* (stop I) by SCMPDS_6:def_3; not a in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; then (Initialize t) . (DataLoc (((Initialize t) . a),i)) = (Initialize t) . (DataLoc ((s . a),i)) by A12, FUNCT_4:11 .= t . (DataLoc ((s . a),i)) by A31, FUNCT_4:11 ; then A43: IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),1)) = succ (IC (Initialize t)) by A14, A21, SCMPDS_2:56 .= 0 + 1 by A32 ; then A44: IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) = (card I) + 1 by A17, A42, A30, A23, A39, Th36; A45: (Q +* (stop (for-down (a,i,n,I)))) /. (IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) = (Q +* (stop (for-down (a,i,n,I)))) . (IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) by PBOOLE:143; A46: Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)) = Comput ((Q +* (stop (for-down (a,i,n,I)))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t)))) by EXTPRO_1:4; then A47: CurInstr ((Q +* (stop (for-down (a,i,n,I)))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) = (Q +* (stop (for-down (a,i,n,I)))) . ((card I) + 1) by A17, A42, A30, A43, A23, A39, Th36, A45 .= (for-down (a,i,n,I)) . ((card I) + 1) by A33, A38, GRFUNC_1:2 .= AddTo (a,i,(- n)) by Th62 ; A50: Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)) = Following ((Q +* (stop (for-down (a,i,n,I)))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) by EXTPRO_1:3 .= Exec ((AddTo (a,i,(- n))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) by A47 ; then A51: IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) = succ (IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1)))) by SCMPDS_2:48 .= ((card I) + 1) + 1 by A44, A46, NAT_1:38 .= (card I) + (1 + 1) ; then A52: CurInstr ((Q +* (stop (for-down (a,i,n,I)))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)))) = (Q +* (stop (for-down (a,i,n,I)))) . ((card I) + 2) by PBOOLE:143 .= (for-down (a,i,n,I)) . ((card I) + 2) by A38, A36, GRFUNC_1:2 .= goto (- ((card I) + 2)) by Th62 ; A54: Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)) = Following ((Q +* (stop (for-down (a,i,n,I)))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)))) by EXTPRO_1:3 .= Exec ((goto (- ((card I) + 2))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1)))) by A52 ; then IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) = ICplusConst ((Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))),(0 - ((card I) + 2))) by SCMPDS_2:54 .= 0 by A51, Th1 ; then A55: Initialize (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) = Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)) by MEMSTR_0:46; A57: DataPart (Comput ((Q +* (stop I)),(Initialize t),(LifeSpan ((Q +* (stop I)),(Initialize t))))) = DataPart (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) by A17, A42, A30, A43, A23, A39, Th36; then A58: (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . a = (Comput ((Q +* (stop I)),(Initialize t),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . a by SCMPDS_4:8 .= s . a by A12, A34, A40, EXTPRO_1:23 ; then DataLoc (((Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1))) . a),i) = DataLoc ((s . a),i) by EXTPRO_1:4; then (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . a = (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1))) . a by A5, A50, SCMPDS_2:48 .= s . a by A58, EXTPRO_1:4 ; then A59: (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) . a = s . a by A54, SCMPDS_2:54; A60: now__::_thesis:_for_x_being_Int_position_st_x_in_X_holds_ (Comput_((Q_+*_(stop_(for-down_(a,i,n,I)))),(Initialize_t),((((LifeSpan_((Q_+*_(stop_I)),(Initialize_t)))_+_1)_+_1)_+_1)))_._x_=_s_._x let x be Int_position; ::_thesis: ( x in X implies (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) . x = s . x ) assume A61: x in X ; ::_thesis: (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) . x = s . x (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . x = (Comput ((Q +* (stop I)),(Initialize t),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . x by A57, SCMPDS_4:8 .= (IExec (I,Q,(Initialize t))) . x by A40, EXTPRO_1:23 .= (Initialize t) . x by A6, A61, A11, A13 .= t . x by SCMPDS_5:15 .= s . x by A10, A61 ; then (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . x = s . x by A2, A58, A46, A50, A61, SCMPDS_2:48; hence (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) . x = s . x by A54, SCMPDS_2:54; ::_thesis: verum end; A63: (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),1)),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . (DataLoc ((s . a),i)) = (Comput ((Q +* (stop I)),(Initialize t),(LifeSpan ((Q +* (stop I)),(Initialize t))))) . (DataLoc ((s . a),i)) by A57, SCMPDS_4:8 .= t . (DataLoc ((s . a),i)) by A26, A40, EXTPRO_1:23 ; A64: (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1))) . (DataLoc ((s . a),i)) = (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),(((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1))) . (DataLoc ((s . a),i)) by A54, SCMPDS_2:54 .= (t . (DataLoc ((s . a),i))) + (- n) by A58, A63, A46, A50, SCMPDS_2:48 ; then A65: for-down (a,i,n,I) is_closed_on Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)),Q +* (stop (for-down (a,i,n,I))) by A8, A59, A60, A28; now__::_thesis:_for_k_being_Element_of_NAT_holds_IC_(Comput_((Q_+*_(stop_(for-down_(a,i,n,I)))),(Initialize_t),k))_in_dom_(stop_(for-down_(a,i,n,I))) let k be Element of NAT ; ::_thesis: IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),b1)) in dom (stop (for-down (a,i,n,I))) percases ( k < (((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1 or k >= (((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1 ) ; suppose k < (((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1 ; ::_thesis: IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),b1)) in dom (stop (for-down (a,i,n,I))) then k <= ((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1 by INT_1:7; then A66: ( k <= (LifeSpan ((Q +* (stop I)),(Initialize t))) + 1 or k = ((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1 ) by NAT_1:8; hereby ::_thesis: verum percases ( k <= LifeSpan ((Q +* (stop I)),(Initialize t)) or k = (LifeSpan ((Q +* (stop I)),(Initialize t))) + 1 or k = ((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1 ) by A66, NAT_1:8; supposeA67: k <= LifeSpan ((Q +* (stop I)),(Initialize t)) ; ::_thesis: IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-down (a,i,n,I))) hereby ::_thesis: verum percases ( k = 0 or k <> 0 ) ; suppose k = 0 ; ::_thesis: IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-down (a,i,n,I))) hence IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-down (a,i,n,I))) by A35, A32, EXTPRO_1:2; ::_thesis: verum end; suppose k <> 0 ; ::_thesis: IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-down (a,i,n,I))) then consider kn being Nat such that A68: k = kn + 1 by NAT_1:6; reconsider kn = kn as Element of NAT by ORDINAL1:def_12; reconsider lm = IC (Comput ((Q +* (stop I)),(Initialize t),kn)) as Element of NAT ; kn < k by A68, XREAL_1:29; then kn < LifeSpan ((Q +* (stop I)),(Initialize t)) by A67, XXREAL_0:2; then (IC (Comput ((Q +* (stop I)),(Initialize t),kn))) + 1 = IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),1)),kn)) by A17, A42, A30, A43, A23, A39, Th34; then A69: IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),k)) = lm + 1 by A68, EXTPRO_1:4; IC (Comput ((Q +* (stop I)),(Initialize t),kn)) in dom (stop I) by A29, SCMPDS_6:def_2; then lm < card (stop I) by AFINSQ_1:66; then lm < (card I) + 1 by COMPOS_1:55; then A70: lm + 1 <= (card I) + 1 by INT_1:7; (card I) + 1 < (card I) + 4 by XREAL_1:6; then lm + 1 < (card I) + 4 by A70, XXREAL_0:2; then lm + 1 < card (stop (for-down (a,i,n,I))) by Lm4; hence IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-down (a,i,n,I))) by A69, AFINSQ_1:66; ::_thesis: verum end; end; end; end; supposeA71: k = (LifeSpan ((Q +* (stop I)),(Initialize t))) + 1 ; ::_thesis: IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-down (a,i,n,I))) (card I) + 1 in dom (stop (for-down (a,i,n,I))) by A33, COMPOS_1:62; hence IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-down (a,i,n,I))) by A17, A42, A30, A43, A23, A39, A46, A71, Th36; ::_thesis: verum end; suppose k = ((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1 ; ::_thesis: IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-down (a,i,n,I))) hence IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-down (a,i,n,I))) by A51, A36, COMPOS_1:62; ::_thesis: verum end; end; end; end; suppose k >= (((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1 ; ::_thesis: IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),b1)) in dom (stop (for-down (a,i,n,I))) then consider nn being Nat such that A72: k = ((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1) + nn by NAT_1:10; reconsider nn = nn as Element of NAT by ORDINAL1:def_12; Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),k) = Comput (((Q +* (stop (for-down (a,i,n,I)))) +* (stop (for-down (a,i,n,I)))),(Initialize (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)))),nn) by A55, A72, EXTPRO_1:4; hence IC (Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),k)) in dom (stop (for-down (a,i,n,I))) by A65, SCMPDS_6:def_2; ::_thesis: verum end; end; end; hence for-down (a,i,n,I) is_closed_on t,Q by SCMPDS_6:def_2; ::_thesis: for-down (a,i,n,I) is_halting_on t,Q RR: Q +* (stop (for-down (a,i,n,I))) = (Q +* (stop (for-down (a,i,n,I)))) +* (stop (for-down (a,i,n,I))) ; for-down (a,i,n,I) is_halting_on Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)),Q +* (stop (for-down (a,i,n,I))) by A8, A59, A60, A64, A28; then Q +* (stop (for-down (a,i,n,I))) halts_on Comput ((Q +* (stop (for-down (a,i,n,I)))),(Initialize t),((((LifeSpan ((Q +* (stop I)),(Initialize t))) + 1) + 1) + 1)) by A55, RR, SCMPDS_6:def_3; then Q +* (stop (for-down (a,i,n,I))) halts_on Initialize t by EXTPRO_1:22; hence for-down (a,i,n,I) is_halting_on t,Q by SCMPDS_6:def_3; ::_thesis: verum end; end; end; reconsider n = s . (DataLoc ((s . a),i)) as Element of NAT by A1, INT_1:3; A73: S1[ 0 ] by Th63; for k being Element of NAT holds S1[k] from NAT_1:sch_1(A73, A7); then A74: S1[n] ; for x being Int_position st x in X holds s . x = s . x ; hence ( for-down (a,i,n,I) is_closed_on s,P & for-down (a,i,n,I) is_halting_on s,P ) by A74; ::_thesis: verum end; theorem Th68: :: SCMPDS_7:49 for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for I being halt-free shiftable Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for I being halt-free shiftable Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) let s be 0 -started State of SCMPDS; ::_thesis: for I being halt-free shiftable Program of SCMPDS for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) let I be halt-free shiftable Program of SCMPDS; ::_thesis: for a being Int_position for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) let a be Int_position; ::_thesis: for i being Integer for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) let i be Integer; ::_thesis: for n being Element of NAT for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) let n be Element of NAT ; ::_thesis: for X being set st s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) holds IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) let X be set ; ::_thesis: ( s . (DataLoc ((s . a),i)) > 0 & not DataLoc ((s . a),i) in X & n > 0 & a <> DataLoc ((s . a),i) & ( for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) implies IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) ) set b = DataLoc ((s . a),i); set FOR = for-down (a,i,n,I); set pFOR = stop (for-down (a,i,n,I)); set P1 = P +* (stop (for-down (a,i,n,I))); set i1 = (a,i) <=0_goto ((card I) + 3); set i2 = AddTo (a,i,(- n)); set i3 = goto (- ((card I) + 2)); assume A2: s . (DataLoc ((s . a),i)) > 0 ; ::_thesis: ( DataLoc ((s . a),i) in X or not n > 0 or not a <> DataLoc ((s . a),i) or ex t being 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) or IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) ) set s4 = Comput ((P +* (stop (for-down (a,i,n,I)))),s,1); set P4 = P +* (stop (for-down (a,i,n,I))); A3: IC s = 0 by MEMSTR_0:def_11; set m0 = LifeSpan ((P +* (stop (for-down (a,i,n,I)))),s); set l2 = (card I) + 2; set sI = s; set PI = P +* (stop I); set m1 = (LifeSpan ((P +* (stop I)),s)) + 3; set J = I ';' (AddTo (a,i,(- n))); set sJ = s; set PJ = P +* (stop (I ';' (AddTo (a,i,(- n))))); set s2 = Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)); set P2 = P +* (stop (for-down (a,i,n,I))); set m2 = LifeSpan ((P +* (stop (for-down (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))); set Es = IExec ((I ';' (AddTo (a,i,(- n)))),P,s); set bj = DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i); A7: stop I c= P +* (stop I) by FUNCT_4:25; A11: for-down (a,i,n,I) = ((a,i) <=0_goto ((card I) + 3)) ';' ((I ';' (AddTo (a,i,(- n)))) ';' (goto (- ((card I) + 2)))) by Th15; set mI = LifeSpan ((P +* (stop I)),s); set s5 = Comput ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s))); set P5 = P +* (stop (for-down (a,i,n,I))); set l1 = (card I) + 1; set m3 = (LifeSpan ((P +* (stop I)),s)) + 1; set s6 = Comput ((P +* (stop (for-down (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)); set P6 = P +* (stop (for-down (a,i,n,I))); set s7 = Comput ((P +* (stop (for-down (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1)); set P7 = P +* (stop (for-down (a,i,n,I))); A12: stop (for-down (a,i,n,I)) c= P +* (stop (for-down (a,i,n,I))) by FUNCT_4:25; for-down (a,i,n,I) c= stop (for-down (a,i,n,I)) by AFINSQ_1:74; then A13: for-down (a,i,n,I) c= P +* (stop (for-down (a,i,n,I))) by A12, XBOOLE_1:1; Shift (I,1) c= for-down (a,i,n,I) by Lm5; then A14: Shift (I,1) c= P +* (stop (for-down (a,i,n,I))) by A13, XBOOLE_1:1; (card I) + 2 < (card I) + 3 by XREAL_1:6; then A15: (card I) + 2 in dom (for-down (a,i,n,I)) by Th61; set m5 = (((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1; set s8 = Comput ((P +* (stop (for-down (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1)); (card I) + 1 < (card I) + 3 by XREAL_1:6; then A17: (card I) + 1 in dom (for-down (a,i,n,I)) by Th61; assume A18: not DataLoc ((s . a),i) in X ; ::_thesis: ( not n > 0 or not a <> DataLoc ((s . a),i) or ex t being 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) or IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) ) assume A19: n > 0 ; ::_thesis: ( not a <> DataLoc ((s . a),i) or ex t being 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) or IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) ) assume A21: a <> DataLoc ((s . a),i) ; ::_thesis: ( ex t being 0 -started State of SCMPDS ex Q being Instruction-Sequence of SCMPDS st ( ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a & not ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) or IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) ) I: Initialize s = s by MEMSTR_0:44; assume A22: for t being 0 -started State of SCMPDS for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = s . x ) & t . a = s . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc ((s . a),i)) = t . (DataLoc ((s . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ; ::_thesis: IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) then for-down (a,i,n,I) is_halting_on s,P by A2, A18, A19, A21, Th67; then A23: P +* (stop (for-down (a,i,n,I))) halts_on s by I, SCMPDS_6:def_3; A24: for x being Int_position st x in X holds s . x = s . x ; then A25: (IExec (I,P,s)) . (DataLoc ((s . a),i)) = s . (DataLoc ((s . a),i)) by A22; A26: (IExec (I,P,s)) . a = s . a by A22, A24; A27: DataLoc ((s . a),i) = DataLoc (((IExec (I,P,s)) . a),i) by A22, A24; A28: (IExec (I,P,s)) . a = s . a by A22, A24; A29: Comput ((P +* (stop (for-down (a,i,n,I)))),s,(0 + 1)) = Following ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,0))) by EXTPRO_1:3 .= Following ((P +* (stop (for-down (a,i,n,I)))),s) .= Exec (((a,i) <=0_goto ((card I) + 3)),s) by A11, I, SCMPDS_6:11 ; A30: IC (Comput ((P +* (stop (for-down (a,i,n,I)))),s,1)) = succ (IC s) by A2, A29, SCMPDS_2:56 .= 0 + 1 by A3 ; for a being Int_position holds s . a = (Comput ((P +* (stop (for-down (a,i,n,I)))),s,1)) . a by A29, SCMPDS_2:56; then A32: DataPart s = DataPart (Comput ((P +* (stop (for-down (a,i,n,I)))),s,1)) by SCMPDS_4:8; A33: I is_halting_on s,P by A22, A24; then A34: P +* (stop I) halts_on s by I, SCMPDS_6:def_3; P +* (stop I) = (P +* (stop I)) +* (stop I) ; then A36: I is_halting_on s,P +* (stop I) by A34, I, SCMPDS_6:def_3; A37: I is_closed_on s,P by A22, A24; then A38: (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . (DataLoc ((s . a),i)) = (Exec ((AddTo (a,i,(- n))),(IExec (I,P,s)))) . (DataLoc ((s . a),i)) by A33, Th50 .= ((IExec (I,P,s)) . (DataLoc ((s . a),i))) + (- n) by A26, SCMPDS_2:48 .= (s . (DataLoc ((s . a),i))) + (- n) by A22, A24 ; A39: (P +* (stop (for-down (a,i,n,I)))) /. (IC (Comput ((P +* (stop (for-down (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)))) = (P +* (stop (for-down (a,i,n,I)))) . (IC (Comput ((P +* (stop (for-down (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)))) by PBOOLE:143; A40: I is_closed_on s,P +* (stop I) by A22, A24; then A41: IC (Comput ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s)))) = (card I) + 1 by A7, A36, A30, A32, A14, Th36; A42: Comput ((P +* (stop (for-down (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)) = Comput ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s))) by EXTPRO_1:4; then A43: CurInstr ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)))) = (P +* (stop (for-down (a,i,n,I)))) . ((card I) + 1) by A7, A36, A40, A30, A32, A14, Th36, A39 .= (for-down (a,i,n,I)) . ((card I) + 1) by A17, A13, GRFUNC_1:2 .= AddTo (a,i,(- n)) by Th62 ; A44: DataPart (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))) = DataPart (Comput ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s)))) by A7, A36, A40, A30, A32, A14, Th36; then A45: (Comput ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s)))) . a = (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))) . a by SCMPDS_4:8 .= s . a by A28, A34, EXTPRO_1:23 ; A46: (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a = (Exec ((AddTo (a,i,(- n))),(IExec (I,P,s)))) . a by A37, A33, Th50 .= s . a by A21, A26, SCMPDS_2:48 ; now__::_thesis:_for-down_(a,i,n,I)_is_halting_on_IExec_((I_';'_(AddTo_(a,i,(-_n)))),P,s),P percases ( (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) <= 0 or (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) > 0 ) ; suppose (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) <= 0 ; ::_thesis: for-down (a,i,n,I) is_halting_on IExec ((I ';' (AddTo (a,i,(- n)))),P,s),P hence for-down (a,i,n,I) is_halting_on IExec ((I ';' (AddTo (a,i,(- n)))),P,s),P by Th63; ::_thesis: verum end; supposeA47: (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) > 0 ; ::_thesis: for-down (a,i,n,I) is_halting_on IExec ((I ';' (AddTo (a,i,(- n)))),P,s),P now__::_thesis:_for_t_being_0_-started_State_of_SCMPDS for_Q_being_Instruction-Sequence_of_SCMPDS_st_(_for_x_being_Int_position_st_x_in_X_holds_ t_._x_=_(IExec_((I_';'_(AddTo_(a,i,(-_n)))),P,s))_._x_)_&_t_._a_=_(IExec_((I_';'_(AddTo_(a,i,(-_n)))),P,s))_._a_holds_ (_(IExec_(I,Q,t))_._a_=_t_._a_&_(IExec_(I,Q,t))_._(DataLoc_(((IExec_((I_';'_(AddTo_(a,i,(-_n)))),P,s))_._a),i))_=_t_._(DataLoc_(((IExec_((I_';'_(AddTo_(a,i,(-_n)))),P,s))_._a),i))_&_I_is_closed_on_t,Q_&_I_is_halting_on_t,Q_&_(_for_y_being_Int_position_st_y_in_X_holds_ (IExec_(I,Q,t))_._y_=_t_._y_)_) let t be 0 -started State of SCMPDS; ::_thesis: for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in X holds t . x = (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . x ) & t . a = (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a holds ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) = t . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) let Q be Instruction-Sequence of SCMPDS; ::_thesis: ( ( for x being Int_position st x in X holds t . x = (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . x ) & t . a = (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a implies ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) = t . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) ) assume that A48: for x being Int_position st x in X holds t . x = (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . x and A49: t . a = (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a ; ::_thesis: ( (IExec (I,Q,t)) . a = t . a & (IExec (I,Q,t)) . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) = t . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) A50: now__::_thesis:_for_x_being_Int_position_st_x_in_X_holds_ t_._x_=_s_._x let x be Int_position; ::_thesis: ( x in X implies t . x = s . x ) assume A51: x in X ; ::_thesis: t . x = s . x hence t . x = (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . x by A48 .= (Exec ((AddTo (a,i,(- n))),(IExec (I,P,s)))) . x by A37, A33, Th50 .= (IExec (I,P,s)) . x by A18, A26, A51, SCMPDS_2:48 .= s . x by A22, A24, A51 ; ::_thesis: verum end; hence (IExec (I,Q,t)) . a = t . a by A22, A46, A49; ::_thesis: ( (IExec (I,Q,t)) . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) = t . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) & I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) thus (IExec (I,Q,t)) . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) = t . (DataLoc (((IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . a),i)) by A22, A46, A49, A50; ::_thesis: ( I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) thus ( I is_closed_on t,Q & I is_halting_on t,Q & ( for y being Int_position st y in X holds (IExec (I,Q,t)) . y = t . y ) ) by A22, A46, A49, A50; ::_thesis: verum end; hence for-down (a,i,n,I) is_halting_on IExec ((I ';' (AddTo (a,i,(- n)))),P,s),P by A18, A19, A21, A46, A47, Th67; ::_thesis: verum end; end; end; then A52: P +* (stop (for-down (a,i,n,I))) halts_on Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) by SCMPDS_6:def_3; A55: Comput ((P +* (stop (for-down (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1)) = Following ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)))) by EXTPRO_1:3 .= Exec ((AddTo (a,i,(- n))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)))) by A43 ; then A56: IC (Comput ((P +* (stop (for-down (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1))) = succ (IC (Comput ((P +* (stop (for-down (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 1)))) by SCMPDS_2:48 .= ((card I) + 1) + 1 by A41, A42, NAT_1:38 .= (card I) + (1 + 1) ; then A57: CurInstr ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1)))) = (P +* (stop (for-down (a,i,n,I)))) . ((card I) + 2) by PBOOLE:143 .= (for-down (a,i,n,I)) . ((card I) + 2) by A13, A15, GRFUNC_1:2 .= goto (- ((card I) + 2)) by Th62 ; A59: Comput ((P +* (stop (for-down (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1)) = Following ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1)))) by EXTPRO_1:3 .= Exec ((goto (- ((card I) + 2))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1)))) by A57 ; then IC (Comput ((P +* (stop (for-down (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) = ICplusConst ((Comput ((P +* (stop (for-down (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1))),(0 - ((card I) + 2))) by SCMPDS_2:54 .= 0 by A56, Th1 ; then A60: IC (Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))) = IC (Comput ((P +* (stop (for-down (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 3))) by MEMSTR_0:def_11; A61: (Comput ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s)))) . (DataLoc ((s . a),i)) = (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))) . (DataLoc ((s . a),i)) by A44, SCMPDS_4:8 .= s . (DataLoc ((s . a),i)) by A25, A34, EXTPRO_1:23 ; A62: (Comput ((P +* (stop (for-down (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) . (DataLoc ((s . a),i)) = (Comput ((P +* (stop (for-down (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1))) . (DataLoc ((s . a),i)) by A59, SCMPDS_2:54 .= (s . (DataLoc ((s . a),i))) + (- n) by A45, A61, A42, A55, SCMPDS_2:48 ; now__::_thesis:_for_x_being_Int_position_holds_(Comput_((P_+*_(stop_(for-down_(a,i,n,I)))),s,((((LifeSpan_((P_+*_(stop_I)),s))_+_1)_+_1)_+_1)))_._x_=_(Initialize_(IExec_((I_';'_(AddTo_(a,i,(-_n)))),P,s)))_._x let x be Int_position; ::_thesis: (Comput ((P +* (stop (for-down (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) . b1 = (Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))) . b1 A63: not x in dom (Start-At (0,SCMPDS)) by SCMPDS_4:18; then A64: (Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))) . x = (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . x by FUNCT_4:11; percases ( x = DataLoc ((s . a),i) or x <> DataLoc ((s . a),i) ) ; suppose x = DataLoc ((s . a),i) ; ::_thesis: (Comput ((P +* (stop (for-down (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) . b1 = (Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))) . b1 hence (Comput ((P +* (stop (for-down (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) . x = (Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))) . x by A62, A38, A63, FUNCT_4:11; ::_thesis: verum end; supposeA65: x <> DataLoc ((s . a),i) ; ::_thesis: (Comput ((P +* (stop (for-down (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) . b1 = (Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))) . b1 A67: (Comput ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s)))) . x = (Comput ((P +* (stop I)),s,(LifeSpan ((P +* (stop I)),s)))) . x by A44, SCMPDS_4:8 .= (IExec (I,P,s)) . x by A34, EXTPRO_1:23 ; A68: (Comput ((P +* (stop (for-down (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 1) + 1))) . x = (Comput ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,1)),(LifeSpan ((P +* (stop I)),s)))) . x by A45, A42, A55, A65, SCMPDS_2:48; (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) . x = (Exec ((AddTo (a,i,(- n))),(IExec (I,P,s)))) . x by A37, A33, Th50 .= (IExec (I,P,s)) . x by A27, A65, SCMPDS_2:48 ; hence (Comput ((P +* (stop (for-down (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) . x = (Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))) . x by A59, A64, A67, A68, SCMPDS_2:54; ::_thesis: verum end; end; end; then A69: DataPart (Comput ((P +* (stop (for-down (a,i,n,I)))),s,((((LifeSpan ((P +* (stop I)),s)) + 1) + 1) + 1))) = DataPart (Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))) by SCMPDS_4:8; A71: Comput ((P +* (stop (for-down (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 3)) = Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)) by A69, A60, MEMSTR_0:78; then CurInstr ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,((LifeSpan ((P +* (stop I)),s)) + 3)))) = (a,i) <=0_goto ((card I) + 3) by A11, SCMPDS_6:11; then LifeSpan ((P +* (stop (for-down (a,i,n,I)))),s) > (LifeSpan ((P +* (stop I)),s)) + 3 by A23, EXTPRO_1:36; then consider nn being Nat such that A72: LifeSpan ((P +* (stop (for-down (a,i,n,I)))),s) = ((LifeSpan ((P +* (stop I)),s)) + 3) + nn by NAT_1:10; reconsider nn = nn as Element of NAT by ORDINAL1:def_12; Comput ((P +* (stop (for-down (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 3) + (LifeSpan ((P +* (stop (for-down (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))))))) = Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))),(LifeSpan ((P +* (stop (for-down (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))))) by A71, EXTPRO_1:4; then CurInstr ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),s,(((LifeSpan ((P +* (stop I)),s)) + 3) + (LifeSpan ((P +* (stop (for-down (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))))))))) = halt SCMPDS by A52, EXTPRO_1:def_15; then ((LifeSpan ((P +* (stop I)),s)) + 3) + (LifeSpan ((P +* (stop (for-down (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))))) >= LifeSpan ((P +* (stop (for-down (a,i,n,I)))),s) by A23, EXTPRO_1:def_15; then A74: LifeSpan ((P +* (stop (for-down (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) >= nn by A72, XREAL_1:6; A75: Comput ((P +* (stop (for-down (a,i,n,I)))),s,(LifeSpan ((P +* (stop (for-down (a,i,n,I)))),s))) = Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))),nn) by A71, A72, EXTPRO_1:4; then CurInstr ((P +* (stop (for-down (a,i,n,I)))),(Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))),nn))) = halt SCMPDS by A23, EXTPRO_1:def_15; then nn >= LifeSpan ((P +* (stop (for-down (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) by A52, EXTPRO_1:def_15; then nn = LifeSpan ((P +* (stop (for-down (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) by A74, XXREAL_0:1; then Result ((P +* (stop (for-down (a,i,n,I)))),s) = Comput ((P +* (stop (for-down (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s))),(LifeSpan ((P +* (stop (for-down (a,i,n,I)))),(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))))) by A23, A75, EXTPRO_1:23; hence IExec ((for-down (a,i,n,I)),P,s) = IExec ((for-down (a,i,n,I)),P,(Initialize (IExec ((I ';' (AddTo (a,i,(- n)))),P,s)))) by A52, EXTPRO_1:23; ::_thesis: verum end; registration let I be shiftable Program of SCMPDS; let a be Int_position; let i be Integer; let n be Element of NAT ; cluster for-down (a,i,n,I) -> shiftable ; correctness coherence for-down (a,i,n,I) is shiftable ; proof set FOR = for-down (a,i,n,I); set i1 = (a,i) <=0_goto ((card I) + 3); set i2 = AddTo (a,i,(- n)); reconsider PF = ((Load ((a,i) <=0_goto ((card I) + 3))) ';' I) ';' (AddTo (a,i,(- n))) as shiftable Program of SCMPDS ; card PF = (card (((a,i) <=0_goto ((card I) + 3)) ';' I)) + 1 by SCMP_GCD:4 .= ((card I) + 1) + 1 by SCMPDS_6:6 .= (card I) + (1 + 1) ; then (card PF) + (- ((card I) + 2)) = 0 ; hence for-down (a,i,n,I) is shiftable by SCMPDS_4:23; ::_thesis: verum end; end; registration let I be halt-free Program of SCMPDS; let a be Int_position; let i be Integer; let n be Element of NAT ; cluster for-down (a,i,n,I) -> halt-free ; correctness coherence for-down (a,i,n,I) is halt-free ; proof reconsider i3 = goto (- ((card I) + 2)) as No-StopCode Instruction of SCMPDS by SCMPDS_5:21; for-down (a,i,n,I) = ((((a,i) <=0_goto ((card I) + 3)) ';' I) ';' (AddTo (a,i,(- n)))) ';' i3 ; hence for-down (a,i,n,I) is halt-free ; ::_thesis: verum end; end; begin definition let n be Element of NAT ; func sum n -> Program of SCMPDS equals :: SCMPDS_7:def 3 (((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)) ';' (for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))); coherence (((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)) ';' (for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))) is Program of SCMPDS ; end; :: deftheorem defines sum SCMPDS_7:def_3_:_ for n being Element of NAT holds sum n = (((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)) ';' (for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))); theorem Th69: :: SCMPDS_7:50 for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS st s . GBP = 0 holds ( for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_closed_on s,P & for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_halting_on s,P ) proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS st s . GBP = 0 holds ( for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_closed_on s,P & for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_halting_on s,P ) set I = Load (AddTo (GBP,3,1)); let s be 0 -started State of SCMPDS; ::_thesis: ( s . GBP = 0 implies ( for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_closed_on s,P & for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_halting_on s,P ) ) assume A1: s . GBP = 0 ; ::_thesis: ( for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_closed_on s,P & for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_halting_on s,P ) percases ( s . (DataLoc ((s . GBP),2)) <= 0 or s . (DataLoc ((s . GBP),2)) > 0 ) ; suppose s . (DataLoc ((s . GBP),2)) <= 0 ; ::_thesis: ( for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_closed_on s,P & for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_halting_on s,P ) hence ( for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_closed_on s,P & for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_halting_on s,P ) by Th63; ::_thesis: verum end; supposeA2: s . (DataLoc ((s . GBP),2)) > 0 ; ::_thesis: ( for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_closed_on s,P & for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_halting_on s,P ) A3: now__::_thesis:_for_t_being_0_-started_State_of_SCMPDS for_Q_being_Instruction-Sequence_of_SCMPDS_st_(_for_x_being_Int_position_st_x_in_{GBP}_holds_ t_._x_=_s_._x_)_&_t_._GBP_=_s_._GBP_holds_ (_(IExec_((Load_(AddTo_(GBP,3,1))),Q,t))_._GBP_=_t_._GBP_&_(IExec_((Load_(AddTo_(GBP,3,1))),Q,t))_._(DataLoc_((s_._GBP),2))_=_t_._(DataLoc_((s_._GBP),2))_&_Load_(AddTo_(GBP,3,1))_is_closed_on_t,Q_&_Load_(AddTo_(GBP,3,1))_is_halting_on_t,Q_&_(_for_y_being_Int_position_st_y_in_{GBP}_holds_ (IExec_((Load_(AddTo_(GBP,3,1))),Q,t))_._y_=_t_._y_)_) set cv = DataLoc ((s . GBP),2); let t be 0 -started State of SCMPDS; ::_thesis: for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in {GBP} holds t . x = s . x ) & t . GBP = s . GBP holds ( (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . GBP = t . GBP & (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = t . (DataLoc ((s . GBP),2)) & Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) ) let Q be Instruction-Sequence of SCMPDS; ::_thesis: ( ( for x being Int_position st x in {GBP} holds t . x = s . x ) & t . GBP = s . GBP implies ( (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . GBP = t . GBP & (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = t . (DataLoc ((s . GBP),2)) & Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) ) ) II: Initialize t = t by MEMSTR_0:44; assume that for x being Int_position st x in {GBP} holds t . x = s . x and A4: t . GBP = s . GBP ; ::_thesis: ( (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . GBP = t . GBP & (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = t . (DataLoc ((s . GBP),2)) & Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) ) set t0 = Initialize t; (Initialize t) . GBP = 0 by A1, A4, SCMPDS_5:15; then A5: DataLoc (((Initialize t) . GBP),3) = intpos (0 + 3) by SCMP_GCD:1; thus A6: (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . GBP = (Exec ((AddTo (GBP,3,1)),(Initialize t))) . GBP by II, SCMPDS_5:40 .= (Initialize t) . GBP by A5, AMI_3:10, SCMPDS_2:48 .= t . GBP by SCMPDS_5:15 ; ::_thesis: ( (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = t . (DataLoc ((s . GBP),2)) & Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) ) A7: DataLoc ((s . GBP),2) = intpos (0 + 2) by A1, SCMP_GCD:1; thus (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = (Exec ((AddTo (GBP,3,1)),(Initialize t))) . (DataLoc ((s . GBP),2)) by II, SCMPDS_5:40 .= (Initialize t) . (DataLoc ((s . GBP),2)) by A5, A7, AMI_3:10, SCMPDS_2:48 .= t . (DataLoc ((s . GBP),2)) by SCMPDS_5:15 ; ::_thesis: ( Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) ) thus ( Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q ) by SCMPDS_6:20, SCMPDS_6:21; ::_thesis: for y being Int_position st y in {GBP} holds (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y let y be Int_position; ::_thesis: ( y in {GBP} implies (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) assume y in {GBP} ; ::_thesis: (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y then y = GBP by TARSKI:def_1; hence (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y by A6; ::_thesis: verum end; DataLoc ((s . GBP),2) = intpos (0 + 2) by A1, SCMP_GCD:1; then DataLoc ((s . GBP),2) <> GBP by AMI_3:10; then not DataLoc ((s . GBP),2) in {GBP} by TARSKI:def_1; hence ( for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_closed_on s,P & for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_halting_on s,P ) by A1, A2, A3, Th67; ::_thesis: verum end; end; end; theorem Th70: :: SCMPDS_7:51 for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for n being Element of NAT st s . GBP = 0 & s . (intpos 2) = n & s . (intpos 3) = 0 holds (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = n proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for n being Element of NAT st s . GBP = 0 & s . (intpos 2) = n & s . (intpos 3) = 0 holds (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = n set i = AddTo (GBP,3,1); set I = Load (AddTo (GBP,3,1)); set FD = for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))); set a = intpos 3; let s be 0 -started State of SCMPDS; ::_thesis: for n being Element of NAT st s . GBP = 0 & s . (intpos 2) = n & s . (intpos 3) = 0 holds (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = n let n be Element of NAT ; ::_thesis: ( s . GBP = 0 & s . (intpos 2) = n & s . (intpos 3) = 0 implies (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = n ) assume that A1: s . GBP = 0 and A2: s . (intpos 2) = n and A3: s . (intpos 3) = 0 ; ::_thesis: (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = n defpred S1[ Element of NAT ] means for s being 0 -started State of SCMPDS st s . (intpos 2) = $1 & s . GBP = 0 holds (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = $1 + (s . (intpos 3)); 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:_for_s_being_0_-started_State_of_SCMPDS_st_s_._(intpos_2)_=_k_+_1_&_s_._GBP_=_0_holds_ (IExec_((for-down_(GBP,2,1,(Load_(AddTo_(GBP,3,1))))),P,s))_._(intpos_3)_=_(k_+_1)_+_(s_._(intpos_3)) let s be 0 -started State of SCMPDS; ::_thesis: ( s . (intpos 2) = k + 1 & s . GBP = 0 implies (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = (k + 1) + (s . (intpos 3)) ) assume that A6: s . (intpos 2) = k + 1 and A7: s . GBP = 0 ; ::_thesis: (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = (k + 1) + (s . (intpos 3)) GBP <> DataLoc ((s . GBP),2) by A6, A7, SCMP_GCD:1; then A8: not DataLoc ((s . GBP),2) in {GBP} by TARSKI:def_1; A9: now__::_thesis:_for_t_being_0_-started_State_of_SCMPDS for_Q_being_Instruction-Sequence_of_SCMPDS_st_(_for_x_being_Int_position_st_x_in_{GBP}_holds_ t_._x_=_s_._x_)_&_t_._GBP_=_s_._GBP_holds_ (_(IExec_((Load_(AddTo_(GBP,3,1))),Q,t))_._GBP_=_t_._GBP_&_(IExec_((Load_(AddTo_(GBP,3,1))),Q,t))_._(DataLoc_((s_._GBP),2))_=_t_._(DataLoc_((s_._GBP),2))_&_Load_(AddTo_(GBP,3,1))_is_closed_on_t,Q_&_Load_(AddTo_(GBP,3,1))_is_halting_on_t,Q_&_(_for_y_being_Int_position_st_y_in_{GBP}_holds_ (IExec_((Load_(AddTo_(GBP,3,1))),Q,t))_._y_=_t_._y_)_) set cv = DataLoc ((s . GBP),2); let t be 0 -started State of SCMPDS; ::_thesis: for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in {GBP} holds t . x = s . x ) & t . GBP = s . GBP holds ( (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . GBP = t . GBP & (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = t . (DataLoc ((s . GBP),2)) & Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) ) let Q be Instruction-Sequence of SCMPDS; ::_thesis: ( ( for x being Int_position st x in {GBP} holds t . x = s . x ) & t . GBP = s . GBP implies ( (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . GBP = t . GBP & (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = t . (DataLoc ((s . GBP),2)) & Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) ) ) II: Initialize t = t by MEMSTR_0:44; assume that for x being Int_position st x in {GBP} holds t . x = s . x and A10: t . GBP = s . GBP ; ::_thesis: ( (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . GBP = t . GBP & (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = t . (DataLoc ((s . GBP),2)) & Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) ) set t0 = Initialize t; (Initialize t) . GBP = 0 by A7, A10, SCMPDS_5:15; then A11: DataLoc (((Initialize t) . GBP),3) = intpos (0 + 3) by SCMP_GCD:1; then A12: DataLoc ((s . GBP),2) <> DataLoc (((Initialize t) . GBP),3) by A6, A7, AMI_3:10, SCMP_GCD:1; thus A13: (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . GBP = (Exec ((AddTo (GBP,3,1)),(Initialize t))) . GBP by II, SCMPDS_5:40 .= (Initialize t) . GBP by A11, AMI_3:10, SCMPDS_2:48 .= t . GBP by SCMPDS_5:15 ; ::_thesis: ( (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = t . (DataLoc ((s . GBP),2)) & Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) ) thus (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . (DataLoc ((s . GBP),2)) = (Exec ((AddTo (GBP,3,1)),(Initialize t))) . (DataLoc ((s . GBP),2)) by II, SCMPDS_5:40 .= (Initialize t) . (DataLoc ((s . GBP),2)) by A12, SCMPDS_2:48 .= t . (DataLoc ((s . GBP),2)) by SCMPDS_5:15 ; ::_thesis: ( Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q & ( for y being Int_position st y in {GBP} holds (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) ) thus ( Load (AddTo (GBP,3,1)) is_closed_on t,Q & Load (AddTo (GBP,3,1)) is_halting_on t,Q ) by SCMPDS_6:20, SCMPDS_6:21; ::_thesis: for y being Int_position st y in {GBP} holds (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y let y be Int_position; ::_thesis: ( y in {GBP} implies (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y ) assume y in {GBP} ; ::_thesis: (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y then y = GBP by TARSKI:def_1; hence (IExec ((Load (AddTo (GBP,3,1))),Q,t)) . y = t . y by A13; ::_thesis: verum end; set j = AddTo (GBP,2,(- 1)); set s0 = s; set s1 = IExec ((Load (AddTo (GBP,3,1))),P,s); set s2 = IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s); set l2 = intpos 2; set P2 = P; A15: DataLoc ((s . GBP),3) = intpos (0 + 3) by A7, SCMP_GCD:1; A16: (IExec ((Load (AddTo (GBP,3,1))),P,s)) . GBP = (Exec ((AddTo (GBP,3,1)),s)) . GBP by SCMPDS_5:40 .= 0 by A7, A15, AMI_3:10, SCMPDS_2:48 ; then A17: DataLoc (((IExec ((Load (AddTo (GBP,3,1))),P,s)) . GBP),2) = intpos (0 + 2) by SCMP_GCD:1; A18: (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . (intpos 2) = (Exec ((AddTo (GBP,2,(- 1))),(IExec ((Load (AddTo (GBP,3,1))),P,s)))) . (intpos 2) by SCMPDS_5:41 .= ((IExec ((Load (AddTo (GBP,3,1))),P,s)) . (intpos 2)) + (- 1) by A17, SCMPDS_2:48 .= ((Exec ((AddTo (GBP,3,1)),s)) . (intpos 2)) + (- 1) by SCMPDS_5:40 .= (s . (intpos 2)) + (- 1) by A15, AMI_3:10, SCMPDS_2:48 .= k by A6 ; A19: (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . (intpos 3) = (Exec ((AddTo (GBP,2,(- 1))),(IExec ((Load (AddTo (GBP,3,1))),P,s)))) . (intpos 3) by SCMPDS_5:41 .= (IExec ((Load (AddTo (GBP,3,1))),P,s)) . (intpos 3) by A17, AMI_3:10, SCMPDS_2:48 .= (Exec ((AddTo (GBP,3,1)),s)) . (intpos 3) by SCMPDS_5:40 .= (s . (intpos 3)) + 1 by A15, SCMPDS_2:48 ; A20: (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . GBP = (Exec ((AddTo (GBP,2,(- 1))),(IExec ((Load (AddTo (GBP,3,1))),P,s)))) . GBP by SCMPDS_5:41 .= 0 by A16, A17, AMI_3:10, SCMPDS_2:48 ; A21: (Initialize (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s))) . (intpos 2) = (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . (intpos 2) by SCMPDS_5:15; A22: (Initialize (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s))) . (intpos 3) = (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . (intpos 3) by SCMPDS_5:15; A23: (Initialize (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s))) . GBP = (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . GBP by SCMPDS_5:15; DataLoc ((s . GBP),2) = intpos (0 + 2) by A7, SCMP_GCD:1; hence (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,(Initialize (IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s))))) . (intpos 3) by A6, A7, A8, A9, Th68 .= k + ((IExec (((Load (AddTo (GBP,3,1))) ';' (AddTo (GBP,2,(- 1)))),P,s)) . (intpos 3)) by A5, A18, A20, A21, A22, A23 .= (k + 1) + (s . (intpos 3)) by A19 ; ::_thesis: verum end; hence S1[k + 1] ; ::_thesis: verum end; A25: S1[ 0 ] proof let s be 0 -started State of SCMPDS; ::_thesis: ( s . (intpos 2) = 0 & s . GBP = 0 implies (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = 0 + (s . (intpos 3)) ) assume that A26: s . (intpos 2) = 0 and A27: s . GBP = 0 ; ::_thesis: (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = 0 + (s . (intpos 3)) I: Initialize s = s by MEMSTR_0:44; DataLoc ((s . GBP),2) = intpos (0 + 2) by A27, SCMP_GCD:1; hence (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = 0 + (s . (intpos 3)) by A26, Th66, I; ::_thesis: verum end; for k being Element of NAT holds S1[k] from NAT_1:sch_1(A25, A4); hence (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,s)) . (intpos 3) = n + 0 by A1, A2, A3 .= n ; ::_thesis: verum end; theorem :: SCMPDS_7:52 for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for n being Element of NAT holds (IExec ((sum n),P,s)) . (intpos 3) = n proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for n being Element of NAT holds (IExec ((sum n),P,s)) . (intpos 3) = n let s be 0 -started State of SCMPDS; ::_thesis: for n being Element of NAT holds (IExec ((sum n),P,s)) . (intpos 3) = n let n be Element of NAT ; ::_thesis: (IExec ((sum n),P,s)) . (intpos 3) = n set i1 = GBP := 0; set i2 = (GBP,2) := n; set i3 = (GBP,3) := 0; set i4 = AddTo (GBP,3,1); set FD = for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))); set a = intpos 3; set I2 = (GBP := 0) ';' ((GBP,2) := n); set s1 = IExec (((GBP := 0) ';' ((GBP,2) := n)),P,s); set s2 = Exec ((GBP := 0),s); set I3 = ((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0); set s3 = IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s); set P3 = P; A1: ((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0) is_closed_on s,P by SCMPDS_6:20; A2: ((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0) is_halting_on s,P by SCMPDS_6:21; A3: (Exec ((GBP := 0),s)) . GBP = 0 by SCMPDS_2:45; then A4: DataLoc (((Exec ((GBP := 0),s)) . GBP),2) = intpos (0 + 2) by SCMP_GCD:1; A5: (IExec (((GBP := 0) ';' ((GBP,2) := n)),P,s)) . GBP = (Exec (((GBP,2) := n),(Exec ((GBP := 0),s)))) . GBP by SCMPDS_5:42 .= 0 by A3, A4, AMI_3:10, SCMPDS_2:46 ; then A6: DataLoc (((IExec (((GBP := 0) ';' ((GBP,2) := n)),P,s)) . GBP),3) = intpos (0 + 3) by SCMP_GCD:1; A7: (Initialize (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s))) . GBP = (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s)) . GBP by SCMPDS_5:15; A8: (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s)) . GBP = (Exec (((GBP,3) := 0),(IExec (((GBP := 0) ';' ((GBP,2) := n)),P,s)))) . GBP by SCMPDS_5:41 .= 0 by A5, A6, AMI_3:10, SCMPDS_2:46 ; then for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_halting_on Initialize (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s)),P by Th69, A7; then A9: for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_halting_on IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s),P by SCMPDS_6:126; A10: (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s)) . (intpos 2) = (Exec (((GBP,3) := 0),(IExec (((GBP := 0) ';' ((GBP,2) := n)),P,s)))) . (intpos 2) by SCMPDS_5:41 .= (IExec (((GBP := 0) ';' ((GBP,2) := n)),P,s)) . (intpos 2) by A6, AMI_3:10, SCMPDS_2:46 .= (Exec (((GBP,2) := n),(Exec ((GBP := 0),s)))) . (intpos 2) by SCMPDS_5:42 .= n by A4, SCMPDS_2:46 ; A11: (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s)) . (intpos 3) = (Exec (((GBP,3) := 0),(IExec (((GBP := 0) ';' ((GBP,2) := n)),P,s)))) . (intpos 3) by SCMPDS_5:41 .= 0 by A6, SCMPDS_2:46 ; A12: (Initialize (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s))) . (intpos 2) = (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s)) . (intpos 2) by SCMPDS_5:15; A13: (Initialize (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s))) . (intpos 3) = (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s)) . (intpos 3) by SCMPDS_5:15; A14: (Initialize (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s))) . GBP = (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s)) . GBP by SCMPDS_5:15; for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_closed_on Initialize (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s)),P by A8, Th69, A14; then for-down (GBP,2,1,(Load (AddTo (GBP,3,1)))) is_closed_on IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s),P by SCMPDS_6:125; hence (IExec ((sum n),P,s)) . (intpos 3) = (IExec ((for-down (GBP,2,1,(Load (AddTo (GBP,3,1))))),P,(Initialize (IExec ((((GBP := 0) ';' ((GBP,2) := n)) ';' ((GBP,3) := 0)),P,s))))) . (intpos 3) by A1, A2, A9, Th49 .= n by A11, A8, A10, Th70, A12, A13, A14 ; ::_thesis: verum end; definition let sp, control, result, pp, pData be Element of NAT ; func sum (sp,control,result,pp,pData) -> Program of SCMPDS equals :: SCMPDS_7:def 4 ((((intpos sp),result) := 0) ';' ((intpos pp) := pData)) ';' (for-down ((intpos sp),control,1,((AddTo ((intpos sp),result,(intpos pData),0)) ';' (AddTo ((intpos pp),0,1))))); coherence ((((intpos sp),result) := 0) ';' ((intpos pp) := pData)) ';' (for-down ((intpos sp),control,1,((AddTo ((intpos sp),result,(intpos pData),0)) ';' (AddTo ((intpos pp),0,1))))) is Program of SCMPDS ; end; :: deftheorem defines sum SCMPDS_7:def_4_:_ for sp, control, result, pp, pData being Element of NAT holds sum (sp,control,result,pp,pData) = ((((intpos sp),result) := 0) ';' ((intpos pp) := pData)) ';' (for-down ((intpos sp),control,1,((AddTo ((intpos sp),result,(intpos pData),0)) ';' (AddTo ((intpos pp),0,1))))); theorem Th72: :: SCMPDS_7:53 for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for sp, cv, result, pp, pD being Element of NAT st s . (intpos sp) > sp & cv < result & s . (intpos pp) = pD & (s . (intpos sp)) + result < pp & pp < pD & pD < s . (intpos pD) holds ( for-down ((intpos sp),cv,1,((AddTo ((intpos sp),result,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_closed_on s,P & for-down ((intpos sp),cv,1,((AddTo ((intpos sp),result,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_halting_on s,P ) proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for sp, cv, result, pp, pD being Element of NAT st s . (intpos sp) > sp & cv < result & s . (intpos pp) = pD & (s . (intpos sp)) + result < pp & pp < pD & pD < s . (intpos pD) holds ( for-down ((intpos sp),cv,1,((AddTo ((intpos sp),result,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_closed_on s,P & for-down ((intpos sp),cv,1,((AddTo ((intpos sp),result,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_halting_on s,P ) let s be 0 -started State of SCMPDS; ::_thesis: for sp, cv, result, pp, pD being Element of NAT st s . (intpos sp) > sp & cv < result & s . (intpos pp) = pD & (s . (intpos sp)) + result < pp & pp < pD & pD < s . (intpos pD) holds ( for-down ((intpos sp),cv,1,((AddTo ((intpos sp),result,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_closed_on s,P & for-down ((intpos sp),cv,1,((AddTo ((intpos sp),result,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_halting_on s,P ) let sp, cv, fr, pp, pD be Element of NAT ; ::_thesis: ( s . (intpos sp) > sp & cv < fr & s . (intpos pp) = pD & (s . (intpos sp)) + fr < pp & pp < pD & pD < s . (intpos pD) implies ( for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_closed_on s,P & for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_halting_on s,P ) ) set BP = intpos sp; set PD = intpos pD; set PP = intpos pp; assume that A1: s . (intpos sp) > sp and A2: cv < fr and A3: s . (intpos pp) = pD and A4: (s . (intpos sp)) + fr < pp and A5: pp < pD and A6: pD < s . (intpos pD) ; ::_thesis: ( for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_closed_on s,P & for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_halting_on s,P ) set i2 = AddTo ((intpos sp),fr,(intpos pD),0); set i3 = AddTo ((intpos pp),0,1); set I = (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)); percases ( s . (DataLoc ((s . (intpos sp)),cv)) <= 0 or s . (DataLoc ((s . (intpos sp)),cv)) > 0 ) ; suppose s . (DataLoc ((s . (intpos sp)),cv)) <= 0 ; ::_thesis: ( for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_closed_on s,P & for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_halting_on s,P ) hence ( for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_closed_on s,P & for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_halting_on s,P ) by Th63; ::_thesis: verum end; supposeA7: s . (DataLoc ((s . (intpos sp)),cv)) > 0 ; ::_thesis: ( for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_closed_on s,P & for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_halting_on s,P ) reconsider n = s . (intpos sp) as Element of NAT by A1, INT_1:3; n + cv <> sp by A1, NAT_1:11; then abs (n + cv) <> sp by ABSVALUE:def_1; then A8: DataLoc ((s . (intpos sp)),cv) <> intpos sp by XTUPLE_0:1; A9: n + fr > n + cv by A2, XREAL_1:6; A10: now__::_thesis:_for_t_being_0_-started_State_of_SCMPDS for_Q_being_Instruction-Sequence_of_SCMPDS_st_(_for_x_being_Int_position_st_x_in_{(intpos_sp),(intpos_pp)}_holds_ t_._x_=_s_._x_)_&_t_._(intpos_sp)_=_s_._(intpos_sp)_holds_ (_(IExec_(((AddTo_((intpos_sp),fr,(intpos_pD),0))_';'_(AddTo_((intpos_pp),0,1))),Q,t))_._(intpos_sp)_=_t_._(intpos_sp)_&_(IExec_(((AddTo_((intpos_sp),fr,(intpos_pD),0))_';'_(AddTo_((intpos_pp),0,1))),Q,t))_._(DataLoc_((s_._(intpos_sp)),cv))_=_t_._(DataLoc_((s_._(intpos_sp)),cv))_&_(AddTo_((intpos_sp),fr,(intpos_pD),0))_';'_(AddTo_((intpos_pp),0,1))_is_closed_on_t,Q_&_(AddTo_((intpos_sp),fr,(intpos_pD),0))_';'_(AddTo_((intpos_pp),0,1))_is_halting_on_t,Q_&_(_for_y_being_Int_position_st_y_in_{(intpos_sp),(intpos_pp)}_holds_ (IExec_(((AddTo_((intpos_sp),fr,(intpos_pD),0))_';'_(AddTo_((intpos_pp),0,1))),Q,t))_._y_=_t_._y_)_) set Dv = DataLoc ((s . (intpos sp)),cv); let t be 0 -started State of SCMPDS; ::_thesis: for Q being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in {(intpos sp),(intpos pp)} holds t . x = s . x ) & t . (intpos sp) = s . (intpos sp) holds ( (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp) = t . (intpos sp) & (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (DataLoc ((s . (intpos sp)),cv)) = t . (DataLoc ((s . (intpos sp)),cv)) & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_closed_on t,Q & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_halting_on t,Q & ( for y being Int_position st y in {(intpos sp),(intpos pp)} holds (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . y = t . y ) ) let Q be Instruction-Sequence of SCMPDS; ::_thesis: ( ( for x being Int_position st x in {(intpos sp),(intpos pp)} holds t . x = s . x ) & t . (intpos sp) = s . (intpos sp) implies ( (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp) = t . (intpos sp) & (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (DataLoc ((s . (intpos sp)),cv)) = t . (DataLoc ((s . (intpos sp)),cv)) & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_closed_on t,Q & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_halting_on t,Q & ( for y being Int_position st y in {(intpos sp),(intpos pp)} holds (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . y = t . y ) ) ) II: Initialize t = t by MEMSTR_0:44; assume that A11: for x being Int_position st x in {(intpos sp),(intpos pp)} holds t . x = s . x and A12: t . (intpos sp) = s . (intpos sp) ; ::_thesis: ( (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp) = t . (intpos sp) & (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (DataLoc ((s . (intpos sp)),cv)) = t . (DataLoc ((s . (intpos sp)),cv)) & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_closed_on t,Q & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_halting_on t,Q & ( for y being Int_position st y in {(intpos sp),(intpos pp)} holds (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . y = t . y ) ) set t0 = Initialize t; set t1 = Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t)); A13: DataLoc (((Initialize t) . (intpos sp)),fr) = DataLoc (n,fr) by A12, SCMPDS_5:15 .= intpos (n + fr) by SCMP_GCD:1 ; then DataLoc (((Initialize t) . (intpos sp)),fr) <> intpos pp by A4, XTUPLE_0:1; then A14: (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t))) . (intpos pp) = (Initialize t) . (intpos pp) by SCMPDS_2:49 .= t . (intpos pp) by SCMPDS_5:15 ; n + fr <> sp by A1, NAT_1:11; then DataLoc (((Initialize t) . (intpos sp)),fr) <> intpos sp by A13, XTUPLE_0:1; then A15: (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t))) . (intpos sp) = (Initialize t) . (intpos sp) by SCMPDS_2:49 .= t . (intpos sp) by SCMPDS_5:15 ; intpos pp in {(intpos sp),(intpos pp)} by TARSKI:def_2; then (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t))) . (intpos pp) = pD by A3, A11, A14; then A16: DataLoc (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t))) . (intpos pp)),0) = intpos (pD + 0) by SCMP_GCD:1; then A17: abs (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t))) . (intpos pp)) + 0) = pD by XTUPLE_0:1; n <= n + fr by NAT_1:11; then sp < n + fr by A1, XXREAL_0:2; then abs (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t))) . (intpos pp)) + 0) <> sp by A4, A5, A17, XXREAL_0:2; then A18: DataLoc (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t))) . (intpos pp)),0) <> intpos sp by XTUPLE_0:1; DataLoc ((s . (intpos sp)),cv) = intpos (n + cv) by SCMP_GCD:1; then A19: abs ((s . (intpos sp)) + cv) = n + cv by XTUPLE_0:1; then abs (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t))) . (intpos pp)) + 0) <> abs ((s . (intpos sp)) + cv) by A4, A5, A9, A17, XXREAL_0:2; then A20: DataLoc (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t))) . (intpos pp)),0) <> DataLoc ((s . (intpos sp)),cv) by XTUPLE_0:1; abs (((Initialize t) . (intpos sp)) + fr) = n + fr by A13, XTUPLE_0:1; then abs (((Initialize t) . (intpos sp)) + fr) <> abs ((s . (intpos sp)) + cv) by A2, A19; then A21: DataLoc (((Initialize t) . (intpos sp)),fr) <> DataLoc ((s . (intpos sp)),cv) by XTUPLE_0:1; thus A22: (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp) = (Exec ((AddTo ((intpos pp),0,1)),(Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t))))) . (intpos sp) by II, SCMPDS_5:42 .= t . (intpos sp) by A15, A18, SCMPDS_2:48 ; ::_thesis: ( (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (DataLoc ((s . (intpos sp)),cv)) = t . (DataLoc ((s . (intpos sp)),cv)) & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_closed_on t,Q & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_halting_on t,Q & ( for y being Int_position st y in {(intpos sp),(intpos pp)} holds (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . y = t . y ) ) thus (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (DataLoc ((s . (intpos sp)),cv)) = (Exec ((AddTo ((intpos pp),0,1)),(Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t))))) . (DataLoc ((s . (intpos sp)),cv)) by II, SCMPDS_5:42 .= (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t))) . (DataLoc ((s . (intpos sp)),cv)) by A20, SCMPDS_2:48 .= (Initialize t) . (DataLoc ((s . (intpos sp)),cv)) by A21, SCMPDS_2:49 .= t . (DataLoc ((s . (intpos sp)),cv)) by SCMPDS_5:15 ; ::_thesis: ( (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_closed_on t,Q & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_halting_on t,Q & ( for y being Int_position st y in {(intpos sp),(intpos pp)} holds (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . y = t . y ) ) thus ( (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_closed_on t,Q & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_halting_on t,Q ) by SCMPDS_6:20, SCMPDS_6:21; ::_thesis: for y being Int_position st y in {(intpos sp),(intpos pp)} holds (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . y = t . y A23: (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,(Initialize t))) . (intpos pp) = (Exec ((AddTo ((intpos pp),0,1)),(Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize t))))) . (intpos pp) by SCMPDS_5:42 .= t . (intpos pp) by A3, A6, A14, A16, SCMPDS_2:48 ; hereby ::_thesis: verum let y be Int_position; ::_thesis: ( y in {(intpos sp),(intpos pp)} implies (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . b1 = t . b1 ) assume A24: y in {(intpos sp),(intpos pp)} ; ::_thesis: (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . b1 = t . b1 percases ( y = intpos sp or y = intpos pp ) by A24, TARSKI:def_2; suppose y = intpos sp ; ::_thesis: (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . b1 = t . b1 hence (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . y = t . y by A22; ::_thesis: verum end; suppose y = intpos pp ; ::_thesis: (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . b1 = t . b1 hence (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . y = t . y by A23, MEMSTR_0:44; ::_thesis: verum end; end; end; end; n + cv <> pp by A2, A4, XREAL_1:6; then abs (n + cv) <> pp by ABSVALUE:def_1; then DataLoc ((s . (intpos sp)),cv) <> intpos pp by XTUPLE_0:1; then not DataLoc ((s . (intpos sp)),cv) in {(intpos sp),(intpos pp)} by A8, TARSKI:def_2; hence ( for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_closed_on s,P & for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_halting_on s,P ) by A7, A8, A10, Th67; ::_thesis: verum end; end; end; theorem Th73: :: SCMPDS_7:54 for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for sp, cv, result, pp, pD being Element of NAT for f being FinSequence of NAT st s . (intpos sp) > sp & cv < result & s . (intpos pp) = pD & (s . (intpos sp)) + result < pp & pp < pD & pD < s . (intpos pD) & s . (DataLoc ((s . (intpos sp)),result)) = 0 & len f = s . (DataLoc ((s . (intpos sp)),cv)) & ( for k being Element of NAT st k < len f holds f . (k + 1) = s . (DataLoc ((s . (intpos pD)),k)) ) holds (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),result,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),P,s)) . (DataLoc ((s . (intpos sp)),result)) = Sum f proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for sp, cv, result, pp, pD being Element of NAT for f being FinSequence of NAT st s . (intpos sp) > sp & cv < result & s . (intpos pp) = pD & (s . (intpos sp)) + result < pp & pp < pD & pD < s . (intpos pD) & s . (DataLoc ((s . (intpos sp)),result)) = 0 & len f = s . (DataLoc ((s . (intpos sp)),cv)) & ( for k being Element of NAT st k < len f holds f . (k + 1) = s . (DataLoc ((s . (intpos pD)),k)) ) holds (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),result,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),P,s)) . (DataLoc ((s . (intpos sp)),result)) = Sum f let s be 0 -started State of SCMPDS; ::_thesis: for sp, cv, result, pp, pD being Element of NAT for f being FinSequence of NAT st s . (intpos sp) > sp & cv < result & s . (intpos pp) = pD & (s . (intpos sp)) + result < pp & pp < pD & pD < s . (intpos pD) & s . (DataLoc ((s . (intpos sp)),result)) = 0 & len f = s . (DataLoc ((s . (intpos sp)),cv)) & ( for k being Element of NAT st k < len f holds f . (k + 1) = s . (DataLoc ((s . (intpos pD)),k)) ) holds (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),result,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),P,s)) . (DataLoc ((s . (intpos sp)),result)) = Sum f let sp, cv, fr, pp, pD be Element of NAT ; ::_thesis: for f being FinSequence of NAT st s . (intpos sp) > sp & cv < fr & s . (intpos pp) = pD & (s . (intpos sp)) + fr < pp & pp < pD & pD < s . (intpos pD) & s . (DataLoc ((s . (intpos sp)),fr)) = 0 & len f = s . (DataLoc ((s . (intpos sp)),cv)) & ( for k being Element of NAT st k < len f holds f . (k + 1) = s . (DataLoc ((s . (intpos pD)),k)) ) holds (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),P,s)) . (DataLoc ((s . (intpos sp)),fr)) = Sum f let f be FinSequence of NAT ; ::_thesis: ( s . (intpos sp) > sp & cv < fr & s . (intpos pp) = pD & (s . (intpos sp)) + fr < pp & pp < pD & pD < s . (intpos pD) & s . (DataLoc ((s . (intpos sp)),fr)) = 0 & len f = s . (DataLoc ((s . (intpos sp)),cv)) & ( for k being Element of NAT st k < len f holds f . (k + 1) = s . (DataLoc ((s . (intpos pD)),k)) ) implies (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),P,s)) . (DataLoc ((s . (intpos sp)),fr)) = Sum f ) set BP = intpos sp; set PD = intpos pD; set PP = intpos pp; assume that A1: s . (intpos sp) > sp and A2: cv < fr and A3: s . (intpos pp) = pD and A4: (s . (intpos sp)) + fr < pp and A5: pp < pD and A6: pD < s . (intpos pD) and A7: s . (DataLoc ((s . (intpos sp)),fr)) = 0 and A8: len f = s . (DataLoc ((s . (intpos sp)),cv)) and A9: for k being Element of NAT st k < len f holds f . (k + 1) = s . (DataLoc ((s . (intpos pD)),k)) ; ::_thesis: (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),P,s)) . (DataLoc ((s . (intpos sp)),fr)) = Sum f reconsider n = s . (intpos sp) as Element of NAT by A1, INT_1:3; A10: n + fr < pD by A4, A5, XXREAL_0:2; set i2 = AddTo ((intpos sp),fr,(intpos pD),0); set i3 = AddTo ((intpos pp),0,1); set I = (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)); set FD = for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))); set a = DataLoc ((s . (intpos sp)),fr); defpred S1[ Element of NAT ] means for Q being Instruction-Sequence of SCMPDS for t being 0 -started State of SCMPDS for f being FinSequence of NAT st t . (intpos sp) = s . (intpos sp) & t . (intpos pp) = pD & pD < t . (intpos pD) & len f = t . (DataLoc ((t . (intpos sp)),cv)) & len f = $1 & ( for k being Element of NAT st k < len f holds f . (k + 1) = t . (DataLoc ((t . (intpos pD)),k)) ) holds (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),Q,t)) . (DataLoc ((s . (intpos sp)),fr)) = (Sum f) + (t . (DataLoc ((s . (intpos sp)),fr))); n <= n + fr by NAT_1:11; then A11: sp < n + fr by A1, XXREAL_0:2; A12: n + fr > n + cv by A2, XREAL_1:6; then n + cv < pp by A4, XXREAL_0:2; then A13: n + cv < pD by A5, XXREAL_0:2; A14: 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 A15: S1[k] ; ::_thesis: S1[k + 1] now__::_thesis:_for_t_being_0_-started_State_of_SCMPDS for_f_being_FinSequence_of_NAT_ for_Q_being_Instruction-Sequence_of_SCMPDS_st_t_._(intpos_sp)_=_s_._(intpos_sp)_&_t_._(intpos_pp)_=_pD_&_pD_<_t_._(intpos_pD)_&_len_f_=_t_._(DataLoc_((t_._(intpos_sp)),cv))_&_len_f_=_k_+_1_&_(_for_i_being_Element_of_NAT_st_i_<_len_f_holds_ f_._(i_+_1)_=_t_._(DataLoc_((t_._(intpos_pD)),i))_)_holds_ (IExec_((for-down_((intpos_sp),cv,1,((AddTo_((intpos_sp),fr,(intpos_pD),0))_';'_(AddTo_((intpos_pp),0,1))))),Q,t))_._(DataLoc_((s_._(intpos_sp)),fr))_=_(Sum_f)_+_(t_._(DataLoc_((s_._(intpos_sp)),fr))) let t be 0 -started State of SCMPDS; ::_thesis: for f being FinSequence of NAT for Q being Instruction-Sequence of SCMPDS st t . (intpos sp) = s . (intpos sp) & t . (intpos pp) = pD & pD < t . (intpos pD) & len f = t . (DataLoc ((t . (intpos sp)),cv)) & len f = k + 1 & ( for i being Element of NAT st i < len f holds f . (i + 1) = t . (DataLoc ((t . (intpos pD)),i)) ) holds (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),Q,t)) . (DataLoc ((s . (intpos sp)),fr)) = (Sum f) + (t . (DataLoc ((s . (intpos sp)),fr))) let f be FinSequence of NAT ; ::_thesis: for Q being Instruction-Sequence of SCMPDS st t . (intpos sp) = s . (intpos sp) & t . (intpos pp) = pD & pD < t . (intpos pD) & len f = t . (DataLoc ((t . (intpos sp)),cv)) & len f = k + 1 & ( for i being Element of NAT st i < len f holds f . (i + 1) = t . (DataLoc ((t . (intpos pD)),i)) ) holds (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),Q,t)) . (DataLoc ((s . (intpos sp)),fr)) = (Sum f) + (t . (DataLoc ((s . (intpos sp)),fr))) let Q be Instruction-Sequence of SCMPDS; ::_thesis: ( t . (intpos sp) = s . (intpos sp) & t . (intpos pp) = pD & pD < t . (intpos pD) & len f = t . (DataLoc ((t . (intpos sp)),cv)) & len f = k + 1 & ( for i being Element of NAT st i < len f holds f . (i + 1) = t . (DataLoc ((t . (intpos pD)),i)) ) implies (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),Q,t)) . (DataLoc ((s . (intpos sp)),fr)) = (Sum f) + (t . (DataLoc ((s . (intpos sp)),fr))) ) assume that A16: t . (intpos sp) = s . (intpos sp) and A17: t . (intpos pp) = pD and A18: pD < t . (intpos pD) and A19: len f = t . (DataLoc ((t . (intpos sp)),cv)) and A20: len f = k + 1 and A21: for i being Element of NAT st i < len f holds f . (i + 1) = t . (DataLoc ((t . (intpos pD)),i)) ; ::_thesis: (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),Q,t)) . (DataLoc ((s . (intpos sp)),fr)) = (Sum f) + (t . (DataLoc ((s . (intpos sp)),fr))) A22: f is FinSequence of REAL by FINSEQ_2:24; A23: now__::_thesis:_for_u_being_0_-started_State_of_SCMPDS for_U_being_Instruction-Sequence_of_SCMPDS_st_(_for_x_being_Int_position_st_x_in_{(intpos_sp),(intpos_pp)}_holds_ u_._x_=_t_._x_)_&_u_._(intpos_sp)_=_t_._(intpos_sp)_holds_ (_(IExec_(((AddTo_((intpos_sp),fr,(intpos_pD),0))_';'_(AddTo_((intpos_pp),0,1))),U,u))_._(intpos_sp)_=_u_._(intpos_sp)_&_(IExec_(((AddTo_((intpos_sp),fr,(intpos_pD),0))_';'_(AddTo_((intpos_pp),0,1))),U,u))_._(DataLoc_((t_._(intpos_sp)),cv))_=_u_._(DataLoc_((t_._(intpos_sp)),cv))_&_(AddTo_((intpos_sp),fr,(intpos_pD),0))_';'_(AddTo_((intpos_pp),0,1))_is_closed_on_u,U_&_(AddTo_((intpos_sp),fr,(intpos_pD),0))_';'_(AddTo_((intpos_pp),0,1))_is_halting_on_u,U_&_(_for_y_being_Int_position_st_y_in_{(intpos_sp),(intpos_pp)}_holds_ (IExec_(((AddTo_((intpos_sp),fr,(intpos_pD),0))_';'_(AddTo_((intpos_pp),0,1))),U,u))_._y_=_u_._y_)_) set Dv = DataLoc ((t . (intpos sp)),cv); let u be 0 -started State of SCMPDS; ::_thesis: for U being Instruction-Sequence of SCMPDS st ( for x being Int_position st x in {(intpos sp),(intpos pp)} holds u . x = t . x ) & u . (intpos sp) = t . (intpos sp) holds ( (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),U,u)) . (intpos sp) = u . (intpos sp) & (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),U,u)) . (DataLoc ((t . (intpos sp)),cv)) = u . (DataLoc ((t . (intpos sp)),cv)) & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_closed_on u,U & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_halting_on u,U & ( for y being Int_position st y in {(intpos sp),(intpos pp)} holds (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),b4,b3)) . b5 = b3 . b5 ) ) let U be Instruction-Sequence of SCMPDS; ::_thesis: ( ( for x being Int_position st x in {(intpos sp),(intpos pp)} holds u . x = t . x ) & u . (intpos sp) = t . (intpos sp) implies ( (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),U,u)) . (intpos sp) = u . (intpos sp) & (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),U,u)) . (DataLoc ((t . (intpos sp)),cv)) = u . (DataLoc ((t . (intpos sp)),cv)) & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_closed_on u,U & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_halting_on u,U & ( for y being Int_position st y in {(intpos sp),(intpos pp)} holds (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),b3,b2)) . b4 = b2 . b4 ) ) ) UU: Initialize u = u by MEMSTR_0:44; assume that A24: for x being Int_position st x in {(intpos sp),(intpos pp)} holds u . x = t . x and A25: u . (intpos sp) = t . (intpos sp) ; ::_thesis: ( (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),U,u)) . (intpos sp) = u . (intpos sp) & (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),U,u)) . (DataLoc ((t . (intpos sp)),cv)) = u . (DataLoc ((t . (intpos sp)),cv)) & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_closed_on u,U & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_halting_on u,U & ( for y being Int_position st y in {(intpos sp),(intpos pp)} holds (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),b3,b2)) . b4 = b2 . b4 ) ) set t0 = Initialize u; set t1 = Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u)); A26: DataLoc (((Initialize u) . (intpos sp)),fr) = DataLoc (n,fr) by A16, A25, SCMPDS_5:15 .= intpos (n + fr) by SCMP_GCD:1 ; then A27: abs (((Initialize u) . (intpos sp)) + fr) = n + fr by XTUPLE_0:1; then A28: (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))) . (intpos pp) = (Initialize u) . (intpos pp) by A3, A5, A7, A26, SCMPDS_2:49 .= u . (intpos pp) by SCMPDS_5:15 ; intpos pp in {(intpos sp),(intpos pp)} by TARSKI:def_2; then A29: (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))) . (intpos pp) = pD by A17, A24, A28; then ((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))) . (intpos pp)) + 0 <> sp by A4, A5, A11, XXREAL_0:2; then abs (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))) . (intpos pp)) + 0) <> sp by A29, ABSVALUE:def_1; then A30: DataLoc (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))) . (intpos pp)),0) <> intpos sp by XTUPLE_0:1; A31: (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))) . (intpos sp) = (Initialize u) . (intpos sp) by A1, A7, A26, A27, SCMPDS_2:49 .= u . (intpos sp) by SCMPDS_5:15 ; thus A32: (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),U,u)) . (intpos sp) = (Exec ((AddTo ((intpos pp),0,1)),(Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))))) . (intpos sp) by UU, SCMPDS_5:42 .= u . (intpos sp) by A31, A30, SCMPDS_2:48 ; ::_thesis: ( (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),U,u)) . (DataLoc ((t . (intpos sp)),cv)) = u . (DataLoc ((t . (intpos sp)),cv)) & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_closed_on u,U & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_halting_on u,U & ( for y being Int_position st y in {(intpos sp),(intpos pp)} holds (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),b3,b2)) . b4 = b2 . b4 ) ) DataLoc ((t . (intpos sp)),cv) = intpos (n + cv) by A16, SCMP_GCD:1; then A33: abs ((t . (intpos sp)) + cv) = n + cv by XTUPLE_0:1; then abs (((Initialize u) . (intpos sp)) + fr) <> abs ((t . (intpos sp)) + cv) by A2, A27; then A34: DataLoc (((Initialize u) . (intpos sp)),fr) <> DataLoc ((t . (intpos sp)),cv) by XTUPLE_0:1; A35: DataLoc (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))) . (intpos pp)),0) = intpos (pD + 0) by A29, SCMP_GCD:1; then abs (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))) . (intpos pp)) + 0) = pD + 0 by XTUPLE_0:1; then abs (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))) . (intpos pp)) + 0) <> abs ((t . (intpos sp)) + cv) by A4, A5, A12, A33, XXREAL_0:2; then A36: DataLoc (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))) . (intpos pp)),0) <> DataLoc ((t . (intpos sp)),cv) by XTUPLE_0:1; thus (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),U,u)) . (DataLoc ((t . (intpos sp)),cv)) = (Exec ((AddTo ((intpos pp),0,1)),(Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))))) . (DataLoc ((t . (intpos sp)),cv)) by UU, SCMPDS_5:42 .= (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))) . (DataLoc ((t . (intpos sp)),cv)) by A36, SCMPDS_2:48 .= (Initialize u) . (DataLoc ((t . (intpos sp)),cv)) by A34, SCMPDS_2:49 .= u . (DataLoc ((t . (intpos sp)),cv)) by SCMPDS_5:15 ; ::_thesis: ( (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_closed_on u,U & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_halting_on u,U & ( for y being Int_position st y in {(intpos sp),(intpos pp)} holds (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),b3,b2)) . b4 = b2 . b4 ) ) thus ( (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_closed_on u,U & (AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)) is_halting_on u,U ) by SCMPDS_6:20, SCMPDS_6:21; ::_thesis: for y being Int_position st y in {(intpos sp),(intpos pp)} holds (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),b3,b2)) . b4 = b2 . b4 A37: (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),U,(Initialize u))) . (intpos pp) = (Exec ((AddTo ((intpos pp),0,1)),(Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),(Initialize u))))) . (intpos pp) by SCMPDS_5:42 .= u . (intpos pp) by A3, A6, A28, A35, SCMPDS_2:48 ; let y be Int_position; ::_thesis: ( y in {(intpos sp),(intpos pp)} implies (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),b2,b1)) . b3 = b1 . b3 ) assume A38: y in {(intpos sp),(intpos pp)} ; ::_thesis: (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),b2,b1)) . b3 = b1 . b3 percases ( y = intpos sp or y = intpos pp ) by A38, TARSKI:def_2; suppose y = intpos sp ; ::_thesis: (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),b2,b1)) . b3 = b1 . b3 hence (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),U,u)) . y = u . y by A32; ::_thesis: verum end; suppose y = intpos pp ; ::_thesis: (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),b2,b1)) . b3 = b1 . b3 hence (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),U,u)) . y = u . y by A37, MEMSTR_0:44; ::_thesis: verum end; end; end; A39: DataLoc ((s . (intpos sp)),fr) = intpos (n + fr) by SCMP_GCD:1; set t0 = t; set t1 = Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t); set j = AddTo ((intpos sp),cv,(- 1)); set s2 = IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t); set P2 = Q; set g = Del (f,1); set It = IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t); DataLoc ((t . (intpos sp)),fr) = intpos (n + fr) by A16, SCMP_GCD:1; then A41: abs ((t . (intpos sp)) + fr) = n + fr by XTUPLE_0:1; A42: (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (intpos sp) = t . (intpos sp) by A1, A7, A16, SCMPDS_2:49; (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (intpos pp) = t . (intpos pp) by A3, A5, A7, A16, SCMPDS_2:49; then A43: DataLoc (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (intpos pp)),0) = intpos (pD + 0) by A17, SCMP_GCD:1; then A44: abs (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (intpos pp)) + 0) = pD + 0 by XTUPLE_0:1; then abs (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (intpos pp)) + 0) <> sp by A4, A5, A11, XXREAL_0:2; then A45: DataLoc (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (intpos pp)),0) <> intpos sp by XTUPLE_0:1; A46: (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp) = (Exec ((AddTo ((intpos pp),0,1)),(Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)))) . (intpos sp) by SCMPDS_5:42 .= t . (intpos sp) by A42, A45, SCMPDS_2:48 ; then A47: DataLoc (((IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp)),cv) = intpos (n + cv) by A16, SCMP_GCD:1; then A48: abs (((IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp)) + cv) = n + cv by XTUPLE_0:1; then pD <> abs (((IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp)) + cv) by A4, A5, A12, XXREAL_0:2; then A49: intpos pD <> DataLoc (((IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp)),cv) by XTUPLE_0:1; A50: f . (0 + 1) = t . (DataLoc ((t . (intpos pD)),0)) by A20, A21; n + fr <> abs (((IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp)) + cv) by A2, A48; then A51: DataLoc ((s . (intpos sp)),fr) <> DataLoc (((IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp)),cv) by A39, XTUPLE_0:1; A52: (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (DataLoc ((s . (intpos sp)),fr)) = (Exec ((AddTo ((intpos pp),0,1)),(Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)))) . (DataLoc ((s . (intpos sp)),fr)) by SCMPDS_5:42 .= (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (DataLoc ((s . (intpos sp)),fr)) by A6, A7, A43, SCMPDS_2:48 .= (t . (DataLoc ((s . (intpos sp)),fr))) + (f . 1) by A16, A50, SCMPDS_2:49 ; A53: (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (DataLoc ((s . (intpos sp)),fr)) = (Exec ((AddTo ((intpos sp),cv,(- 1))),(IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)))) . (DataLoc ((s . (intpos sp)),fr)) by SCMPDS_5:41 .= (f . 1) + (t . (DataLoc ((s . (intpos sp)),fr))) by A51, A52, SCMPDS_2:48 ; n + cv <> sp by A1, NAT_1:11; then abs (n + cv) <> sp by ABSVALUE:def_1; then A54: DataLoc ((t . (intpos sp)),cv) <> intpos sp by A16, XTUPLE_0:1; A55: (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos pD) = (Exec ((AddTo ((intpos sp),cv,(- 1))),(IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)))) . (intpos pD) by SCMPDS_5:41 .= (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos pD) by A49, SCMPDS_2:48 .= (Exec ((AddTo ((intpos pp),0,1)),(Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)))) . (intpos pD) by SCMPDS_5:42 .= ((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (intpos pD)) + 1 by A43, SCMPDS_2:48 .= (t . (intpos pD)) + 1 by A6, A7, A16, SCMPDS_2:49 ; then t . (intpos pD) < (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos pD) by XREAL_1:29; then A56: pD < (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos pD) by A18, XXREAL_0:2; 1 <= k + 1 by NAT_1:11; then 1 in Seg (k + 1) by FINSEQ_1:1; then A57: 1 in dom f by A20, FINSEQ_1:def_3; then A58: (len (Del (f,1))) + 1 = len f by WSIERP_1:def_1; A59: (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos pD) = (Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD) by SCMPDS_5:15; A60: (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (DataLoc (((IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos sp)),cv)) = (Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (DataLoc (((IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos sp)),cv)) by SCMPDS_5:15; A61: (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos pp) = (Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pp) by SCMPDS_5:15; A62: (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos sp) = (Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos sp) by SCMPDS_5:15; A63: for k being Element of NAT st k < len (Del (f,1)) holds (Del (f,1)) . (k + 1) = (Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),k)) proof reconsider m = t . (intpos pD) as Element of NAT by A18, INT_1:3; let i be Element of NAT ; ::_thesis: ( i < len (Del (f,1)) implies (Del (f,1)) . (i + 1) = (Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i)) ) set SD = DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i); assume i < len (Del (f,1)) ; ::_thesis: (Del (f,1)) . (i + 1) = (Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i)) then A64: i + 1 < (len (Del (f,1))) + 1 by XREAL_1:6; A65: (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i)) = (Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i)) by SCMPDS_5:15; DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i) = intpos ((m + 1) + i) by A55, A59, SCMP_GCD:1 .= intpos (m + (1 + i)) ; then A66: abs (((IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos pD)) + i) = m + (1 + i) by A59, XTUPLE_0:1; then abs (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (intpos pp)) + 0) <> abs (((IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos pD)) + i) by A18, A44, NAT_1:11; then A67: DataLoc (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (intpos pp)),0) <> DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i) by A59, XTUPLE_0:1; m <= m + (1 + i) by NAT_1:11; then abs ((t . (intpos sp)) + fr) <> abs (((IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos pD)) + i) by A10, A18, A41, A66, XXREAL_0:2; then A68: DataLoc ((t . (intpos sp)),fr) <> DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i) by A59, XTUPLE_0:1; n + cv < m by A13, A18, XXREAL_0:2; then abs (((IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos pD)) + i) <> abs (((IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp)) + cv) by A48, A66, NAT_1:11; then A69: DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i) <> DataLoc (((IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp)),cv) by A59, XTUPLE_0:1; A70: (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i)) = (Exec ((AddTo ((intpos sp),cv,(- 1))),(IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)))) . (DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i)) by SCMPDS_5:41 .= (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i)) by A69, SCMPDS_2:48 .= (Exec ((AddTo ((intpos pp),0,1)),(Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)))) . (DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i)) by SCMPDS_5:42 .= (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i)) by A67, SCMPDS_2:48 .= t . (DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i)) by A68, SCMPDS_2:49 ; 0 + 1 <= i + 1 by XREAL_1:6; hence (Del (f,1)) . (i + 1) = f . ((i + 1) + 1) by A57, WSIERP_1:def_1 .= t . (DataLoc ((t . (intpos pD)),(i + 1))) by A21, A58, A64 .= (Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (DataLoc (((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (intpos pD)),i)) by A66, A70, A65, SCMPDS_5:15 ; ::_thesis: verum end; abs ((t . (intpos sp)) + fr) <> n + cv by A2, A41; then A71: DataLoc ((t . (intpos sp)),fr) <> intpos (n + cv) by XTUPLE_0:1; abs (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (intpos pp)) + 0) <> n + cv by A4, A5, A12, A44, XXREAL_0:2; then A72: DataLoc (((Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (intpos pp)),0) <> intpos (n + cv) by XTUPLE_0:1; A73: (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos (n + cv)) = (Exec ((AddTo ((intpos pp),0,1)),(Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)))) . (intpos (n + cv)) by SCMPDS_5:42 .= (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (intpos (n + cv)) by A72, SCMPDS_2:48 .= t . (intpos (n + cv)) by A71, SCMPDS_2:49 .= k + 1 by A16, A19, A20, SCMP_GCD:1 ; abs (((IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp)) + cv) <> sp by A1, A48, NAT_1:11; then A74: DataLoc (((IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp)),cv) <> intpos sp by XTUPLE_0:1; A75: (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos sp) = (Exec ((AddTo ((intpos sp),cv,(- 1))),(IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)))) . (intpos sp) by SCMPDS_5:41 .= s . (intpos sp) by A16, A46, A74, SCMPDS_2:48 ; then DataLoc (((IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos sp)),cv) = intpos (n + cv) by SCMP_GCD:1; then A76: (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (DataLoc (((IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos sp)),cv)) = (Exec ((AddTo ((intpos sp),cv,(- 1))),(IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)))) . (intpos (n + cv)) by SCMPDS_5:41 .= ((IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos (n + cv))) + (- 1) by A47, SCMPDS_2:48 .= len (Del (f,1)) by A20, A58, A73 ; pp <> abs (((IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp)) + cv) by A2, A4, A48, XREAL_1:6; then A77: intpos pp <> DataLoc (((IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos sp)),cv) by XTUPLE_0:1; A78: (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (intpos pp) = (Exec ((AddTo ((intpos sp),cv,(- 1))),(IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)))) . (intpos pp) by SCMPDS_5:41 .= (IExec (((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))),Q,t)) . (intpos pp) by A77, SCMPDS_2:48 .= (Exec ((AddTo ((intpos pp),0,1)),(Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)))) . (intpos pp) by SCMPDS_5:42 .= (Exec ((AddTo ((intpos sp),fr,(intpos pD),0)),t)) . (intpos pp) by A3, A6, A43, SCMPDS_2:48 .= pD by A17, A3, A5, A7, A16, SCMPDS_2:49 ; 1 <= len f by A20, NAT_1:11; then A79: 1 in dom f by FINSEQ_3:25; n + cv <> pp by A2, A4, XREAL_1:6; then abs (n + cv) <> pp by ABSVALUE:def_1; then DataLoc ((s . (intpos sp)),cv) <> intpos pp by XTUPLE_0:1; then not DataLoc ((t . (intpos sp)),cv) in {(intpos sp),(intpos pp)} by A16, A54, TARSKI:def_2; hence (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),Q,t)) . (DataLoc ((s . (intpos sp)),fr)) = (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),Q,(Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))))) . (DataLoc ((s . (intpos sp)),fr)) by A19, A20, A54, A23, Th68 .= (Sum (Del (f,1))) + ((Initialize (IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t))) . (DataLoc ((s . (intpos sp)),fr))) by A15, A20, A75, A58, A76, A78, A56, A63, A59, A60, A61, A62 .= (Sum (Del (f,1))) + ((IExec ((((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))) ';' (AddTo ((intpos sp),cv,(- 1)))),Q,t)) . (DataLoc ((s . (intpos sp)),fr))) by SCMPDS_5:15 .= ((Sum (Del (f,1))) + (f . 1)) + (t . (DataLoc ((s . (intpos sp)),fr))) by A53 .= (Sum f) + (t . (DataLoc ((s . (intpos sp)),fr))) by A79, A22, WSIERP_1:20 ; ::_thesis: verum end; hence S1[k + 1] ; ::_thesis: verum end; now__::_thesis:_for_t_being_0_-started_State_of_SCMPDS for_f_being_FinSequence_of_NAT_st_t_._(intpos_sp)_=_s_._(intpos_sp)_&_t_._(intpos_pp)_=_pD_&_pD_<_t_._(intpos_pD)_&_len_f_=_t_._(DataLoc_((t_._(intpos_sp)),cv))_&_len_f_=_0_&_(_for_k_being_Element_of_NAT_st_k_<_len_f_holds_ f_._(k_+_1)_=_t_._(DataLoc_((t_._(intpos_pD)),k))_)_holds_ for_Q_being_Instruction-Sequence_of_SCMPDS_holds_(IExec_((for-down_((intpos_sp),cv,1,((AddTo_((intpos_sp),fr,(intpos_pD),0))_';'_(AddTo_((intpos_pp),0,1))))),Q,t))_._(DataLoc_((s_._(intpos_sp)),fr))_=_(Sum_f)_+_(t_._(DataLoc_((s_._(intpos_sp)),fr))) let t be 0 -started State of SCMPDS; ::_thesis: for f being FinSequence of NAT st t . (intpos sp) = s . (intpos sp) & t . (intpos pp) = pD & pD < t . (intpos pD) & len f = t . (DataLoc ((t . (intpos sp)),cv)) & len f = 0 & ( for k being Element of NAT st k < len f holds f . (k + 1) = t . (DataLoc ((t . (intpos pD)),k)) ) holds for Q being Instruction-Sequence of SCMPDS holds (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),Q,t)) . (DataLoc ((s . (intpos sp)),fr)) = (Sum f) + (t . (DataLoc ((s . (intpos sp)),fr))) let f be FinSequence of NAT ; ::_thesis: ( t . (intpos sp) = s . (intpos sp) & t . (intpos pp) = pD & pD < t . (intpos pD) & len f = t . (DataLoc ((t . (intpos sp)),cv)) & len f = 0 & ( for k being Element of NAT st k < len f holds f . (k + 1) = t . (DataLoc ((t . (intpos pD)),k)) ) implies for Q being Instruction-Sequence of SCMPDS holds (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),Q,t)) . (DataLoc ((s . (intpos sp)),fr)) = (Sum f) + (t . (DataLoc ((s . (intpos sp)),fr))) ) assume that t . (intpos sp) = s . (intpos sp) and t . (intpos pp) = pD and pD < t . (intpos pD) and A80: len f = t . (DataLoc ((t . (intpos sp)),cv)) and A81: len f = 0 and for k being Element of NAT st k < len f holds f . (k + 1) = t . (DataLoc ((t . (intpos pD)),k)) ; ::_thesis: for Q being Instruction-Sequence of SCMPDS holds (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),Q,t)) . (DataLoc ((s . (intpos sp)),fr)) = (Sum f) + (t . (DataLoc ((s . (intpos sp)),fr))) I: Initialize t = t by MEMSTR_0:44; f = <*> NAT by A81; hence for Q being Instruction-Sequence of SCMPDS holds (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),Q,t)) . (DataLoc ((s . (intpos sp)),fr)) = (Sum f) + (t . (DataLoc ((s . (intpos sp)),fr))) by A80, Th66, I, RVSUM_1:72; ::_thesis: verum end; then A82: S1[ 0 ] ; for k being Element of NAT holds S1[k] from NAT_1:sch_1(A82, A14); hence (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),P,s)) . (DataLoc ((s . (intpos sp)),fr)) = (Sum f) + 0 by A3, A6, A7, A8, A9 .= Sum f ; ::_thesis: verum end; theorem :: SCMPDS_7:55 for P being Instruction-Sequence of SCMPDS for s being 0 -started State of SCMPDS for sp, cv, result, pp, pD being Element of NAT for f being FinSequence of NAT st s . (intpos sp) > sp & cv < result & (s . (intpos sp)) + result < pp & pp < pD & pD < s . (intpos pD) & len f = s . (DataLoc ((s . (intpos sp)),cv)) & ( for k being Element of NAT st k < len f holds f . (k + 1) = s . (DataLoc ((s . (intpos pD)),k)) ) holds (IExec ((sum (sp,cv,result,pp,pD)),P,s)) . (DataLoc ((s . (intpos sp)),result)) = Sum f proof let P be Instruction-Sequence of SCMPDS; ::_thesis: for s being 0 -started State of SCMPDS for sp, cv, result, pp, pD being Element of NAT for f being FinSequence of NAT st s . (intpos sp) > sp & cv < result & (s . (intpos sp)) + result < pp & pp < pD & pD < s . (intpos pD) & len f = s . (DataLoc ((s . (intpos sp)),cv)) & ( for k being Element of NAT st k < len f holds f . (k + 1) = s . (DataLoc ((s . (intpos pD)),k)) ) holds (IExec ((sum (sp,cv,result,pp,pD)),P,s)) . (DataLoc ((s . (intpos sp)),result)) = Sum f let s be 0 -started State of SCMPDS; ::_thesis: for sp, cv, result, pp, pD being Element of NAT for f being FinSequence of NAT st s . (intpos sp) > sp & cv < result & (s . (intpos sp)) + result < pp & pp < pD & pD < s . (intpos pD) & len f = s . (DataLoc ((s . (intpos sp)),cv)) & ( for k being Element of NAT st k < len f holds f . (k + 1) = s . (DataLoc ((s . (intpos pD)),k)) ) holds (IExec ((sum (sp,cv,result,pp,pD)),P,s)) . (DataLoc ((s . (intpos sp)),result)) = Sum f let sp, cv, fr, pp, pD be Element of NAT ; ::_thesis: for f being FinSequence of NAT st s . (intpos sp) > sp & cv < fr & (s . (intpos sp)) + fr < pp & pp < pD & pD < s . (intpos pD) & len f = s . (DataLoc ((s . (intpos sp)),cv)) & ( for k being Element of NAT st k < len f holds f . (k + 1) = s . (DataLoc ((s . (intpos pD)),k)) ) holds (IExec ((sum (sp,cv,fr,pp,pD)),P,s)) . (DataLoc ((s . (intpos sp)),fr)) = Sum f let f be FinSequence of NAT ; ::_thesis: ( s . (intpos sp) > sp & cv < fr & (s . (intpos sp)) + fr < pp & pp < pD & pD < s . (intpos pD) & len f = s . (DataLoc ((s . (intpos sp)),cv)) & ( for k being Element of NAT st k < len f holds f . (k + 1) = s . (DataLoc ((s . (intpos pD)),k)) ) implies (IExec ((sum (sp,cv,fr,pp,pD)),P,s)) . (DataLoc ((s . (intpos sp)),fr)) = Sum f ) set BP = intpos sp; set PD = intpos pD; set PP = intpos pp; assume that A1: s . (intpos sp) > sp and A2: cv < fr and A3: (s . (intpos sp)) + fr < pp and A4: pp < pD and A5: pD < s . (intpos pD) and A6: len f = s . (DataLoc ((s . (intpos sp)),cv)) and A7: for k being Element of NAT st k < len f holds f . (k + 1) = s . (DataLoc ((s . (intpos pD)),k)) ; ::_thesis: (IExec ((sum (sp,cv,fr,pp,pD)),P,s)) . (DataLoc ((s . (intpos sp)),fr)) = Sum f reconsider n = s . (intpos sp) as Element of NAT by A1, INT_1:3; A8: intpos pD <> intpos pp by A4, XTUPLE_0:1; set i0 = ((intpos sp),fr) := 0; set i1 = (intpos pp) := pD; set Hi = (((intpos sp),fr) := 0) ';' ((intpos pp) := pD); set i2 = AddTo ((intpos sp),fr,(intpos pD),0); set i3 = AddTo ((intpos pp),0,1); set FD = for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))); set s2 = IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s); set P2 = P; set s0 = s; set s1 = Exec ((((intpos sp),fr) := 0),s); set a = DataLoc ((s . (intpos sp)),fr); set a1 = DataLoc (((IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos sp)),fr); A9: DataLoc ((s . (intpos sp)),fr) = intpos (n + fr) by SCMP_GCD:1; then A10: abs ((s . (intpos sp)) + fr) = n + fr by XTUPLE_0:1; then abs ((s . (intpos sp)) + fr) <> sp by A1, NAT_1:12; then A11: DataLoc ((s . (intpos sp)),fr) <> intpos sp by XTUPLE_0:1; A12: DataLoc ((s . (intpos sp)),fr) <> intpos pD by A3, A4, A9, XTUPLE_0:1; A13: (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos pD) = (Exec (((intpos pp) := pD),(Exec ((((intpos sp),fr) := 0),s)))) . (intpos pD) by SCMPDS_5:42 .= (Exec ((((intpos sp),fr) := 0),s)) . (intpos pD) by A8, SCMPDS_2:45 .= s . (intpos pD) by A12, SCMPDS_2:46 ; n <= n + fr by NAT_1:12; then sp <> pp by A1, A3, XXREAL_0:2; then A14: intpos sp <> intpos pp by XTUPLE_0:1; A15: intpos (n + fr) <> intpos pp by A3, XTUPLE_0:1; A16: (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos sp) = (Exec (((intpos pp) := pD),(Exec ((((intpos sp),fr) := 0),s)))) . (intpos sp) by SCMPDS_5:42 .= (Exec ((((intpos sp),fr) := 0),s)) . (intpos sp) by A14, SCMPDS_2:45 .= n by A11, SCMPDS_2:46 ; then A17: (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (DataLoc (((IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos sp)),fr)) = (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos (n + fr)) by SCMP_GCD:1 .= (Exec (((intpos pp) := pD),(Exec ((((intpos sp),fr) := 0),s)))) . (intpos (n + fr)) by SCMPDS_5:42 .= (Exec ((((intpos sp),fr) := 0),s)) . (intpos (n + fr)) by A15, SCMPDS_2:45 .= 0 by A9, SCMPDS_2:46 ; A18: n + fr < pD by A3, A4, XXREAL_0:2; A19: now__::_thesis:_for_k_being_Element_of_NAT_st_k_<_len_f_holds_ (Initialize_(IExec_(((((intpos_sp),fr)_:=_0)_';'_((intpos_pp)_:=_pD)),P,s)))_._(DataLoc_(((IExec_(((((intpos_sp),fr)_:=_0)_';'_((intpos_pp)_:=_pD)),P,s))_._(intpos_pD)),k))_=_f_._(k_+_1) reconsider m = s . (intpos pD) as Element of NAT by A5, INT_1:3; let k be Element of NAT ; ::_thesis: ( k < len f implies (Initialize (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s))) . (DataLoc (((IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos pD)),k)) = f . (k + 1) ) assume A20: k < len f ; ::_thesis: (Initialize (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s))) . (DataLoc (((IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos pD)),k)) = f . (k + 1) pp < m by A4, A5, XXREAL_0:2; then m + k <> pp by NAT_1:11; then A21: intpos (m + k) <> intpos pp by XTUPLE_0:1; m <= m + k by NAT_1:11; then abs ((s . (intpos sp)) + fr) <> m + k by A5, A10, A18, XXREAL_0:2; then A22: DataLoc ((s . (intpos sp)),fr) <> intpos (m + k) by XTUPLE_0:1; thus (Initialize (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s))) . (DataLoc (((IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos pD)),k)) = (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (DataLoc (((IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos pD)),k)) by SCMPDS_5:15 .= (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos (m + k)) by A13, SCMP_GCD:1 .= (Exec (((intpos pp) := pD),(Exec ((((intpos sp),fr) := 0),s)))) . (intpos (m + k)) by SCMPDS_5:42 .= (Exec ((((intpos sp),fr) := 0),s)) . (intpos (m + k)) by A21, SCMPDS_2:45 .= s . (intpos (m + k)) by A22, SCMPDS_2:46 .= s . (DataLoc ((s . (intpos pD)),k)) by SCMP_GCD:1 .= f . (k + 1) by A7, A20 ; ::_thesis: verum end; abs ((s . (intpos sp)) + fr) <> n + cv by A2, A10; then A23: DataLoc ((s . (intpos sp)),fr) <> intpos (n + cv) by XTUPLE_0:1; n + cv <> pp by A2, A3, XREAL_1:6; then A24: intpos (n + cv) <> intpos pp by XTUPLE_0:1; A25: (((intpos sp),fr) := 0) ';' ((intpos pp) := pD) is_halting_on s,P by SCMPDS_6:21; A26: (((intpos sp),fr) := 0) ';' ((intpos pp) := pD) is_closed_on s,P by SCMPDS_6:20; A27: (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos pp) = (Initialize (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s))) . (intpos pp) by SCMPDS_5:15; A28: (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos sp) = (Initialize (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s))) . (intpos sp) by SCMPDS_5:15; A29: (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos pD) = (Initialize (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s))) . (intpos pD) by SCMPDS_5:15; A30: (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos pp) = (Exec (((intpos pp) := pD),(Exec ((((intpos sp),fr) := 0),s)))) . (intpos pp) by SCMPDS_5:42 .= pD by SCMPDS_2:45 ; then for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_halting_on Initialize (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)),P by A1, A2, A3, A4, A5, A16, A13, Th72, A27, A28, A29; then A31: for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_halting_on IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s),P by SCMPDS_6:126; A32: (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (DataLoc (((IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos sp)),cv)) = (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos (n + cv)) by A16, SCMP_GCD:1 .= (Exec (((intpos pp) := pD),(Exec ((((intpos sp),fr) := 0),s)))) . (intpos (n + cv)) by SCMPDS_5:42 .= (Exec ((((intpos sp),fr) := 0),s)) . (intpos (n + cv)) by A24, SCMPDS_2:45 .= s . (intpos (n + cv)) by A23, SCMPDS_2:46 .= len f by A6, SCMP_GCD:1 ; A33: (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (DataLoc (((IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos sp)),fr)) = (Initialize (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s))) . (DataLoc (((IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos sp)),fr)) by SCMPDS_5:15; A34: (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (DataLoc (((IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos sp)),cv)) = (Initialize (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s))) . (DataLoc (((IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos sp)),cv)) by SCMPDS_5:15; for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_closed_on Initialize (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)),P by A1, A2, A3, A4, A5, A16, A30, A13, Th72, A27, A28, A29; then for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1)))) is_closed_on IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s),P by SCMPDS_6:125; hence (IExec ((sum (sp,cv,fr,pp,pD)),P,s)) . (DataLoc ((s . (intpos sp)),fr)) = (IExec ((for-down ((intpos sp),cv,1,((AddTo ((intpos sp),fr,(intpos pD),0)) ';' (AddTo ((intpos pp),0,1))))),P,(Initialize (IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s))))) . (DataLoc (((IExec (((((intpos sp),fr) := 0) ';' ((intpos pp) := pD)),P,s)) . (intpos sp)),fr)) by A16, A26, A25, A31, Th49 .= Sum f by A1, A2, A3, A4, A5, A16, A30, A13, A17, A32, A19, Th73, A27, A28, A29, A33, A34 ; ::_thesis: verum end;