:: SCMFSA_2 semantic presentation

theorem Th1: :: SCMFSA_2:1
canceled;

theorem Th2: :: SCMFSA_2:2
canceled;

theorem Th3: :: SCMFSA_2:3
for b1 being with_non-empty_elements set
for b2 being non void AMI-Struct of b1
for b3 being State of b2 holds the Instruction-Locations of b2 c= dom b3
proof end;

theorem Th4: :: SCMFSA_2:4
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated AMI-Struct of b1
for b3 being State of b2 holds IC b3 in dom b3
proof end;

theorem Th5: :: SCMFSA_2:5
for b1 being with_non-empty_elements set
for b2 being non empty non void AMI-Struct of b1
for b3 being State of b2
for b4 being Instruction-Location of b2 holds b4 in dom b3
proof end;

definition
func SCM+FSA -> strict AMI-Struct of {INT ,(INT * )} equals :: SCMFSA_2:def 1
AMI-Struct(# INT ,(In 0,INT ),SCM+FSA-Instr-Loc ,(Segm 13),SCM+FSA-Instr ,SCM+FSA-OK ,SCM+FSA-Exec #);
coherence
AMI-Struct(# INT ,(In 0,INT ),SCM+FSA-Instr-Loc ,(Segm 13),SCM+FSA-Instr ,SCM+FSA-OK ,SCM+FSA-Exec #) is strict AMI-Struct of {INT ,(INT * )}
;
end;

:: deftheorem Def1 defines SCM+FSA SCMFSA_2:def 1 :
SCM+FSA = AMI-Struct(# INT ,(In 0,INT ),SCM+FSA-Instr-Loc ,(Segm 13),SCM+FSA-Instr ,SCM+FSA-OK ,SCM+FSA-Exec #);

registration
cluster SCM+FSA -> non empty strict non void ;
coherence
( not SCM+FSA is empty & not SCM+FSA is void )
by AMI_1:def 3, STRUCT_0:def 1;
end;

theorem Th6: :: SCMFSA_2:6
( the Instruction-Locations of SCM+FSA <> INT & the Instructions of SCM+FSA <> INT & the Instruction-Locations of SCM+FSA <> the Instructions of SCM+FSA & the Instruction-Locations of SCM+FSA <> INT * & the Instructions of SCM+FSA <> INT * ) by SCMFSA_1:13;

theorem Th7: :: SCMFSA_2:7
IC SCM+FSA = 0
proof end;

definition
func Int-Locations -> Subset of SCM+FSA equals :: SCMFSA_2:def 2
SCM+FSA-Data-Loc ;
coherence
SCM+FSA-Data-Loc is Subset of SCM+FSA
;
func FinSeq-Locations -> Subset of SCM+FSA equals :: SCMFSA_2:def 3
SCM+FSA-Data*-Loc ;
coherence
SCM+FSA-Data*-Loc is Subset of SCM+FSA
;
end;

:: deftheorem Def2 defines Int-Locations SCMFSA_2:def 2 :
Int-Locations = SCM+FSA-Data-Loc ;

:: deftheorem Def3 defines FinSeq-Locations SCMFSA_2:def 3 :
FinSeq-Locations = SCM+FSA-Data*-Loc ;

theorem Th8: :: SCMFSA_2:8
the carrier of SCM+FSA = ((Int-Locations \/ FinSeq-Locations ) \/ {(IC SCM+FSA )}) \/ the Instruction-Locations of SCM+FSA by Th7, SCMFSA_1:8, XBOOLE_1:4;

definition
mode Int-Location -> Object of SCM+FSA means :Def4: :: SCMFSA_2:def 4
a1 in SCM+FSA-Data-Loc ;
existence
ex b1 being Object of SCM+FSA st b1 in SCM+FSA-Data-Loc
proof end;
mode FinSeq-Location -> Object of SCM+FSA means :Def5: :: SCMFSA_2:def 5
a1 in SCM+FSA-Data*-Loc ;
existence
ex b1 being Object of SCM+FSA st b1 in SCM+FSA-Data*-Loc
proof end;
end;

:: deftheorem Def4 defines Int-Location SCMFSA_2:def 4 :
for b1 being Object of SCM+FSA holds
( b1 is Int-Location iff b1 in SCM+FSA-Data-Loc );

:: deftheorem Def5 defines FinSeq-Location SCMFSA_2:def 5 :
for b1 being Object of SCM+FSA holds
( b1 is FinSeq-Location iff b1 in SCM+FSA-Data*-Loc );

theorem Th9: :: SCMFSA_2:9
for b1 being Int-Location holds b1 in Int-Locations by Def4;

theorem Th10: :: SCMFSA_2:10
for b1 being FinSeq-Location holds b1 in FinSeq-Locations by Def5;

theorem Th11: :: SCMFSA_2:11
for b1 being set st b1 in Int-Locations holds
b1 is Int-Location by Def4;

theorem Th12: :: SCMFSA_2:12
for b1 being set st b1 in FinSeq-Locations holds
b1 is FinSeq-Location by Def5;

theorem Th13: :: SCMFSA_2:13
Int-Locations misses the Instruction-Locations of SCM+FSA by AMI_5:33, SCMFSA_1:def 1, SCMFSA_1:def 3;

theorem Th14: :: SCMFSA_2:14
FinSeq-Locations misses the Instruction-Locations of SCM+FSA
proof end;

theorem Th15: :: SCMFSA_2:15
Int-Locations misses FinSeq-Locations
proof end;

definition
let c1 be natural number ;
func intloc c1 -> Int-Location equals :: SCMFSA_2:def 6
dl. a1;
coherence
dl. c1 is Int-Location
proof end;
func insloc c1 -> Instruction-Location of SCM+FSA equals :: SCMFSA_2:def 7
il. a1;
coherence
il. c1 is Instruction-Location of SCM+FSA
by AMI_3:def 1, SCMFSA_1:def 3;
func fsloc c1 -> FinSeq-Location equals :: SCMFSA_2:def 8
- (a1 + 1);
coherence
- (c1 + 1) is FinSeq-Location
proof end;
end;

:: deftheorem Def6 defines intloc SCMFSA_2:def 6 :
for b1 being natural number holds intloc b1 = dl. b1;

:: deftheorem Def7 defines insloc SCMFSA_2:def 7 :
for b1 being natural number holds insloc b1 = il. b1;

:: deftheorem Def8 defines fsloc SCMFSA_2:def 8 :
for b1 being natural number holds fsloc b1 = - (b1 + 1);

theorem Th16: :: SCMFSA_2:16
for b1, b2 being natural number st b1 <> b2 holds
intloc b1 <> intloc b2 by AMI_3:52;

theorem Th17: :: SCMFSA_2:17
for b1, b2 being natural number st b1 <> b2 holds
fsloc b1 <> fsloc b2
proof end;

theorem Th18: :: SCMFSA_2:18
for b1, b2 being natural number st b1 <> b2 holds
insloc b1 <> insloc b2 by AMI_3:53;

theorem Th19: :: SCMFSA_2:19
for b1 being Int-Location ex b2 being Nat st b1 = intloc b2
proof end;

theorem Th20: :: SCMFSA_2:20
for b1 being FinSeq-Location ex b2 being Nat st b1 = fsloc b2
proof end;

theorem Th21: :: SCMFSA_2:21
for b1 being Instruction-Location of SCM+FSA ex b2 being Nat st b1 = insloc b2
proof end;

theorem Th22: :: SCMFSA_2:22
not Int-Locations is finite by SCMFSA_1:def 1;

theorem Th23: :: SCMFSA_2:23
not FinSeq-Locations is finite
proof end;

theorem Th24: :: SCMFSA_2:24
not the Instruction-Locations of SCM+FSA is finite
proof end;

theorem Th25: :: SCMFSA_2:25
for b1 being Int-Location holds b1 is Data-Location
proof end;

theorem Th26: :: SCMFSA_2:26
for b1 being Int-Location holds ObjectKind b1 = INT
proof end;

theorem Th27: :: SCMFSA_2:27
for b1 being FinSeq-Location holds ObjectKind b1 = INT *
proof end;

theorem Th28: :: SCMFSA_2:28
for b1 being set st b1 in SCM+FSA-Data-Loc holds
b1 is Int-Location by Def4;

theorem Th29: :: SCMFSA_2:29
for b1 being set st b1 in SCM+FSA-Data*-Loc holds
b1 is FinSeq-Location by Def5;

theorem Th30: :: SCMFSA_2:30
for b1 being set st b1 in SCM+FSA-Instr-Loc holds
b1 is Instruction-Location of SCM+FSA ;

definition
let c1 be Instruction-Location of SCM+FSA ;
func Next c1 -> Instruction-Location of SCM+FSA means :Def9: :: SCMFSA_2:def 9
ex b1 being Element of SCM+FSA-Instr-Loc st
( b1 = a1 & a2 = Next b1 );
existence
ex b1 being Instruction-Location of SCM+FSA ex b2 being Element of SCM+FSA-Instr-Loc st
( b2 = c1 & b1 = Next b2 )
proof end;
correctness
uniqueness
for b1, b2 being Instruction-Location of SCM+FSA st ex b3 being Element of SCM+FSA-Instr-Loc st
( b3 = c1 & b1 = Next b3 ) & ex b3 being Element of SCM+FSA-Instr-Loc st
( b3 = c1 & b2 = Next b3 ) holds
b1 = b2
;
;
end;

:: deftheorem Def9 defines Next SCMFSA_2:def 9 :
for b1, b2 being Instruction-Location of SCM+FSA holds
( b2 = Next b1 iff ex b3 being Element of SCM+FSA-Instr-Loc st
( b3 = b1 & b2 = Next b3 ) );

theorem Th31: :: SCMFSA_2:31
for b1 being Instruction-Location of SCM+FSA
for b2 being Element of SCM+FSA-Instr-Loc st b2 = b1 holds
Next b2 = Next b1 by Def9;

theorem Th32: :: SCMFSA_2:32
for b1 being natural number holds Next (insloc b1) = insloc (b1 + 1)
proof end;

theorem Th33: :: SCMFSA_2:33
for b1 being Instruction-Location of SCM+FSA
for b2 being Instruction-Location of SCM st b1 = b2 holds
Next b1 = Next b2
proof end;

registration
let c1 be Instruction of SCM+FSA ;
cluster InsCode a1 -> natural ;
coherence
InsCode c1 is natural
proof end;
end;

theorem Th34: :: SCMFSA_2:34
for b1 being Instruction of SCM+FSA st InsCode b1 <= 8 holds
b1 is Instruction of SCM
proof end;

theorem Th35: :: SCMFSA_2:35
for b1 being Instruction of SCM+FSA holds InsCode b1 <= 12
proof end;

theorem Th36: :: SCMFSA_2:36
canceled;

theorem Th37: :: SCMFSA_2:37
for b1 being Instruction of SCM+FSA
for b2 being Instruction of SCM st b1 = b2 holds
InsCode b1 = InsCode b2
proof end;

theorem Th38: :: SCMFSA_2:38
for b1 being Instruction of SCM holds b1 is Instruction of SCM+FSA
proof end;

definition
let c1, c2 be Int-Location ;
canceled;
func c1 := c2 -> Instruction of SCM+FSA means :Def11: :: SCMFSA_2:def 11
ex b1, b2 being Data-Location st
( a1 = b1 & a2 = b2 & a3 = b1 := b2 );
existence
ex b1 being Instruction of SCM+FSA ex b2, b3 being Data-Location st
( c1 = b2 & c2 = b3 & b1 = b2 := b3 )
proof end;
correctness
uniqueness
for b1, b2 being Instruction of SCM+FSA st ex b3, b4 being Data-Location st
( c1 = b3 & c2 = b4 & b1 = b3 := b4 ) & ex b3, b4 being Data-Location st
( c1 = b3 & c2 = b4 & b2 = b3 := b4 ) holds
b1 = b2
;
;
func AddTo c1,c2 -> Instruction of SCM+FSA means :Def12: :: SCMFSA_2:def 12
ex b1, b2 being Data-Location st
( a1 = b1 & a2 = b2 & a3 = AddTo b1,b2 );
existence
ex b1 being Instruction of SCM+FSA ex b2, b3 being Data-Location st
( c1 = b2 & c2 = b3 & b1 = AddTo b2,b3 )
proof end;
correctness
uniqueness
for b1, b2 being Instruction of SCM+FSA st ex b3, b4 being Data-Location st
( c1 = b3 & c2 = b4 & b1 = AddTo b3,b4 ) & ex b3, b4 being Data-Location st
( c1 = b3 & c2 = b4 & b2 = AddTo b3,b4 ) holds
b1 = b2
;
;
func SubFrom c1,c2 -> Instruction of SCM+FSA means :Def13: :: SCMFSA_2:def 13
ex b1, b2 being Data-Location st
( a1 = b1 & a2 = b2 & a3 = SubFrom b1,b2 );
existence
ex b1 being Instruction of SCM+FSA ex b2, b3 being Data-Location st
( c1 = b2 & c2 = b3 & b1 = SubFrom b2,b3 )
proof end;
correctness
uniqueness
for b1, b2 being Instruction of SCM+FSA st ex b3, b4 being Data-Location st
( c1 = b3 & c2 = b4 & b1 = SubFrom b3,b4 ) & ex b3, b4 being Data-Location st
( c1 = b3 & c2 = b4 & b2 = SubFrom b3,b4 ) holds
b1 = b2
;
;
func MultBy c1,c2 -> Instruction of SCM+FSA means :Def14: :: SCMFSA_2:def 14
ex b1, b2 being Data-Location st
( a1 = b1 & a2 = b2 & a3 = MultBy b1,b2 );
existence
ex b1 being Instruction of SCM+FSA ex b2, b3 being Data-Location st
( c1 = b2 & c2 = b3 & b1 = MultBy b2,b3 )
proof end;
correctness
uniqueness
for b1, b2 being Instruction of SCM+FSA st ex b3, b4 being Data-Location st
( c1 = b3 & c2 = b4 & b1 = MultBy b3,b4 ) & ex b3, b4 being Data-Location st
( c1 = b3 & c2 = b4 & b2 = MultBy b3,b4 ) holds
b1 = b2
;
;
func Divide c1,c2 -> Instruction of SCM+FSA means :Def15: :: SCMFSA_2:def 15
ex b1, b2 being Data-Location st
( a1 = b1 & a2 = b2 & a3 = Divide b1,b2 );
existence
ex b1 being Instruction of SCM+FSA ex b2, b3 being Data-Location st
( c1 = b2 & c2 = b3 & b1 = Divide b2,b3 )
proof end;
correctness
uniqueness
for b1, b2 being Instruction of SCM+FSA st ex b3, b4 being Data-Location st
( c1 = b3 & c2 = b4 & b1 = Divide b3,b4 ) & ex b3, b4 being Data-Location st
( c1 = b3 & c2 = b4 & b2 = Divide b3,b4 ) holds
b1 = b2
;
;
end;

:: deftheorem Def10 SCMFSA_2:def 10 :
canceled;

:: deftheorem Def11 defines := SCMFSA_2:def 11 :
for b1, b2 being Int-Location
for b3 being Instruction of SCM+FSA holds
( b3 = b1 := b2 iff ex b4, b5 being Data-Location st
( b1 = b4 & b2 = b5 & b3 = b4 := b5 ) );

:: deftheorem Def12 defines AddTo SCMFSA_2:def 12 :
for b1, b2 being Int-Location
for b3 being Instruction of SCM+FSA holds
( b3 = AddTo b1,b2 iff ex b4, b5 being Data-Location st
( b1 = b4 & b2 = b5 & b3 = AddTo b4,b5 ) );

:: deftheorem Def13 defines SubFrom SCMFSA_2:def 13 :
for b1, b2 being Int-Location
for b3 being Instruction of SCM+FSA holds
( b3 = SubFrom b1,b2 iff ex b4, b5 being Data-Location st
( b1 = b4 & b2 = b5 & b3 = SubFrom b4,b5 ) );

:: deftheorem Def14 defines MultBy SCMFSA_2:def 14 :
for b1, b2 being Int-Location
for b3 being Instruction of SCM+FSA holds
( b3 = MultBy b1,b2 iff ex b4, b5 being Data-Location st
( b1 = b4 & b2 = b5 & b3 = MultBy b4,b5 ) );

:: deftheorem Def15 defines Divide SCMFSA_2:def 15 :
for b1, b2 being Int-Location
for b3 being Instruction of SCM+FSA holds
( b3 = Divide b1,b2 iff ex b4, b5 being Data-Location st
( b1 = b4 & b2 = b5 & b3 = Divide b4,b5 ) );

theorem Th39: :: SCMFSA_2:39
the Instruction-Locations of SCM = the Instruction-Locations of SCM+FSA by AMI_3:def 1, SCMFSA_1:def 3;

definition
let c1 be Instruction-Location of SCM+FSA ;
func goto c1 -> Instruction of SCM+FSA means :Def16: :: SCMFSA_2:def 16
ex b1 being Instruction-Location of SCM st
( a1 = b1 & a2 = goto b1 );
existence
ex b1 being Instruction of SCM+FSA ex b2 being Instruction-Location of SCM st
( c1 = b2 & b1 = goto b2 )
proof end;
correctness
uniqueness
for b1, b2 being Instruction of SCM+FSA st ex b3 being Instruction-Location of SCM st
( c1 = b3 & b1 = goto b3 ) & ex b3 being Instruction-Location of SCM st
( c1 = b3 & b2 = goto b3 ) holds
b1 = b2
;
;
let c2 be Int-Location ;
func c2 =0_goto c1 -> Instruction of SCM+FSA means :Def17: :: SCMFSA_2:def 17
ex b1 being Data-Location ex b2 being Instruction-Location of SCM st
( a2 = b1 & a1 = b2 & a3 = b1 =0_goto b2 );
existence
ex b1 being Instruction of SCM+FSA ex b2 being Data-Location ex b3 being Instruction-Location of SCM st
( c2 = b2 & c1 = b3 & b1 = b2 =0_goto b3 )
proof end;
correctness
uniqueness
for b1, b2 being Instruction of SCM+FSA st ex b3 being Data-Location ex b4 being Instruction-Location of SCM st
( c2 = b3 & c1 = b4 & b1 = b3 =0_goto b4 ) & ex b3 being Data-Location ex b4 being Instruction-Location of SCM st
( c2 = b3 & c1 = b4 & b2 = b3 =0_goto b4 ) holds
b1 = b2
;
;
func c2 >0_goto c1 -> Instruction of SCM+FSA means :Def18: :: SCMFSA_2:def 18
ex b1 being Data-Location ex b2 being Instruction-Location of SCM st
( a2 = b1 & a1 = b2 & a3 = b1 >0_goto b2 );
existence
ex b1 being Instruction of SCM+FSA ex b2 being Data-Location ex b3 being Instruction-Location of SCM st
( c2 = b2 & c1 = b3 & b1 = b2 >0_goto b3 )
proof end;
correctness
uniqueness
for b1, b2 being Instruction of SCM+FSA st ex b3 being Data-Location ex b4 being Instruction-Location of SCM st
( c2 = b3 & c1 = b4 & b1 = b3 >0_goto b4 ) & ex b3 being Data-Location ex b4 being Instruction-Location of SCM st
( c2 = b3 & c1 = b4 & b2 = b3 >0_goto b4 ) holds
b1 = b2
;
;
end;

:: deftheorem Def16 defines goto SCMFSA_2:def 16 :
for b1 being Instruction-Location of SCM+FSA
for b2 being Instruction of SCM+FSA holds
( b2 = goto b1 iff ex b3 being Instruction-Location of SCM st
( b1 = b3 & b2 = goto b3 ) );

:: deftheorem Def17 defines =0_goto SCMFSA_2:def 17 :
for b1 being Instruction-Location of SCM+FSA
for b2 being Int-Location
for b3 being Instruction of SCM+FSA holds
( b3 = b2 =0_goto b1 iff ex b4 being Data-Location ex b5 being Instruction-Location of SCM st
( b2 = b4 & b1 = b5 & b3 = b4 =0_goto b5 ) );

:: deftheorem Def18 defines >0_goto SCMFSA_2:def 18 :
for b1 being Instruction-Location of SCM+FSA
for b2 being Int-Location
for b3 being Instruction of SCM+FSA holds
( b3 = b2 >0_goto b1 iff ex b4 being Data-Location ex b5 being Instruction-Location of SCM st
( b2 = b4 & b1 = b5 & b3 = b4 >0_goto b5 ) );

definition
let c1, c2 be Int-Location ;
let c3 be FinSeq-Location ;
func c1 := c3,c2 -> Instruction of SCM+FSA equals :: SCMFSA_2:def 19
[9,<*a1,a3,a2*>];
coherence
[9,<*c1,c3,c2*>] is Instruction of SCM+FSA
proof end;
func c3,c2 := c1 -> Instruction of SCM+FSA equals :: SCMFSA_2:def 20
[10,<*a1,a3,a2*>];
coherence
[10,<*c1,c3,c2*>] is Instruction of SCM+FSA
proof end;
end;

:: deftheorem Def19 defines := SCMFSA_2:def 19 :
for b1, b2 being Int-Location
for b3 being FinSeq-Location holds b1 := b3,b2 = [9,<*b1,b3,b2*>];

:: deftheorem Def20 defines := SCMFSA_2:def 20 :
for b1, b2 being Int-Location
for b3 being FinSeq-Location holds b3,b2 := b1 = [10,<*b1,b3,b2*>];

definition
let c1 be Int-Location ;
let c2 be FinSeq-Location ;
func c1 :=len c2 -> Instruction of SCM+FSA equals :: SCMFSA_2:def 21
[11,<*a1,a2*>];
coherence
[11,<*c1,c2*>] is Instruction of SCM+FSA
proof end;
func c2 :=<0,...,0> c1 -> Instruction of SCM+FSA equals :: SCMFSA_2:def 22
[12,<*a1,a2*>];
coherence
[12,<*c1,c2*>] is Instruction of SCM+FSA
proof end;
end;

:: deftheorem Def21 defines :=len SCMFSA_2:def 21 :
for b1 being Int-Location
for b2 being FinSeq-Location holds b1 :=len b2 = [11,<*b1,b2*>];

:: deftheorem Def22 defines :=<0,...,0> SCMFSA_2:def 22 :
for b1 being Int-Location
for b2 being FinSeq-Location holds b2 :=<0,...,0> b1 = [12,<*b1,b2*>];

theorem Th40: :: SCMFSA_2:40
canceled;

theorem Th41: :: SCMFSA_2:41
canceled;

theorem Th42: :: SCMFSA_2:42
for b1, b2 being Int-Location holds InsCode (b1 := b2) = 1
proof end;

theorem Th43: :: SCMFSA_2:43
for b1, b2 being Int-Location holds InsCode (AddTo b1,b2) = 2
proof end;

theorem Th44: :: SCMFSA_2:44
for b1, b2 being Int-Location holds InsCode (SubFrom b1,b2) = 3
proof end;

theorem Th45: :: SCMFSA_2:45
for b1, b2 being Int-Location holds InsCode (MultBy b1,b2) = 4
proof end;

theorem Th46: :: SCMFSA_2:46
for b1, b2 being Int-Location holds InsCode (Divide b1,b2) = 5
proof end;

theorem Th47: :: SCMFSA_2:47
for b1 being Instruction-Location of SCM+FSA holds InsCode (goto b1) = 6
proof end;

theorem Th48: :: SCMFSA_2:48
for b1 being Instruction-Location of SCM+FSA
for b2 being Int-Location holds InsCode (b2 =0_goto b1) = 7
proof end;

theorem Th49: :: SCMFSA_2:49
for b1 being Instruction-Location of SCM+FSA
for b2 being Int-Location holds InsCode (b2 >0_goto b1) = 8
proof end;

theorem Th50: :: SCMFSA_2:50
for b1 being FinSeq-Location
for b2, b3 being Int-Location holds InsCode (b2 := b1,b3) = 9
proof end;

theorem Th51: :: SCMFSA_2:51
for b1 being FinSeq-Location
for b2, b3 being Int-Location holds InsCode (b1,b2 := b3) = 10
proof end;

theorem Th52: :: SCMFSA_2:52
for b1 being FinSeq-Location
for b2 being Int-Location holds InsCode (b2 :=len b1) = 11
proof end;

theorem Th53: :: SCMFSA_2:53
for b1 being FinSeq-Location
for b2 being Int-Location holds InsCode (b1 :=<0,...,0> b2) = 12
proof end;

theorem Th54: :: SCMFSA_2:54
for b1 being Instruction of SCM+FSA st InsCode b1 = 1 holds
ex b2, b3 being Int-Location st b1 = b2 := b3
proof end;

theorem Th55: :: SCMFSA_2:55
for b1 being Instruction of SCM+FSA st InsCode b1 = 2 holds
ex b2, b3 being Int-Location st b1 = AddTo b2,b3
proof end;

theorem Th56: :: SCMFSA_2:56
for b1 being Instruction of SCM+FSA st InsCode b1 = 3 holds
ex b2, b3 being Int-Location st b1 = SubFrom b2,b3
proof end;

theorem Th57: :: SCMFSA_2:57
for b1 being Instruction of SCM+FSA st InsCode b1 = 4 holds
ex b2, b3 being Int-Location st b1 = MultBy b2,b3
proof end;

theorem Th58: :: SCMFSA_2:58
for b1 being Instruction of SCM+FSA st InsCode b1 = 5 holds
ex b2, b3 being Int-Location st b1 = Divide b2,b3
proof end;

theorem Th59: :: SCMFSA_2:59
for b1 being Instruction of SCM+FSA st InsCode b1 = 6 holds
ex b2 being Instruction-Location of SCM+FSA st b1 = goto b2
proof end;

theorem Th60: :: SCMFSA_2:60
for b1 being Instruction of SCM+FSA st InsCode b1 = 7 holds
ex b2 being Instruction-Location of SCM+FSA ex b3 being Int-Location st b1 = b3 =0_goto b2
proof end;

theorem Th61: :: SCMFSA_2:61
for b1 being Instruction of SCM+FSA st InsCode b1 = 8 holds
ex b2 being Instruction-Location of SCM+FSA ex b3 being Int-Location st b1 = b3 >0_goto b2
proof end;

theorem Th62: :: SCMFSA_2:62
for b1 being Instruction of SCM+FSA st InsCode b1 = 9 holds
ex b2, b3 being Int-Location ex b4 being FinSeq-Location st b1 = b3 := b4,b2
proof end;

theorem Th63: :: SCMFSA_2:63
for b1 being Instruction of SCM+FSA st InsCode b1 = 10 holds
ex b2, b3 being Int-Location ex b4 being FinSeq-Location st b1 = b4,b2 := b3
proof end;

theorem Th64: :: SCMFSA_2:64
for b1 being Instruction of SCM+FSA st InsCode b1 = 11 holds
ex b2 being Int-Location ex b3 being FinSeq-Location st b1 = b2 :=len b3
proof end;

theorem Th65: :: SCMFSA_2:65
for b1 being Instruction of SCM+FSA st InsCode b1 = 12 holds
ex b2 being Int-Location ex b3 being FinSeq-Location st b1 = b3 :=<0,...,0> b2
proof end;

theorem Th66: :: SCMFSA_2:66
for b1 being State of SCM+FSA
for b2 being Int-Location holds b2 in dom b1
proof end;

theorem Th67: :: SCMFSA_2:67
for b1 being FinSeq-Location
for b2 being State of SCM+FSA holds b1 in dom b2
proof end;

theorem Th68: :: SCMFSA_2:68
for b1 being FinSeq-Location
for b2 being State of SCM holds not b1 in dom b2
proof end;

theorem Th69: :: SCMFSA_2:69
for b1 being State of SCM+FSA holds Int-Locations c= dom b1
proof end;

theorem Th70: :: SCMFSA_2:70
for b1 being State of SCM+FSA holds FinSeq-Locations c= dom b1
proof end;

theorem Th71: :: SCMFSA_2:71
for b1 being State of SCM+FSA holds dom (b1 | Int-Locations ) = Int-Locations
proof end;

theorem Th72: :: SCMFSA_2:72
for b1 being State of SCM+FSA holds dom (b1 | FinSeq-Locations ) = FinSeq-Locations
proof end;

theorem Th73: :: SCMFSA_2:73
for b1 being State of SCM+FSA
for b2 being Instruction of SCM holds (b1 | NAT ) +* (SCM-Instr-Loc --> b2) is State of SCM by AMI_3:def 1, SCMFSA_1:18;

theorem Th74: :: SCMFSA_2:74
for b1 being State of SCM+FSA
for b2 being State of SCM holds (b1 +* b2) +* (b1 | SCM+FSA-Instr-Loc ) is State of SCM+FSA by AMI_3:def 1, SCMFSA_1:19;

theorem Th75: :: SCMFSA_2:75
for b1 being Instruction of SCM
for b2 being Instruction of SCM+FSA
for b3 being State of SCM
for b4 being State of SCM+FSA st b1 = b2 & b3 = (b4 | NAT ) +* (SCM-Instr-Loc --> b1) holds
Exec b2,b4 = (b4 +* (Exec b1,b3)) +* (b4 | SCM+FSA-Instr-Loc )
proof end;

definition
let c1 be State of SCM+FSA ;
let c2 be Int-Location ;
redefine func . as c1 . c2 -> Integer;
coherence
c1 . c2 is Integer
proof end;
end;

definition
let c1 be State of SCM+FSA ;
let c2 be FinSeq-Location ;
redefine func . as c1 . c2 -> FinSequence of INT ;
coherence
c1 . c2 is FinSequence of INT
proof end;
end;

theorem Th76: :: SCMFSA_2:76
for b1 being Instruction of SCM
for b2 being State of SCM
for b3 being State of SCM+FSA st b2 = (b3 | NAT ) +* (SCM-Instr-Loc --> b1) holds
b3 = (b3 +* b2) +* (b3 | SCM+FSA-Instr-Loc )
proof end;

theorem Th77: :: SCMFSA_2:77
for b1 being Instruction of SCM+FSA
for b2 being State of SCM+FSA
for b3 being Element of SCM+FSA-Instr st b3 = b1 holds
for b4 being SCM+FSA-State st b4 = b2 holds
Exec b1,b2 = SCM+FSA-Exec-Res b3,b4 by SCMFSA_1:def 18;

theorem Th78: :: SCMFSA_2:78
for b1 being State of SCM
for b2, b3 being State of SCM+FSA st b2 = (b3 +* b1) +* (b3 | SCM+FSA-Instr-Loc ) holds
b2 . (IC SCM+FSA ) = b1 . (IC SCM )
proof end;

theorem Th79: :: SCMFSA_2:79
for b1 being Data-Location
for b2 being Int-Location
for b3 being State of SCM
for b4, b5 being State of SCM+FSA st b4 = (b5 +* b3) +* (b5 | SCM+FSA-Instr-Loc ) & b1 = b2 holds
b3 . b1 = b4 . b2
proof end;

theorem Th80: :: SCMFSA_2:80
for b1 being Instruction of SCM
for b2 being Data-Location
for b3 being Int-Location
for b4 being State of SCM
for b5 being State of SCM+FSA st b4 = (b5 | NAT ) +* (SCM-Instr-Loc --> b1) & b2 = b3 holds
b4 . b2 = b5 . b3
proof end;

registration
cluster SCM+FSA -> non empty strict non void IC-Ins-separated data-oriented steady-programmed definite realistic ;
coherence
( SCM+FSA is realistic & SCM+FSA is IC-Ins-separated & SCM+FSA is data-oriented & SCM+FSA is definite & SCM+FSA is steady-programmed )
proof end;
end;

theorem Th81: :: SCMFSA_2:81
for b1 being Int-Location holds b1 <> IC SCM+FSA
proof end;

theorem Th82: :: SCMFSA_2:82
for b1 being FinSeq-Location holds b1 <> IC SCM+FSA
proof end;

theorem Th83: :: SCMFSA_2:83
for b1 being Int-Location
for b2 being FinSeq-Location holds b1 <> b2
proof end;

theorem Th84: :: SCMFSA_2:84
for b1 being Instruction-Location of SCM+FSA
for b2 being Int-Location holds b1 <> b2
proof end;

theorem Th85: :: SCMFSA_2:85
for b1 being Instruction-Location of SCM+FSA
for b2 being FinSeq-Location holds b1 <> b2
proof end;

theorem Th86: :: SCMFSA_2:86
for b1, b2 being State of SCM+FSA st IC b1 = IC b2 & ( for b3 being Int-Location holds b1 . b3 = b2 . b3 ) & ( for b3 being FinSeq-Location holds b1 . b3 = b2 . b3 ) & ( for b3 being Instruction-Location of SCM+FSA holds b1 . b3 = b2 . b3 ) holds
b1 = b2
proof end;

theorem Th87: :: SCMFSA_2:87
canceled;

theorem Th88: :: SCMFSA_2:88
for b1 being Instruction of SCM
for b2 being State of SCM
for b3 being State of SCM+FSA st b2 = (b3 | NAT ) +* (SCM-Instr-Loc --> b1) holds
IC b3 = IC b2
proof end;

theorem Th89: :: SCMFSA_2:89
for b1, b2 being Int-Location
for b3 being State of SCM+FSA holds
( (Exec (b1 := b2),b3) . (IC SCM+FSA ) = Next (IC b3) & (Exec (b1 := b2),b3) . b1 = b3 . b2 & ( for b4 being Int-Location st b4 <> b1 holds
(Exec (b1 := b2),b3) . b4 = b3 . b4 ) & ( for b4 being FinSeq-Location holds (Exec (b1 := b2),b3) . b4 = b3 . b4 ) )
proof end;

theorem Th90: :: SCMFSA_2:90
for b1, b2 being Int-Location
for b3 being State of SCM+FSA holds
( (Exec (AddTo b1,b2),b3) . (IC SCM+FSA ) = Next (IC b3) & (Exec (AddTo b1,b2),b3) . b1 = (b3 . b1) + (b3 . b2) & ( for b4 being Int-Location st b4 <> b1 holds
(Exec (AddTo b1,b2),b3) . b4 = b3 . b4 ) & ( for b4 being FinSeq-Location holds (Exec (AddTo b1,b2),b3) . b4 = b3 . b4 ) )
proof end;

theorem Th91: :: SCMFSA_2:91
for b1, b2 being Int-Location
for b3 being State of SCM+FSA holds
( (Exec (SubFrom b1,b2),b3) . (IC SCM+FSA ) = Next (IC b3) & (Exec (SubFrom b1,b2),b3) . b1 = (b3 . b1) - (b3 . b2) & ( for b4 being Int-Location st b4 <> b1 holds
(Exec (SubFrom b1,b2),b3) . b4 = b3 . b4 ) & ( for b4 being FinSeq-Location holds (Exec (SubFrom b1,b2),b3) . b4 = b3 . b4 ) )
proof end;

theorem Th92: :: SCMFSA_2:92
for b1, b2 being Int-Location
for b3 being State of SCM+FSA holds
( (Exec (MultBy b1,b2),b3) . (IC SCM+FSA ) = Next (IC b3) & (Exec (MultBy b1,b2),b3) . b1 = (b3 . b1) * (b3 . b2) & ( for b4 being Int-Location st b4 <> b1 holds
(Exec (MultBy b1,b2),b3) . b4 = b3 . b4 ) & ( for b4 being FinSeq-Location holds (Exec (MultBy b1,b2),b3) . b4 = b3 . b4 ) )
proof end;

theorem Th93: :: SCMFSA_2:93
for b1, b2 being Int-Location
for b3 being State of SCM+FSA holds
( (Exec (Divide b1,b2),b3) . (IC SCM+FSA ) = Next (IC b3) & ( b1 <> b2 implies (Exec (Divide b1,b2),b3) . b1 = (b3 . b1) div (b3 . b2) ) & (Exec (Divide b1,b2),b3) . b2 = (b3 . b1) mod (b3 . b2) & ( for b4 being Int-Location st b4 <> b1 & b4 <> b2 holds
(Exec (Divide b1,b2),b3) . b4 = b3 . b4 ) & ( for b4 being FinSeq-Location holds (Exec (Divide b1,b2),b3) . b4 = b3 . b4 ) )
proof end;

theorem Th94: :: SCMFSA_2:94
for b1 being Int-Location
for b2 being State of SCM+FSA holds
( (Exec (Divide b1,b1),b2) . (IC SCM+FSA ) = Next (IC b2) & (Exec (Divide b1,b1),b2) . b1 = (b2 . b1) mod (b2 . b1) & ( for b3 being Int-Location st b3 <> b1 holds
(Exec (Divide b1,b1),b2) . b3 = b2 . b3 ) & ( for b3 being FinSeq-Location holds (Exec (Divide b1,b1),b2) . b3 = b2 . b3 ) )
proof end;

theorem Th95: :: SCMFSA_2:95
for b1 being Instruction-Location of SCM+FSA
for b2 being State of SCM+FSA holds
( (Exec (goto b1),b2) . (IC SCM+FSA ) = b1 & ( for b3 being Int-Location holds (Exec (goto b1),b2) . b3 = b2 . b3 ) & ( for b3 being FinSeq-Location holds (Exec (goto b1),b2) . b3 = b2 . b3 ) )
proof end;

theorem Th96: :: SCMFSA_2:96
for b1 being Instruction-Location of SCM+FSA
for b2 being Int-Location
for b3 being State of SCM+FSA holds
( ( b3 . b2 = 0 implies (Exec (b2 =0_goto b1),b3) . (IC SCM+FSA ) = b1 ) & ( b3 . b2 <> 0 implies (Exec (b2 =0_goto b1),b3) . (IC SCM+FSA ) = Next (IC b3) ) & ( for b4 being Int-Location holds (Exec (b2 =0_goto b1),b3) . b4 = b3 . b4 ) & ( for b4 being FinSeq-Location holds (Exec (b2 =0_goto b1),b3) . b4 = b3 . b4 ) )
proof end;

theorem Th97: :: SCMFSA_2:97
for b1 being Instruction-Location of SCM+FSA
for b2 being Int-Location
for b3 being State of SCM+FSA holds
( ( b3 . b2 > 0 implies (Exec (b2 >0_goto b1),b3) . (IC SCM+FSA ) = b1 ) & ( b3 . b2 <= 0 implies (Exec (b2 >0_goto b1),b3) . (IC SCM+FSA ) = Next (IC b3) ) & ( for b4 being Int-Location holds (Exec (b2 >0_goto b1),b3) . b4 = b3 . b4 ) & ( for b4 being FinSeq-Location holds (Exec (b2 >0_goto b1),b3) . b4 = b3 . b4 ) )
proof end;

theorem Th98: :: SCMFSA_2:98
for b1 being FinSeq-Location
for b2, b3 being Int-Location
for b4 being State of SCM+FSA holds
( (Exec (b2 := b1,b3),b4) . (IC SCM+FSA ) = Next (IC b4) & ex b5 being Nat st
( b5 = abs (b4 . b3) & (Exec (b2 := b1,b3),b4) . b2 = (b4 . b1) /. b5 ) & ( for b5 being Int-Location st b5 <> b2 holds
(Exec (b2 := b1,b3),b4) . b5 = b4 . b5 ) & ( for b5 being FinSeq-Location holds (Exec (b2 := b1,b3),b4) . b5 = b4 . b5 ) )
proof end;

theorem Th99: :: SCMFSA_2:99
for b1 being FinSeq-Location
for b2, b3 being Int-Location
for b4 being State of SCM+FSA holds
( (Exec (b1,b2 := b3),b4) . (IC SCM+FSA ) = Next (IC b4) & ex b5 being Nat st
( b5 = abs (b4 . b2) & (Exec (b1,b2 := b3),b4) . b1 = (b4 . b1) +* b5,(b4 . b3) ) & ( for b5 being Int-Location holds (Exec (b1,b2 := b3),b4) . b5 = b4 . b5 ) & ( for b5 being FinSeq-Location st b5 <> b1 holds
(Exec (b1,b2 := b3),b4) . b5 = b4 . b5 ) )
proof end;

theorem Th100: :: SCMFSA_2:100
for b1 being FinSeq-Location
for b2 being Int-Location
for b3 being State of SCM+FSA holds
( (Exec (b2 :=len b1),b3) . (IC SCM+FSA ) = Next (IC b3) & (Exec (b2 :=len b1),b3) . b2 = len (b3 . b1) & ( for b4 being Int-Location st b4 <> b2 holds
(Exec (b2 :=len b1),b3) . b4 = b3 . b4 ) & ( for b4 being FinSeq-Location holds (Exec (b2 :=len b1),b3) . b4 = b3 . b4 ) )
proof end;

theorem Th101: :: SCMFSA_2:101
for b1 being FinSeq-Location
for b2 being Int-Location
for b3 being State of SCM+FSA holds
( (Exec (b1 :=<0,...,0> b2),b3) . (IC SCM+FSA ) = Next (IC b3) & ex b4 being Nat st
( b4 = abs (b3 . b2) & (Exec (b1 :=<0,...,0> b2),b3) . b1 = b4 |-> 0 ) & ( for b4 being Int-Location holds (Exec (b1 :=<0,...,0> b2),b3) . b4 = b3 . b4 ) & ( for b4 being FinSeq-Location st b4 <> b1 holds
(Exec (b1 :=<0,...,0> b2),b3) . b4 = b3 . b4 ) )
proof end;

theorem Th102: :: SCMFSA_2:102
for b1 being State of SCM+FSA
for b2 being SCM+FSA-State st b2 = b1 holds
IC b1 = IC b2 by SCMFSA_1:def 16, Th7;

theorem Th103: :: SCMFSA_2:103
for b1 being Instruction of SCM
for b2 being Instruction of SCM+FSA st b1 = b2 & b1 is halting holds
b2 is halting
proof end;

theorem Th104: :: SCMFSA_2:104
for b1 being Instruction of SCM+FSA st ex b2 being State of SCM+FSA st (Exec b1,b2) . (IC SCM+FSA ) = Next (IC b2) holds
not b1 is halting
proof end;

theorem Th105: :: SCMFSA_2:105
for b1, b2 being Int-Location holds not b1 := b2 is halting
proof end;

theorem Th106: :: SCMFSA_2:106
for b1, b2 being Int-Location holds not AddTo b1,b2 is halting
proof end;

theorem Th107: :: SCMFSA_2:107
for b1, b2 being Int-Location holds not SubFrom b1,b2 is halting
proof end;

theorem Th108: :: SCMFSA_2:108
for b1, b2 being Int-Location holds not MultBy b1,b2 is halting
proof end;

theorem Th109: :: SCMFSA_2:109
for b1, b2 being Int-Location holds not Divide b1,b2 is halting
proof end;

theorem Th110: :: SCMFSA_2:110
for b1 being Instruction-Location of SCM+FSA holds not goto b1 is halting
proof end;

theorem Th111: :: SCMFSA_2:111
for b1 being Instruction-Location of SCM+FSA
for b2 being Int-Location holds not b2 =0_goto b1 is halting
proof end;

theorem Th112: :: SCMFSA_2:112
for b1 being Instruction-Location of SCM+FSA
for b2 being Int-Location holds not b2 >0_goto b1 is halting
proof end;

theorem Th113: :: SCMFSA_2:113
for b1 being FinSeq-Location
for b2, b3 being Int-Location holds not b2 := b1,b3 is halting
proof end;

theorem Th114: :: SCMFSA_2:114
for b1 being FinSeq-Location
for b2, b3 being Int-Location holds not b1,b2 := b3 is halting
proof end;

theorem Th115: :: SCMFSA_2:115
for b1 being FinSeq-Location
for b2 being Int-Location holds not b2 :=len b1 is halting
proof end;

theorem Th116: :: SCMFSA_2:116
for b1 being FinSeq-Location
for b2 being Int-Location holds not b1 :=<0,...,0> b2 is halting
proof end;

theorem Th117: :: SCMFSA_2:117
[0,{} ] is Instruction of SCM+FSA by SCMFSA_1:4;

theorem Th118: :: SCMFSA_2:118
for b1 being Instruction of SCM+FSA st b1 = [0,{} ] holds
b1 is halting by Th103, AMI_3:71;

theorem Th119: :: SCMFSA_2:119
for b1 being Instruction of SCM+FSA st InsCode b1 = 0 holds
b1 = [0,{} ]
proof end;

theorem Th120: :: SCMFSA_2:120
for b1 being set holds
( b1 is Instruction of SCM+FSA iff ( b1 = [0,{} ] or ex b2, b3 being Int-Location st b1 = b2 := b3 or ex b2, b3 being Int-Location st b1 = AddTo b2,b3 or ex b2, b3 being Int-Location st b1 = SubFrom b2,b3 or ex b2, b3 being Int-Location st b1 = MultBy b2,b3 or ex b2, b3 being Int-Location st b1 = Divide b2,b3 or ex b2 being Instruction-Location of SCM+FSA st b1 = goto b2 or ex b2 being Instruction-Location of SCM+FSA ex b3 being Int-Location st b1 = b3 =0_goto b2 or ex b2 being Instruction-Location of SCM+FSA ex b3 being Int-Location st b1 = b3 >0_goto b2 or ex b2, b3 being Int-Location ex b4 being FinSeq-Location st b1 = b3 := b4,b2 or ex b2, b3 being Int-Location ex b4 being FinSeq-Location st b1 = b4,b2 := b3 or ex b2 being Int-Location ex b3 being FinSeq-Location st b1 = b2 :=len b3 or ex b2 being Int-Location ex b3 being FinSeq-Location st b1 = b3 :=<0,...,0> b2 ) )
proof end;

registration
cluster SCM+FSA -> non empty strict non void halting IC-Ins-separated data-oriented steady-programmed definite realistic ;
coherence
SCM+FSA is halting
proof end;
end;

theorem Th121: :: SCMFSA_2:121
for b1 being Instruction of SCM+FSA st b1 is halting holds
b1 = halt SCM+FSA
proof end;

theorem Th122: :: SCMFSA_2:122
for b1 being Instruction of SCM+FSA st InsCode b1 = 0 holds
b1 = halt SCM+FSA
proof end;

theorem Th123: :: SCMFSA_2:123
halt SCM = halt SCM+FSA
proof end;

theorem Th124: :: SCMFSA_2:124
InsCode (halt SCM+FSA ) = 0
proof end;

theorem Th125: :: SCMFSA_2:125
for b1 being Instruction of SCM
for b2 being Instruction of SCM+FSA st b1 = b2 & not b1 is halting holds
not b2 is halting by Th121, Th123;