reserve p,p1,p2,h for Instruction-Sequence of SCM+FSA;
reserve k, l, n for Nat,
  j for Integer,
  i,i1 for Instruction of SCM+FSA;
reserve s, s1, s2 for State of SCM+FSA,
  a for read-write Int-Location,
  b for Int-Location,
  I, J for MacroInstruction of SCM+FSA,
  Ig for good MacroInstruction of SCM+FSA,
  i, j, k, m, n for Nat;

theorem Th30: :: based on SCMFSA_9:36
 for I being really-closed MacroInstruction of SCM+FSA holds
I is_halting_on s,p & s.a > 0 implies DataPart
  Comput(p +* while>0(a,I),Initialize s,LifeSpan(p +* I,Initialize s) + 2)
     = DataPart Comput(p +* I,Initialize s,LifeSpan(p +* I,Initialize s))
proof let I be really-closed MacroInstruction of SCM+FSA;
  assume that
A1: I is_halting_on s,p and
A2: s.a > 0;
  set sI = Initialize s,
      pI = p +* I;
  set s1 = Initialize s,
      p1 = p +* while>0(a,I);
  defpred P[Nat] means $1 <= LifeSpan(pI,sI) implies
   IC Comput(p1,s1,1+$1) = IC Comput(pI,sI,$1) + 3 &
  DataPart Comput(p1,s1,1+$1) = DataPart Comput(pI,sI,$1);
A3: now
    let k be Nat;
    assume
A4: P[k];
    now
A5:   k + 0 < k + 1 by XREAL_1:6;
      assume k + 1 <= LifeSpan(pI,sI);
      then k < LifeSpan(pI,sI) by A5,XXREAL_0:2;
      hence IC Comput(p1,s1,1+k+1) = IC Comput(pI,sI,k+1) + 3 & DataPart
Comput(p1,s1,1+k+1) = DataPart Comput(pI,sI,k+1) by A1,A4,SCMFSA_9:39;
    end;
    hence P[k + 1];
  end;
  set i = a >0_goto 3;
  set s2 = Comput(p1,s1,1),
      p2 = p1;
A6: IC SCM+FSA in dom Start-At(0,SCM+FSA) by MEMSTR_0:15;
A7: IC s1 = IC Start-At(0,SCM+FSA) by A6,FUNCT_4:13
    .=  0 by FUNCOP_1:72;
  not a in dom Start-At(0,SCM+FSA) by SCMFSA_2:102;
  then
A8: s1.a = s.a by FUNCT_4:11;
  set loc4 =  (card I + 3);
A9:  p1/.IC s1 = p1.IC s1 by PBOOLE:143;
  0 in dom while>0(a,I) by AFINSQ_1:65;
  then p1. 0 = while>0(a,I). 0  by FUNCT_4:13
    .= i by SCMFSA_X:10;
  then
A10: CurInstr(p1,s1) = i by A7,A9;
A11: Comput(p1,s1,0+1) = Following(p1,Comput(p1,s1,0)) by EXTPRO_1:3
    .= Exec(i,s1) by A10;
  then ( for c being Int-Location holds s2.c = s1.c)& for f being
  FinSeq-Location holds s2.f = s1.f by SCMFSA_2:71;
  then
A12: DataPart s2 = DataPart sI by SCMFSA_M:2;
A13: IC s2 =  3 by A2,A11,A8,SCMFSA_2:71;
A14: P[0]
  proof
    assume 0 <= LifeSpan(pI,sI);
A15: IC SCM+FSA in dom Start-At(0,SCM+FSA) by MEMSTR_0:15;
    IC Comput(pI,sI,0)
       = IC Start-At(0,SCM+FSA) by A15,FUNCT_4:13
      .=  0 by FUNCOP_1:72;
    hence thesis by A13,A12;
  end;
  for k being Nat holds P[k] from NAT_1:sch 2(A14,A3);
  then
A16: P[LifeSpan(pI,sI)];
  set s4=Comput(p1,s1,1+LifeSpan(pI,sI)+1),
      p4 = p1;
  set s3 = Comput(p1,s1,1+LifeSpan(pI,sI)),
      p3 = p1;
  set s2 = Comput(p1,s1,1+LifeSpan(pI,sI));
A17: CurInstr(p2,s2) = goto 0 by A1,A16,SCMFSA_9:40;
A18: CurInstr(p3,s3) = goto  0 by A17;
  s4 = Following(p1,s3) by EXTPRO_1:3
    .= Exec(goto  0,s3) by A18;
  then ( for c being Int-Location holds s4.c = s3.c)& for f being
  FinSeq-Location holds s4.f = s3.f by SCMFSA_2:69;
  hence DataPart Comput(p1,s1,LifeSpan(pI,sI)+2) =
DataPart s3 by SCMFSA_M:2
    .= DataPart Comput(pI,sI,LifeSpan(pI,sI)) by A16;
end;
