:: SCMRING2 semantic presentation

definition
let c1 be good Ring;
func SCM c1 -> strict AMI-Struct of {the carrier of a1} means :Def1: :: SCMRING2:def 1
( the carrier of a2 = NAT & the Instruction-Counter of a2 = 0 & the Instruction-Locations of a2 = SCM-Instr-Loc & the Instruction-Codes of a2 = Segm 8 & the Instructions of a2 = SCM-Instr a1 & the Object-Kind of a2 = SCM-OK a1 & the Execution of a2 = SCM-Exec a1 );
existence
ex b1 being strict AMI-Struct of {the carrier of c1} st
( the carrier of b1 = NAT & the Instruction-Counter of b1 = 0 & the Instruction-Locations of b1 = SCM-Instr-Loc & the Instruction-Codes of b1 = Segm 8 & the Instructions of b1 = SCM-Instr c1 & the Object-Kind of b1 = SCM-OK c1 & the Execution of b1 = SCM-Exec c1 )
proof end;
uniqueness
for b1, b2 being strict AMI-Struct of {the carrier of c1} st the carrier of b1 = NAT & the Instruction-Counter of b1 = 0 & the Instruction-Locations of b1 = SCM-Instr-Loc & the Instruction-Codes of b1 = Segm 8 & the Instructions of b1 = SCM-Instr c1 & the Object-Kind of b1 = SCM-OK c1 & the Execution of b1 = SCM-Exec c1 & the carrier of b2 = NAT & the Instruction-Counter of b2 = 0 & the Instruction-Locations of b2 = SCM-Instr-Loc & the Instruction-Codes of b2 = Segm 8 & the Instructions of b2 = SCM-Instr c1 & the Object-Kind of b2 = SCM-OK c1 & the Execution of b2 = SCM-Exec c1 holds
b1 = b2
;
end;

:: deftheorem Def1 defines SCM SCMRING2:def 1 :
for b1 being good Ring
for b2 being strict AMI-Struct of {the carrier of b1} holds
( b2 = SCM b1 iff ( the carrier of b2 = NAT & the Instruction-Counter of b2 = 0 & the Instruction-Locations of b2 = SCM-Instr-Loc & the Instruction-Codes of b2 = Segm 8 & the Instructions of b2 = SCM-Instr b1 & the Object-Kind of b2 = SCM-OK b1 & the Execution of b2 = SCM-Exec b1 ) );

registration
let c1 be good Ring;
cluster SCM a1 -> non empty strict non void ;
coherence
( not SCM c1 is empty & not SCM c1 is void )
proof end;
end;

definition
let c1 be good Ring;
let c2 be State of (SCM c1);
let c3 be Element of SCM-Data-Loc ;
redefine func . as c2 . c3 -> Element of a1;
coherence
c2 . c3 is Element of c1
proof end;
end;

definition
let c1 be good Ring;
mode Data-Location of c1 -> Object of (SCM a1) means :Def2: :: SCMRING2:def 2
a2 in the carrier of (SCM a1) \ (SCM-Instr-Loc \/ {0});
existence
ex b1 being Object of (SCM c1) st b1 in the carrier of (SCM c1) \ (SCM-Instr-Loc \/ {0})
proof end;
end;

:: deftheorem Def2 defines Data-Location SCMRING2:def 2 :
for b1 being good Ring
for b2 being Object of (SCM b1) holds
( b2 is Data-Location of b1 iff b2 in the carrier of (SCM b1) \ (SCM-Instr-Loc \/ {0}) );

theorem Th1: :: SCMRING2:1
for b1 being set
for b2 being good Ring holds
( b1 is Data-Location of b2 iff b1 in SCM-Data-Loc )
proof end;

definition
let c1 be good Ring;
let c2 be State of (SCM c1);
let c3 be Data-Location of c1;
redefine func . as c2 . c3 -> Element of a1;
coherence
c2 . c3 is Element of c1
proof end;
end;

theorem Th2: :: SCMRING2:2
for b1 being non empty 1-sorted holds [0,{} ] in SCM-Instr b1
proof end;

theorem Th3: :: SCMRING2:3
for b1 being good Ring holds [0,{} ] is Instruction of (SCM b1)
proof end;

theorem Th4: :: SCMRING2:4
for b1 being non empty 1-sorted
for b2 being set
for b3 being good Ring
for b4, b5 being Data-Location of b3 st b2 in {1,2,3,4} holds
[b2,<*b4,b5*>] in SCM-Instr b1
proof end;

theorem Th5: :: SCMRING2:5
for b1 being non empty 1-sorted
for b2 being Element of b1
for b3 being good Ring
for b4 being Data-Location of b3 holds [5,<*b4,b2*>] in SCM-Instr b1
proof end;

theorem Th6: :: SCMRING2:6
for b1 being non empty 1-sorted
for b2 being good Ring
for b3 being Instruction-Location of (SCM b2) holds [6,<*b3*>] in SCM-Instr b1
proof end;

theorem Th7: :: SCMRING2:7
for b1 being non empty 1-sorted
for b2 being good Ring
for b3 being Data-Location of b2
for b4 being Instruction-Location of (SCM b2) holds [7,<*b4,b3*>] in SCM-Instr b1
proof end;

definition
let c1 be good Ring;
let c2, c3 be Data-Location of c1;
func c2 := c3 -> Instruction of (SCM a1) equals :: SCMRING2:def 3
[1,<*a2,a3*>];
coherence
[1,<*c2,c3*>] is Instruction of (SCM c1)
proof end;
func AddTo c2,c3 -> Instruction of (SCM a1) equals :: SCMRING2:def 4
[2,<*a2,a3*>];
coherence
[2,<*c2,c3*>] is Instruction of (SCM c1)
proof end;
func SubFrom c2,c3 -> Instruction of (SCM a1) equals :: SCMRING2:def 5
[3,<*a2,a3*>];
coherence
[3,<*c2,c3*>] is Instruction of (SCM c1)
proof end;
func MultBy c2,c3 -> Instruction of (SCM a1) equals :: SCMRING2:def 6
[4,<*a2,a3*>];
coherence
[4,<*c2,c3*>] is Instruction of (SCM c1)
proof end;
end;

:: deftheorem Def3 defines := SCMRING2:def 3 :
for b1 being good Ring
for b2, b3 being Data-Location of b1 holds b2 := b3 = [1,<*b2,b3*>];

:: deftheorem Def4 defines AddTo SCMRING2:def 4 :
for b1 being good Ring
for b2, b3 being Data-Location of b1 holds AddTo b2,b3 = [2,<*b2,b3*>];

:: deftheorem Def5 defines SubFrom SCMRING2:def 5 :
for b1 being good Ring
for b2, b3 being Data-Location of b1 holds SubFrom b2,b3 = [3,<*b2,b3*>];

:: deftheorem Def6 defines MultBy SCMRING2:def 6 :
for b1 being good Ring
for b2, b3 being Data-Location of b1 holds MultBy b2,b3 = [4,<*b2,b3*>];

definition
let c1 be good Ring;
let c2 be Data-Location of c1;
let c3 be Element of c1;
func c2 := c3 -> Instruction of (SCM a1) equals :: SCMRING2:def 7
[5,<*a2,a3*>];
coherence
[5,<*c2,c3*>] is Instruction of (SCM c1)
proof end;
end;

:: deftheorem Def7 defines := SCMRING2:def 7 :
for b1 being good Ring
for b2 being Data-Location of b1
for b3 being Element of b1 holds b2 := b3 = [5,<*b2,b3*>];

definition
let c1 be good Ring;
let c2 be Instruction-Location of (SCM c1);
func goto c2 -> Instruction of (SCM a1) equals :: SCMRING2:def 8
[6,<*a2*>];
coherence
[6,<*c2*>] is Instruction of (SCM c1)
proof end;
end;

:: deftheorem Def8 defines goto SCMRING2:def 8 :
for b1 being good Ring
for b2 being Instruction-Location of (SCM b1) holds goto b2 = [6,<*b2*>];

definition
let c1 be good Ring;
let c2 be Instruction-Location of (SCM c1);
let c3 be Data-Location of c1;
func c3 =0_goto c2 -> Instruction of (SCM a1) equals :: SCMRING2:def 9
[7,<*a2,a3*>];
coherence
[7,<*c2,c3*>] is Instruction of (SCM c1)
proof end;
end;

:: deftheorem Def9 defines =0_goto SCMRING2:def 9 :
for b1 being good Ring
for b2 being Instruction-Location of (SCM b1)
for b3 being Data-Location of b1 holds b3 =0_goto b2 = [7,<*b2,b3*>];

theorem Th8: :: SCMRING2:8
for b1 being good Ring
for b2 being set holds
( b2 is Instruction of (SCM b1) iff ( b2 = [0,{} ] or ex b3, b4 being Data-Location of b1 st b2 = b3 := b4 or ex b3, b4 being Data-Location of b1 st b2 = AddTo b3,b4 or ex b3, b4 being Data-Location of b1 st b2 = SubFrom b3,b4 or ex b3, b4 being Data-Location of b1 st b2 = MultBy b3,b4 or ex b3 being Instruction-Location of (SCM b1) st b2 = goto b3 or ex b3 being Data-Location of b1ex b4 being Instruction-Location of (SCM b1) st b2 = b3 =0_goto b4 or ex b3 being Data-Location of b1ex b4 being Element of b1 st b2 = b3 := b4 ) )
proof end;

registration
let c1 be good Ring;
cluster SCM a1 -> non empty strict non void IC-Ins-separated ;
coherence
SCM c1 is IC-Ins-separated
proof end;
end;

theorem Th9: :: SCMRING2:9
for b1 being good Ring holds IC (SCM b1) = 0 by Def1;

theorem Th10: :: SCMRING2:10
for b1 being good Ring
for b2 being State of (SCM b1)
for b3 being SCM-State of b1 st b3 = b2 holds
IC b2 = IC b3
proof end;

definition
let c1 be good Ring;
let c2 be Instruction-Location of (SCM c1);
func Next c2 -> Instruction-Location of (SCM a1) means :Def10: :: SCMRING2:def 10
ex b1 being Element of SCM-Instr-Loc st
( b1 = a2 & a3 = Next b1 );
existence
ex b1 being Instruction-Location of (SCM c1)ex b2 being Element of SCM-Instr-Loc st
( b2 = c2 & b1 = Next b2 )
proof end;
uniqueness
for b1, b2 being Instruction-Location of (SCM c1) st ex b3 being Element of SCM-Instr-Loc st
( b3 = c2 & b1 = Next b3 ) & ex b3 being Element of SCM-Instr-Loc st
( b3 = c2 & b2 = Next b3 ) holds
b1 = b2
;
end;

:: deftheorem Def10 defines Next SCMRING2:def 10 :
for b1 being good Ring
for b2, b3 being Instruction-Location of (SCM b1) holds
( b3 = Next b2 iff ex b4 being Element of SCM-Instr-Loc st
( b4 = b2 & b3 = Next b4 ) );

theorem Th11: :: SCMRING2:11
for b1 being good Ring
for b2 being Instruction-Location of (SCM b1)
for b3 being Element of SCM-Instr-Loc st b3 = b2 holds
Next b3 = Next b2
proof end;

theorem Th12: :: SCMRING2:12
for b1 being good Ring
for b2 being State of (SCM b1)
for b3 being Instruction of (SCM b1)
for b4 being Element of SCM-Instr b1 st b4 = b3 holds
for b5 being SCM-State of b1 st b5 = b2 holds
Exec b3,b2 = SCM-Exec-Res b4,b5
proof end;

theorem Th13: :: SCMRING2:13
for b1 being good Ring
for b2, b3 being Data-Location of b1
for b4 being State of (SCM b1) holds
( (Exec (b2 := b3),b4) . (IC (SCM b1)) = Next (IC b4) & (Exec (b2 := b3),b4) . b2 = b4 . b3 & ( for b5 being Data-Location of b1 st b5 <> b2 holds
(Exec (b2 := b3),b4) . b5 = b4 . b5 ) )
proof end;

theorem Th14: :: SCMRING2:14
for b1 being good Ring
for b2, b3 being Data-Location of b1
for b4 being State of (SCM b1) holds
( (Exec (AddTo b2,b3),b4) . (IC (SCM b1)) = Next (IC b4) & (Exec (AddTo b2,b3),b4) . b2 = (b4 . b2) + (b4 . b3) & ( for b5 being Data-Location of b1 st b5 <> b2 holds
(Exec (AddTo b2,b3),b4) . b5 = b4 . b5 ) )
proof end;

theorem Th15: :: SCMRING2:15
for b1 being good Ring
for b2, b3 being Data-Location of b1
for b4 being State of (SCM b1) holds
( (Exec (SubFrom b2,b3),b4) . (IC (SCM b1)) = Next (IC b4) & (Exec (SubFrom b2,b3),b4) . b2 = (b4 . b2) - (b4 . b3) & ( for b5 being Data-Location of b1 st b5 <> b2 holds
(Exec (SubFrom b2,b3),b4) . b5 = b4 . b5 ) )
proof end;

theorem Th16: :: SCMRING2:16
for b1 being good Ring
for b2, b3 being Data-Location of b1
for b4 being State of (SCM b1) holds
( (Exec (MultBy b2,b3),b4) . (IC (SCM b1)) = Next (IC b4) & (Exec (MultBy b2,b3),b4) . b2 = (b4 . b2) * (b4 . b3) & ( for b5 being Data-Location of b1 st b5 <> b2 holds
(Exec (MultBy b2,b3),b4) . b5 = b4 . b5 ) )
proof end;

theorem Th17: :: SCMRING2:17
for b1 being good Ring
for b2 being Data-Location of b1
for b3 being Instruction-Location of (SCM b1)
for b4 being State of (SCM b1) holds
( (Exec (goto b3),b4) . (IC (SCM b1)) = b3 & (Exec (goto b3),b4) . b2 = b4 . b2 )
proof end;

theorem Th18: :: SCMRING2:18
for b1 being good Ring
for b2, b3 being Data-Location of b1
for b4 being Instruction-Location of (SCM b1)
for b5 being State of (SCM b1) holds
( ( b5 . b2 = 0. b1 implies (Exec (b2 =0_goto b4),b5) . (IC (SCM b1)) = b4 ) & ( b5 . b2 <> 0. b1 implies (Exec (b2 =0_goto b4),b5) . (IC (SCM b1)) = Next (IC b5) ) & (Exec (b2 =0_goto b4),b5) . b3 = b5 . b3 )
proof end;

theorem Th19: :: SCMRING2:19
for b1 being good Ring
for b2 being Element of b1
for b3 being Data-Location of b1
for b4 being State of (SCM b1) holds
( (Exec (b3 := b2),b4) . (IC (SCM b1)) = Next (IC b4) & (Exec (b3 := b2),b4) . b3 = b2 & ( for b5 being Data-Location of b1 st b5 <> b3 holds
(Exec (b3 := b2),b4) . b5 = b4 . b5 ) )
proof end;

theorem Th20: :: SCMRING2:20
for b1 being good Ring
for b2 being Instruction of (SCM b1) st ex b3 being State of (SCM b1) st (Exec b2,b3) . (IC (SCM b1)) = Next (IC b3) holds
not b2 is halting
proof end;

theorem Th21: :: SCMRING2:21
for b1 being good Ring
for b2 being Instruction of (SCM b1) st b2 = [0,{} ] holds
b2 is halting
proof end;

Lemma24: for b1 being good Ring
for b2, b3 being Data-Location of b1 holds not b2 := b3 is halting
proof end;

Lemma25: for b1 being good Ring
for b2, b3 being Data-Location of b1 holds not AddTo b2,b3 is halting
proof end;

Lemma26: for b1 being good Ring
for b2, b3 being Data-Location of b1 holds not SubFrom b2,b3 is halting
proof end;

Lemma27: for b1 being good Ring
for b2, b3 being Data-Location of b1 holds not MultBy b2,b3 is halting
proof end;

Lemma28: for b1 being good Ring
for b2 being Instruction-Location of (SCM b1) holds not goto b2 is halting
proof end;

Lemma29: for b1 being good Ring
for b2 being Data-Location of b1
for b3 being Instruction-Location of (SCM b1) holds not b2 =0_goto b3 is halting
proof end;

Lemma30: for b1 being good Ring
for b2 being Element of b1
for b3 being Data-Location of b1 holds not b3 := b2 is halting
proof end;

registration
let c1 be good Ring;
let c2, c3 be Data-Location of c1;
cluster a2 := a3 -> non halting ;
coherence
not c2 := c3 is halting
by Lemma24;
cluster AddTo a2,a3 -> non halting ;
coherence
not AddTo c2,c3 is halting
by Lemma25;
cluster SubFrom a2,a3 -> non halting ;
coherence
not SubFrom c2,c3 is halting
by Lemma26;
cluster MultBy a2,a3 -> non halting ;
coherence
not MultBy c2,c3 is halting
by Lemma27;
end;

registration
let c1 be good Ring;
let c2 be Instruction-Location of (SCM c1);
cluster goto a2 -> non halting ;
coherence
not goto c2 is halting
by Lemma28;
end;

registration
let c1 be good Ring;
let c2 be Data-Location of c1;
let c3 be Instruction-Location of (SCM c1);
cluster a2 =0_goto a3 -> non halting ;
coherence
not c2 =0_goto c3 is halting
by Lemma29;
end;

registration
let c1 be good Ring;
let c2 be Data-Location of c1;
let c3 be Element of c1;
cluster a2 := a3 -> non halting ;
coherence
not c2 := c3 is halting
by Lemma30;
end;

registration
let c1 be good Ring;
cluster SCM a1 -> non empty strict non void halting IC-Ins-separated data-oriented steady-programmed definite realistic ;
coherence
( SCM c1 is halting & SCM c1 is definite & SCM c1 is data-oriented & SCM c1 is steady-programmed & SCM c1 is realistic )
proof end;
end;

theorem Th22: :: SCMRING2:22
canceled;

theorem Th23: :: SCMRING2:23
canceled;

theorem Th24: :: SCMRING2:24
canceled;

theorem Th25: :: SCMRING2:25
canceled;

theorem Th26: :: SCMRING2:26
canceled;

theorem Th27: :: SCMRING2:27
canceled;

theorem Th28: :: SCMRING2:28
canceled;

theorem Th29: :: SCMRING2:29
for b1 being good Ring
for b2 being Instruction of (SCM b1) st b2 is halting holds
b2 = halt (SCM b1)
proof end;

theorem Th30: :: SCMRING2:30
for b1 being good Ring holds halt (SCM b1) = [0,{} ]
proof end;