:: SCMFSA_9 semantic presentation

theorem Th1: :: SCMFSA_9:1
for b1 being Macro-Instruction
for b2 being Int-Location holds card (if=0 b2,(b1 ';' (Goto (insloc 0))),SCM+FSA-Stop ) = (card b1) + 6
proof end;

theorem Th2: :: SCMFSA_9:2
for b1 being Macro-Instruction
for b2 being Int-Location holds card (if>0 b2,(b1 ';' (Goto (insloc 0))),SCM+FSA-Stop ) = (card b1) + 6
proof end;

definition
let c1 be Int-Location ;
let c2 be Macro-Instruction;
func while=0 c1,c2 -> Macro-Instruction equals :: SCMFSA_9:def 1
(if=0 a1,(a2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) +* ((insloc ((card a2) + 4)) .--> (goto (insloc 0)));
correctness
coherence
(if=0 c1,(c2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) +* ((insloc ((card c2) + 4)) .--> (goto (insloc 0))) is Macro-Instruction
;
proof end;
func while>0 c1,c2 -> Macro-Instruction equals :: SCMFSA_9:def 2
(if>0 a1,(a2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) +* ((insloc ((card a2) + 4)) .--> (goto (insloc 0)));
correctness
coherence
(if>0 c1,(c2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) +* ((insloc ((card c2) + 4)) .--> (goto (insloc 0))) is Macro-Instruction
;
proof end;
end;

:: deftheorem Def1 defines while=0 SCMFSA_9:def 1 :
for b1 being Int-Location
for b2 being Macro-Instruction holds while=0 b1,b2 = (if=0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) +* ((insloc ((card b2) + 4)) .--> (goto (insloc 0)));

:: deftheorem Def2 defines while>0 SCMFSA_9:def 2 :
for b1 being Int-Location
for b2 being Macro-Instruction holds while>0 b1,b2 = (if>0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) +* ((insloc ((card b2) + 4)) .--> (goto (insloc 0)));

theorem Th3: :: SCMFSA_9:3
for b1 being Macro-Instruction
for b2 being Int-Location holds card (if=0 b2,SCM+FSA-Stop ,(if>0 b2,SCM+FSA-Stop ,(b1 ';' (Goto (insloc 0))))) = (card b1) + 11
proof end;

definition
let c1 be Int-Location ;
let c2 be Macro-Instruction;
func while<0 c1,c2 -> Macro-Instruction equals :: SCMFSA_9:def 3
(if=0 a1,SCM+FSA-Stop ,(if>0 a1,SCM+FSA-Stop ,(a2 ';' (Goto (insloc 0))))) +* ((insloc ((card a2) + 4)) .--> (goto (insloc 0)));
correctness
coherence
(if=0 c1,SCM+FSA-Stop ,(if>0 c1,SCM+FSA-Stop ,(c2 ';' (Goto (insloc 0))))) +* ((insloc ((card c2) + 4)) .--> (goto (insloc 0))) is Macro-Instruction
;
proof end;
end;

:: deftheorem Def3 defines while<0 SCMFSA_9:def 3 :
for b1 being Int-Location
for b2 being Macro-Instruction holds while<0 b1,b2 = (if=0 b1,SCM+FSA-Stop ,(if>0 b1,SCM+FSA-Stop ,(b2 ';' (Goto (insloc 0))))) +* ((insloc ((card b2) + 4)) .--> (goto (insloc 0)));

theorem Th4: :: SCMFSA_9:4
for b1 being Macro-Instruction
for b2 being Int-Location holds card (while=0 b2,b1) = (card b1) + 6
proof end;

theorem Th5: :: SCMFSA_9:5
for b1 being Macro-Instruction
for b2 being Int-Location holds card (while>0 b2,b1) = (card b1) + 6
proof end;

theorem Th6: :: SCMFSA_9:6
for b1 being Macro-Instruction
for b2 being Int-Location holds card (while<0 b2,b1) = (card b1) + 11
proof end;

theorem Th7: :: SCMFSA_9:7
for b1 being Int-Location
for b2 being Instruction-Location of SCM+FSA holds b1 =0_goto b2 <> halt SCM+FSA by SCMFSA_2:48, SCMFSA_2:124;

theorem Th8: :: SCMFSA_9:8
for b1 being Int-Location
for b2 being Instruction-Location of SCM+FSA holds b1 >0_goto b2 <> halt SCM+FSA by SCMFSA_2:49, SCMFSA_2:124;

theorem Th9: :: SCMFSA_9:9
for b1 being Instruction-Location of SCM+FSA holds goto b1 <> halt SCM+FSA by SCMFSA_2:47, SCMFSA_2:124;

theorem Th10: :: SCMFSA_9:10
for b1 being Int-Location
for b2 being Macro-Instruction holds
( insloc 0 in dom (while=0 b1,b2) & insloc 1 in dom (while=0 b1,b2) & insloc 0 in dom (while>0 b1,b2) & insloc 1 in dom (while>0 b1,b2) )
proof end;

theorem Th11: :: SCMFSA_9:11
for b1 being Int-Location
for b2 being Macro-Instruction holds
( (while=0 b1,b2) . (insloc 0) = b1 =0_goto (insloc 4) & (while=0 b1,b2) . (insloc 1) = goto (insloc 2) & (while>0 b1,b2) . (insloc 0) = b1 >0_goto (insloc 4) & (while>0 b1,b2) . (insloc 1) = goto (insloc 2) )
proof end;

theorem Th12: :: SCMFSA_9:12
for b1 being Int-Location
for b2 being Macro-Instruction
for b3 being Nat st b3 < 6 holds
insloc b3 in dom (while=0 b1,b2)
proof end;

theorem Th13: :: SCMFSA_9:13
for b1 being Int-Location
for b2 being Macro-Instruction
for b3 being Nat st b3 < 6 holds
insloc ((card b2) + b3) in dom (while=0 b1,b2)
proof end;

theorem Th14: :: SCMFSA_9:14
for b1 being Int-Location
for b2 being Macro-Instruction holds (while=0 b1,b2) . (insloc ((card b2) + 5)) = halt SCM+FSA
proof end;

theorem Th15: :: SCMFSA_9:15
for b1 being Int-Location
for b2 being Macro-Instruction holds (while=0 b1,b2) . (insloc 3) = goto (insloc ((card b2) + 5))
proof end;

theorem Th16: :: SCMFSA_9:16
for b1 being Int-Location
for b2 being Macro-Instruction holds (while=0 b1,b2) . (insloc 2) = goto (insloc 3)
proof end;

theorem Th17: :: SCMFSA_9:17
for b1 being Int-Location
for b2 being Macro-Instruction
for b3 being Nat st b3 < (card b2) + 6 holds
insloc b3 in dom (while=0 b1,b2)
proof end;

theorem Th18: :: SCMFSA_9:18
for b1 being State of SCM+FSA
for b2 being Macro-Instruction
for b3 being read-write Int-Location st b1 . b3 <> 0 holds
( while=0 b3,b2 is_halting_on b1 & while=0 b3,b2 is_closed_on b1 )
proof end;

theorem Th19: :: SCMFSA_9:19
for b1 being Int-Location
for b2 being Macro-Instruction
for b3 being State of SCM+FSA
for b4 being Nat st b2 is_closed_on b3 & b2 is_halting_on b3 & b4 < LifeSpan (b3 +* (b2 +* (Start-At (insloc 0)))) & IC ((Computation (b3 +* ((while=0 b1,b2) +* (Start-At (insloc 0))))) . (1 + b4)) = (IC ((Computation (b3 +* (b2 +* (Start-At (insloc 0))))) . b4)) + 4 & ((Computation (b3 +* ((while=0 b1,b2) +* (Start-At (insloc 0))))) . (1 + b4)) | (Int-Locations \/ FinSeq-Locations ) = ((Computation (b3 +* (b2 +* (Start-At (insloc 0))))) . b4) | (Int-Locations \/ FinSeq-Locations ) holds
( IC ((Computation (b3 +* ((while=0 b1,b2) +* (Start-At (insloc 0))))) . ((1 + b4) + 1)) = (IC ((Computation (b3 +* (b2 +* (Start-At (insloc 0))))) . (b4 + 1))) + 4 & ((Computation (b3 +* ((while=0 b1,b2) +* (Start-At (insloc 0))))) . ((1 + b4) + 1)) | (Int-Locations \/ FinSeq-Locations ) = ((Computation (b3 +* (b2 +* (Start-At (insloc 0))))) . (b4 + 1)) | (Int-Locations \/ FinSeq-Locations ) )
proof end;

theorem Th20: :: SCMFSA_9:20
for b1 being Int-Location
for b2 being Macro-Instruction
for b3 being State of SCM+FSA st b2 is_closed_on b3 & b2 is_halting_on b3 & IC ((Computation (b3 +* ((while=0 b1,b2) +* (Start-At (insloc 0))))) . (1 + (LifeSpan (b3 +* (b2 +* (Start-At (insloc 0))))))) = (IC ((Computation (b3 +* (b2 +* (Start-At (insloc 0))))) . (LifeSpan (b3 +* (b2 +* (Start-At (insloc 0))))))) + 4 holds
CurInstr ((Computation (b3 +* ((while=0 b1,b2) +* (Start-At (insloc 0))))) . (1 + (LifeSpan (b3 +* (b2 +* (Start-At (insloc 0))))))) = goto (insloc ((card b2) + 4))
proof end;

theorem Th21: :: SCMFSA_9:21
for b1 being Int-Location
for b2 being Macro-Instruction holds (while=0 b1,b2) . (insloc ((card b2) + 4)) = goto (insloc 0)
proof end;

theorem Th22: :: SCMFSA_9:22
for b1 being State of SCM+FSA
for b2 being Macro-Instruction
for b3 being read-write Int-Location st b2 is_closed_on b1 & b2 is_halting_on b1 & b1 . b3 = 0 holds
( IC ((Computation (b1 +* ((while=0 b3,b2) +* (Start-At (insloc 0))))) . ((LifeSpan (b1 +* (b2 +* (Start-At (insloc 0))))) + 3)) = insloc 0 & ( for b4 being Nat st b4 <= (LifeSpan (b1 +* (b2 +* (Start-At (insloc 0))))) + 3 holds
IC ((Computation (b1 +* ((while=0 b3,b2) +* (Start-At (insloc 0))))) . b4) in dom (while=0 b3,b2) ) )
proof end;

set c1 = Start-At (insloc 0);

definition
let c2 be State of SCM+FSA ;
let c3 be Macro-Instruction;
let c4 be read-write Int-Location ;
func StepWhile=0 c3,c2,c1 -> Function of NAT , product the Object-Kind of SCM+FSA means :Def4: :: SCMFSA_9:def 4
( a4 . 0 = a1 & ( for b1 being Nat holds a4 . (b1 + 1) = (Computation ((a4 . b1) +* ((while=0 a3,a2) +* (Start-At (insloc 0))))) . ((LifeSpan ((a4 . b1) +* (a2 +* (Start-At (insloc 0))))) + 3) ) );
existence
ex b1 being Function of NAT , product the Object-Kind of SCM+FSA st
( b1 . 0 = c2 & ( for b2 being Nat holds b1 . (b2 + 1) = (Computation ((b1 . b2) +* ((while=0 c4,c3) +* (Start-At (insloc 0))))) . ((LifeSpan ((b1 . b2) +* (c3 +* (Start-At (insloc 0))))) + 3) ) )
proof end;
uniqueness
for b1, b2 being Function of NAT , product the Object-Kind of SCM+FSA st b1 . 0 = c2 & ( for b3 being Nat holds b1 . (b3 + 1) = (Computation ((b1 . b3) +* ((while=0 c4,c3) +* (Start-At (insloc 0))))) . ((LifeSpan ((b1 . b3) +* (c3 +* (Start-At (insloc 0))))) + 3) ) & b2 . 0 = c2 & ( for b3 being Nat holds b2 . (b3 + 1) = (Computation ((b2 . b3) +* ((while=0 c4,c3) +* (Start-At (insloc 0))))) . ((LifeSpan ((b2 . b3) +* (c3 +* (Start-At (insloc 0))))) + 3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def4 defines StepWhile=0 SCMFSA_9:def 4 :
for b1 being State of SCM+FSA
for b2 being Macro-Instruction
for b3 being read-write Int-Location
for b4 being Function of NAT , product the Object-Kind of SCM+FSA holds
( b4 = StepWhile=0 b3,b2,b1 iff ( b4 . 0 = b1 & ( for b5 being Nat holds b4 . (b5 + 1) = (Computation ((b4 . b5) +* ((while=0 b3,b2) +* (Start-At (insloc 0))))) . ((LifeSpan ((b4 . b5) +* (b2 +* (Start-At (insloc 0))))) + 3) ) ) );

theorem Th23: :: SCMFSA_9:23
canceled;

theorem Th24: :: SCMFSA_9:24
canceled;

theorem Th25: :: SCMFSA_9:25
for b1 being State of SCM+FSA
for b2 being Macro-Instruction
for b3 being read-write Int-Location
for b4 being Nat holds (StepWhile=0 b3,b2,b1) . (b4 + 1) = (StepWhile=0 b3,b2,((StepWhile=0 b3,b2,b1) . b4)) . 1
proof end;

scheme :: SCMFSA_9:sch 1
s1{ F1( Nat) -> Nat, F2() -> Nat } :
ex b1 being Nat st
( F1(b1) = 0 & ( for b2 being Nat st F1(b2) = 0 holds
b1 <= b2 ) )
provided
E23: F1(0) = F2() and
E24: for b1 being Nat holds
( F1((b1 + 1)) < F1(b1) or F1(b1) = 0 )
proof end;

theorem Th26: :: SCMFSA_9:26
for b1, b2 being Function holds (b1 +* b2) +* b2 = b1 +* b2
proof end;

theorem Th27: :: SCMFSA_9:27
for b1, b2, b3 being Function
for b4 being set st (b1 +* b2) | b4 = b3 | b4 holds
(b3 +* b2) | b4 = (b1 +* b2) | b4
proof end;

theorem Th28: :: SCMFSA_9:28
for b1, b2, b3 being Function
for b4 being set st b1 | b4 = b3 | b4 holds
(b3 +* b2) | b4 = (b1 +* b2) | b4
proof end;

theorem Th29: :: SCMFSA_9:29
for b1, b2 being State of SCM+FSA st IC b1 = IC b2 & b1 | (Int-Locations \/ FinSeq-Locations ) = b2 | (Int-Locations \/ FinSeq-Locations ) & b1 | the Instruction-Locations of SCM+FSA = b2 | the Instruction-Locations of SCM+FSA holds
b1 = b2
proof end;

theorem Th30: :: SCMFSA_9:30
for b1 being Macro-Instruction
for b2 being read-write Int-Location
for b3 being State of SCM+FSA holds (StepWhile=0 b2,b1,b3) . (0 + 1) = (Computation (b3 +* ((while=0 b2,b1) +* (Start-At (insloc 0))))) . ((LifeSpan (b3 +* (b1 +* (Start-At (insloc 0))))) + 3)
proof end;

theorem Th31: :: SCMFSA_9:31
for b1 being Macro-Instruction
for b2 being read-write Int-Location
for b3 being State of SCM+FSA
for b4, b5 being Nat st IC ((StepWhile=0 b2,b1,b3) . b4) = insloc 0 & (StepWhile=0 b2,b1,b3) . b4 = (Computation (b3 +* ((while=0 b2,b1) +* (Start-At (insloc 0))))) . b5 holds
( (StepWhile=0 b2,b1,b3) . b4 = ((StepWhile=0 b2,b1,b3) . b4) +* ((while=0 b2,b1) +* (Start-At (insloc 0))) & (StepWhile=0 b2,b1,b3) . (b4 + 1) = (Computation (b3 +* ((while=0 b2,b1) +* (Start-At (insloc 0))))) . (b5 + ((LifeSpan (((StepWhile=0 b2,b1,b3) . b4) +* (b1 +* (Start-At (insloc 0))))) + 3)) )
proof end;

theorem Th32: :: SCMFSA_9:32
for b1 being Macro-Instruction
for b2 being read-write Int-Location
for b3 being State of SCM+FSA st ( for b4 being Nat holds
( b1 is_closed_on (StepWhile=0 b2,b1,b3) . b4 & b1 is_halting_on (StepWhile=0 b2,b1,b3) . b4 ) ) & ex b4 being Function of product the Object-Kind of SCM+FSA , NAT st
for b5 being Nat holds
( ( b4 . ((StepWhile=0 b2,b1,b3) . (b5 + 1)) < b4 . ((StepWhile=0 b2,b1,b3) . b5) or b4 . ((StepWhile=0 b2,b1,b3) . b5) = 0 ) & ( b4 . ((StepWhile=0 b2,b1,b3) . b5) = 0 implies ((StepWhile=0 b2,b1,b3) . b5) . b2 <> 0 ) & ( ((StepWhile=0 b2,b1,b3) . b5) . b2 <> 0 implies b4 . ((StepWhile=0 b2,b1,b3) . b5) = 0 ) ) holds
( while=0 b2,b1 is_halting_on b3 & while=0 b2,b1 is_closed_on b3 )
proof end;

theorem Th33: :: SCMFSA_9:33
for b1 being parahalting Macro-Instruction
for b2 being read-write Int-Location
for b3 being State of SCM+FSA st ex b4 being Function of product the Object-Kind of SCM+FSA , NAT st
for b5 being Nat holds
( ( b4 . ((StepWhile=0 b2,b1,b3) . (b5 + 1)) < b4 . ((StepWhile=0 b2,b1,b3) . b5) or b4 . ((StepWhile=0 b2,b1,b3) . b5) = 0 ) & ( b4 . ((StepWhile=0 b2,b1,b3) . b5) = 0 implies ((StepWhile=0 b2,b1,b3) . b5) . b2 <> 0 ) & ( ((StepWhile=0 b2,b1,b3) . b5) . b2 <> 0 implies b4 . ((StepWhile=0 b2,b1,b3) . b5) = 0 ) ) holds
( while=0 b2,b1 is_halting_on b3 & while=0 b2,b1 is_closed_on b3 )
proof end;

theorem Th34: :: SCMFSA_9:34
for b1 being parahalting Macro-Instruction
for b2 being read-write Int-Location st ex b3 being Function of product the Object-Kind of SCM+FSA , NAT st
for b4 being State of SCM+FSA holds
( ( b3 . ((StepWhile=0 b2,b1,b4) . 1) < b3 . b4 or b3 . b4 = 0 ) & ( b3 . b4 = 0 implies b4 . b2 <> 0 ) & ( b4 . b2 <> 0 implies b3 . b4 = 0 ) ) holds
while=0 b2,b1 is parahalting
proof end;

theorem Th35: :: SCMFSA_9:35
for b1, b2 being Instruction-Location of SCM+FSA
for b3 being Int-Location holds b1 .--> (goto b2) does_not_destroy b3
proof end;

theorem Th36: :: SCMFSA_9:36
for b1 being Instruction of SCM+FSA st b1 does_not_destroy intloc 0 holds
Macro b1 is good
proof end;

registration
let c2, c3 be good Macro-Instruction;
let c4 be Int-Location ;
cluster if=0 a3,a1,a2 -> good ;
correctness
coherence
if=0 c4,c2,c3 is good
;
proof end;
end;

registration
let c2 be good Macro-Instruction;
let c3 be Int-Location ;
cluster while=0 a2,a1 -> good ;
correctness
coherence
while=0 c3,c2 is good
;
proof end;
end;

theorem Th37: :: SCMFSA_9:37
for b1 being Int-Location
for b2 being Macro-Instruction
for b3 being Nat st b3 < 6 holds
insloc b3 in dom (while>0 b1,b2)
proof end;

theorem Th38: :: SCMFSA_9:38
for b1 being Int-Location
for b2 being Macro-Instruction
for b3 being Nat st b3 < 6 holds
insloc ((card b2) + b3) in dom (while>0 b1,b2)
proof end;

theorem Th39: :: SCMFSA_9:39
for b1 being Int-Location
for b2 being Macro-Instruction holds (while>0 b1,b2) . (insloc ((card b2) + 5)) = halt SCM+FSA
proof end;

theorem Th40: :: SCMFSA_9:40
for b1 being Int-Location
for b2 being Macro-Instruction holds (while>0 b1,b2) . (insloc 3) = goto (insloc ((card b2) + 5))
proof end;

theorem Th41: :: SCMFSA_9:41
for b1 being Int-Location
for b2 being Macro-Instruction holds (while>0 b1,b2) . (insloc 2) = goto (insloc 3)
proof end;

theorem Th42: :: SCMFSA_9:42
for b1 being Int-Location
for b2 being Macro-Instruction
for b3 being Nat st b3 < (card b2) + 6 holds
insloc b3 in dom (while>0 b1,b2)
proof end;

theorem Th43: :: SCMFSA_9:43
for b1 being State of SCM+FSA
for b2 being Macro-Instruction
for b3 being read-write Int-Location st b1 . b3 <= 0 holds
( while>0 b3,b2 is_halting_on b1 & while>0 b3,b2 is_closed_on b1 )
proof end;

theorem Th44: :: SCMFSA_9:44
for b1 being Int-Location
for b2 being Macro-Instruction
for b3 being State of SCM+FSA
for b4 being Nat st b2 is_closed_on b3 & b2 is_halting_on b3 & b4 < LifeSpan (b3 +* (b2 +* (Start-At (insloc 0)))) & IC ((Computation (b3 +* ((while>0 b1,b2) +* (Start-At (insloc 0))))) . (1 + b4)) = (IC ((Computation (b3 +* (b2 +* (Start-At (insloc 0))))) . b4)) + 4 & ((Computation (b3 +* ((while>0 b1,b2) +* (Start-At (insloc 0))))) . (1 + b4)) | (Int-Locations \/ FinSeq-Locations ) = ((Computation (b3 +* (b2 +* (Start-At (insloc 0))))) . b4) | (Int-Locations \/ FinSeq-Locations ) holds
( IC ((Computation (b3 +* ((while>0 b1,b2) +* (Start-At (insloc 0))))) . ((1 + b4) + 1)) = (IC ((Computation (b3 +* (b2 +* (Start-At (insloc 0))))) . (b4 + 1))) + 4 & ((Computation (b3 +* ((while>0 b1,b2) +* (Start-At (insloc 0))))) . ((1 + b4) + 1)) | (Int-Locations \/ FinSeq-Locations ) = ((Computation (b3 +* (b2 +* (Start-At (insloc 0))))) . (b4 + 1)) | (Int-Locations \/ FinSeq-Locations ) )
proof end;

theorem Th45: :: SCMFSA_9:45
for b1 being Int-Location
for b2 being Macro-Instruction
for b3 being State of SCM+FSA st b2 is_closed_on b3 & b2 is_halting_on b3 & IC ((Computation (b3 +* ((while>0 b1,b2) +* (Start-At (insloc 0))))) . (1 + (LifeSpan (b3 +* (b2 +* (Start-At (insloc 0))))))) = (IC ((Computation (b3 +* (b2 +* (Start-At (insloc 0))))) . (LifeSpan (b3 +* (b2 +* (Start-At (insloc 0))))))) + 4 holds
CurInstr ((Computation (b3 +* ((while>0 b1,b2) +* (Start-At (insloc 0))))) . (1 + (LifeSpan (b3 +* (b2 +* (Start-At (insloc 0))))))) = goto (insloc ((card b2) + 4))
proof end;

theorem Th46: :: SCMFSA_9:46
for b1 being Int-Location
for b2 being Macro-Instruction holds (while>0 b1,b2) . (insloc ((card b2) + 4)) = goto (insloc 0)
proof end;

theorem Th47: :: SCMFSA_9:47
for b1 being State of SCM+FSA
for b2 being Macro-Instruction
for b3 being read-write Int-Location st b2 is_closed_on b1 & b2 is_halting_on b1 & b1 . b3 > 0 holds
( IC ((Computation (b1 +* ((while>0 b3,b2) +* (Start-At (insloc 0))))) . ((LifeSpan (b1 +* (b2 +* (Start-At (insloc 0))))) + 3)) = insloc 0 & ( for b4 being Nat st b4 <= (LifeSpan (b1 +* (b2 +* (Start-At (insloc 0))))) + 3 holds
IC ((Computation (b1 +* ((while>0 b3,b2) +* (Start-At (insloc 0))))) . b4) in dom (while>0 b3,b2) ) )
proof end;

set c2 = Start-At (insloc 0);

definition
let c3 be State of SCM+FSA ;
let c4 be Macro-Instruction;
let c5 be read-write Int-Location ;
func StepWhile>0 c3,c2,c1 -> Function of NAT , product the Object-Kind of SCM+FSA means :Def5: :: SCMFSA_9:def 5
( a4 . 0 = a1 & ( for b1 being Nat holds a4 . (b1 + 1) = (Computation ((a4 . b1) +* ((while>0 a3,a2) +* (Start-At (insloc 0))))) . ((LifeSpan ((a4 . b1) +* (a2 +* (Start-At (insloc 0))))) + 3) ) );
existence
ex b1 being Function of NAT , product the Object-Kind of SCM+FSA st
( b1 . 0 = c3 & ( for b2 being Nat holds b1 . (b2 + 1) = (Computation ((b1 . b2) +* ((while>0 c5,c4) +* (Start-At (insloc 0))))) . ((LifeSpan ((b1 . b2) +* (c4 +* (Start-At (insloc 0))))) + 3) ) )
proof end;
uniqueness
for b1, b2 being Function of NAT , product the Object-Kind of SCM+FSA st b1 . 0 = c3 & ( for b3 being Nat holds b1 . (b3 + 1) = (Computation ((b1 . b3) +* ((while>0 c5,c4) +* (Start-At (insloc 0))))) . ((LifeSpan ((b1 . b3) +* (c4 +* (Start-At (insloc 0))))) + 3) ) & b2 . 0 = c3 & ( for b3 being Nat holds b2 . (b3 + 1) = (Computation ((b2 . b3) +* ((while>0 c5,c4) +* (Start-At (insloc 0))))) . ((LifeSpan ((b2 . b3) +* (c4 +* (Start-At (insloc 0))))) + 3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def5 defines StepWhile>0 SCMFSA_9:def 5 :
for b1 being State of SCM+FSA
for b2 being Macro-Instruction
for b3 being read-write Int-Location
for b4 being Function of NAT , product the Object-Kind of SCM+FSA holds
( b4 = StepWhile>0 b3,b2,b1 iff ( b4 . 0 = b1 & ( for b5 being Nat holds b4 . (b5 + 1) = (Computation ((b4 . b5) +* ((while>0 b3,b2) +* (Start-At (insloc 0))))) . ((LifeSpan ((b4 . b5) +* (b2 +* (Start-At (insloc 0))))) + 3) ) ) );

theorem Th48: :: SCMFSA_9:48
canceled;

theorem Th49: :: SCMFSA_9:49
canceled;

theorem Th50: :: SCMFSA_9:50
for b1 being Nat
for b2 being State of SCM+FSA
for b3 being Macro-Instruction
for b4 being read-write Int-Location holds (StepWhile>0 b4,b3,b2) . (b1 + 1) = (StepWhile>0 b4,b3,((StepWhile>0 b4,b3,b2) . b1)) . 1
proof end;

theorem Th51: :: SCMFSA_9:51
for b1 being Macro-Instruction
for b2 being read-write Int-Location
for b3 being State of SCM+FSA holds (StepWhile>0 b2,b1,b3) . (0 + 1) = (Computation (b3 +* ((while>0 b2,b1) +* (Start-At (insloc 0))))) . ((LifeSpan (b3 +* (b1 +* (Start-At (insloc 0))))) + 3)
proof end;

theorem Th52: :: SCMFSA_9:52
for b1 being Macro-Instruction
for b2 being read-write Int-Location
for b3 being State of SCM+FSA
for b4, b5 being Nat st IC ((StepWhile>0 b2,b1,b3) . b4) = insloc 0 & (StepWhile>0 b2,b1,b3) . b4 = (Computation (b3 +* ((while>0 b2,b1) +* (Start-At (insloc 0))))) . b5 holds
( (StepWhile>0 b2,b1,b3) . b4 = ((StepWhile>0 b2,b1,b3) . b4) +* ((while>0 b2,b1) +* (Start-At (insloc 0))) & (StepWhile>0 b2,b1,b3) . (b4 + 1) = (Computation (b3 +* ((while>0 b2,b1) +* (Start-At (insloc 0))))) . (b5 + ((LifeSpan (((StepWhile>0 b2,b1,b3) . b4) +* (b1 +* (Start-At (insloc 0))))) + 3)) )
proof end;

theorem Th53: :: SCMFSA_9:53
for b1 being Macro-Instruction
for b2 being read-write Int-Location
for b3 being State of SCM+FSA st ( for b4 being Nat holds
( b1 is_closed_on (StepWhile>0 b2,b1,b3) . b4 & b1 is_halting_on (StepWhile>0 b2,b1,b3) . b4 ) ) & ex b4 being Function of product the Object-Kind of SCM+FSA , NAT st
for b5 being Nat holds
( ( b4 . ((StepWhile>0 b2,b1,b3) . (b5 + 1)) < b4 . ((StepWhile>0 b2,b1,b3) . b5) or b4 . ((StepWhile>0 b2,b1,b3) . b5) = 0 ) & ( b4 . ((StepWhile>0 b2,b1,b3) . b5) = 0 implies ((StepWhile>0 b2,b1,b3) . b5) . b2 <= 0 ) & ( ((StepWhile>0 b2,b1,b3) . b5) . b2 <= 0 implies b4 . ((StepWhile>0 b2,b1,b3) . b5) = 0 ) ) holds
( while>0 b2,b1 is_halting_on b3 & while>0 b2,b1 is_closed_on b3 )
proof end;

theorem Th54: :: SCMFSA_9:54
for b1 being parahalting Macro-Instruction
for b2 being read-write Int-Location
for b3 being State of SCM+FSA st ex b4 being Function of product the Object-Kind of SCM+FSA , NAT st
for b5 being Nat holds
( ( b4 . ((StepWhile>0 b2,b1,b3) . (b5 + 1)) < b4 . ((StepWhile>0 b2,b1,b3) . b5) or b4 . ((StepWhile>0 b2,b1,b3) . b5) = 0 ) & ( b4 . ((StepWhile>0 b2,b1,b3) . b5) = 0 implies ((StepWhile>0 b2,b1,b3) . b5) . b2 <= 0 ) & ( ((StepWhile>0 b2,b1,b3) . b5) . b2 <= 0 implies b4 . ((StepWhile>0 b2,b1,b3) . b5) = 0 ) ) holds
( while>0 b2,b1 is_halting_on b3 & while>0 b2,b1 is_closed_on b3 )
proof end;

theorem Th55: :: SCMFSA_9:55
for b1 being parahalting Macro-Instruction
for b2 being read-write Int-Location st ex b3 being Function of product the Object-Kind of SCM+FSA , NAT st
for b4 being State of SCM+FSA holds
( ( b3 . ((StepWhile>0 b2,b1,b4) . 1) < b3 . b4 or b3 . b4 = 0 ) & ( b3 . b4 = 0 implies b4 . b2 <= 0 ) & ( b4 . b2 <= 0 implies b3 . b4 = 0 ) ) holds
while>0 b2,b1 is parahalting
proof end;

registration
let c3, c4 be good Macro-Instruction;
let c5 be Int-Location ;
cluster if>0 a3,a1,a2 -> good ;
coherence
if>0 c5,c3,c4 is good
proof end;
end;

registration
let c3 be good Macro-Instruction;
let c4 be Int-Location ;
cluster while>0 a2,a1 -> good ;
correctness
coherence
while>0 c4,c3 is good
;
proof end;
end;