reserve x for set,
  m,n for Nat,
  a,b for Int_position,
  i,j,k for Instruction of SCMPDS,
  s,s1,s2 for State of SCMPDS,
  k1,k2 for Integer,
  loc,l for Nat,
  I,J,K for Program of SCMPDS;
reserve P,P1,P2,Q for Instruction-Sequence of SCMPDS;

theorem Th32:
  for a be Int_position,i be Integer,n be Nat, I be
  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,i be Integer,n be Nat, I be Program of
  SCMPDS;
  set i1=(a,i)>=0_goto (card I +3), i2=AddTo(a,i,n), i3=goto -(card I+2);
  set I4=i1 ';' I, I5=I4 ';' i2;
  set J6=i2 ';' i3, J5=I ';' J6;
  set FLOOP=for-up(a,i,n,I);
  FLOOP=I4 ';' J6 by SCMPDS_4:13;
  then FLOOP=i1 ';' J5 by SCMPDS_4:14;
  hence FLOOP. 0=i1 by SCMPDS_6:7;
A1: card I4=card I+1 by SCMPDS_6:6;
  hence FLOOP.(card I+1)=i2 by SCMP_GCD:7;
  card I5=card I +1 +1 by A1,SCMP_GCD:4
    .=card I+ (1+1);
  hence thesis by SCMP_GCD:6;
end;
