begin
begin
begin
set S1 = { [14,{},<*k1*>] where k1 is Element of INT : verum } ;
set S2 = { [1,{},<*d1*>] where d1 is Element of SCM-Data-Loc : verum } ;
set S3 = { [I1,{},<*d2,k2*>] where I1 is Element of Segm 15, d2 is Element of SCM-Data-Loc , k2 is Element of INT : I1 in {2,3} } ;
set S4 = { [I2,{},<*d3,k3,k4*>] where I2 is Element of Segm 15, d3 is Element of SCM-Data-Loc , k3, k4 is Element of INT : I2 in {4,5,6,7,8} } ;
set S5 = { [I3,{},<*d4,d5,k5,k6*>] where I3 is Element of Segm 15, d4, d5 is Element of SCM-Data-Loc , k5, k6 is Element of INT : I3 in {9,10,11,12,13} } ;
Lm1:
for I being Instruction of SCMPDS holds
( I in {[0,{},{}]} or I in { [14,{},<*k1*>] where k1 is Element of INT : verum } or I in { [1,{},<*d1*>] where d1 is Element of SCM-Data-Loc : verum } or I in { [I1,{},<*d2,k2*>] where I1 is Element of Segm 15, d2 is Element of SCM-Data-Loc , k2 is Element of INT : I1 in {2,3} } or I in { [I2,{},<*d3,k3,k4*>] where I2 is Element of Segm 15, d3 is Element of SCM-Data-Loc , k3, k4 is Element of INT : I2 in {4,5,6,7,8} } or I in { [I3,{},<*d4,d5,k5,k6*>] where I3 is Element of Segm 15, d4, d5 is Element of SCM-Data-Loc , k5, k6 is Element of INT : I3 in {9,10,11,12,13} } )
theorem Th11:
for
x being
set for
d4,
d5 being
Element of
SCM-Data-Loc for
k5,
k6 being
Integer st
x in {9,10,11,12,13} holds
[x,{},<*d4,d5,k5,k6*>] in SCMPDS-Instr
definition
let a be
Int_position;
let k1,
k2 be
Integer;
correctness
coherence
[4,{},<*a,k1,k2*>] is Instruction of SCMPDS;
correctness
coherence
[5,{},<*a,k1,k2*>] is Instruction of SCMPDS;
correctness
coherence
[6,{},<*a,k1,k2*>] is Instruction of SCMPDS;
correctness
coherence
[7,{},<*a,k1,k2*>] is Instruction of SCMPDS;
correctness
coherence
[8,{},<*a,k1,k2*>] is Instruction of SCMPDS;
end;
definition
let a,
b be
Int_position;
let k1,
k2 be
Integer;
correctness
coherence
[9,{},<*a,b,k1,k2*>] is Instruction of SCMPDS;
correctness
coherence
[10,{},<*a,b,k1,k2*>] is Instruction of SCMPDS;
correctness
coherence
[11,{},<*a,b,k1,k2*>] is Instruction of SCMPDS;
correctness
coherence
[12,{},<*a,b,k1,k2*>] is Instruction of SCMPDS;
correctness
coherence
[13,{},<*a,b,k1,k2*>] is Instruction of SCMPDS;
end;
::
deftheorem defines
AddTo SCMPDS_2:def 13 :
for a, b being Int_position
for k1, k2 being Integer holds AddTo (a,k1,b,k2) = [9,{},<*a,b,k1,k2*>];
::
deftheorem defines
SubFrom SCMPDS_2:def 14 :
for a, b being Int_position
for k1, k2 being Integer holds SubFrom (a,k1,b,k2) = [10,{},<*a,b,k1,k2*>];
::
deftheorem defines
MultBy SCMPDS_2:def 15 :
for a, b being Int_position
for k1, k2 being Integer holds MultBy (a,k1,b,k2) = [11,{},<*a,b,k1,k2*>];
::
deftheorem defines
Divide SCMPDS_2:def 16 :
for a, b being Int_position
for k1, k2 being Integer holds Divide (a,k1,b,k2) = [12,{},<*a,b,k1,k2*>];
Lm2:
for I being Instruction of SCMPDS st I in { [14,{},<*k1*>] where k1 is Element of INT : verum } holds
InsCode I = 14
Lm3:
for I being Instruction of SCMPDS st I in { [1,{},<*d1*>] where d1 is Element of SCM-Data-Loc : verum } holds
InsCode I = 1
Lm4:
for I being Instruction of SCMPDS holds
( not I in { [I1,{},<*d1,k1*>] where I1 is Element of Segm 15, d1 is Element of SCM-Data-Loc , k1 is Element of INT : I1 in {2,3} } or InsCode I = 2 or InsCode I = 3 )
Lm5:
for I being Instruction of SCMPDS holds
( not I in { [I1,{},<*d1,k1,k2*>] where I1 is Element of Segm 15, d1 is Element of SCM-Data-Loc , k1, k2 is Element of INT : I1 in {4,5,6,7,8} } or InsCode I = 4 or InsCode I = 5 or InsCode I = 6 or InsCode I = 7 or InsCode I = 8 )
Lm6:
for I being Instruction of SCMPDS holds
( not I in { [I1,{},<*d1,d2,k1,k2*>] where I1 is Element of Segm 15, d1, d2 is Element of SCM-Data-Loc , k1, k2 is Element of INT : I1 in {9,10,11,12,13} } or InsCode I = 9 or InsCode I = 10 or InsCode I = 11 or InsCode I = 12 or InsCode I = 13 )
Lm7:
for I being Instruction of SCMPDS st I in {[0,{},{}]} holds
InsCode I = 0
Lm8:
for I being Instruction of SCMPDS holds
( ( not I in {[0,{},{}]} & not I in { [14,{},<*k1*>] where k1 is Element of INT : verum } & not I in { [1,{},<*d1*>] where d1 is Element of SCM-Data-Loc : verum } & not I in { [I1,{},<*d2,k2*>] where I1 is Element of Segm 15, d2 is Element of SCM-Data-Loc , k2 is Element of INT : I1 in {2,3} } & not I in { [I3,{},<*d4,d5,k5,k6*>] where I3 is Element of Segm 15, d4, d5 is Element of SCM-Data-Loc , k5, k6 is Element of INT : I3 in {9,10,11,12,13} } ) or InsCode I = 0 or InsCode I = 14 or InsCode I = 1 or InsCode I = 2 or InsCode I = 3 or InsCode I = 9 or InsCode I = 10 or InsCode I = 11 or InsCode I = 12 or InsCode I = 13 )
by Lm2, Lm3, Lm4, Lm6, Lm7;
Lm9:
for I being Instruction of SCMPDS holds
( ( not I in {[0,{},{}]} & not I in { [14,{},<*k1*>] where k1 is Element of INT : verum } & not I in { [1,{},<*d1*>] where d1 is Element of SCM-Data-Loc : verum } & not I in { [I1,{},<*d2,k2*>] where I1 is Element of Segm 15, d2 is Element of SCM-Data-Loc , k2 is Element of INT : I1 in {2,3} } & not I in { [I2,{},<*d3,k3,k4*>] where I2 is Element of Segm 15, d3 is Element of SCM-Data-Loc , k3, k4 is Element of INT : I2 in {4,5,6,7,8} } ) or InsCode I = 0 or InsCode I = 14 or InsCode I = 1 or InsCode I = 2 or InsCode I = 3 or InsCode I = 4 or InsCode I = 5 or InsCode I = 6 or InsCode I = 7 or InsCode I = 8 )
Lm10:
Data-Locations = SCM-Data-Loc
begin
theorem Th47:
for
s being
State of
SCMPDS for
k1,
k2 being
Integer for
a,
b being
Int_position holds
(
(Exec (((a,k1) := (b,k2)),s)) . (IC ) = succ (IC s) &
(Exec (((a,k1) := (b,k2)),s)) . (DataLoc ((s . a),k1)) = s . (DataLoc ((s . b),k2)) & ( for
c being
Int_position st
c <> DataLoc (
(s . a),
k1) holds
(Exec (((a,k1) := (b,k2)),s)) . c = s . c ) )
theorem Th48:
for
s being
State of
SCMPDS for
k1,
k2 being
Integer for
a being
Int_position holds
(
(Exec ((AddTo (a,k1,k2)),s)) . (IC ) = succ (IC s) &
(Exec ((AddTo (a,k1,k2)),s)) . (DataLoc ((s . a),k1)) = (s . (DataLoc ((s . a),k1))) + k2 & ( for
b being
Int_position st
b <> DataLoc (
(s . a),
k1) holds
(Exec ((AddTo (a,k1,k2)),s)) . b = s . b ) )
theorem Th49:
for
s being
State of
SCMPDS for
k1,
k2 being
Integer for
a,
b being
Int_position holds
(
(Exec ((AddTo (a,k1,b,k2)),s)) . (IC ) = succ (IC s) &
(Exec ((AddTo (a,k1,b,k2)),s)) . (DataLoc ((s . a),k1)) = (s . (DataLoc ((s . a),k1))) + (s . (DataLoc ((s . b),k2))) & ( for
c being
Int_position st
c <> DataLoc (
(s . a),
k1) holds
(Exec ((AddTo (a,k1,b,k2)),s)) . c = s . c ) )
theorem Th50:
for
s being
State of
SCMPDS for
k1,
k2 being
Integer for
a,
b being
Int_position holds
(
(Exec ((SubFrom (a,k1,b,k2)),s)) . (IC ) = succ (IC s) &
(Exec ((SubFrom (a,k1,b,k2)),s)) . (DataLoc ((s . a),k1)) = (s . (DataLoc ((s . a),k1))) - (s . (DataLoc ((s . b),k2))) & ( for
c being
Int_position st
c <> DataLoc (
(s . a),
k1) holds
(Exec ((SubFrom (a,k1,b,k2)),s)) . c = s . c ) )
theorem Th51:
for
s being
State of
SCMPDS for
k1,
k2 being
Integer for
a,
b being
Int_position holds
(
(Exec ((MultBy (a,k1,b,k2)),s)) . (IC ) = succ (IC s) &
(Exec ((MultBy (a,k1,b,k2)),s)) . (DataLoc ((s . a),k1)) = (s . (DataLoc ((s . a),k1))) * (s . (DataLoc ((s . b),k2))) & ( for
c being
Int_position st
c <> DataLoc (
(s . a),
k1) holds
(Exec ((MultBy (a,k1,b,k2)),s)) . c = s . c ) )
theorem Th52:
for
s being
State of
SCMPDS for
k1,
k2 being
Integer for
a,
b being
Int_position holds
(
(Exec ((Divide (a,k1,b,k2)),s)) . (IC ) = succ (IC s) & (
DataLoc (
(s . a),
k1)
<> DataLoc (
(s . b),
k2) implies
(Exec ((Divide (a,k1,b,k2)),s)) . (DataLoc ((s . a),k1)) = (s . (DataLoc ((s . a),k1))) div (s . (DataLoc ((s . b),k2))) ) &
(Exec ((Divide (a,k1,b,k2)),s)) . (DataLoc ((s . b),k2)) = (s . (DataLoc ((s . a),k1))) mod (s . (DataLoc ((s . b),k2))) & ( for
c being
Int_position st
c <> DataLoc (
(s . a),
k1) &
c <> DataLoc (
(s . b),
k2) holds
(Exec ((Divide (a,k1,b,k2)),s)) . c = s . c ) )
theorem
for
s being
State of
SCMPDS for
k1 being
Integer for
a being
Int_position holds
(
(Exec ((Divide (a,k1,a,k1)),s)) . (IC ) = succ (IC s) &
(Exec ((Divide (a,k1,a,k1)),s)) . (DataLoc ((s . a),k1)) = (s . (DataLoc ((s . a),k1))) mod (s . (DataLoc ((s . a),k1))) & ( for
c being
Int_position st
c <> DataLoc (
(s . a),
k1) holds
(Exec ((Divide (a,k1,a,k1)),s)) . c = s . c ) )
by Th52;
theorem Th55:
for
s being
State of
SCMPDS for
k1,
k2 being
Integer for
a,
b being
Int_position holds
( (
s . (DataLoc ((s . a),k1)) <> 0 implies
(Exec (((a,k1) <>0_goto k2),s)) . (IC ) = ICplusConst (
s,
k2) ) & (
s . (DataLoc ((s . a),k1)) = 0 implies
(Exec (((a,k1) <>0_goto k2),s)) . (IC ) = succ (IC s) ) &
(Exec (((a,k1) <>0_goto k2),s)) . b = s . b )
theorem Th56:
for
s being
State of
SCMPDS for
k1,
k2 being
Integer for
a,
b being
Int_position holds
( (
s . (DataLoc ((s . a),k1)) <= 0 implies
(Exec (((a,k1) <=0_goto k2),s)) . (IC ) = ICplusConst (
s,
k2) ) & (
s . (DataLoc ((s . a),k1)) > 0 implies
(Exec (((a,k1) <=0_goto k2),s)) . (IC ) = succ (IC s) ) &
(Exec (((a,k1) <=0_goto k2),s)) . b = s . b )
theorem Th57:
for
s being
State of
SCMPDS for
k1,
k2 being
Integer for
a,
b being
Int_position holds
( (
s . (DataLoc ((s . a),k1)) >= 0 implies
(Exec (((a,k1) >=0_goto k2),s)) . (IC ) = ICplusConst (
s,
k2) ) & (
s . (DataLoc ((s . a),k1)) < 0 implies
(Exec (((a,k1) >=0_goto k2),s)) . (IC ) = succ (IC s) ) &
(Exec (((a,k1) >=0_goto k2),s)) . b = s . b )
Lm11:
for s being State of SCMPDS
for I being Instruction of SCMPDS st InsCode I = 0 holds
Exec (I,s) = s
theorem
for
I being
set holds
( not
I is
Instruction of
SCMPDS or
I = [0,{},{}] or ex
k1 being
Integer st
I = goto k1 or ex
a being
Int_position st
I = return a or ex
a being
Int_position ex
k1 being
Integer st
I = saveIC (
a,
k1) or ex
a being
Int_position ex
k1 being
Integer st
I = a := k1 or ex
a being
Int_position ex
k1,
k2 being
Integer st
I = (
a,
k1)
:= k2 or ex
a being
Int_position ex
k1,
k2 being
Integer st
I = (
a,
k1)
<>0_goto k2 or ex
a being
Int_position ex
k1,
k2 being
Integer st
I = (
a,
k1)
<=0_goto k2 or ex
a being
Int_position ex
k1,
k2 being
Integer st
I = (
a,
k1)
>=0_goto k2 or ex
a,
b being
Int_position ex
k1,
k2 being
Integer st
I = AddTo (
a,
k1,
k2) or ex
a,
b being
Int_position ex
k1,
k2 being
Integer st
I = AddTo (
a,
k1,
b,
k2) or ex
a,
b being
Int_position ex
k1,
k2 being
Integer st
I = SubFrom (
a,
k1,
b,
k2) or ex
a,
b being
Int_position ex
k1,
k2 being
Integer st
I = MultBy (
a,
k1,
b,
k2) or ex
a,
b being
Int_position ex
k1,
k2 being
Integer st
I = Divide (
a,
k1,
b,
k2) or ex
a,
b being
Int_position ex
k1,
k2 being
Integer st
I = (
a,
k1)
:= (
b,
k2) )
:: tego lematu nie mozna udowodnic.
::Lm11: for W being Instruction of SCMPDS st W is halting holds W = goto 0
::proof
:: set I = goto 0;
:: let W be Instruction of SCMPDS such that
::A1: W is halting;
:: assume
::A2: I <> W;
:: per cases by Th91;
:: suppose
:: ex k1 st W=goto k1;
:: hence thesis by A1,A2,Th85;
:: end;
:: suppose
:: ex a st W = return a;
:: hence thesis by A1,Th89;
:: end;
:: suppose
:: ex a,k1 st W = saveIC(a,k1);
:: hence thesis by A1,Th90;
:: end;
:: suppose
:: ex a,k1 st W = a:=k1;
:: hence thesis by A1,Th77;
:: end;
:: suppose
:: ex a,k1,k2 st W=(a,k1):=k2;
:: hence thesis by A1,Th78;
:: end;
:: suppose
:: ex a,k1,k2 st W = (a,k1)<>0_goto k2;
:: hence thesis by A1,Th86;
:: end;
:: suppose
:: ex a,k1,k2 st W = (a,k1)<=0_goto k2;
:: hence thesis by A1,Th87;
:: end;
:: suppose
:: ex a,k1,k2 st W = (a,k1)>=0_goto k2;
:: hence thesis by A1,Th88;
:: end;
:: suppose
:: ex a,b,k1,k2 st W = AddTo(a,k1,k2);
:: hence thesis by A1,Th80;
:: end;
:: suppose
:: ex a,b,k1,k2 st W = AddTo(a,k1,b,k2);
:: hence thesis by A1,Th81;
:: end;
:: suppose
:: ex a,b,k1,k2 st W = SubFrom(a,k1,b,k2);
:: hence thesis by A1,Th82;
:: end;
:: suppose
:: ex a,b,k1,k2 st W = MultBy(a,k1,b,k2);
:: hence thesis by A1,Th83;
:: end;
:: suppose
:: ex a,b,k1,k2 st W = Divide(a,k1,b,k2);
:: hence thesis by A1,Th84;
:: end;
:: suppose
:: ex a,b,k1,k2 st W = (a,k1):=(b,k2);
:: hence thesis by A1,Th79;
:: end;
::end;