reserve x,a for Int_position,
  s for State of SCMPDS;
reserve P,Q for Instruction-Sequence of SCMPDS;

theorem Th8:
  for s being 0-started State of SCMPDS,I being Program of SCMPDS,a,c being
Int_position, i being Integer st s.DataLoc(s.a,i) >= 0
 holds IExec(while<0(a,i,I),P,s) = s +* Start-At((card I+2),SCMPDS)
proof
  let s be 0-started State of SCMPDS,I be Program of SCMPDS,
      a,c be Int_position, i be Integer;
  set d1=DataLoc(s.a,i);
  set WHL=while<0(a,i,I), pWHL=stop WHL, P3 = P +* pWHL,
     s4 = Comput(P3,s,1), P4 = P3,
     i1=(a,i)>=0_goto (card I+2), i2=goto -(card I+1);
  set SAl=Start-At((card I+2),SCMPDS);
A1: Initialize s = s by MEMSTR_0:44;
A2: IC s = 0 by MEMSTR_0:def 11;
A3: WHL = i1 ';' (I ';' i2) by SCMPDS_4:15;
A4: CurInstr(P3,s) = i1 by A3,A1,SCMPDS_6:11;
A5: Comput(P3,s,0+1) = Following(P3,Comput(P3,s,0)) by EXTPRO_1:3
    .= Following(P3,s)
    .= Exec(i1,s) by A3,A1,SCMPDS_6:11;
A6: pWHL c= P4 by FUNCT_4:25;
A7: IExec(WHL,P,s) = Result(P3,s) by SCMPDS_4:def 5;
  assume s.d1 >= 0;
  then
A8: IC s4 = ICplusConst(s,(card I+2)) by A5,SCMPDS_2:57
    .= (0+(card I+2)) by A2,SCMPDS_6:12;
A9: card WHL=card I+2 by Th4;
  then (card I+2) in dom pWHL by COMPOS_1:64;
  then P4.(card I+2) = pWHL.(card I+2) by A6,GRFUNC_1:2
    .=halt SCMPDS by A9,COMPOS_1:64;
  then
A10: CurInstr(P4,s4) = halt SCMPDS by A8,PBOOLE:143;
  then
A11: P3 halts_on s by EXTPRO_1:29;
  now
    let l be Nat;
    assume l < 0+1;
    then l=0 by NAT_1:13;
    hence CurInstr(P3,Comput(P3,s,l)) <>
     halt SCMPDS by A4;
  end;
  then for l be Nat
   st CurInstr(P3,Comput(P3,s,l)) = halt SCMPDS
  holds 1 <= l;
  then
A12:  LifeSpan(P3,s) = 1 by A10,A11,EXTPRO_1:def 15;
A13: now
    let x be object;
A14: dom SAl = {IC SCMPDS} by FUNCOP_1:13;
    assume
A15: x in dom IExec(WHL,P,s);
    per cases by A15,SCMPDS_4:6;
    suppose
A16:  x is Int_position;
      then x <> IC SCMPDS by SCMPDS_2:43;
      then
A17:  not x in dom SAl by A14,TARSKI:def 1;
      thus IExec(WHL,P,s).x = s4.x by A12,A7,A11,EXTPRO_1:23
        .= s.x by A5,A16,SCMPDS_2:57
        .= (s +* SAl).x by A17,FUNCT_4:11;
    end;
    suppose
A18:  x = IC SCMPDS;
      hence IExec(WHL,P,s).x = (card I + 2) by A8,A12,A7,A11,EXTPRO_1:23
        .= (s +* SAl).x by A18,FUNCT_4:113;
    end;
  end;
  dom IExec(WHL,P,s) = the carrier of SCMPDS by PARTFUN1:def 2
    .= dom (s +* SAl) by PARTFUN1:def 2;
  hence thesis by A13,FUNCT_1:2;
end;
