:: SCMFSA6A semantic presentation

theorem Th1: :: SCMFSA6A:1
for b1, b2 being Function
for b3, b4 being set st b2 c= b1 & not b3 in dom b2 holds
b2 c= b1 +* b3,b4
proof end;

theorem Th2: :: SCMFSA6A:2
for b1, b2 being Function
for b3 being set st b1 | b3 = b2 | b3 & b1,b2 equal_outside b3 holds
b1 = b2
proof end;

theorem Th3: :: SCMFSA6A:3
for b1 being Function
for b2, b3, b4 being set st b2 in b4 holds
b1,b1 +* b2,b3 equal_outside b4
proof end;

theorem Th4: :: SCMFSA6A:4
for b1 being Function
for b2, b3, b4 being set holds
( b2 in b4 or (b1 +* b2,b3) | b4 = b1 | b4 )
proof end;

theorem Th5: :: SCMFSA6A:5
for b1, b2 being Function
for b3, b4, b5 being set st b1 | b5 = b2 | b5 holds
(b1 +* b3,b4) | b5 = (b2 +* b3,b4) | b5
proof end;

theorem Th6: :: SCMFSA6A:6
for b1, b2, b3 being Function st b1 c= b3 & b2 c= b3 holds
b1 +* b2 c= b3
proof end;

theorem Th7: :: SCMFSA6A:7
for b1, b2 being set
for b3 being Function holds
( b1 .--> b2 c= b3 iff ( b1 in dom b3 & b3 . b1 = b2 ) )
proof end;

theorem Th8: :: SCMFSA6A:8
for b1 being Function
for b2 being set holds dom (b1 | ((dom b1) \ b2)) = (dom b1) \ b2
proof end;

theorem Th9: :: SCMFSA6A:9
for b1, b2 being Function
for b3 being set st b3 c= dom b1 & b3 c= dom b2 holds
( b1 | b3 = b2 | b3 iff for b4 being set st b4 in b3 holds
b1 . b4 = b2 . b4 )
proof end;

theorem Th10: :: SCMFSA6A:10
for b1 being Function
for b2 being set holds b1 | b2 = b1 | ((dom b1) /\ b2)
proof end;

theorem Th11: :: SCMFSA6A:11
for b1, b2, b3 being Function
for b4 being set st b1,b2 equal_outside b4 holds
b1 +* b3,b2 +* b3 equal_outside b4
proof end;

theorem Th12: :: SCMFSA6A:12
for b1, b2, b3 being Function
for b4 being set st b1,b2 equal_outside b4 holds
b3 +* b1,b3 +* b2 equal_outside b4
proof end;

theorem Th13: :: SCMFSA6A:13
for b1, b2, b3 being Function holds
( b1 +* b3 = b2 +* b3 iff b1,b2 equal_outside dom b3 )
proof end;

definition
mode Macro-Instruction is programmed initial FinPartState of SCM+FSA ;
end;

definition
let c1 be programmed FinPartState of SCM+FSA ;
func Directed c1 -> programmed FinPartState of SCM+FSA equals :: SCMFSA6A:def 1
((id the Instructions of SCM+FSA ) +* ((halt SCM+FSA ) .--> (goto (insloc (card a1))))) * a1;
coherence
((id the Instructions of SCM+FSA ) +* ((halt SCM+FSA ) .--> (goto (insloc (card c1))))) * c1 is programmed FinPartState of SCM+FSA
proof end;
correctness
;
end;

:: deftheorem Def1 defines Directed SCMFSA6A:def 1 :
for b1 being programmed FinPartState of SCM+FSA holds Directed b1 = ((id the Instructions of SCM+FSA ) +* ((halt SCM+FSA ) .--> (goto (insloc (card b1))))) * b1;

theorem Th14: :: SCMFSA6A:14
for b1 being Macro-Instruction holds dom (Directed b1) = dom b1
proof end;

registration
let c1 be Macro-Instruction;
cluster Directed a1 -> programmed initial ;
coherence
Directed c1 is initial
proof end;
end;

definition
let c1 be Instruction of SCM+FSA ;
func Macro c1 -> Macro-Instruction equals :: SCMFSA6A:def 2
(insloc 0),(insloc 1) --> a1,(halt SCM+FSA );
coherence
(insloc 0),(insloc 1) --> c1,(halt SCM+FSA ) is Macro-Instruction
proof end;
correctness
;
end;

:: deftheorem Def2 defines Macro SCMFSA6A:def 2 :
for b1 being Instruction of SCM+FSA holds Macro b1 = (insloc 0),(insloc 1) --> b1,(halt SCM+FSA );

registration
let c1 be Instruction of SCM+FSA ;
cluster Macro a1 -> non empty ;
coherence
not Macro c1 is empty
;
end;

theorem Th15: :: SCMFSA6A:15
for b1 being Macro-Instruction
for b2 being Nat holds
( b2 < card b1 iff insloc b2 in dom b1 )
proof end;

registration
let c1 be initial FinPartState of SCM+FSA ;
cluster ProgramPart a1 -> initial ;
coherence
ProgramPart c1 is initial
proof end;
end;

theorem Th16: :: SCMFSA6A:16
for b1, b2 being Macro-Instruction holds dom b1 misses dom (ProgramPart (Relocated b2,(card b1)))
proof end;

theorem Th17: :: SCMFSA6A:17
for b1 being Nat
for b2 being programmed FinPartState of SCM+FSA holds card (ProgramPart (Relocated b2,b1)) = card b2
proof end;

theorem Th18: :: SCMFSA6A:18
for b1 being Macro-Instruction holds not halt SCM+FSA in rng (Directed b1)
proof end;

theorem Th19: :: SCMFSA6A:19
for b1 being Nat
for b2 being Macro-Instruction holds ProgramPart (Relocated (Directed b2),b1) = ((id the Instructions of SCM+FSA ) +* ((halt SCM+FSA ) .--> (goto (insloc (b1 + (card b2)))))) * (ProgramPart (Relocated b2,b1))
proof end;

theorem Th20: :: SCMFSA6A:20
for b1, b2 being FinPartState of SCM+FSA holds ProgramPart (b1 +* b2) = (ProgramPart b1) +* (ProgramPart b2)
proof end;

theorem Th21: :: SCMFSA6A:21
for b1 being Nat
for b2, b3 being FinPartState of SCM+FSA holds ProgramPart (Relocated (b2 +* b3),b1) = (ProgramPart (Relocated b2,b1)) +* (ProgramPart (Relocated b3,b1))
proof end;

theorem Th22: :: SCMFSA6A:22
for b1, b2 being Nat
for b3 being Macro-Instruction holds ProgramPart (Relocated (ProgramPart (Relocated b3,b1)),b2) = ProgramPart (Relocated b3,(b1 + b2))
proof end;

definition
let c1 be FinPartState of SCM+FSA ;
func Initialized c1 -> FinPartState of SCM+FSA equals :: SCMFSA6A:def 3
(a1 +* ((intloc 0) .--> 1)) +* (Start-At (insloc 0));
coherence
(c1 +* ((intloc 0) .--> 1)) +* (Start-At (insloc 0)) is FinPartState of SCM+FSA
proof end;
correctness
;
end;

:: deftheorem Def3 defines Initialized SCMFSA6A:def 3 :
for b1 being FinPartState of SCM+FSA holds Initialized b1 = (b1 +* ((intloc 0) .--> 1)) +* (Start-At (insloc 0));

theorem Th23: :: SCMFSA6A:23
for b1 being Instruction of SCM+FSA
for b2 being State of SCM+FSA holds
( InsCode b1 in {0,6,7,8} or (Exec b1,b2) . (IC SCM+FSA ) = Next (IC b2) )
proof end;

theorem Th24: :: SCMFSA6A:24
for b1 being Macro-Instruction holds IC SCM+FSA in dom (Initialized b1)
proof end;

theorem Th25: :: SCMFSA6A:25
for b1 being Macro-Instruction holds IC (Initialized b1) = insloc 0
proof end;

theorem Th26: :: SCMFSA6A:26
for b1 being Macro-Instruction holds b1 c= Initialized b1
proof end;

theorem Th27: :: SCMFSA6A:27
for b1 being set
for b2 being AMI-Struct of b1
for b3 being State of b2
for b4 being programmed FinPartState of b2 holds b3,b3 +* b4 equal_outside the Instruction-Locations of b2
proof end;

theorem Th28: :: SCMFSA6A:28
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 ) holds
b1,b2 equal_outside the Instruction-Locations of SCM+FSA
proof end;

theorem Th29: :: SCMFSA6A:29
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite realistic AMI-Struct of b1
for b3, b4 being State of b2 st b3,b4 equal_outside the Instruction-Locations of b2 holds
IC b3 = IC b4
proof end;

theorem Th30: :: SCMFSA6A:30
for b1, b2 being State of SCM+FSA st b1,b2 equal_outside the Instruction-Locations of SCM+FSA holds
for b3 being Int-Location holds b1 . b3 = b2 . b3
proof end;

theorem Th31: :: SCMFSA6A:31
for b1, b2 being State of SCM+FSA st b1,b2 equal_outside the Instruction-Locations of SCM+FSA holds
for b3 being FinSeq-Location holds b1 . b3 = b2 . b3
proof end;

theorem Th32: :: SCMFSA6A:32
for b1 being Instruction of SCM+FSA
for b2, b3 being State of SCM+FSA st b2,b3 equal_outside the Instruction-Locations of SCM+FSA holds
Exec b1,b2, Exec b1,b3 equal_outside the Instruction-Locations of SCM+FSA
proof end;

theorem Th33: :: SCMFSA6A:33
for b1 being Macro-Instruction holds (Initialized b1) | the Instruction-Locations of SCM+FSA = b1
proof end;

scheme :: SCMFSA6A:sch 1
s1{ F1( set ) -> Element of the Instructions of SCM+FSA , F2( set ) -> Integer, F3( set ) -> FinSequence of INT , F4() -> Instruction-Location of SCM+FSA } :
ex b1 being State of SCM+FSA st
( IC b1 = F4() & ( for b2 being Nat holds
( b1 . (insloc b2) = F1(b2) & b1 . (intloc b2) = F2(b2) & b1 . (fsloc b2) = F3(b2) ) ) )
proof end;

theorem Th34: :: SCMFSA6A:34
for b1 being State of SCM+FSA holds dom b1 = ((Int-Locations \/ FinSeq-Locations ) \/ {(IC SCM+FSA )}) \/ the Instruction-Locations of SCM+FSA by AMI_3:36, SCMFSA_2:8;

theorem Th35: :: SCMFSA6A:35
for b1 being State of SCM+FSA
for b2 being set holds
( not b2 in dom b1 or b2 is Int-Location or b2 is FinSeq-Location or b2 = IC SCM+FSA or b2 is Instruction-Location of SCM+FSA )
proof end;

theorem Th36: :: SCMFSA6A:36
for b1, b2 being State of SCM+FSA holds
( ( for b3 being Instruction-Location of SCM+FSA holds b1 . b3 = b2 . b3 ) iff b1 | the Instruction-Locations of SCM+FSA = b2 | the Instruction-Locations of SCM+FSA )
proof end;

theorem Th37: :: SCMFSA6A:37
for b1 being Instruction-Location of SCM+FSA holds
( not b1 in Int-Locations \/ FinSeq-Locations & not IC SCM+FSA in Int-Locations \/ FinSeq-Locations )
proof end;

theorem Th38: :: SCMFSA6A:38
for b1, b2 being State of SCM+FSA holds
( ( ( for b3 being Int-Location holds b1 . b3 = b2 . b3 ) & ( for b3 being FinSeq-Location holds b1 . b3 = b2 . b3 ) ) iff b1 | (Int-Locations \/ FinSeq-Locations ) = b2 | (Int-Locations \/ FinSeq-Locations ) )
proof end;

theorem Th39: :: SCMFSA6A:39
for b1, b2 being State of SCM+FSA st b1,b2 equal_outside the Instruction-Locations of SCM+FSA holds
b1 | (Int-Locations \/ FinSeq-Locations ) = b2 | (Int-Locations \/ FinSeq-Locations )
proof end;

theorem Th40: :: SCMFSA6A:40
for b1, b2 being State of SCM+FSA
for b3 being set holds (b2 +* (b1 | b3)) | b3 = b1 | b3
proof end;

theorem Th41: :: SCMFSA6A:41
for b1, b2 being State of SCM+FSA
for b3 being Nat
for b4 being Instruction of SCM+FSA st (IC b1) + b3 = IC b2 & b1 | (Int-Locations \/ FinSeq-Locations ) = b2 | (Int-Locations \/ FinSeq-Locations ) holds
( (IC (Exec b4,b1)) + b3 = IC (Exec (IncAddr b4,b3),b2) & (Exec b4,b1) | (Int-Locations \/ FinSeq-Locations ) = (Exec (IncAddr b4,b3),b2) | (Int-Locations \/ FinSeq-Locations ) )
proof end;

theorem Th42: :: SCMFSA6A:42
for b1, b2 being Macro-Instruction holds b1,b2 equal_outside the Instruction-Locations of SCM+FSA
proof end;

theorem Th43: :: SCMFSA6A:43
for b1 being Macro-Instruction holds dom (Initialized b1) = ((dom b1) \/ {(intloc 0)}) \/ {(IC SCM+FSA )}
proof end;

theorem Th44: :: SCMFSA6A:44
for b1 being Macro-Instruction
for b2 being set holds
( not b2 in dom (Initialized b1) or b2 in dom b1 or b2 = intloc 0 or b2 = IC SCM+FSA )
proof end;

theorem Th45: :: SCMFSA6A:45
for b1 being Macro-Instruction holds intloc 0 in dom (Initialized b1)
proof end;

theorem Th46: :: SCMFSA6A:46
for b1 being Macro-Instruction holds
( (Initialized b1) . (intloc 0) = 1 & (Initialized b1) . (IC SCM+FSA ) = insloc 0 )
proof end;

theorem Th47: :: SCMFSA6A:47
for b1 being Macro-Instruction holds
( not intloc 0 in dom b1 & not IC SCM+FSA in dom b1 )
proof end;

theorem Th48: :: SCMFSA6A:48
for b1 being Macro-Instruction
for b2 being Int-Location st b2 <> intloc 0 holds
not b2 in dom (Initialized b1)
proof end;

theorem Th49: :: SCMFSA6A:49
for b1 being Macro-Instruction
for b2 being FinSeq-Location holds not b2 in dom (Initialized b1)
proof end;

theorem Th50: :: SCMFSA6A:50
for b1 being Macro-Instruction
for b2 being set st b2 in dom b1 holds
b1 . b2 = (Initialized b1) . b2
proof end;

theorem Th51: :: SCMFSA6A:51
for b1, b2 being Macro-Instruction
for b3 being State of SCM+FSA st Initialized b2 c= b3 holds
b3 +* (Initialized b1) = b3 +* b1
proof end;

theorem Th52: :: SCMFSA6A:52
for b1, b2 being Macro-Instruction
for b3 being State of SCM+FSA st Initialized b2 c= b3 holds
Initialized b1 c= b3 +* b1
proof end;

theorem Th53: :: SCMFSA6A:53
for b1, b2 being Macro-Instruction
for b3 being State of SCM+FSA holds b3 +* (Initialized b1),b3 +* (Initialized b2) equal_outside the Instruction-Locations of SCM+FSA
proof end;

definition
let c1, c2 be Macro-Instruction;
func c1 ';' c2 -> Macro-Instruction equals :: SCMFSA6A:def 4
(Directed a1) +* (ProgramPart (Relocated a2,(card a1)));
coherence
(Directed c1) +* (ProgramPart (Relocated c2,(card c1))) is Macro-Instruction
proof end;
correctness
;
end;

:: deftheorem Def4 defines ';' SCMFSA6A:def 4 :
for b1, b2 being Macro-Instruction holds b1 ';' b2 = (Directed b1) +* (ProgramPart (Relocated b2,(card b1)));

theorem Th54: :: SCMFSA6A:54
for b1, b2 being Macro-Instruction
for b3 being Instruction-Location of SCM+FSA st b3 in dom b1 & b1 . b3 <> halt SCM+FSA holds
(b1 ';' b2) . b3 = b1 . b3
proof end;

theorem Th55: :: SCMFSA6A:55
for b1, b2 being Macro-Instruction holds Directed b1 c= b1 ';' b2
proof end;

theorem Th56: :: SCMFSA6A:56
for b1, b2 being Macro-Instruction holds dom b1 c= dom (b1 ';' b2)
proof end;

theorem Th57: :: SCMFSA6A:57
for b1, b2 being Macro-Instruction holds b1 +* (b1 ';' b2) = b1 ';' b2
proof end;

theorem Th58: :: SCMFSA6A:58
for b1, b2 being Macro-Instruction holds (Initialized b1) +* (b1 ';' b2) = Initialized (b1 ';' b2)
proof end;

definition
let c1 be Instruction of SCM+FSA ;
let c2 be Macro-Instruction;
func c1 ';' c2 -> Macro-Instruction equals :: SCMFSA6A:def 5
(Macro a1) ';' a2;
correctness
coherence
(Macro c1) ';' c2 is Macro-Instruction
;
;
end;

:: deftheorem Def5 defines ';' SCMFSA6A:def 5 :
for b1 being Instruction of SCM+FSA
for b2 being Macro-Instruction holds b1 ';' b2 = (Macro b1) ';' b2;

definition
let c1 be Macro-Instruction;
let c2 be Instruction of SCM+FSA ;
func c1 ';' c2 -> Macro-Instruction equals :: SCMFSA6A:def 6
a1 ';' (Macro a2);
correctness
coherence
c1 ';' (Macro c2) is Macro-Instruction
;
;
end;

:: deftheorem Def6 defines ';' SCMFSA6A:def 6 :
for b1 being Macro-Instruction
for b2 being Instruction of SCM+FSA holds b1 ';' b2 = b1 ';' (Macro b2);

definition
let c1, c2 be Instruction of SCM+FSA ;
func c1 ';' c2 -> Macro-Instruction equals :: SCMFSA6A:def 7
(Macro a1) ';' (Macro a2);
correctness
coherence
(Macro c1) ';' (Macro c2) is Macro-Instruction
;
;
end;

:: deftheorem Def7 defines ';' SCMFSA6A:def 7 :
for b1, b2 being Instruction of SCM+FSA holds b1 ';' b2 = (Macro b1) ';' (Macro b2);

theorem Th59: :: SCMFSA6A:59
for b1, b2 being Instruction of SCM+FSA holds b1 ';' b2 = (Macro b1) ';' b2 ;

theorem Th60: :: SCMFSA6A:60
for b1, b2 being Instruction of SCM+FSA holds b1 ';' b2 = b1 ';' (Macro b2) ;

theorem Th61: :: SCMFSA6A:61
for b1, b2 being Macro-Instruction holds card (b1 ';' b2) = (card b1) + (card b2)
proof end;

theorem Th62: :: SCMFSA6A:62
for b1, b2, b3 being Macro-Instruction holds (b1 ';' b2) ';' b3 = b1 ';' (b2 ';' b3)
proof end;

theorem Th63: :: SCMFSA6A:63
for b1 being Instruction of SCM+FSA
for b2, b3 being Macro-Instruction holds (b2 ';' b3) ';' b1 = b2 ';' (b3 ';' b1) by Th62;

theorem Th64: :: SCMFSA6A:64
for b1 being Instruction of SCM+FSA
for b2, b3 being Macro-Instruction holds (b2 ';' b1) ';' b3 = b2 ';' (b1 ';' b3) by Th62;

theorem Th65: :: SCMFSA6A:65
for b1, b2 being Instruction of SCM+FSA
for b3 being Macro-Instruction holds (b3 ';' b1) ';' b2 = b3 ';' (b1 ';' b2)
proof end;

theorem Th66: :: SCMFSA6A:66
for b1 being Instruction of SCM+FSA
for b2, b3 being Macro-Instruction holds (b1 ';' b2) ';' b3 = b1 ';' (b2 ';' b3) by Th62;

theorem Th67: :: SCMFSA6A:67
for b1, b2 being Instruction of SCM+FSA
for b3 being Macro-Instruction holds (b1 ';' b3) ';' b2 = b1 ';' (b3 ';' b2) by Th63;

theorem Th68: :: SCMFSA6A:68
for b1, b2 being Instruction of SCM+FSA
for b3 being Macro-Instruction holds (b1 ';' b2) ';' b3 = b1 ';' (b2 ';' b3)
proof end;

theorem Th69: :: SCMFSA6A:69
for b1, b2, b3 being Instruction of SCM+FSA holds (b1 ';' b2) ';' b3 = b1 ';' (b2 ';' b3)
proof end;