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 Th19:
 for Ig being good really-closed MacroInstruction of SCM+FSA holds
  s.intloc 0 = 1 & ProperForUpBody a,bb,cc,Ig,s,p & k < s.cc-s.
bb+1 implies
  StepForUp(a,bb,cc,Ig,p,s).(k+1) |
    ({a, bb, cc} \/ UsedILoc Ig \/ FinSeq-Locations)
 = IExec(Ig ";" AddTo(a, intloc 0),
   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)),
   StepForUp(a, bb, cc, Ig, p, s).k) |
     ({a, bb, cc} \/ UsedILoc Ig \/ FinSeq-Locations)
proof let Ig be good really-closed MacroInstruction of SCM+FSA;
  assume that
A1: s.intloc 0 = 1 and
A2: ProperForUpBody a,bb,cc,Ig,s,p and
A3: k < s.cc-s.bb+1;
  set FL = FinSeq-Locations;
  set I = Ig;
  set aux = (1-stRWNotIn ({a, bb, cc} \/ UsedILoc I));
  set SF = StepForUp(a,bb,cc,I,p,s);
  set IB = I ";" AddTo(a, intloc 0) ";" SubFrom(aux, intloc 0);
  set s2 = s+*(aux, s.cc-s.bb+1)+*(a, s.bb),
      p2 = p;
  set SW2 = StepWhile>0(aux,IB,p2,s2);
A4: SW2.k.intloc 0 = 1 by A1,A2,A3,Th17;
  set scb1 = s.cc-s.bb+1;
A5: SF.k.aux+k = scb1 by A1,A2,A3,Th17;
A6: SW2.k.aux > 0
  proof
    assume SW2.k.aux <= 0;
    then SW2.k.aux + k < 0+scb1 by A3,XREAL_1:8;
    hence contradiction by A5;
  end;
  set S2 = IExec(IB,p+*while>0(aux,IB),SW2.k);
  set IB1 = I ";" AddTo(a, intloc 0);
  set Iloc = {a, bb, cc} \/ UsedILoc I;
  set S1 = IExec(IB1,p+*while>0(aux,IB), SW2.k);
  I is_halting_on SF.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))
 by A2,A3;
  then
A7: I is_halting_on Initialized SW2.k,p+*while>0(aux,IB) by A4,SCMFSA8B:42;
  Macro AddTo(a, intloc 0) is_halting_on
   IExec(I,p+*while>0(aux,IB),SW2.k),p+*while>0(aux,IB)
   by SCMFSA7B:19;
  then
A8: IB1 is_halting_on Initialized SW2.k,p+*while>0(aux,IB) by A7,SFMASTR1:3;
  now
    hereby
      let x be Int-Location;
      assume x in Iloc;
      then
A9:  x <> aux by SCMFSA_M:25;
      S2.x = Exec(SubFrom(aux, intloc 0), S1).x by A8,SFMASTR1:11
        .= S1.x by A9,SCMFSA_2:65;
      hence S1.x = S2.x;
    end;
    let x be FinSeq-Location;
    S2.x = Exec(SubFrom(aux, intloc 0), S1).x by A8,SFMASTR1:12
      .= S1.x by SCMFSA_2:65;
    hence S1.x = S2.x;
  end;
  then
A10: S1 | (Iloc \/ FL) = IExec(IB,p+*while>0(aux,IB),SW2.k) | (Iloc \/ FL)
 by SCMFSA_M:28;
A11: IB = I ";"(AddTo(a, intloc 0) ";" SubFrom(aux, intloc 0))
by SCMFSA6A:28;
  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 DataPart SW2.(k+1) = DataPart IExec(IB,p+*while>0(aux,IB),SW2.k)
   by A4,A6,A7,A11,SCMFSA9A:32,SFMASTR1:3;
  hence thesis by A10,RELAT_1:153,SCMFSA_2:100,XBOOLE_1:9;
end;
