Article AMI_3, MML version 4.99.1005

:: AMI_3:funcnot 1 => AMI_3:func 1
definition
  func SCM -> strict AMI-Struct over NAT,{INT} equals
    AMI-Struct(#SCM-Memory,In(NAT,SCM-Memory),SCM-Instr,SCM-OK,SCM-Exec#);
end;

:: AMI_3:def 1
theorem
SCM = AMI-Struct(#SCM-Memory,In(NAT,SCM-Memory),SCM-Instr,SCM-OK,SCM-Exec#);

:: AMI_3:funcreg 1
registration
  cluster SCM -> non empty strict stored-program standard-ins;
end;

:: AMI_3:th 2
theorem
SCM is definite(NAT, {INT});

:: AMI_3:funcreg 2
registration
  cluster SCM -> strict IC-Ins-separated definite;
end;

:: AMI_3:modenot 1 => AMI_3:mode 1
definition
  mode Data-Location -> Element of the carrier of SCM means
    it in SCM-Data-Loc;
end;

:: AMI_3:dfs 2
definiens
  let a1 be Element of the carrier of SCM;
To prove
     a1 is Data-Location
it is sufficient to prove
  thus a1 in SCM-Data-Loc;

:: AMI_3:def 2
theorem
for b1 being Element of the carrier of SCM holds
      b1 is Data-Location
   iff
      b1 in SCM-Data-Loc;

:: AMI_3:funcnot 2 => AMI_3:func 2
definition
  let a1 be Element of product the Object-Kind of SCM;
  let a2 be Data-Location;
  redefine func a1 . a2 -> integer set;
end;

:: AMI_3:funcnot 3 => AMI_3:func 3
definition
  let a1, a2 be Data-Location;
  func A1 := A2 -> Element of the Instructions of SCM equals
    [1,<*a1,a2*>];
end;

:: AMI_3:def 3
theorem
for b1, b2 being Data-Location holds
b1 := b2 = [1,<*b1,b2*>];

:: AMI_3:funcnot 4 => AMI_3:func 4
definition
  let a1, a2 be Data-Location;
  func AddTo(A1,A2) -> Element of the Instructions of SCM equals
    [2,<*a1,a2*>];
end;

:: AMI_3:def 4
theorem
for b1, b2 being Data-Location holds
AddTo(b1,b2) = [2,<*b1,b2*>];

:: AMI_3:funcnot 5 => AMI_3:func 5
definition
  let a1, a2 be Data-Location;
  func SubFrom(A1,A2) -> Element of the Instructions of SCM equals
    [3,<*a1,a2*>];
end;

:: AMI_3:def 5
theorem
for b1, b2 being Data-Location holds
SubFrom(b1,b2) = [3,<*b1,b2*>];

:: AMI_3:funcnot 6 => AMI_3:func 6
definition
  let a1, a2 be Data-Location;
  func MultBy(A1,A2) -> Element of the Instructions of SCM equals
    [4,<*a1,a2*>];
end;

:: AMI_3:def 6
theorem
for b1, b2 being Data-Location holds
MultBy(b1,b2) = [4,<*b1,b2*>];

:: AMI_3:funcnot 7 => AMI_3:func 7
definition
  let a1, a2 be Data-Location;
  func Divide(A1,A2) -> Element of the Instructions of SCM equals
    [5,<*a1,a2*>];
end;

:: AMI_3:def 7
theorem
for b1, b2 being Data-Location holds
Divide(b1,b2) = [5,<*b1,b2*>];

:: AMI_3:funcnot 8 => AMI_3:func 8
definition
  let a1 be Instruction-Location of SCM;
  func goto A1 -> Element of the Instructions of SCM equals
    [6,<*a1*>];
end;

:: AMI_3:def 8
theorem
for b1 being Instruction-Location of SCM holds
   goto b1 = [6,<*b1*>];

:: AMI_3:funcnot 9 => AMI_3:func 9
definition
  let a1 be Instruction-Location of SCM;
  let a2 be Data-Location;
  func A2 =0_goto A1 -> Element of the Instructions of SCM equals
    [7,<*a1,a2*>];
end;

:: AMI_3:def 9
theorem
for b1 being Instruction-Location of SCM
for b2 being Data-Location holds
   b2 =0_goto b1 = [7,<*b1,b2*>];

:: AMI_3:funcnot 10 => AMI_3:func 10
definition
  let a1 be Instruction-Location of SCM;
  let a2 be Data-Location;
  func A2 >0_goto A1 -> Element of the Instructions of SCM equals
    [8,<*a1,a2*>];
end;

:: AMI_3:def 10
theorem
for b1 being Instruction-Location of SCM
for b2 being Data-Location holds
   b2 >0_goto b1 = [8,<*b1,b2*>];

:: AMI_3:th 4
theorem
IC SCM = NAT;

:: AMI_3:condreg 1
registration
  cluster -> natural (Instruction-Location of SCM);
end;

:: AMI_3:th 8
theorem
for b1, b2 being Data-Location
for b3 being Element of product the Object-Kind of SCM holds
   (Exec(b1 := b2,b3)) . IC SCM = succ IC b3 &
    (Exec(b1 := b2,b3)) . b1 = b3 . b2 &
    (for b4 being Data-Location
          st b4 <> b1
       holds (Exec(b1 := b2,b3)) . b4 = b3 . b4);

:: AMI_3:th 9
theorem
for b1, b2 being Data-Location
for b3 being Element of product the Object-Kind of SCM holds
   (Exec(AddTo(b1,b2),b3)) . IC SCM = succ IC b3 &
    (Exec(AddTo(b1,b2),b3)) . b1 = (b3 . b1) + (b3 . b2) &
    (for b4 being Data-Location
          st b4 <> b1
       holds (Exec(AddTo(b1,b2),b3)) . b4 = b3 . b4);

:: AMI_3:th 10
theorem
for b1, b2 being Data-Location
for b3 being Element of product the Object-Kind of SCM holds
   (Exec(SubFrom(b1,b2),b3)) . IC SCM = succ IC b3 &
    (Exec(SubFrom(b1,b2),b3)) . b1 = (b3 . b1) - (b3 . b2) &
    (for b4 being Data-Location
          st b4 <> b1
       holds (Exec(SubFrom(b1,b2),b3)) . b4 = b3 . b4);

:: AMI_3:th 11
theorem
for b1, b2 being Data-Location
for b3 being Element of product the Object-Kind of SCM holds
   (Exec(MultBy(b1,b2),b3)) . IC SCM = succ IC b3 &
    (Exec(MultBy(b1,b2),b3)) . b1 = (b3 . b1) * (b3 . b2) &
    (for b4 being Data-Location
          st b4 <> b1
       holds (Exec(MultBy(b1,b2),b3)) . b4 = b3 . b4);

:: AMI_3:th 12
theorem
for b1, b2 being Data-Location
for b3 being Element of product the Object-Kind of SCM holds
   (Exec(Divide(b1,b2),b3)) . IC SCM = succ IC b3 &
    (b1 = b2 or (Exec(Divide(b1,b2),b3)) . b1 = (b3 . b1) div (b3 . b2)) &
    (Exec(Divide(b1,b2),b3)) . b2 = (b3 . b1) mod (b3 . b2) &
    (for b4 being Data-Location
          st b4 <> b1 & b4 <> b2
       holds (Exec(Divide(b1,b2),b3)) . b4 = b3 . b4);

:: AMI_3:th 13
theorem
for b1 being Data-Location
for b2 being Instruction-Location of SCM
for b3 being Element of product the Object-Kind of SCM holds
   (Exec(goto b2,b3)) . IC SCM = b2 & (Exec(goto b2,b3)) . b1 = b3 . b1;

:: AMI_3:th 14
theorem
for b1, b2 being Data-Location
for b3 being Instruction-Location of SCM
for b4 being Element of product the Object-Kind of SCM holds
   (b4 . b1 = {} implies (Exec(b1 =0_goto b3,b4)) . IC SCM = b3) &
    (b4 . b1 = {} or (Exec(b1 =0_goto b3,b4)) . IC SCM = succ IC b4) &
    (Exec(b1 =0_goto b3,b4)) . b2 = b4 . b2;

:: AMI_3:th 15
theorem
for b1, b2 being Data-Location
for b3 being Instruction-Location of SCM
for b4 being Element of product the Object-Kind of SCM holds
   (b4 . b1 <= {} or (Exec(b1 >0_goto b3,b4)) . IC SCM = b3) &
    (b4 . b1 <= {} implies (Exec(b1 >0_goto b3,b4)) . IC SCM = succ IC b4) &
    (Exec(b1 >0_goto b3,b4)) . b2 = b4 . b2;

:: AMI_3:funcreg 3
registration
  cluster SCM -> strict halting;
end;

:: AMI_3:th 51
theorem
SCM is realistic(NAT, {INT});

:: AMI_3:funcreg 4
registration
  cluster SCM -> strict steady-programmed realistic;
end;

:: AMI_3:funcnot 11 => AMI_3:func 11
definition
  let a1 be natural set;
  func dl. A1 -> Data-Location equals
    [1,a1];
end;

:: AMI_3:def 19
theorem
for b1 being natural set holds
   dl. b1 = [1,b1];

:: AMI_3:funcnot 12 => AMI_3:func 12
definition
  let a1 be natural set;
  func il. A1 -> Instruction-Location of SCM equals
    a1;
end;

:: AMI_3:def 20
theorem
for b1 being natural set holds
   il. b1 = b1;

:: AMI_3:th 52
theorem
for b1, b2 being natural set
      st b1 <> b2
   holds dl. b1 <> dl. b2;

:: AMI_3:th 55
theorem
for b1 being Data-Location holds
   ObjectKind b1 = INT;

:: AMI_3:funcnot 13 => AMI_3:func 13
definition
  let a1 be Data-Location;
  let a2 be integer set;
  redefine func a1 .--> a2 -> finite Element of sproduct the Object-Kind of SCM;
end;

:: AMI_3:funcnot 14 => AMI_3:func 14
definition
  let a1, a2 be Data-Location;
  let a3, a4 be integer set;
  redefine func (a1,a2)-->(a3,a4) -> finite Element of sproduct the Object-Kind of SCM;
end;

:: AMI_3:th 56
theorem
for b1, b2 being natural set holds
dl. b1 <> b2;

:: AMI_3:th 57
theorem
for b1 being natural set holds
   IC SCM <> dl. b1 & IC SCM <> b1;

:: AMI_3:th 58
theorem
for b1 being Element of the Instructions of SCM
      st ex b2 being Element of product the Object-Kind of SCM st
           (Exec(b1,b2)) . IC SCM = succ IC b2
   holds b1 is halting(not NAT, {INT}, SCM);

:: AMI_3:th 59
theorem
for b1 being Element of the Instructions of SCM
      st b1 = [{},{}]
   holds b1 is halting(NAT, {INT}, SCM);

:: AMI_3:th 60
theorem
for b1, b2 being Data-Location holds
b1 := b2 is halting(not NAT, {INT}, SCM);

:: AMI_3:th 61
theorem
for b1, b2 being Data-Location holds
AddTo(b1,b2) is halting(not NAT, {INT}, SCM);

:: AMI_3:th 62
theorem
for b1, b2 being Data-Location holds
SubFrom(b1,b2) is halting(not NAT, {INT}, SCM);

:: AMI_3:th 63
theorem
for b1, b2 being Data-Location holds
MultBy(b1,b2) is halting(not NAT, {INT}, SCM);

:: AMI_3:th 64
theorem
for b1, b2 being Data-Location holds
Divide(b1,b2) is halting(not NAT, {INT}, SCM);

:: AMI_3:th 65
theorem
for b1 being Instruction-Location of SCM holds
   goto b1 is halting(not NAT, {INT}, SCM);

:: AMI_3:th 66
theorem
for b1 being Data-Location
for b2 being Instruction-Location of SCM holds
   b1 =0_goto b2 is halting(not NAT, {INT}, SCM);

:: AMI_3:th 67
theorem
for b1 being Data-Location
for b2 being Instruction-Location of SCM holds
   b1 >0_goto b2 is halting(not NAT, {INT}, SCM);

:: AMI_3:th 69
theorem
for b1 being set holds
      b1 is Element of the Instructions of SCM
   iff
      (b1 <> [{},{}] &
       (for b2, b3 being Data-Location holds
       b1 <> b2 := b3) &
       (for b2, b3 being Data-Location holds
       b1 <> AddTo(b2,b3)) &
       (for b2, b3 being Data-Location holds
       b1 <> SubFrom(b2,b3)) &
       (for b2, b3 being Data-Location holds
       b1 <> MultBy(b2,b3)) &
       (for b2, b3 being Data-Location holds
       b1 <> Divide(b2,b3)) &
       (for b2 being Instruction-Location of SCM holds
          b1 <> goto b2) &
       (for b2 being Data-Location
       for b3 being Instruction-Location of SCM holds
          b1 <> b2 =0_goto b3) implies ex b2 being Data-Location st
         ex b3 being Instruction-Location of SCM st
            b1 = b2 >0_goto b3);

:: AMI_3:th 70
theorem
for b1 being Element of the Instructions of SCM
      st b1 is halting(NAT, {INT}, SCM)
   holds b1 = halt SCM;

:: AMI_3:th 71
theorem
halt SCM = [{},{}];