:: SCMFSA6B semantic presentation

theorem Th1: :: SCMFSA6B:1
canceled;

theorem Th2: :: SCMFSA6B:2
canceled;

theorem Th3: :: SCMFSA6B:3
for b1, b2 being Function
for b3 being set st b3 /\ (dom b1) c= b3 /\ (dom b2) holds
(b1 +* (b2 | b3)) | b3 = b2 | b3
proof end;

theorem Th4: :: SCMFSA6B:4
for b1 being Macro-Instruction holds Start-At (insloc 0) c= Initialized b1
proof end;

theorem Th5: :: SCMFSA6B:5
for b1 being Nat
for b2 being Macro-Instruction
for b3 being State of SCM+FSA st b2 +* (Start-At (insloc b1)) c= b3 holds
b2 c= b3
proof end;

theorem Th6: :: SCMFSA6B:6
for b1 being Nat
for b2 being Macro-Instruction holds (b2 +* (Start-At (insloc b1))) | the Instruction-Locations of SCM+FSA = b2
proof end;

theorem Th7: :: SCMFSA6B:7
for b1 being Nat
for b2 being set
for b3 being Macro-Instruction st b2 in dom b3 holds
b3 . b2 = (b3 +* (Start-At (insloc b1))) . b2
proof end;

theorem Th8: :: SCMFSA6B:8
for b1 being Macro-Instruction
for b2 being State of SCM+FSA st Initialized b1 c= b2 holds
b1 +* (Start-At (insloc 0)) c= b2
proof end;

theorem Th9: :: SCMFSA6B:9
for b1 being Int-Location
for b2 being Instruction-Location of SCM+FSA holds not b1 in dom (Start-At b2)
proof end;

theorem Th10: :: SCMFSA6B:10
for b1 being FinSeq-Location
for b2 being Instruction-Location of SCM+FSA holds not b1 in dom (Start-At b2)
proof end;

theorem Th11: :: SCMFSA6B:11
for b1, b2 being Instruction-Location of SCM+FSA holds not b1 in dom (Start-At b2)
proof end;

theorem Th12: :: SCMFSA6B:12
for b1 being Macro-Instruction
for b2 being Int-Location
for b3 being Instruction-Location of SCM+FSA holds not b2 in dom (b1 +* (Start-At b3))
proof end;

theorem Th13: :: SCMFSA6B:13
for b1 being Macro-Instruction
for b2 being FinSeq-Location
for b3 being Instruction-Location of SCM+FSA holds not b2 in dom (b1 +* (Start-At b3))
proof end;

theorem Th14: :: SCMFSA6B:14
for b1 being Macro-Instruction
for b2 being State of SCM+FSA holds (b2 +* b1) +* (Start-At (insloc 0)) = (b2 +* (Start-At (insloc 0))) +* b1
proof end;

theorem Th15: :: SCMFSA6B:15
for b1 being State of SCM+FSA st b1 = Following b1 holds
for b2 being Nat holds (Computation b1) . b2 = b1
proof end;

theorem Th16: :: SCMFSA6B:16
for b1 being non empty with_non-empty_elements set
for b2 being non empty non void halting IC-Ins-separated definite AMI-Struct of b1
for b3 being State of b2 st b3 is halting holds
Result b3 = (Computation b3) . (LifeSpan b3)
proof end;

definition
let c1 be non empty with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite AMI-Struct of c1;
let c3 be State of c2;
let c4 be Instruction-Location of c2;
let c5 be Instruction of c2;
redefine func +* as c3 +* c4,c5 -> State of a2;
coherence
c3 +* c4,c5 is State of c2
proof end;
end;

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

theorem Th17: :: SCMFSA6B:17
for b1 being non empty with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated steady-programmed definite AMI-Struct of b1
for b3 being State of b2
for b4 being Nat holds b3 | the Instruction-Locations of b2 = ((Computation b3) . b4) | the Instruction-Locations of b2
proof end;

definition
let c1 be Macro-Instruction;
let c2 be State of SCM+FSA ;
func IExec c1,c2 -> State of SCM+FSA equals :: SCMFSA6B:def 1
(Result (a2 +* (Initialized a1))) +* (a2 | the Instruction-Locations of SCM+FSA );
coherence
(Result (c2 +* (Initialized c1))) +* (c2 | the Instruction-Locations of SCM+FSA ) is State of SCM+FSA
by AMI_5:82;
end;

:: deftheorem Def1 defines IExec SCMFSA6B:def 1 :
for b1 being Macro-Instruction
for b2 being State of SCM+FSA holds IExec b1,b2 = (Result (b2 +* (Initialized b1))) +* (b2 | the Instruction-Locations of SCM+FSA );

definition
let c1 be Macro-Instruction;
attr a1 is paraclosed means :Def2: :: SCMFSA6B:def 2
for b1 being State of SCM+FSA
for b2 being Nat st a1 +* (Start-At (insloc 0)) c= b1 holds
IC ((Computation b1) . b2) in dom a1;
attr a1 is parahalting means :Def3: :: SCMFSA6B:def 3
a1 +* (Start-At (insloc 0)) is halting;
attr a1 is keeping_0 means :Def4: :: SCMFSA6B:def 4
for b1 being State of SCM+FSA st a1 +* (Start-At (insloc 0)) c= b1 holds
for b2 being Nat holds ((Computation b1) . b2) . (intloc 0) = b1 . (intloc 0);
end;

:: deftheorem Def2 defines paraclosed SCMFSA6B:def 2 :
for b1 being Macro-Instruction holds
( b1 is paraclosed iff for b2 being State of SCM+FSA
for b3 being Nat st b1 +* (Start-At (insloc 0)) c= b2 holds
IC ((Computation b2) . b3) in dom b1 );

:: deftheorem Def3 defines parahalting SCMFSA6B:def 3 :
for b1 being Macro-Instruction holds
( b1 is parahalting iff b1 +* (Start-At (insloc 0)) is halting );

:: deftheorem Def4 defines keeping_0 SCMFSA6B:def 4 :
for b1 being Macro-Instruction holds
( b1 is keeping_0 iff for b2 being State of SCM+FSA st b1 +* (Start-At (insloc 0)) c= b2 holds
for b3 being Nat holds ((Computation b2) . b3) . (intloc 0) = b2 . (intloc 0) );

Lemma16: Macro (halt SCM+FSA ) is parahalting
proof end;

registration
cluster parahalting FinPartState of SCM+FSA ;
existence
ex b1 being Macro-Instruction st b1 is parahalting
by Lemma16;
end;

theorem Th18: :: SCMFSA6B:18
for b1 being State of SCM+FSA
for b2 being parahalting Macro-Instruction st b2 +* (Start-At (insloc 0)) c= b1 holds
b1 is halting
proof end;

theorem Th19: :: SCMFSA6B:19
for b1 being State of SCM+FSA
for b2 being parahalting Macro-Instruction st Initialized b2 c= b1 holds
b1 is halting
proof end;

registration
let c1 be parahalting Macro-Instruction;
cluster Initialized a1 -> halting ;
coherence
Initialized c1 is halting
proof end;
end;

theorem Th20: :: SCMFSA6B:20
for b1 being State of SCM+FSA holds not b1 +* (IC b1),(goto (IC b1)) is halting
proof end;

theorem Th21: :: SCMFSA6B:21
for b1 being Nat
for b2 being Macro-Instruction
for b3, b4 being State of SCM+FSA st b3,b4 equal_outside the Instruction-Locations of SCM+FSA & b2 c= b3 & b2 c= b4 & ( for b5 being Nat st b5 < b1 holds
IC ((Computation b4) . b5) in dom b2 ) holds
for b5 being Nat st b5 <= b1 holds
(Computation b3) . b5,(Computation b4) . b5 equal_outside the Instruction-Locations of SCM+FSA
proof end;

registration
cluster parahalting -> paraclosed FinPartState of SCM+FSA ;
coherence
for b1 being Macro-Instruction st b1 is parahalting holds
b1 is paraclosed
proof end;
cluster keeping_0 -> paraclosed FinPartState of SCM+FSA ;
coherence
for b1 being Macro-Instruction st b1 is keeping_0 holds
b1 is paraclosed
proof end;
end;

theorem Th22: :: SCMFSA6B:22
for b1 being State of SCM+FSA
for b2 being parahalting Macro-Instruction
for b3 being read-write Int-Location st not b3 in UsedIntLoc b2 holds
(IExec b2,b1) . b3 = b1 . b3
proof end;

theorem Th23: :: SCMFSA6B:23
for b1 being FinSeq-Location
for b2 being State of SCM+FSA
for b3 being parahalting Macro-Instruction st not b1 in UsedInt*Loc b3 holds
(IExec b3,b2) . b1 = b2 . b1
proof end;

theorem Th24: :: SCMFSA6B:24
for b1 being Instruction-Location of SCM+FSA
for b2 being State of SCM+FSA st IC b2 = b1 & b2 . b1 = goto b1 holds
not b2 is halting
proof end;

registration
cluster parahalting -> non empty FinPartState of SCM+FSA ;
coherence
for b1 being Macro-Instruction st b1 is parahalting holds
not b1 is empty
proof end;
end;

theorem Th25: :: SCMFSA6B:25
for b1 being parahalting Macro-Instruction holds dom b1 <> {}
proof end;

theorem Th26: :: SCMFSA6B:26
for b1 being parahalting Macro-Instruction holds insloc 0 in dom b1
proof end;

theorem Th27: :: SCMFSA6B:27
for b1, b2 being State of SCM+FSA
for b3 being parahalting Macro-Instruction st b3 +* (Start-At (insloc 0)) c= b1 holds
for b4 being Nat st ProgramPart (Relocated b3,b4) c= b2 & IC b2 = insloc b4 & b1 | (Int-Locations \/ FinSeq-Locations ) = b2 | (Int-Locations \/ FinSeq-Locations ) holds
for b5 being Nat holds
( (IC ((Computation b1) . b5)) + b4 = IC ((Computation b2) . b5) & IncAddr (CurInstr ((Computation b1) . b5)),b4 = CurInstr ((Computation b2) . b5) & ((Computation b1) . b5) | (Int-Locations \/ FinSeq-Locations ) = ((Computation b2) . b5) | (Int-Locations \/ FinSeq-Locations ) )
proof end;

theorem Th28: :: SCMFSA6B:28
for b1, b2 being State of SCM+FSA
for b3 being parahalting Macro-Instruction st b3 +* (Start-At (insloc 0)) c= b1 & b3 +* (Start-At (insloc 0)) c= b2 & b1,b2 equal_outside the Instruction-Locations of SCM+FSA holds
for b4 being Nat holds
( (Computation b1) . b4,(Computation b2) . b4 equal_outside the Instruction-Locations of SCM+FSA & CurInstr ((Computation b1) . b4) = CurInstr ((Computation b2) . b4) )
proof end;

theorem Th29: :: SCMFSA6B:29
for b1, b2 being State of SCM+FSA
for b3 being parahalting Macro-Instruction st b3 +* (Start-At (insloc 0)) c= b1 & b3 +* (Start-At (insloc 0)) c= b2 & b1,b2 equal_outside the Instruction-Locations of SCM+FSA holds
( LifeSpan b1 = LifeSpan b2 & Result b1, Result b2 equal_outside the Instruction-Locations of SCM+FSA )
proof end;

theorem Th30: :: SCMFSA6B:30
for b1 being State of SCM+FSA
for b2 being parahalting Macro-Instruction holds IC (IExec b2,b1) = IC (Result (b1 +* (Initialized b2)))
proof end;

theorem Th31: :: SCMFSA6B:31
for b1 being non empty Macro-Instruction holds
( insloc 0 in dom b1 & insloc 0 in dom (Initialized b1) & insloc 0 in dom (b1 +* (Start-At (insloc 0))) )
proof end;

theorem Th32: :: SCMFSA6B:32
for b1 being set
for b2 being Instruction of SCM+FSA holds
( b1 in dom (Macro b2) iff ( b1 = insloc 0 or b1 = insloc 1 ) )
proof end;

theorem Th33: :: SCMFSA6B:33
for b1 being Instruction of SCM+FSA holds
( (Macro b1) . (insloc 0) = b1 & (Macro b1) . (insloc 1) = halt SCM+FSA & (Initialized (Macro b1)) . (insloc 0) = b1 & (Initialized (Macro b1)) . (insloc 1) = halt SCM+FSA & ((Macro b1) +* (Start-At (insloc 0))) . (insloc 0) = b1 )
proof end;

theorem Th34: :: SCMFSA6B:34
for b1 being Macro-Instruction
for b2 being State of SCM+FSA st Initialized b1 c= b2 holds
IC b2 = insloc 0
proof end;

Lemma31: ( Macro (halt SCM+FSA ) is keeping_0 & Macro (halt SCM+FSA ) is parahalting )
proof end;

registration
cluster non empty paraclosed parahalting keeping_0 FinPartState of SCM+FSA ;
existence
ex b1 being Macro-Instruction st
( b1 is keeping_0 & b1 is parahalting )
by Lemma31;
end;

theorem Th35: :: SCMFSA6B:35
for b1 being State of SCM+FSA
for b2 being parahalting keeping_0 Macro-Instruction holds (IExec b2,b1) . (intloc 0) = 1
proof end;

theorem Th36: :: SCMFSA6B:36
for b1 being State of SCM+FSA
for b2 being paraclosed Macro-Instruction
for b3 being Macro-Instruction st b2 +* (Start-At (insloc 0)) c= b1 & b1 is halting holds
for b4 being Nat st b4 <= LifeSpan b1 holds
(Computation b1) . b4,(Computation (b1 +* (b2 ';' b3))) . b4 equal_outside the Instruction-Locations of SCM+FSA
proof end;

theorem Th37: :: SCMFSA6B:37
for b1 being State of SCM+FSA
for b2 being paraclosed Macro-Instruction st b1 +* b2 is halting & Directed b2 c= b1 & Start-At (insloc 0) c= b1 holds
IC ((Computation b1) . ((LifeSpan (b1 +* b2)) + 1)) = insloc (card b2)
proof end;

theorem Th38: :: SCMFSA6B:38
for b1 being State of SCM+FSA
for b2 being paraclosed Macro-Instruction st b1 +* b2 is halting & Directed b2 c= b1 & Start-At (insloc 0) c= b1 holds
((Computation b1) . (LifeSpan (b1 +* b2))) | (Int-Locations \/ FinSeq-Locations ) = ((Computation b1) . ((LifeSpan (b1 +* b2)) + 1)) | (Int-Locations \/ FinSeq-Locations )
proof end;

theorem Th39: :: SCMFSA6B:39
for b1 being State of SCM+FSA
for b2 being parahalting Macro-Instruction st Initialized b2 c= b1 holds
for b3 being Nat st b3 <= LifeSpan b1 holds
CurInstr ((Computation (b1 +* (Directed b2))) . b3) <> halt SCM+FSA
proof end;

theorem Th40: :: SCMFSA6B:40
for b1 being State of SCM+FSA
for b2 being paraclosed Macro-Instruction st b1 +* (b2 +* (Start-At (insloc 0))) is halting holds
for b3 being Macro-Instruction
for b4 being Nat st b4 <= LifeSpan (b1 +* (b2 +* (Start-At (insloc 0)))) holds
(Computation (b1 +* (b2 +* (Start-At (insloc 0))))) . b4,(Computation (b1 +* ((b2 ';' b3) +* (Start-At (insloc 0))))) . b4 equal_outside the Instruction-Locations of SCM+FSA
proof end;

Lemma37: for b1 being parahalting keeping_0 Macro-Instruction
for b2 being parahalting Macro-Instruction
for b3 being State of SCM+FSA st Initialized (b1 ';' b2) c= b3 holds
( IC ((Computation b3) . ((LifeSpan (b3 +* b1)) + 1)) = insloc (card b1) & ((Computation b3) . ((LifeSpan (b3 +* b1)) + 1)) | (Int-Locations \/ FinSeq-Locations ) = (((Computation (b3 +* b1)) . (LifeSpan (b3 +* b1))) +* (Initialized b2)) | (Int-Locations \/ FinSeq-Locations ) & ProgramPart (Relocated b2,(card b1)) c= (Computation b3) . ((LifeSpan (b3 +* b1)) + 1) & ((Computation b3) . ((LifeSpan (b3 +* b1)) + 1)) . (intloc 0) = 1 & b3 is halting & LifeSpan b3 = ((LifeSpan (b3 +* b1)) + 1) + (LifeSpan ((Result (b3 +* b1)) +* (Initialized b2))) & ( b2 is keeping_0 implies (Result b3) . (intloc 0) = 1 ) )
proof end;

registration
let c1, c2 be parahalting Macro-Instruction;
cluster a1 ';' a2 -> non empty paraclosed parahalting ;
coherence
c1 ';' c2 is parahalting
proof end;
end;

theorem Th41: :: SCMFSA6B:41
for b1 being State of SCM+FSA
for b2 being keeping_0 Macro-Instruction st not b1 +* (b2 +* (Start-At (insloc 0))) is halting holds
for b3 being Macro-Instruction
for b4 being Nat holds (Computation (b1 +* (b2 +* (Start-At (insloc 0))))) . b4,(Computation (b1 +* ((b2 ';' b3) +* (Start-At (insloc 0))))) . b4 equal_outside the Instruction-Locations of SCM+FSA
proof end;

theorem Th42: :: SCMFSA6B:42
for b1 being State of SCM+FSA
for b2 being keeping_0 Macro-Instruction st b1 +* b2 is halting holds
for b3 being paraclosed Macro-Instruction st (b2 ';' b3) +* (Start-At (insloc 0)) c= b1 holds
for b4 being Nat holds ((Computation ((Result (b1 +* b2)) +* (b3 +* (Start-At (insloc 0))))) . b4) +* (Start-At ((IC ((Computation ((Result (b1 +* b2)) +* (b3 +* (Start-At (insloc 0))))) . b4)) + (card b2))),(Computation (b1 +* (b2 ';' b3))) . (((LifeSpan (b1 +* b2)) + 1) + b4) equal_outside the Instruction-Locations of SCM+FSA
proof end;

registration
let c1, c2 be keeping_0 Macro-Instruction;
cluster a1 ';' a2 -> paraclosed keeping_0 ;
coherence
c1 ';' c2 is keeping_0
proof end;
end;

theorem Th43: :: SCMFSA6B:43
for b1 being State of SCM+FSA
for b2 being parahalting keeping_0 Macro-Instruction
for b3 being parahalting Macro-Instruction holds LifeSpan (b1 +* (Initialized (b2 ';' b3))) = ((LifeSpan (b1 +* (Initialized b2))) + 1) + (LifeSpan ((Result (b1 +* (Initialized b2))) +* (Initialized b3)))
proof end;

theorem Th44: :: SCMFSA6B:44
for b1 being State of SCM+FSA
for b2 being parahalting keeping_0 Macro-Instruction
for b3 being parahalting Macro-Instruction holds IExec (b2 ';' b3),b1 = (IExec b3,(IExec b2,b1)) +* (Start-At ((IC (IExec b3,(IExec b2,b1))) + (card b2)))
proof end;