thus
SCM is IC-good
SCM is Exec-preserving proof
let I be
Instruction of
SCM ;
AMISTD_2:def 19 I is IC-good
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-good let k be
Nat;
AMISTD_2:def 18 for b1 being set holds (IC (Exec I,b1)) + k = IC (Exec (IncAddr I,k),(IncrIC b1,k))let s1 be
State of
SCM ;
(IC (Exec I,s1)) + k = IC (Exec (IncAddr I,k),(IncrIC s1,k))set s2 =
IncrIC 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 I,s1)) + k =
IC (Exec (SCM-goto (i1 + k)),(IncrIC s1,k))
by AMI_3:13
.=
IC (Exec (IncAddr I,k),(IncrIC s1,k))
by A2, Th57
;
verum end; suppose
ex
a being
Data-Location ex
k being
natural number st
I = a =0_goto k
;
I is IC-good 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 k be
natural number ;
AMISTD_2:def 18 for b1 being set holds (IC (Exec I,b1)) + k = IC (Exec (IncAddr I,k),(IncrIC b1,k))let s1 be
State of
SCM ;
(IC (Exec I,s1)) + k = IC (Exec (IncAddr I,k),(IncrIC s1,k))set s2 =
IncrIC s1,
k;
(
a <> IC SCM &
dom ((IC SCM ) .--> ((IC s1) + k)) = {(IC SCM )} )
by AMI_5:20, FUNCOP_1:19;
then
not
a in dom ((IC SCM ) .--> ((IC s1) + k))
by TARSKI:def 1;
then A5:
s1 . a = (IncrIC s1,k) . a
by FUNCT_4:12;
now per cases
( s1 . a = 0 or s1 . a <> 0 )
;
suppose A6:
s1 . a = 0
;
(IC (Exec I,s1)) + k = IC (Exec (IncAddr I,k),(IncrIC s1,k))then
IC (Exec I,s1) = k1
by A3, AMI_3:14;
hence (IC (Exec I,s1)) + k =
IC (Exec (a =0_goto (i1 + k)),(IncrIC s1,k))
by A5, A6, AMI_3:14
.=
IC (Exec (IncAddr I,k),(IncrIC s1,k))
by A3, Th58
;
verum end; suppose A7:
s1 . a <> 0
;
(IC (Exec I,s1)) + k = IC (Exec (IncAddr I,k),(IncrIC s1,k))
dom ((IC SCM ) .--> ((IC s1) + k)) = {(IC SCM )}
by FUNCOP_1:19;
then
IC SCM in dom ((IC SCM ) .--> ((IC s1) + k))
by TARSKI:def 1;
then A8:
IC (IncrIC s1,k) =
((IC SCM ) .--> ((IC s1) + k)) . (IC SCM )
by FUNCT_4:14
.=
(IC s1) + k
by FUNCOP_1:87
;
A9:
IC (Exec I,s1) =
succ (IC s1)
by A3, A7, AMI_3:14
.=
(IC s1) + 1
;
IC (Exec I,(IncrIC s1,k)) =
succ (IC (IncrIC s1,k))
by A3, A5, A7, AMI_3:14
.=
((IC s1) + 1) + k
by A8
;
hence (IC (Exec I,s1)) + k =
succ (IC (IncrIC s1,k))
by A3, A5, A7, A9, AMI_3:14
.=
IC (Exec (a =0_goto (i1 + k)),(IncrIC s1,k))
by A5, A7, AMI_3:14
.=
IC (Exec (IncAddr I,k),(IncrIC s1,k))
by A3, Th58
;
verum end; end; end; hence
(IC (Exec I,s1)) + k = IC (Exec (IncAddr I,k),(IncrIC s1,k))
;
verum end; suppose
ex
a being
Data-Location ex
k being
natural number st
I = a >0_goto k
;
I is IC-good 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 k be
natural number ;
AMISTD_2:def 18 for b1 being set holds (IC (Exec I,b1)) + k = IC (Exec (IncAddr I,k),(IncrIC b1,k))let s1 be
State of
SCM ;
(IC (Exec I,s1)) + k = IC (Exec (IncAddr I,k),(IncrIC s1,k))set s2 =
IncrIC s1,
k;
(
a <> IC SCM &
dom ((IC SCM ) .--> ((IC s1) + k)) = {(IC SCM )} )
by AMI_5:20, FUNCOP_1:19;
then
not
a in dom ((IC SCM ) .--> ((IC s1) + k))
by TARSKI:def 1;
then A12:
s1 . a = (IncrIC s1,k) . a
by FUNCT_4:12;
now per cases
( s1 . a > 0 or s1 . a <= 0 )
;
suppose A13:
s1 . a > 0
;
(IC (Exec I,s1)) + k = IC (Exec (IncAddr I,k),(IncrIC s1,k))then
IC (Exec I,s1) = k1
by A10, AMI_3:15;
hence (IC (Exec I,s1)) + k =
IC (Exec (a >0_goto (i1 + k)),(IncrIC s1,k))
by A12, A13, AMI_3:15
.=
IC (Exec (IncAddr I,k),(IncrIC s1,k))
by A10, Th59
;
verum end; suppose A14:
s1 . a <= 0
;
(IC (Exec I,s1)) + k = IC (Exec (IncAddr I,k),(IncrIC s1,k))
dom ((IC SCM ) .--> ((IC s1) + k)) = {(IC SCM )}
by FUNCOP_1:19;
then
IC SCM in dom ((IC SCM ) .--> ((IC s1) + k))
by TARSKI:def 1;
then A15:
IC (IncrIC s1,k) =
((IC SCM ) .--> ((IC s1) + k)) . (IC SCM )
by FUNCT_4:14
.=
(IC s1) + k
by FUNCOP_1:87
;
A16:
IC (Exec I,s1) =
succ (IC s1)
by A10, A14, AMI_3:15
.=
(IC s1) + 1
;
IC (Exec I,(IncrIC s1,k)) =
succ (IC (IncrIC s1,k))
by A10, A12, A14, AMI_3:15
.=
((IC s1) + 1) + k
by A15
;
hence (IC (Exec I,s1)) + k =
succ (IC (IncrIC s1,k))
by A10, A12, A14, A16, AMI_3:15
.=
IC (Exec (a >0_goto (i1 + k)),(IncrIC s1,k))
by A12, A14, AMI_3:15
.=
IC (Exec (IncAddr I,k),(IncrIC s1,k))
by A10, Th59
;
verum end; end; end; hence
(IC (Exec I,s1)) + k = IC (Exec (IncAddr I,k),(IncrIC s1,k))
;
verum 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 s1,s2 equal_outside NAT or Exec I,s1, Exec I,s2 equal_outside NAT )
assume A18:
s1,s2 equal_outside NAT
; Exec I,s1, Exec I,s2 equal_outside NAT
A19:
IC s1 = IC s2
by A18, COMPOS_1:24;
A20:
dom (Exec I,s1) = the carrier of SCM
by PARTFUN1:def 4;
then A21:
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
;
Exec I,s1, Exec I,s2 equal_outside NAT then consider a,
b being
Data-Location such that A22:
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 A23:
x in (dom (Exec I,s1)) \ NAT
;
(Exec I,s1) . x = (Exec I,s2) . x
then A24:
not
x in NAT
by XBOOLE_0:def 5;
per cases
( x = IC SCM or x = a or ( x is Data-Location & x <> a ) )
by A20, A23, A24, Th3;
suppose that A27:
x is
Data-Location
and A28:
x <> a
;
(Exec I,s1) . x = (Exec I,s2) . xthus (Exec I,s1) . x =
s1 . x
by A22, A27, A28, AMI_3:8
.=
s2 . x
by A18, A27, Th5
.=
(Exec I,s2) . x
by A22, A27, A28, AMI_3:8
;
verum end; end;
end; hence
(Exec I,s1) | ((dom (Exec I,s1)) \ NAT ) = (Exec I,s2) | ((dom (Exec I,s2)) \ NAT )
by A21, FUNCT_1:165;
FUNCT_7:def 2 verum end; suppose
ex
a,
b being
Data-Location st
I = AddTo a,
b
;
Exec I,s1, Exec I,s2 equal_outside NAT then consider a,
b being
Data-Location such that A29:
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 A30:
x in (dom (Exec I,s1)) \ NAT
;
(Exec I,s1) . x = (Exec I,s2) . x
then A31:
not
x in NAT
by XBOOLE_0:def 5;
per cases
( x = IC SCM or x = a or ( x is Data-Location & x <> a ) )
by A20, A30, A31, Th3;
suppose that A34:
x is
Data-Location
and A35:
x <> a
;
(Exec I,s1) . x = (Exec I,s2) . xthus (Exec I,s1) . x =
s1 . x
by A29, A34, A35, AMI_3:9
.=
s2 . x
by A18, A34, Th5
.=
(Exec I,s2) . x
by A29, A34, A35, AMI_3:9
;
verum end; end;
end; hence
(Exec I,s1) | ((dom (Exec I,s1)) \ NAT ) = (Exec I,s2) | ((dom (Exec I,s2)) \ NAT )
by A21, FUNCT_1:165;
FUNCT_7:def 2 verum end; suppose
ex
a,
b being
Data-Location st
I = SubFrom a,
b
;
Exec I,s1, Exec I,s2 equal_outside NAT then consider a,
b being
Data-Location such that A36:
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 A37:
x in (dom (Exec I,s1)) \ NAT
;
(Exec I,s1) . x = (Exec I,s2) . x
then A38:
not
x in NAT
by XBOOLE_0:def 5;
per cases
( x = IC SCM or x = a or ( x is Data-Location & x <> a ) )
by A20, A37, A38, Th3;
suppose that A41:
x is
Data-Location
and A42:
x <> a
;
(Exec I,s1) . x = (Exec I,s2) . xthus (Exec I,s1) . x =
s1 . x
by A36, A41, A42, AMI_3:10
.=
s2 . x
by A18, A41, Th5
.=
(Exec I,s2) . x
by A36, A41, A42, AMI_3:10
;
verum end; end;
end; hence
(Exec I,s1) | ((dom (Exec I,s1)) \ NAT ) = (Exec I,s2) | ((dom (Exec I,s2)) \ NAT )
by A21, FUNCT_1:165;
FUNCT_7:def 2 verum end; suppose
ex
a,
b being
Data-Location st
I = MultBy a,
b
;
Exec I,s1, Exec I,s2 equal_outside NAT then consider a,
b being
Data-Location such that A43:
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 A44:
x in (dom (Exec I,s1)) \ NAT
;
(Exec I,s1) . x = (Exec I,s2) . x
then A45:
not
x in NAT
by XBOOLE_0:def 5;
per cases
( x = IC SCM or x = a or ( x is Data-Location & x <> a ) )
by A20, A44, A45, Th3;
suppose that A48:
x is
Data-Location
and A49:
x <> a
;
(Exec I,s1) . x = (Exec I,s2) . xthus (Exec I,s1) . x =
s1 . x
by A43, A48, A49, AMI_3:11
.=
s2 . x
by A18, A48, Th5
.=
(Exec I,s2) . x
by A43, A48, A49, AMI_3:11
;
verum end; end;
end; hence
(Exec I,s1) | ((dom (Exec I,s1)) \ NAT ) = (Exec I,s2) | ((dom (Exec I,s2)) \ NAT )
by A21, FUNCT_1:165;
FUNCT_7:def 2 verum end; suppose
ex
a,
b being
Data-Location st
I = Divide a,
b
;
Exec I,s1, Exec I,s2 equal_outside NAT then consider a,
b being
Data-Location such that A50:
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
hence
(Exec I,s1) | ((dom (Exec I,s1)) \ NAT ) = (Exec I,s2) | ((dom (Exec I,s2)) \ NAT )
by A21, FUNCT_1:165;
FUNCT_7:def 2 verum end; end;