Lm1:
for F being NAT -defined the InstructionsF of SCM -valued total Function
for k being Nat
for s being State of SCM holds Comput (F,s,(k + 1)) = Exec ((CurInstr (F,(Comput (F,s,k)))),(Comput (F,s,k)))
Lm2:
now for F being NAT -defined the InstructionsF of SCM -valued total Function
for k, n being Element of NAT
for s being State of SCM
for a, b being Data-Location st IC (Comput (F,s,k)) = n & ( F . n = a := b or F . n = AddTo (a,b) or F . n = SubFrom (a,b) or F . n = MultBy (a,b) or ( a <> b & F . n = Divide (a,b) ) ) holds
( Comput (F,s,(k + 1)) = Exec ((F . n),(Comput (F,s,k))) & IC (Comput (F,s,(k + 1))) = n + 1 )
let F be
NAT -defined the
InstructionsF of
SCM -valued total Function;
for k, n being Element of NAT
for s being State of SCM
for a, b being Data-Location st IC (Comput (F,s,k)) = n & ( F . n = a := b or F . n = AddTo (a,b) or F . n = SubFrom (a,b) or F . n = MultBy (a,b) or ( a <> b & F . n = Divide (a,b) ) ) holds
( Comput (F,s,(k + 1)) = Exec ((F . n),(Comput (F,s,k))) & IC (Comput (F,s,(k + 1))) = n + 1 )let k,
n be
Element of
NAT ;
for s being State of SCM
for a, b being Data-Location st IC (Comput (F,s,k)) = n & ( F . n = a := b or F . n = AddTo (a,b) or F . n = SubFrom (a,b) or F . n = MultBy (a,b) or ( a <> b & F . n = Divide (a,b) ) ) holds
( Comput (F,s,(k + 1)) = Exec ((F . n),(Comput (F,s,k))) & IC (Comput (F,s,(k + 1))) = n + 1 )let s be
State of
SCM;
for a, b being Data-Location st IC (Comput (F,s,k)) = n & ( F . n = a := b or F . n = AddTo (a,b) or F . n = SubFrom (a,b) or F . n = MultBy (a,b) or ( a <> b & F . n = Divide (a,b) ) ) holds
( Comput (F,s,(k + 1)) = Exec ((F . n),(Comput (F,s,k))) & IC (Comput (F,s,(k + 1))) = n + 1 )let a,
b be
Data-Location;
( IC (Comput (F,s,k)) = n & ( F . n = a := b or F . n = AddTo (a,b) or F . n = SubFrom (a,b) or F . n = MultBy (a,b) or ( a <> b & F . n = Divide (a,b) ) ) implies ( Comput (F,s,(k + 1)) = Exec ((F . n),(Comput (F,s,k))) & IC (Comput (F,s,(k + 1))) = n + 1 ) )assume A1:
IC (Comput (F,s,k)) = n
;
( ( F . n = a := b or F . n = AddTo (a,b) or F . n = SubFrom (a,b) or F . n = MultBy (a,b) or ( a <> b & F . n = Divide (a,b) ) ) implies ( Comput (F,s,(k + 1)) = Exec ((F . n),(Comput (F,s,k))) & IC (Comput (F,s,(k + 1))) = n + 1 ) )set csk1 =
Comput (
F,
s,
(k + 1));
set csk =
Comput (
F,
s,
k);
assume A2:
(
F . n = a := b or
F . n = AddTo (
a,
b) or
F . n = SubFrom (
a,
b) or
F . n = MultBy (
a,
b) or (
a <> b &
F . n = Divide (
a,
b) ) )
;
( Comput (F,s,(k + 1)) = Exec ((F . n),(Comput (F,s,k))) & IC (Comput (F,s,(k + 1))) = n + 1 )A3:
dom F = NAT
by PARTFUN1:def 2;
thus Comput (
F,
s,
(k + 1)) =
Exec (
(CurInstr (F,(Comput (F,s,k)))),
(Comput (F,s,k)))
by Lm1
.=
Exec (
(F . n),
(Comput (F,s,k)))
by A1, A3, PARTFUN1:def 6
;
IC (Comput (F,s,(k + 1))) = n + 1hence IC (Comput (F,s,(k + 1))) =
(IC (Comput (F,s,k))) + 1
by A2, AMI_3:2, AMI_3:3, AMI_3:4, AMI_3:5, AMI_3:6
.=
n + 1
by A1
;
verum
end;
theorem Th4:
for
F being
NAT -defined the
InstructionsF of
SCM -valued total Function for
k,
n being
Element of
NAT for
s being
State of
SCM for
a,
b being
Data-Location st
IC (Comput (F,s,k)) = n &
F . n = a := b holds
(
IC (Comput (F,s,(k + 1))) = n + 1 &
(Comput (F,s,(k + 1))) . a = (Comput (F,s,k)) . b & ( for
d being
Data-Location st
d <> a holds
(Comput (F,s,(k + 1))) . d = (Comput (F,s,k)) . d ) )
theorem Th5:
for
F being
NAT -defined the
InstructionsF of
SCM -valued total Function for
k,
n being
Element of
NAT for
s being
State of
SCM for
a,
b being
Data-Location st
IC (Comput (F,s,k)) = n &
F . n = AddTo (
a,
b) holds
(
IC (Comput (F,s,(k + 1))) = n + 1 &
(Comput (F,s,(k + 1))) . a = ((Comput (F,s,k)) . a) + ((Comput (F,s,k)) . b) & ( for
d being
Data-Location st
d <> a holds
(Comput (F,s,(k + 1))) . d = (Comput (F,s,k)) . d ) )
theorem Th6:
for
F being
NAT -defined the
InstructionsF of
SCM -valued total Function for
k,
n being
Element of
NAT for
s being
State of
SCM for
a,
b being
Data-Location st
IC (Comput (F,s,k)) = n &
F . n = SubFrom (
a,
b) holds
(
IC (Comput (F,s,(k + 1))) = n + 1 &
(Comput (F,s,(k + 1))) . a = ((Comput (F,s,k)) . a) - ((Comput (F,s,k)) . b) & ( for
d being
Data-Location st
d <> a holds
(Comput (F,s,(k + 1))) . d = (Comput (F,s,k)) . d ) )
theorem Th7:
for
F being
NAT -defined the
InstructionsF of
SCM -valued total Function for
k,
n being
Element of
NAT for
s being
State of
SCM for
a,
b being
Data-Location st
IC (Comput (F,s,k)) = n &
F . n = MultBy (
a,
b) holds
(
IC (Comput (F,s,(k + 1))) = n + 1 &
(Comput (F,s,(k + 1))) . a = ((Comput (F,s,k)) . a) * ((Comput (F,s,k)) . b) & ( for
d being
Data-Location st
d <> a holds
(Comput (F,s,(k + 1))) . d = (Comput (F,s,k)) . d ) )
theorem Th8:
for
F being
NAT -defined the
InstructionsF of
SCM -valued total Function for
k,
n being
Element of
NAT for
s being
State of
SCM for
a,
b being
Data-Location st
IC (Comput (F,s,k)) = n &
F . n = Divide (
a,
b) &
a <> b holds
(
IC (Comput (F,s,(k + 1))) = n + 1 &
(Comput (F,s,(k + 1))) . a = ((Comput (F,s,k)) . a) div ((Comput (F,s,k)) . b) &
(Comput (F,s,(k + 1))) . b = ((Comput (F,s,k)) . a) mod ((Comput (F,s,k)) . b) & ( for
d being
Data-Location st
d <> a &
d <> b holds
(Comput (F,s,(k + 1))) . d = (Comput (F,s,k)) . d ) )
theorem Th10:
for
F being
NAT -defined the
InstructionsF of
SCM -valued total Function for
k,
n being
Nat for
s being
State of
SCM for
a being
Data-Location for
il being
Element of
NAT st
IC (Comput (F,s,k)) = n &
F . n = a =0_goto il holds
( (
(Comput (F,s,k)) . a = 0 implies
IC (Comput (F,s,(k + 1))) = il ) & (
(Comput (F,s,k)) . a <> 0 implies
IC (Comput (F,s,(k + 1))) = n + 1 ) & ( for
d being
Data-Location holds
(Comput (F,s,(k + 1))) . d = (Comput (F,s,k)) . d ) )
theorem Th11:
for
F being
NAT -defined the
InstructionsF of
SCM -valued total Function for
k,
n being
Element of
NAT for
s being
State of
SCM for
a being
Data-Location for
il being
Element of
NAT st
IC (Comput (F,s,k)) = n &
F . n = a >0_goto il holds
( (
(Comput (F,s,k)) . a > 0 implies
IC (Comput (F,s,(k + 1))) = il ) & (
(Comput (F,s,k)) . a <= 0 implies
IC (Comput (F,s,(k + 1))) = n + 1 ) & ( for
d being
Data-Location holds
(Comput (F,s,(k + 1))) . d = (Comput (F,s,k)) . d ) )