Article SCM_1, MML version 4.99.1005

:: SCM_1:funcnot 1 => SCM_1:func 1
definition
  let a1 be integer set;
  redefine func <*a1*> -> FinSequence of INT;
end;

:: SCM_1:th 2
theorem
for b1 being Element of product the Object-Kind of SCM
for b2 being Element of NAT holds
   CurInstr Computation(b1,b2) = b1 . IC Computation(b1,b2) &
    CurInstr Computation(b1,b2) = b1 . ((Computation(b1,b2)) . NAT);

:: SCM_1:th 3
theorem
for b1 being Element of product the Object-Kind of SCM
      st ex b2 being Element of NAT st
           b1 . IC Computation(b1,b2) = halt SCM
   holds b1 is halting(NAT, {INT}, SCM);

:: SCM_1:th 4
theorem
for b1 being Element of product the Object-Kind of SCM
for b2 being Element of NAT
      st b1 . IC Computation(b1,b2) = halt SCM
   holds Result b1 = Computation(b1,b2);

:: SCM_1:th 7
theorem
for b1, b2 being Element of NAT holds
IC SCM <> il. b1 & IC SCM <> dl. b1 & il. b1 <> dl. b2;

:: SCM_1:modenot 1 => SCM_1:mode 1
definition
  let a1 be FinSequence of the Instructions of SCM;
  let a2 be FinSequence of INT;
  let a3, a4, a5 be Element of NAT;
  mode State-consisting of A3,A4,A5,A1,A2 -> Element of product the Object-Kind of SCM means
    IC it = il. a3 &
     (for b1 being Element of NAT
           st b1 < len a1
        holds it . il. (a4 + b1) = a1 . (b1 + 1)) &
     (for b1 being Element of NAT
           st b1 < len a2
        holds it . dl. (a5 + b1) = a2 . (b1 + 1));
end;

:: SCM_1:dfs 1
definiens
  let a1 be FinSequence of the Instructions of SCM;
  let a2 be FinSequence of INT;
  let a3, a4, a5 be Element of NAT;
  let a6 be Element of product the Object-Kind of SCM;
To prove
     a6 is State-consisting of a3,a4,a5,a1,a2
it is sufficient to prove
  thus IC a6 = il. a3 &
     (for b1 being Element of NAT
           st b1 < len a1
        holds a6 . il. (a4 + b1) = a1 . (b1 + 1)) &
     (for b1 being Element of NAT
           st b1 < len a2
        holds a6 . dl. (a5 + b1) = a2 . (b1 + 1));

:: SCM_1:def 1
theorem
for b1 being FinSequence of the Instructions of SCM
for b2 being FinSequence of INT
for b3, b4, b5 being Element of NAT
for b6 being Element of product the Object-Kind of SCM holds
      b6 is State-consisting of b3,b4,b5,b1,b2
   iff
      IC b6 = il. b3 &
       (for b7 being Element of NAT
             st b7 < len b1
          holds b6 . il. (b4 + b7) = b1 . (b7 + 1)) &
       (for b7 being Element of NAT
             st b7 < len b2
          holds b6 . dl. (b5 + b7) = b2 . (b7 + 1));

:: SCM_1:th 14
theorem
for b1, b2, b3, b4, b5, b6, b7, b8, b9 being Element of the Instructions of SCM
for b10, b11, b12, b13 being integer set
for b14 being Element of NAT
for b15 being State-consisting of b14,0,0,(((((((<*b1*> ^ <*b2*>) ^ <*b3*>) ^ <*b4*>) ^ <*b5*>) ^ <*b6*>) ^ <*b7*>) ^ <*b8*>) ^ <*b9*>,((<*b10*> ^ <*b11*>) ^ <*b12*>) ^ <*b13*> holds
   IC b15 = il. b14 & b15 . il. 0 = b1 & b15 . il. 1 = b2 & b15 . il. 2 = b3 & b15 . il. 3 = b4 & b15 . il. 4 = b5 & b15 . il. 5 = b6 & b15 . il. 6 = b7 & b15 . il. 7 = b8 & b15 . il. 8 = b9 & b15 . dl. 0 = b10 & b15 . dl. 1 = b11 & b15 . dl. 2 = b12 & b15 . dl. 3 = b13;

:: SCM_1:th 15
theorem
for b1, b2 being Element of the Instructions of SCM
for b3, b4 being integer set
for b5 being Element of NAT
for b6 being State-consisting of b5,0,0,<*b1*> ^ <*b2*>,<*b3*> ^ <*b4*> holds
   IC b6 = il. b5 & b6 . il. 0 = b1 & b6 . il. 1 = b2 & b6 . dl. 0 = b3 & b6 . dl. 1 = b4;

:: SCM_1:th 16
theorem
for b1 being Element of product the Object-Kind of SCM
for b2 being Element of NAT holds
      b1 . IC Computation(b1,b2) <> halt SCM &
       b1 . IC Computation(b1,b2 + 1) = halt SCM
   iff
      LifeSpan b1 = b2 + 1 & b1 is halting(NAT, {INT}, SCM);

:: SCM_1:th 17
theorem
for b1 being Element of product the Object-Kind of SCM
for b2 being Element of NAT
      st IC Computation(b1,b2) <> IC Computation(b1,b2 + 1) &
         b1 . IC Computation(b1,b2 + 1) = halt SCM
   holds LifeSpan b1 = b2 + 1;

:: SCM_1:th 18
theorem
for b1, b2 being Element of NAT
for b3 being Element of product the Object-Kind of SCM
for b4, b5 being Data-Location
      st IC Computation(b3,b1) = il. b2 & b3 . il. b2 = b4 := b5
   holds IC Computation(b3,b1 + 1) = il. (b2 + 1) &
    (Computation(b3,b1 + 1)) . b4 = (Computation(b3,b1)) . b5 &
    (for b6 being Data-Location
          st b6 <> b4
       holds (Computation(b3,b1 + 1)) . b6 = (Computation(b3,b1)) . b6);

:: SCM_1:th 19
theorem
for b1, b2 being Element of NAT
for b3 being Element of product the Object-Kind of SCM
for b4, b5 being Data-Location
      st IC Computation(b3,b1) = il. b2 & b3 . il. b2 = AddTo(b4,b5)
   holds IC Computation(b3,b1 + 1) = il. (b2 + 1) &
    (Computation(b3,b1 + 1)) . b4 = ((Computation(b3,b1)) . b4) + ((Computation(b3,b1)) . b5) &
    (for b6 being Data-Location
          st b6 <> b4
       holds (Computation(b3,b1 + 1)) . b6 = (Computation(b3,b1)) . b6);

:: SCM_1:th 20
theorem
for b1, b2 being Element of NAT
for b3 being Element of product the Object-Kind of SCM
for b4, b5 being Data-Location
      st IC Computation(b3,b1) = il. b2 & b3 . il. b2 = SubFrom(b4,b5)
   holds IC Computation(b3,b1 + 1) = il. (b2 + 1) &
    (Computation(b3,b1 + 1)) . b4 = ((Computation(b3,b1)) . b4) - ((Computation(b3,b1)) . b5) &
    (for b6 being Data-Location
          st b6 <> b4
       holds (Computation(b3,b1 + 1)) . b6 = (Computation(b3,b1)) . b6);

:: SCM_1:th 21
theorem
for b1, b2 being Element of NAT
for b3 being Element of product the Object-Kind of SCM
for b4, b5 being Data-Location
      st IC Computation(b3,b1) = il. b2 & b3 . il. b2 = MultBy(b4,b5)
   holds IC Computation(b3,b1 + 1) = il. (b2 + 1) &
    (Computation(b3,b1 + 1)) . b4 = ((Computation(b3,b1)) . b4) * ((Computation(b3,b1)) . b5) &
    (for b6 being Data-Location
          st b6 <> b4
       holds (Computation(b3,b1 + 1)) . b6 = (Computation(b3,b1)) . b6);

:: SCM_1:th 22
theorem
for b1, b2 being Element of NAT
for b3 being Element of product the Object-Kind of SCM
for b4, b5 being Data-Location
      st IC Computation(b3,b1) = il. b2 & b3 . il. b2 = Divide(b4,b5) & b4 <> b5
   holds IC Computation(b3,b1 + 1) = il. (b2 + 1) &
    (Computation(b3,b1 + 1)) . b4 = ((Computation(b3,b1)) . b4) div ((Computation(b3,b1)) . b5) &
    (Computation(b3,b1 + 1)) . b5 = ((Computation(b3,b1)) . b4) mod ((Computation(b3,b1)) . b5) &
    (for b6 being Data-Location
          st b6 <> b4 & b6 <> b5
       holds (Computation(b3,b1 + 1)) . b6 = (Computation(b3,b1)) . b6);

:: SCM_1:th 23
theorem
for b1, b2 being Element of NAT
for b3 being Element of product the Object-Kind of SCM
for b4 being Instruction-Location of SCM
      st IC Computation(b3,b1) = il. b2 & b3 . il. b2 = goto b4
   holds IC Computation(b3,b1 + 1) = b4 &
    (for b5 being Data-Location holds
       (Computation(b3,b1 + 1)) . b5 = (Computation(b3,b1)) . b5);

:: SCM_1:th 24
theorem
for b1, b2 being Element of NAT
for b3 being Element of product the Object-Kind of SCM
for b4 being Data-Location
for b5 being Instruction-Location of SCM
      st IC Computation(b3,b1) = il. b2 & b3 . il. b2 = b4 =0_goto b5
   holds ((Computation(b3,b1)) . b4 = 0 implies IC Computation(b3,b1 + 1) = b5) &
    ((Computation(b3,b1)) . b4 = 0 or IC Computation(b3,b1 + 1) = il. (b2 + 1)) &
    (for b6 being Data-Location holds
       (Computation(b3,b1 + 1)) . b6 = (Computation(b3,b1)) . b6);

:: SCM_1:th 25
theorem
for b1, b2 being Element of NAT
for b3 being Element of product the Object-Kind of SCM
for b4 being Data-Location
for b5 being Instruction-Location of SCM
      st IC Computation(b3,b1) = il. b2 & b3 . il. b2 = b4 >0_goto b5
   holds ((Computation(b3,b1)) . b4 <= 0 or IC Computation(b3,b1 + 1) = b5) &
    ((Computation(b3,b1)) . b4 <= 0 implies IC Computation(b3,b1 + 1) = il. (b2 + 1)) &
    (for b6 being Data-Location holds
       (Computation(b3,b1 + 1)) . b6 = (Computation(b3,b1)) . b6);

:: SCM_1:th 26
theorem
(halt SCM) `1 = 0 &
 (for b1, b2 being Data-Location holds
 (b1 := b2) `1 = 1) &
 (for b1, b2 being Data-Location holds
 (AddTo(b1,b2)) `1 = 2) &
 (for b1, b2 being Data-Location holds
 (SubFrom(b1,b2)) `1 = 3) &
 (for b1, b2 being Data-Location holds
 (MultBy(b1,b2)) `1 = 4) &
 (for b1, b2 being Data-Location holds
 (Divide(b1,b2)) `1 = 5) &
 (for b1 being Instruction-Location of SCM holds
    (goto b1) `1 = 6) &
 (for b1 being Data-Location
 for b2 being Instruction-Location of SCM holds
    (b1 =0_goto b2) `1 = 7) &
 (for b1 being Data-Location
 for b2 being Instruction-Location of SCM holds
    (b1 >0_goto b2) `1 = 8);

:: SCM_1:th 28
theorem
for b1, b2 being Element of product the Object-Kind of SCM
for b3, b4 being Element of NAT
      st b2 = Computation(b1,b3) & LifeSpan b2 = b4 & b2 is halting(NAT, {INT}, SCM) & 0 < b4
   holds LifeSpan b1 = b3 + b4;

:: SCM_1:th 29
theorem
for b1, b2 being Element of product the Object-Kind of SCM
for b3 being Element of NAT
      st b2 = Computation(b1,b3) & b2 is halting(NAT, {INT}, SCM)
   holds Result b2 = Result b1;

:: SCM_1:th 30
theorem
for b1, b2, b3, b4, b5, b6, b7, b8, b9 being Element of the Instructions of SCM
for b10, b11, b12, b13 being integer set
for b14 being Element of NAT
for b15 being Element of product the Object-Kind of SCM
      st IC b15 = il. b14 & b15 . il. 0 = b1 & b15 . il. 1 = b2 & b15 . il. 2 = b3 & b15 . il. 3 = b4 & b15 . il. 4 = b5 & b15 . il. 5 = b6 & b15 . il. 6 = b7 & b15 . il. 7 = b8 & b15 . il. 8 = b9 & b15 . dl. 0 = b10 & b15 . dl. 1 = b11 & b15 . dl. 2 = b12 & b15 . dl. 3 = b13
   holds b15 is State-consisting of b14,0,0,(((((((<*b1*> ^ <*b2*>) ^ <*b3*>) ^ <*b4*>) ^ <*b5*>) ^ <*b6*>) ^ <*b7*>) ^ <*b8*>) ^ <*b9*>,((<*b10*> ^ <*b11*>) ^ <*b12*>) ^ <*b13*>;

:: SCM_1:th 31
theorem
for b1 being State-consisting of 0,0,0,<*halt SCM*>,<*> INT holds
   b1 is halting(NAT, {INT}, SCM) & LifeSpan b1 = 0 & Result b1 = b1;

:: SCM_1:th 32
theorem
for b1, b2 being integer set
for b3 being State-consisting of 0,0,0,<*(dl. 0) := dl. 1*> ^ <*halt SCM*>,<*b1*> ^ <*b2*> holds
   b3 is halting(NAT, {INT}, SCM) &
    LifeSpan b3 = 1 &
    (Result b3) . dl. 0 = b2 &
    (for b4 being Data-Location
          st b4 <> dl. 0
       holds (Result b3) . b4 = b3 . b4);

:: SCM_1:th 33
theorem
for b1, b2 being integer set
for b3 being State-consisting of 0,0,0,<*AddTo(dl. 0,dl. 1)*> ^ <*halt SCM*>,<*b1*> ^ <*b2*> holds
   b3 is halting(NAT, {INT}, SCM) &
    LifeSpan b3 = 1 &
    (Result b3) . dl. 0 = b1 + b2 &
    (for b4 being Data-Location
          st b4 <> dl. 0
       holds (Result b3) . b4 = b3 . b4);

:: SCM_1:th 34
theorem
for b1, b2 being integer set
for b3 being State-consisting of 0,0,0,<*SubFrom(dl. 0,dl. 1)*> ^ <*halt SCM*>,<*b1*> ^ <*b2*> holds
   b3 is halting(NAT, {INT}, SCM) &
    LifeSpan b3 = 1 &
    (Result b3) . dl. 0 = b1 - b2 &
    (for b4 being Data-Location
          st b4 <> dl. 0
       holds (Result b3) . b4 = b3 . b4);

:: SCM_1:th 35
theorem
for b1, b2 being integer set
for b3 being State-consisting of 0,0,0,<*MultBy(dl. 0,dl. 1)*> ^ <*halt SCM*>,<*b1*> ^ <*b2*> holds
   b3 is halting(NAT, {INT}, SCM) &
    LifeSpan b3 = 1 &
    (Result b3) . dl. 0 = b1 * b2 &
    (for b4 being Data-Location
          st b4 <> dl. 0
       holds (Result b3) . b4 = b3 . b4);

:: SCM_1:th 36
theorem
for b1, b2 being integer set
for b3 being State-consisting of 0,0,0,<*Divide(dl. 0,dl. 1)*> ^ <*halt SCM*>,<*b1*> ^ <*b2*> holds
   b3 is halting(NAT, {INT}, SCM) &
    LifeSpan b3 = 1 &
    (Result b3) . dl. 0 = b1 div b2 &
    (Result b3) . dl. 1 = b1 mod b2 &
    (for b4 being Data-Location
          st b4 <> dl. 0 & b4 <> dl. 1
       holds (Result b3) . b4 = b3 . b4);

:: SCM_1:th 37
theorem
for b1, b2 being integer set
for b3 being State-consisting of 0,0,0,<*goto il. 1*> ^ <*halt SCM*>,<*b1*> ^ <*b2*> holds
   b3 is halting(NAT, {INT}, SCM) &
    LifeSpan b3 = 1 &
    (for b4 being Data-Location holds
       (Result b3) . b4 = b3 . b4);

:: SCM_1:th 38
theorem
for b1, b2 being integer set
for b3 being State-consisting of 0,0,0,<*(dl. 0) =0_goto il. 1*> ^ <*halt SCM*>,<*b1*> ^ <*b2*> holds
   b3 is halting(NAT, {INT}, SCM) &
    LifeSpan b3 = 1 &
    (for b4 being Data-Location holds
       (Result b3) . b4 = b3 . b4);

:: SCM_1:th 39
theorem
for b1, b2 being integer set
for b3 being State-consisting of 0,0,0,<*(dl. 0) >0_goto il. 1*> ^ <*halt SCM*>,<*b1*> ^ <*b2*> holds
   b3 is halting(NAT, {INT}, SCM) &
    LifeSpan b3 = 1 &
    (for b4 being Data-Location holds
       (Result b3) . b4 = b3 . b4);