thus
SCM is IC-relocable
SCM is Exec-preserving proof
let I be
Instruction of
SCM;
AMISTD_2:def 19 I is IC-relocable
per cases
( I = [0,{},{}] or ex a, b being Data-Location st I = a := b or ex a, b being Data-Location st I = AddTo (a,b) or ex a, b being Data-Location st I = SubFrom (a,b) or ex a, b being Data-Location st I = MultBy (a,b) or ex a, b being Data-Location st I = Divide (a,b) or ex k being natural number st I = SCM-goto k or ex a being Data-Location ex k being natural number st I = a =0_goto k or ex a being Data-Location ex k being natural number st I = a >0_goto k )
by AMI_3:69;
suppose A1:
ex
k being
natural number st
I = SCM-goto k
;
I is IC-relocable let j,
k be
Nat;
AMISTD_2:def 18 for b1 being set holds (IC (Exec ((IncAddr (I,j)),b1))) + k = IC (Exec ((IncAddr (I,(j + k))),(IncIC (b1,k))))let s1 be
State of
SCM;
(IC (Exec ((IncAddr (I,j)),s1))) + k = IC (Exec ((IncAddr (I,(j + k))),(IncIC (s1,k))))set s2 =
IncIC (
s1,
k);
consider k1 being
natural number such that A2:
I = SCM-goto k1
by A1;
reconsider i1 =
k1 as
Element of
NAT by ORDINAL1:def 13;
IC (Exec (I,s1)) = k1
by A2, AMI_3:13;
hence (IC (Exec ((IncAddr (I,j)),s1))) + k =
(IC (Exec ((SCM-goto (j + k1)),s1))) + k
by A2, Th59
.=
(j + k1) + k
by AMI_3:13
.=
IC (Exec ((SCM-goto ((j + i1) + k)),(IncIC (s1,k))))
by AMI_3:13
.=
IC (Exec ((SCM-goto ((j + k) + i1)),(IncIC (s1,k))))
.=
IC (Exec ((IncAddr (I,(j + k))),(IncIC (s1,k))))
by A2, Th59
;
verum end; suppose
ex
a being
Data-Location ex
k being
natural number st
I = a =0_goto k
;
I is IC-relocable then consider a being
Data-Location ,
k1 being
natural number such that A3:
I = a =0_goto k1
;
reconsider i1 =
k1 as
Element of
NAT by ORDINAL1:def 13;
let j,
k be
natural number ;
AMISTD_2:def 18 for b1 being set holds (IC (Exec ((IncAddr (I,j)),b1))) + k = IC (Exec ((IncAddr (I,(j + k))),(IncIC (b1,k))))let s1 be
State of
SCM;
(IC (Exec ((IncAddr (I,j)),s1))) + k = IC (Exec ((IncAddr (I,(j + k))),(IncIC (s1,k))))set s2 =
IncIC (
s1,
k);
(
a <> IC &
dom ((IC ) .--> ((IC s1) + k)) = {(IC )} )
by AMI_5:20, FUNCOP_1:19;
then
not
a in dom ((IC ) .--> ((IC s1) + k))
by TARSKI:def 1;
then A4:
s1 . a = (IncIC (s1,k)) . a
by FUNCT_4:12;
now per cases
( s1 . a = 0 or s1 . a <> 0 )
;
suppose A5:
s1 . a = 0
;
(IC (Exec ((IncAddr (I,j)),s1))) + k = IC (Exec ((IncAddr (I,(j + k))),(IncIC (s1,k))))then
IC (Exec (I,s1)) = k1
by A3, AMI_3:14;
hence (IC (Exec ((IncAddr (I,j)),s1))) + k =
(IC (Exec ((a =0_goto (j + k1)),s1))) + k
by A3, Th60
.=
(j + k1) + k
by A5, AMI_3:14
.=
IC (Exec ((a =0_goto ((j + i1) + k)),(IncIC (s1,k))))
by A4, A5, AMI_3:14
.=
IC (Exec ((a =0_goto ((j + k) + i1)),(IncIC (s1,k))))
.=
IC (Exec ((IncAddr (I,(j + k))),(IncIC (s1,k))))
by A3, Th60
;
verum end; suppose A6:
s1 . a <> 0
;
(IC (Exec ((IncAddr (I,j)),s1))) + k = IC (Exec ((IncAddr (I,(j + k))),(IncIC (s1,k))))A7:
IncAddr (
I,
j)
= a =0_goto (i1 + j)
by A3, Th60;
A8:
IncAddr (
I,
(j + k))
= a =0_goto (i1 + (j + k))
by A3, Th60;
dom ((IC ) .--> ((IC s1) + k)) = {(IC )}
by FUNCOP_1:19;
then
IC in dom ((IC ) .--> ((IC s1) + k))
by TARSKI:def 1;
then A9:
IC (IncIC (s1,k)) =
((IC ) .--> ((IC s1) + k)) . (IC )
by FUNCT_4:14
.=
(IC s1) + k
by FUNCOP_1:87
;
thus (IC (Exec ((IncAddr (I,j)),s1))) + k =
(succ (IC s1)) + k
by A7, A6, AMI_3:14
.=
((IC s1) + 1) + k
.=
succ (IC (IncIC (s1,k)))
by A9
.=
IC (Exec ((IncAddr (I,(j + k))),(IncIC (s1,k))))
by A8, A6, A4, AMI_3:14
;
verum end; end; end; hence
(IC (Exec ((IncAddr (I,j)),s1))) + k = IC (Exec ((IncAddr (I,(j + k))),(IncIC (s1,k))))
;
verum end; suppose
ex
a being
Data-Location ex
k being
natural number st
I = a >0_goto k
;
I is IC-relocable then consider a being
Data-Location ,
k1 being
natural number such that A10:
I = a >0_goto k1
;
reconsider i1 =
k1 as
Element of
NAT by ORDINAL1:def 13;
let j,
k be
natural number ;
AMISTD_2:def 18 for b1 being set holds (IC (Exec ((IncAddr (I,j)),b1))) + k = IC (Exec ((IncAddr (I,(j + k))),(IncIC (b1,k))))let s1 be
State of
SCM;
(IC (Exec ((IncAddr (I,j)),s1))) + k = IC (Exec ((IncAddr (I,(j + k))),(IncIC (s1,k))))set s2 =
IncIC (
s1,
k);
(
a <> IC &
dom ((IC ) .--> ((IC s1) + k)) = {(IC )} )
by AMI_5:20, FUNCOP_1:19;
then
not
a in dom ((IC ) .--> ((IC s1) + k))
by TARSKI:def 1;
then A11:
s1 . a = (IncIC (s1,k)) . a
by FUNCT_4:12;
per cases
( s1 . a > 0 or s1 . a <= 0 )
;
suppose A12:
s1 . a > 0
;
(IC (Exec ((IncAddr (I,j)),s1))) + k = IC (Exec ((IncAddr (I,(j + k))),(IncIC (s1,k))))then
IC (Exec (I,s1)) = k1
by A10, AMI_3:15;
hence (IC (Exec ((IncAddr (I,j)),s1))) + k =
(IC (Exec ((a >0_goto (j + k1)),s1))) + k
by A10, Th61
.=
(j + k1) + k
by A12, AMI_3:15
.=
IC (Exec ((a >0_goto ((j + i1) + k)),(IncIC (s1,k))))
by A11, A12, AMI_3:15
.=
IC (Exec ((a >0_goto ((j + k) + i1)),(IncIC (s1,k))))
.=
IC (Exec ((IncAddr (I,(j + k))),(IncIC (s1,k))))
by A10, Th61
;
verum end; suppose A13:
s1 . a <= 0
;
(IC (Exec ((IncAddr (I,j)),s1))) + k = IC (Exec ((IncAddr (I,(j + k))),(IncIC (s1,k))))A14:
IncAddr (
I,
j)
= a >0_goto (i1 + j)
by A10, Th61;
A15:
IncAddr (
I,
(j + k))
= a >0_goto (i1 + (j + k))
by A10, Th61;
dom ((IC ) .--> ((IC s1) + k)) = {(IC )}
by FUNCOP_1:19;
then
IC in dom ((IC ) .--> ((IC s1) + k))
by TARSKI:def 1;
then A16:
IC (IncIC (s1,k)) =
((IC ) .--> ((IC s1) + k)) . (IC )
by FUNCT_4:14
.=
(IC s1) + k
by FUNCOP_1:87
;
thus (IC (Exec ((IncAddr (I,j)),s1))) + k =
(succ (IC s1)) + k
by A14, A13, AMI_3:15
.=
((IC s1) + 1) + k
.=
succ (IC (IncIC (s1,k)))
by A16
.=
IC (Exec ((IncAddr (I,(j + k))),(IncIC (s1,k))))
by A15, A13, A11, AMI_3:15
;
verum end; end; end; end;
end;
let I be Instruction of SCM; AMISTD_2:def 21 I is Exec-preserving
let s1, s2 be State of SCM; AMISTD_2:def 20 ( not NPP s1 = NPP s2 or NPP (Exec (I,s1)) = NPP (Exec (I,s2)) )
assume A17:
NPP s1 = NPP s2
; NPP (Exec (I,s1)) = NPP (Exec (I,s2))
A18:
IC s1 = IC s2
by A17, COMPOS_1:230;
A19:
dom (Exec (I,s1)) = the carrier of SCM
by PARTFUN1:def 4;
then A20:
dom (Exec (I,s1)) = dom (Exec (I,s2))
by PARTFUN1:def 4;
per cases
( I = [0,{},{}] or ex a, b being Data-Location st I = a := b or ex a, b being Data-Location st I = AddTo (a,b) or ex a, b being Data-Location st I = SubFrom (a,b) or ex a, b being Data-Location st I = MultBy (a,b) or ex a, b being Data-Location st I = Divide (a,b) or ex k being natural number st I = SCM-goto k or ex a being Data-Location ex k being natural number st I = a =0_goto k or ex a being Data-Location ex k being natural number st I = a >0_goto k )
by AMI_3:69;
suppose
ex
a,
b being
Data-Location st
I = a := b
;
NPP (Exec (I,s1)) = NPP (Exec (I,s2))then consider a,
b being
Data-Location such that A21:
I = a := b
;
for
x being
set st
x in (dom (Exec (I,s1))) \ NAT holds
(Exec (I,s1)) . x = (Exec (I,s2)) . x
proof
let x be
set ;
( x in (dom (Exec (I,s1))) \ NAT implies (Exec (I,s1)) . x = (Exec (I,s2)) . x )
assume A22:
x in (dom (Exec (I,s1))) \ NAT
;
(Exec (I,s1)) . x = (Exec (I,s2)) . x
then A23:
not
x in NAT
by XBOOLE_0:def 5;
per cases
( x = IC or x = a or ( x is Data-Location & x <> a ) )
by A19, A22, A23, Th3;
suppose that A26:
x is
Data-Location
and A27:
x <> a
;
(Exec (I,s1)) . x = (Exec (I,s2)) . xthus (Exec (I,s1)) . x =
s1 . x
by A21, A26, A27, AMI_3:8
.=
s2 . x
by A17, A26, Th5
.=
(Exec (I,s2)) . x
by A21, A26, A27, AMI_3:8
;
verum end; end;
end; then
(Exec (I,s1)) | ((dom (Exec (I,s1))) \ NAT) = (Exec (I,s2)) | ((dom (Exec (I,s2))) \ NAT)
by A20, FUNCT_1:165;
hence
NPP (Exec (I,s1)) = NPP (Exec (I,s2))
by COMPOS_1:233;
verum end; suppose
ex
a,
b being
Data-Location st
I = AddTo (
a,
b)
;
NPP (Exec (I,s1)) = NPP (Exec (I,s2))then consider a,
b being
Data-Location such that A28:
I = AddTo (
a,
b)
;
for
x being
set st
x in (dom (Exec (I,s1))) \ NAT holds
(Exec (I,s1)) . x = (Exec (I,s2)) . x
proof
let x be
set ;
( x in (dom (Exec (I,s1))) \ NAT implies (Exec (I,s1)) . x = (Exec (I,s2)) . x )
assume A29:
x in (dom (Exec (I,s1))) \ NAT
;
(Exec (I,s1)) . x = (Exec (I,s2)) . x
then A30:
not
x in NAT
by XBOOLE_0:def 5;
per cases
( x = IC or x = a or ( x is Data-Location & x <> a ) )
by A19, A29, A30, Th3;
suppose that A33:
x is
Data-Location
and A34:
x <> a
;
(Exec (I,s1)) . x = (Exec (I,s2)) . xthus (Exec (I,s1)) . x =
s1 . x
by A28, A33, A34, AMI_3:9
.=
s2 . x
by A17, A33, Th5
.=
(Exec (I,s2)) . x
by A28, A33, A34, AMI_3:9
;
verum end; end;
end; then
(Exec (I,s1)) | ((dom (Exec (I,s1))) \ NAT) = (Exec (I,s2)) | ((dom (Exec (I,s2))) \ NAT)
by A20, FUNCT_1:165;
hence
NPP (Exec (I,s1)) = NPP (Exec (I,s2))
by COMPOS_1:233;
verum end; suppose
ex
a,
b being
Data-Location st
I = SubFrom (
a,
b)
;
NPP (Exec (I,s1)) = NPP (Exec (I,s2))then consider a,
b being
Data-Location such that A35:
I = SubFrom (
a,
b)
;
for
x being
set st
x in (dom (Exec (I,s1))) \ NAT holds
(Exec (I,s1)) . x = (Exec (I,s2)) . x
proof
let x be
set ;
( x in (dom (Exec (I,s1))) \ NAT implies (Exec (I,s1)) . x = (Exec (I,s2)) . x )
assume A36:
x in (dom (Exec (I,s1))) \ NAT
;
(Exec (I,s1)) . x = (Exec (I,s2)) . x
then A37:
not
x in NAT
by XBOOLE_0:def 5;
per cases
( x = IC or x = a or ( x is Data-Location & x <> a ) )
by A19, A36, A37, Th3;
suppose that A40:
x is
Data-Location
and A41:
x <> a
;
(Exec (I,s1)) . x = (Exec (I,s2)) . xthus (Exec (I,s1)) . x =
s1 . x
by A35, A40, A41, AMI_3:10
.=
s2 . x
by A17, A40, Th5
.=
(Exec (I,s2)) . x
by A35, A40, A41, AMI_3:10
;
verum end; end;
end; then
(Exec (I,s1)) | ((dom (Exec (I,s1))) \ NAT) = (Exec (I,s2)) | ((dom (Exec (I,s2))) \ NAT)
by A20, FUNCT_1:165;
hence
NPP (Exec (I,s1)) = NPP (Exec (I,s2))
by COMPOS_1:233;
verum end; suppose
ex
a,
b being
Data-Location st
I = MultBy (
a,
b)
;
NPP (Exec (I,s1)) = NPP (Exec (I,s2))then consider a,
b being
Data-Location such that A42:
I = MultBy (
a,
b)
;
for
x being
set st
x in (dom (Exec (I,s1))) \ NAT holds
(Exec (I,s1)) . x = (Exec (I,s2)) . x
proof
let x be
set ;
( x in (dom (Exec (I,s1))) \ NAT implies (Exec (I,s1)) . x = (Exec (I,s2)) . x )
assume A43:
x in (dom (Exec (I,s1))) \ NAT
;
(Exec (I,s1)) . x = (Exec (I,s2)) . x
then A44:
not
x in NAT
by XBOOLE_0:def 5;
per cases
( x = IC or x = a or ( x is Data-Location & x <> a ) )
by A19, A43, A44, Th3;
suppose that A47:
x is
Data-Location
and A48:
x <> a
;
(Exec (I,s1)) . x = (Exec (I,s2)) . xthus (Exec (I,s1)) . x =
s1 . x
by A42, A47, A48, AMI_3:11
.=
s2 . x
by A17, A47, Th5
.=
(Exec (I,s2)) . x
by A42, A47, A48, AMI_3:11
;
verum end; end;
end; then
(Exec (I,s1)) | ((dom (Exec (I,s1))) \ NAT) = (Exec (I,s2)) | ((dom (Exec (I,s2))) \ NAT)
by A20, FUNCT_1:165;
hence
NPP (Exec (I,s1)) = NPP (Exec (I,s2))
by COMPOS_1:233;
verum end; suppose
ex
a,
b being
Data-Location st
I = Divide (
a,
b)
;
NPP (Exec (I,s1)) = NPP (Exec (I,s2))then consider a,
b being
Data-Location such that A49:
I = Divide (
a,
b)
;
for
x being
set st
x in (dom (Exec (I,s1))) \ NAT holds
(Exec (I,s1)) . x = (Exec (I,s2)) . x
then
(Exec (I,s1)) | ((dom (Exec (I,s1))) \ NAT) = (Exec (I,s2)) | ((dom (Exec (I,s2))) \ NAT)
by A20, FUNCT_1:165;
hence
NPP (Exec (I,s1)) = NPP (Exec (I,s2))
by COMPOS_1:233;
verum end; suppose
ex
k being
natural number st
I = SCM-goto k
;
NPP (Exec (I,s1)) = NPP (Exec (I,s2))then consider k1 being
natural number such that A58:
I = SCM-goto k1
;
for
x being
set st
x in (dom (Exec (I,s1))) \ NAT holds
(Exec (I,s1)) . x = (Exec (I,s2)) . x
then
(Exec (I,s1)) | ((dom (Exec (I,s1))) \ NAT) = (Exec (I,s2)) | ((dom (Exec (I,s2))) \ NAT)
by A20, FUNCT_1:165;
hence
NPP (Exec (I,s1)) = NPP (Exec (I,s2))
by COMPOS_1:233;
verum end; suppose
ex
a being
Data-Location ex
k being
natural number st
I = a =0_goto k
;
NPP (Exec (I,s1)) = NPP (Exec (I,s2))then consider a being
Data-Location ,
k1 being
natural number such that A63:
I = a =0_goto k1
;
for
x being
set st
x in (dom (Exec (I,s1))) \ NAT holds
(Exec (I,s1)) . x = (Exec (I,s2)) . x
then
(Exec (I,s1)) | ((dom (Exec (I,s1))) \ NAT) = (Exec (I,s2)) | ((dom (Exec (I,s2))) \ NAT)
by A20, FUNCT_1:165;
hence
NPP (Exec (I,s1)) = NPP (Exec (I,s2))
by COMPOS_1:233;
verum end; suppose
ex
a being
Data-Location ex
k being
natural number st
I = a >0_goto k
;
NPP (Exec (I,s1)) = NPP (Exec (I,s2))then consider a being
Data-Location ,
k being
natural number such that A70:
I = a >0_goto k
;
for
x being
set st
x in (dom (Exec (I,s1))) \ NAT holds
(Exec (I,s1)) . x = (Exec (I,s2)) . x
then
(Exec (I,s1)) | ((dom (Exec (I,s1))) \ NAT) = (Exec (I,s2)) | ((dom (Exec (I,s2))) \ NAT)
by A20, FUNCT_1:165;
hence
NPP (Exec (I,s1)) = NPP (Exec (I,s2))
by COMPOS_1:233;
verum end; end;