reserve s for State of SCM+FSA,
  a, c for read-write Int-Location,
  aa, bb, cc,
  dd, x for Int-Location,
  f for FinSeq-Location,
  I, J for MacroInstruction of SCM+FSA,
  Ig for good MacroInstruction of SCM+FSA,
  i, k for Nat,
  p for Instruction-Sequence of SCM+FSA;

theorem Th16:
 for Ig being good really-closed MacroInstruction of SCM+FSA holds
  StepForUp(a,bb,cc,Ig,p,s).k.intloc 0 = 1 &
  Ig is_halting_on StepForUp(a,bb,cc,Ig,p,s).k,
   p +* while>0(1-stRWNotIn ({a, bb, cc} \/ UsedILoc Ig),
     Ig ";" AddTo(a, intloc 0) ";"
      SubFrom(1-stRWNotIn ({a, bb, cc} \/ UsedILoc Ig), intloc 0))
  implies StepForUp(a,bb,cc,Ig,p,s).(k+1).intloc 0 = 1
proof let Ig be good really-closed MacroInstruction of SCM+FSA;
  set I = Ig;
  assume that
A1: StepForUp(a,bb,cc,I,p,s).k.intloc 0 = 1 and
A2:
I is_halting_on
  StepForUp(a,bb,cc,I,p,s).k,
   p +* while>0(1-stRWNotIn ({a, bb, cc} \/ UsedILoc I),
     I ";" AddTo(a, intloc 0) ";"
      SubFrom(1-stRWNotIn ({a, bb, cc} \/ UsedILoc I), intloc 0));
  set aux = 1-stRWNotIn ({a, bb, cc} \/ UsedILoc I);
  set IB = I ";" AddTo(a, intloc 0) ";" SubFrom(aux, intloc 0);
:::     as MacroInstruction of SCM+FSA;
  set SW2 = StepWhile>0(aux,IB,p,s+*(aux,s.cc-s.bb+1)+*(a, s.bb));
A3: IB = I ";"(AddTo(a, intloc 0) ";" SubFrom(aux, intloc 0)) by SCMFSA6A:28;
  per cases;
  suppose
    SW2.k.aux <= 0;
    then DataPart SW2.(k+1) = DataPart SW2.k by SCMFSA9A:31;
    hence thesis by A1,SCMFSA_M:2;
  end;
  suppose
A4: SW2.k.aux > 0;
A5: I is_halting_on Initialized SW2.k,p+*while>0(aux,IB) by A1,A2,SCMFSA8B:42;
     AddTo(a, intloc 0) ";" SubFrom(aux, intloc 0)
      is_halting_on IExec(I,p+*while>0(aux,IB),SW2.k),p+*while>0(aux,IB)
       by SCMFSA7B:19;
    then
A6: DataPart SW2.(k+1) = DataPart IExec(IB,p+*while>0(aux,IB),SW2.k)
 by A1,A3,A4,A5,SCMFSA9A:32,SFMASTR1:3;
    IExec(IB,p+*while>0(aux,IB),SW2.k).intloc 0
     = IExec(AddTo(a, intloc 0) ";" SubFrom(aux,intloc 0),p+*while>0(aux,IB),
        IExec(I,p+*while>0(aux,IB),
        SW2.k)).intloc 0 by A3,A5,SFMASTR1:7
      .= Exec(SubFrom(aux, intloc 0), Exec(AddTo(a, intloc 0), Initialized
    IExec(I,p+*while>0(aux,IB),SW2.k))).intloc 0 by SCMFSA6C:8
      .= Exec(AddTo(a, intloc 0),
      Initialized IExec(I,p+*while>0(aux,IB),SW2.k)).intloc 0 by SCMFSA_2:65
      .= (Initialized IExec(I,p+*while>0(aux,IB),SW2.k)).intloc 0
       by SCMFSA_2:64
      .= 1 by SCMFSA_M:9;
    hence thesis by A6,SCMFSA_M:2;
  end;
end;
