reserve m,n for Nat,
  a,b for Int_position,
  i,j for Instruction of SCMPDS,
  s,s1,s2 for State of SCMPDS,
  I,J for Program of SCMPDS;
reserve P,P1,P2 for Instruction-Sequence of SCMPDS;

theorem
  for p being FinPartState of SCMPDS,
     x,y being Integer st y >= 0 & x >= y
  & p=(intpos 9,intpos 10) --> (x,y)
  holds Initialize p is GCD-Algorithm-autonomic
proof
  let p be FinPartState of SCMPDS,x,y be Integer;
  set GA=GCD-Algorithm, a=intpos 9, b=intpos 10;
  assume that
A1: y >= 0 and
A2: x >= y and
A3: p=(a,b) --> (x,y);
A4: dom p = { a,b } by A3,FUNCT_4:62;
   a in SCM-Data-Loc & b in SCM-Data-Loc by AMI_2:def 16;
   then a in Data-Locations SCMPDS & b in Data-Locations SCMPDS
         by SCMPDS_2:84;
   then
A5: dom p c= Data-Locations SCMPDS by A4,ZFMISC_1:32;
  not IC SCMPDS in Data-Locations SCMPDS by STRUCT_0:3;
  then {IC SCMPDS} misses Data-Locations SCMPDS by ZFMISC_1:50;
  then Data-Locations SCMPDS misses {IC SCMPDS};
  then dom p misses {IC SCMPDS} by A5,XBOOLE_1:63;
  then
A6: p is data-only;
     a in dom p by A4,TARSKI:def 2;
     then
A7: a in dom  p;
     b in dom p by A4,TARSKI:def 2;
     then
A8: b in dom  p;
A9:  dom Start-At(0,SCMPDS) = {IC SCMPDS} by FUNCOP_1:13;
A10: for t being State of SCMPDS st (Initialize p) c= t
      holds t.a = x & t.b = y
  proof
    let t be State of SCMPDS such that
A11: (Initialize p) c= t;
    p = DataPart p by A6,MEMSTR_0:7;
    then dom p misses dom Start-At(0,SCMPDS) by A9,MEMSTR_0:4;
    then p c= Initialize p by FUNCT_4:32;
    then  p c=  Initialize p;
    then
A12:  p c= t by A11,XBOOLE_1:1;
    hence t.a = ( p).a by A7,GRFUNC_1:2
      .= p.a
      .= x by A3,AMI_3:10,FUNCT_4:63;
    thus t.b = ( p).b by A12,A8,GRFUNC_1:2
      .= p.b
      .= y by A3,FUNCT_4:63;
  end;
    let P1,P2 be Instruction-Sequence of SCMPDS
     such that
A13: GA c= P1 & GA c= P2;
    let s1,s2 be State of SCMPDS such that
A14:  Initialize p c= s1 and
A15:  Initialize p c= s2;
      Initialize p c= s1 by A14;
     then
A16: Start-At(0,SCMPDS) c= s1 by MEMSTR_0:50;
    then
A17: s1 is 0-started by MEMSTR_0:29;
A18: GA c= P1 by A13;
      Initialize p c= s2 by A15;
     then
A19: Start-At(0,SCMPDS) c= s2 by MEMSTR_0:50;
    then
A20: s2 is 0-started by MEMSTR_0:29;
A21: GA c= P2 by A13;
A22: s1.a=x by A10,A14;
A23: s1.b=y by A10,A14;
A24: s2.a=x by A10,A15;
A25: s2.b=y by A10,A15;
    set s4=Comput(P1,s1,4), t4=Comput(P2,s2,4);
A26: IC s4 =  5 by Th11,A18,A17;
A27: s4.GBP = 0 by Th11,A18,A17;
A28: s4.SBP = 7 by Th11,A18,A17;
A29: s4.intpos(7+RetIC) =  2 by Th11,A18,A17;
A30: s4.intpos 9 = s1.intpos 9 by Th11,A18,A17;
A31: s4.intpos 10 = s1.intpos 10 by Th11,A18,A17;
A32: s4.DataLoc(s4.SBP,3)=s4.intpos (7+3) by A28,Th1
      .=y by A10,A14,A31;
A33: DataLoc(s4.SBP,2)=intpos(7+2) by A28,Th1;
A34: IC t4 =  5 by Th11,A21,A20;
A35: t4.GBP = 0 by Th11,A21,A20;
A36: t4.SBP = 7 by Th11,A21,A20;
A37: t4.intpos(7+RetIC) =  2 by Th11,A21,A20;
A38: t4.intpos 9 = s2.intpos 9 by Th11,A21,A20;
A39: t4.intpos 10 = s2.intpos 10 by Th11,A21,A20;
    t4.DataLoc(t4.SBP,3)=t4.intpos (7+3) by A36,Th1
      .=s4.DataLoc(s4.SBP,3) by A10,A15,A32,A39;
    then consider n such that
A40: CurInstr(P1,Comput(P1,
s4,n))
 = return SBP and
A41: s4.SBP=Comput(P1,s4,n).SBP and
A42: CurInstr(P2,Comput(P2,t4,n))
   = return SBP and
A43: t4.SBP=Comput(P2,t4,n).SBP and
A44: for j be Nat st 1<j & j <= s4.SBP+1 holds s4.intpos j=
    Comput(P1,s4,n).intpos j & t4.intpos j=Comput(P2,
t4,n).intpos j and
A45: for k be Nat,c be Int_position st k <= n & s4.c = t4.c
    holds IC Comput(P1,s4,k) = IC Comput(P2,t4,k) &
     Comput(P1,s4,k).c =
    Comput(P2,t4,k).c
    by A1,A2,A10,A15,A22,A26,A27,A28,A30,A32,A33,A34,A35,A36,A38,Lm8,A18,A21;
A46: Comput(P1,s4,n).DataLoc(Comput(P1,s4,n).SBP,RetIC)
    =Comput(P1,s4,n).intpos(7+1) by A28,A41,Th1,SCMPDS_I:def 14
      .= 2 by A28,A29,A44,SCMPDS_I:def 14;
A47: Comput(P2,t4,n).DataLoc(Comput(P2,t4,n).SBP,
RetIC)
    =Comput(P2,t4,n).intpos(7+1) by A36,A43,Th1,SCMPDS_I:def 14
      .= 2 by A28,A37,A44,SCMPDS_I:def 14;
A48:  P1/.IC Comput(P1,s4,n+1) = P1.IC Comput(P1,s4,n+1) by PBOOLE:143;
A49: Comput(P1,s4,n+1)=Following(P1,Comput(P1,s4,n)) by EXTPRO_1:3
      .= Exec(i14,Comput(P1,s4,n)) by A40;
    then
A50: IC Comput(P1,s4,n+1)=
    (|.Comput(P1,s4,n).DataLoc(Comput(P1,s4,n).SBP,
RetIC).|)+2
    by SCMPDS_2:58
      .=  (2+2) by A46,ABSVALUE:29;
    then
A51: CurInstr(P1,Comput(P1,s4,n+1))
       =P1. 4 by A48
      .=P1. 4
      .=i04 by Lm1,A18;
A52:  P2/.IC Comput(P2,t4,n+1) = P2.IC Comput(P2,t4,n+1) by PBOOLE:143;
A53: Comput(P2,t4,n+1)= Following(P2,Comput(P2,t4,n)) by EXTPRO_1:3
      .= Exec(i14,Comput(P2,t4,n)) by A42;
    then
A54: IC Comput(P2,t4,n+1)= (|.Comput(P2,t4,n).
    DataLoc(Comput(P2,t4,n).SBP,RetIC).|)+2 by SCMPDS_2:58
      .= 2+2 by A47,ABSVALUE:29;
    then
A55: CurInstr(P2,Comput(P2,t4,n+1))
       =P2. 4 by A52
      .=P2. 4
      .=i04 by Lm1,A21;
A56: s4.a=t4.a by A19,A22,A24,Lm9,A18,A16,A21;
A57: s4.b=t4.b by A19,A23,A25,Lm9,A18,A16,A21;
A58: Comput(P1,s4,n+1).a=Comput(P1,s4,n).a by A49,AMI_3:10,SCMPDS_2:58
      .=Comput(P2,t4,n).a by A45,A56
      .=Comput(P2,t4,n+1).a by A53,AMI_3:10,SCMPDS_2:58;
A59: Comput(P1,s4,n+1).b=Comput(P1,s4,n).b by A49,AMI_3:10,SCMPDS_2:58
      .=Comput(P2,t4,n).b by A45,A57
      .=Comput(P2,t4,n+1).b by A53,AMI_3:10,SCMPDS_2:58;
A60: now
      let j be Nat;
A61:  j<n+4+1 or j>=n+5;
A62:  now
        assume
A63:    j <= n+4;
A64:    j<3+1 or j>= 4;
        per cases by A64,NAT_1:13;
        case j<=3;
          hence j<=3;
        end;
        case j>=4;
          hence j>=4 & j <= n+4 by A63;
        end;
      end;
      per cases by A61,A62,NAT_1:13;
      suppose j<=3;
        then
A65:    j<=4 by XXREAL_0:2;
        hence IC Comput(P1,s1,j)=IC Comput(P2,s2,j)
           by A19,A22,A24,Lm9,A18,A16,A21;
        thus Comput(P1,s1,j).a=Comput(P2,s2,j).a
        by A19,A22,A24,A65,Lm9,A18,A16,A21;
        thus Comput(P1,s1,j).b=Comput(P2,s2,j).b
        by A19,A23,A25,A65,Lm9,A18,A16,A21;
      end;
      suppose
A66:    j>=4 & j<=n+4;
        then consider j1 be Nat such that
A67:    j=4+j1 by NAT_1:10;
        reconsider j1 as Nat;
A68:    j1 <= n by A66,A67,XREAL_1:6;
        thus IC Comput(P1,s1,j) = IC Comput(P1,s4,j1)
by A67,EXTPRO_1:4
          .=IC Comput(P2,t4,j1) by A45,A56,A68
          .=IC Comput(P2,s2,j) by A67,EXTPRO_1:4;
        thus Comput(P1,s1,j).a = Comput(P1,s4,j1).a
by A67,EXTPRO_1:4
          .=Comput(P2,t4,j1).a by A45,A56,A68
          .=Comput(P2,s2,j).a by A67,EXTPRO_1:4;
        thus Comput(P1,s1,j).b = Comput(P1,s4,j1).b
by A67,EXTPRO_1:4
          .=Comput(P2,t4,j1).b by A45,A57,A68
          .=Comput(P2,s2,j).b by A67,EXTPRO_1:4;
      end;
      suppose j>=n+5;
        then consider j1 be Nat such that
A69:    j=n+(1+4)+j1 by NAT_1:10;
        reconsider j1 as Nat;
A70:    j=n+1+j1+4 by A69;
        hence IC Comput(P1,s1,j)=IC Comput(P1,s4,n+1+
j1) by EXTPRO_1:4
          .=IC Comput(P2,t4,n+1)
          by A50,A51,A54,EXTPRO_1:5,NAT_1:11
          .=IC Comput(P2,t4,n+1+j1) by A55,EXTPRO_1:5,NAT_1:11
          .=IC Comput(P2,s2,j) by A70,EXTPRO_1:4;
        thus Comput(P1,s1,j).a = Comput(P1,s4,n+1+j1)
.a by A70,EXTPRO_1:4
          .=Comput(P2,t4,n+1).a by A51,A58,EXTPRO_1:5,NAT_1:11
          .=Comput(P2,t4,n+1+j1).a by A55,EXTPRO_1:5,NAT_1:11
          .=Comput(P2,s2,j).a by A70,EXTPRO_1:4;
        thus Comput(P1,s1,j).b = Comput(P1,s4,n+1+j1)
.b by A70,EXTPRO_1:4
          .=Comput(P2,t4,n+1).b
          by A51,A59,EXTPRO_1:5,NAT_1:11
          .=Comput(P2,t4,n+1+j1).b by A55,EXTPRO_1:5,NAT_1:11
          .=Comput(P2,s2,j).b by A70,EXTPRO_1:4;
      end;
    end;
    set A = { IC SCMPDS, a,b };
A71: IC SCMPDS in dom(Initialize p) by MEMSTR_0:48;
    dom DataPart Initialize p = dom(DataPart p) by MEMSTR_0:45
        .= dom DataPart p
        .= {a,b} by A6,A4,MEMSTR_0:7;
    then
A72: dom  Initialize p = {IC SCMPDS} \/ {a,b} by A71,MEMSTR_0:24
        .= A by ENUMSET1:2;
    let k be Nat;
A73: (Comput(P1,s1,k)).IC SCMPDS = IC Comput(P1,s1,k)
      .=IC Comput(P2,s2,k) by A60
      .=(Comput(P2,s2,k)).IC SCMPDS;
A74: Comput(P1,s1,k).a = Comput(P2,s2,k).a by A60;
A75: Comput(P1,s1,k).b = Comput(P2,s2,k).b by A60;
    dom(Comput(P1,s1,k)) = the carrier of SCMPDS by PARTFUN1:def 2
      .= dom(Comput(P2,s2,k)) by PARTFUN1:def 2;
    then (Comput(P1,s1,k))|A = (Comput(P2,s2,k))|A
         by A73,A74,A75,GRFUNC_1:31;
    hence thesis by A72;
end;
