thus STC N is IC-good :: thesis: STC N is Exec-preserving
proof
let I be Instruction of (STC N); :: according to AMISTD_2:def 19 :: thesis: I is IC-good
let k be natural number ; :: according to AMISTD_2:def 18 :: thesis: for s1 being State of (STC N) holds (IC (Exec I,s1)) + k = IC (Exec (IncAddr I,k),(IncrIC s1,k))
let s1 be State of (STC N); :: thesis: (IC (Exec I,s1)) + k = IC (Exec (IncAddr I,k),(IncrIC s1,k))
set s2 = IncrIC s1,k;
{(IC (STC N))} = dom ((IC (STC N)) .--> ((IC s1) + k)) by FUNCOP_1:19;
then IC (STC N) in dom ((IC (STC N)) .--> ((IC s1) + k)) by TARSKI:def 1;
then A2: IC (IncrIC s1,k) = ((IC (STC N)) .--> ((IC s1) + k)) . (IC (STC N)) by FUNCT_4:14
.= (IC s1) + k by FUNCOP_1:87 ;
per cases ( InsCode I = 1 or InsCode I = 0 ) by AMISTD_1:22;
suppose A3: InsCode I = 1 ; :: thesis: (IC (Exec I,s1)) + k = IC (Exec (IncAddr I,k),(IncrIC s1,k))
then A4: InsCode (IncAddr I,k) = 1 by Def14;
(Exec I,s1) . (IC (STC N)) = succ (IC s1) by A3, AMISTD_1:38
.= (IC s1) + 1 ;
hence (IC (Exec I,s1)) + k = succ (IC (IncrIC s1,k)) by A2
.= IC (Exec (IncAddr I,k),(IncrIC s1,k)) by A4, AMISTD_1:38 ;
:: thesis: verum
end;
suppose InsCode I = 0 ; :: thesis: (IC (Exec I,s1)) + k = IC (Exec (IncAddr I,k),(IncrIC s1,k))
then A5: I is halting by AMISTD_1:20;
hence (IC (Exec I,s1)) + k = (IC s1) + k by AMI_1:def 8
.= IC (Exec (IncAddr I,k),(IncrIC s1,k)) by A2, A5, AMI_1:def 8 ;
:: thesis: verum
end;
end;
end;
let I be Instruction of (STC N); :: according to AMISTD_2:def 21 :: thesis: I is Exec-preserving
per cases ( InsCode I = 1 or InsCode I = 0 ) by AMISTD_1:22;
suppose A6: InsCode I = 1 ; :: thesis: I is Exec-preserving
the Instructions of (STC N) = {[0 ,0 ,0 ],[1,0 ,0 ]} by AMISTD_1:def 11;
then A7: ( I = [0 ,0 ,0 ] or I = [1,0 ,0 ] ) by TARSKI:def 2;
let s1, s2 be State of (STC N); :: according to AMISTD_2:def 20 :: thesis: ( s1,s2 equal_outside NAT implies Exec I,s1, Exec I,s2 equal_outside NAT )
assume A8: s1,s2 equal_outside NAT ; :: thesis: Exec I,s1, Exec I,s2 equal_outside NAT
consider f being Function of (product the Object-Kind of (STC N)),(product the Object-Kind of (STC N)) such that
A9: for s being Element of product the Object-Kind of (STC N) holds f . s = s +* (NAT .--> (succ (s . NAT ))) and
A10: the Execution of (STC N) = ([1,0 ,0 ] .--> f) +* ([0 ,0 ,0 ] .--> (id (product the Object-Kind of (STC N)))) by AMISTD_1:def 11;
B9: for s being State of (STC N) holds f . s = s +* (NAT .--> (succ (s . NAT )))
proof
let s be State of (STC N); :: thesis: f . s = s +* (NAT .--> (succ (s . NAT )))
reconsider s = s as Element of product the Object-Kind of (STC N) by PBOOLE:155;
f . s = s +* (NAT .--> (succ (s . NAT ))) by A9;
hence f . s = s +* (NAT .--> (succ (s . NAT ))) ; :: thesis: verum
end;
[0 ,0 ,0 ] <> [1,0 ,0 ] by MCART_1:28;
then not I in {[0 ,0 ,0 ]} by A6, A7, RECDEF_2:def 1, TARSKI:def 1;
then not I in dom ([0 ,0 ,0 ] .--> (id (product the Object-Kind of (STC N)))) by FUNCOP_1:19;
then A11: the Execution of (STC N) . I = ([1,0 ,0 ] .--> f) . I by A10, FUNCT_4:12;
A12: I in {[1,0 ,0 ]} by A6, A7, RECDEF_2:def 1, TARSKI:def 1;
then A13: Exec I,s1 = f . s1 by A11, FUNCOP_1:13
.= s1 +* (NAT .--> (succ (s1 . NAT ))) by B9 ;
A14: Exec I,s2 = f . s2 by A11, A12, FUNCOP_1:13
.= s2 +* (NAT .--> (succ (s2 . NAT ))) by B9 ;
A15: dom (Exec I,s1) = the carrier of (STC N) by PARTFUN1:def 4
.= dom (Exec I,s2) by PARTFUN1:def 4 ;
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 ; :: thesis: ( x in (dom (Exec I,s1)) \ NAT implies (Exec I,s1) . x = (Exec I,s2) . x )
assume A16: x in (dom (Exec I,s1)) \ NAT ; :: thesis: (Exec I,s1) . x = (Exec I,s2) . x
then A17: not x in NAT by XBOOLE_0:def 5;
A18: s1 . NAT = IC s1 by AMISTD_1:def 11
.= IC s2 by A8, COMPOS_1:24
.= s2 . NAT by AMISTD_1:def 11 ;
x in dom (Exec I,s1) by A16;
then x in the carrier of (STC N) by PARTFUN1:def 4;
then x in NAT \/ {NAT } by AMISTD_1:def 11;
then A19: x in {NAT } by A17, XBOOLE_0:def 3;
then A20: x in dom (NAT .--> (succ (s2 . NAT ))) by FUNCOP_1:19;
x in dom (NAT .--> (succ (s1 . NAT ))) by A19, FUNCOP_1:19;
hence (Exec I,s1) . x = (NAT .--> (succ (s1 . NAT ))) . x by A13, FUNCT_4:14
.= (Exec I,s2) . x by A14, A18, A20, FUNCT_4:14 ;
:: thesis: verum
end;
hence (Exec I,s1) | ((dom (Exec I,s1)) \ NAT ) = (Exec I,s2) | ((dom (Exec I,s2)) \ NAT ) by A15, FUNCT_1:165; :: according to FUNCT_7:def 2 :: thesis: verum
end;
suppose InsCode I = 0 ; :: thesis: I is Exec-preserving
end;
end;