:: SCMFSA9A semantic presentation
theorem Th1: :: SCMFSA9A:1
theorem Th2: :: SCMFSA9A:2
canceled;
theorem Th3: :: SCMFSA9A:3
canceled;
theorem Th4: :: SCMFSA9A:4
theorem Th5: :: SCMFSA9A:5
canceled;
theorem Th6: :: SCMFSA9A:6
theorem Th7: :: SCMFSA9A:7
theorem Th8: :: SCMFSA9A:8
theorem Th9: :: SCMFSA9A:9
theorem Th10: :: SCMFSA9A:10
theorem Th11: :: SCMFSA9A:11
theorem Th12: :: SCMFSA9A:12
set c1 = Int-Locations \/ FinSeq-Locations ;
set c2 = Start-At (insloc 0);
set c3 = the Instruction-Locations of SCM+FSA ;
theorem Th13: :: SCMFSA9A:13
theorem Th14: :: SCMFSA9A:14
theorem Th15: :: SCMFSA9A:15
theorem Th16: :: SCMFSA9A:16
Lemma12:
for b1 being Int-Location
for b2 being Macro-Instruction holds
( insloc ((card b2) + 4) in dom (if=0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) & (if=0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) . (insloc ((card b2) + 4)) = goto ((insloc 0) + ((card b2) + 4)) )
Lemma13:
for b1 being Int-Location
for b2 being Macro-Instruction holds UsedIntLoc (if=0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) = UsedIntLoc ((if=0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) +* ((insloc ((card b2) + 4)) .--> (goto (insloc 0))))
Lemma14:
for b1 being Int-Location
for b2 being Macro-Instruction holds UsedInt*Loc (if=0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) = UsedInt*Loc ((if=0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) +* ((insloc ((card b2) + 4)) .--> (goto (insloc 0))))
theorem Th17: :: SCMFSA9A:17
theorem Th18: :: SCMFSA9A:18
definition
let c
4 be
State of
SCM+FSA ;
let c
5 be
read-write Int-Location ;
let c
6 be
Macro-Instruction;
pred ProperBodyWhile=0 c
2,c
3,c
1 means :
Def1:
:: SCMFSA9A:def 1
for b
1 being
Nat holds
(
((StepWhile=0 a2,a3,a1) . b1) . a
2 = 0 implies ( a
3 is_closed_on (StepWhile=0 a2,a3,a1) . b
1 & a
3 is_halting_on (StepWhile=0 a2,a3,a1) . b
1 ) );
pred WithVariantWhile=0 c
2,c
3,c
1 means :
Def2:
:: SCMFSA9A:def 2
ex b
1 being
Function of
product the
Object-Kind of
SCM+FSA ,
NAT st
for b
2 being
Nat holds
not ( not b
1 . ((StepWhile=0 a2,a3,a1) . (b2 + 1)) < b
1 . ((StepWhile=0 a2,a3,a1) . b2) & not
((StepWhile=0 a2,a3,a1) . b2) . a
2 <> 0 );
end;
:: deftheorem Def1 defines ProperBodyWhile=0 SCMFSA9A:def 1 :
:: deftheorem Def2 defines WithVariantWhile=0 SCMFSA9A:def 2 :
theorem Th19: :: SCMFSA9A:19
theorem Th20: :: SCMFSA9A:20
theorem Th21: :: SCMFSA9A:21
theorem Th22: :: SCMFSA9A:22
theorem Th23: :: SCMFSA9A:23
theorem Th24: :: SCMFSA9A:24
theorem Th25: :: SCMFSA9A:25
for b
1 being
State of
SCM+FSA for b
2 being
read-write Int-Location for b
3 being
Macro-Instructionfor b
4 being
Nat holds
( ( ( b
3 is_halting_on Initialize ((StepWhile=0 b2,b3,b1) . b4) & b
3 is_closed_on Initialize ((StepWhile=0 b2,b3,b1) . b4) ) or b
3 is
parahalting ) &
((StepWhile=0 b2,b3,b1) . b4) . b
2 = 0 &
((StepWhile=0 b2,b3,b1) . b4) . (intloc 0) = 1 implies
((StepWhile=0 b2,b3,b1) . (b4 + 1)) | (Int-Locations \/ FinSeq-Locations ) = (IExec b3,((StepWhile=0 b2,b3,b1) . b4)) | (Int-Locations \/ FinSeq-Locations ) )
theorem Th26: :: SCMFSA9A:26
theorem Th27: :: SCMFSA9A:27
definition
let c
4 be
State of
SCM+FSA ;
let c
5 be
read-write Int-Location ;
let c
6 be
Macro-Instruction;
assume that E24:
(
ProperBodyWhile=0 c
5,c
6,c
4 or c
6 is
parahalting )
and E25:
WithVariantWhile=0 c
5,c
6,c
4
;
func ExitsAtWhile=0 c
2,c
3,c
1 -> Nat means :
Def3:
:: SCMFSA9A:def 3
ex b
1 being
Nat st
( a
4 = b
1 &
((StepWhile=0 a2,a3,a1) . b1) . a
2 <> 0 & ( for b
2 being
Nat holds
(
((StepWhile=0 a2,a3,a1) . b2) . a
2 <> 0 implies b
1 <= b
2 ) ) &
((Computation (a1 +* ((while=0 a2,a3) +* (Start-At (insloc 0))))) . (LifeSpan (a1 +* ((while=0 a2,a3) +* (Start-At (insloc 0)))))) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile=0 a2,a3,a1) . b1) | (Int-Locations \/ FinSeq-Locations ) );
existence
ex b1, b2 being Nat st
( b1 = b2 & ((StepWhile=0 c5,c6,c4) . b2) . c5 <> 0 & ( for b3 being Nat holds
( ((StepWhile=0 c5,c6,c4) . b3) . c5 <> 0 implies b2 <= b3 ) ) & ((Computation (c4 +* ((while=0 c5,c6) +* (Start-At (insloc 0))))) . (LifeSpan (c4 +* ((while=0 c5,c6) +* (Start-At (insloc 0)))))) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile=0 c5,c6,c4) . b2) | (Int-Locations \/ FinSeq-Locations ) )
uniqueness
for b1, b2 being Nat holds
( ex b3 being Nat st
( b1 = b3 & ((StepWhile=0 c5,c6,c4) . b3) . c5 <> 0 & ( for b4 being Nat holds
( ((StepWhile=0 c5,c6,c4) . b4) . c5 <> 0 implies b3 <= b4 ) ) & ((Computation (c4 +* ((while=0 c5,c6) +* (Start-At (insloc 0))))) . (LifeSpan (c4 +* ((while=0 c5,c6) +* (Start-At (insloc 0)))))) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile=0 c5,c6,c4) . b3) | (Int-Locations \/ FinSeq-Locations ) ) & ex b3 being Nat st
( b2 = b3 & ((StepWhile=0 c5,c6,c4) . b3) . c5 <> 0 & ( for b4 being Nat holds
( ((StepWhile=0 c5,c6,c4) . b4) . c5 <> 0 implies b3 <= b4 ) ) & ((Computation (c4 +* ((while=0 c5,c6) +* (Start-At (insloc 0))))) . (LifeSpan (c4 +* ((while=0 c5,c6) +* (Start-At (insloc 0)))))) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile=0 c5,c6,c4) . b3) | (Int-Locations \/ FinSeq-Locations ) ) implies b1 = b2 )
end;
:: deftheorem Def3 defines ExitsAtWhile=0 SCMFSA9A:def 3 :
for b
1 being
State of
SCM+FSA for b
2 being
read-write Int-Location for b
3 being
Macro-Instruction holds
( (
ProperBodyWhile=0 b
2,b
3,b
1 or b
3 is
parahalting ) &
WithVariantWhile=0 b
2,b
3,b
1 implies for b
4 being
Nat holds
( b
4 = ExitsAtWhile=0 b
2,b
3,b
1 iff ex b
5 being
Nat st
( b
4 = b
5 &
((StepWhile=0 b2,b3,b1) . b5) . b
2 <> 0 & ( for b
6 being
Nat holds
(
((StepWhile=0 b2,b3,b1) . b6) . b
2 <> 0 implies b
5 <= b
6 ) ) &
((Computation (b1 +* ((while=0 b2,b3) +* (Start-At (insloc 0))))) . (LifeSpan (b1 +* ((while=0 b2,b3) +* (Start-At (insloc 0)))))) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile=0 b2,b3,b1) . b5) | (Int-Locations \/ FinSeq-Locations ) ) ) );
theorem Th28: :: SCMFSA9A:28
theorem Th29: :: SCMFSA9A:29
for b
1 being
State of
SCM+FSA for b
2 being
read-write Int-Location for b
3 being
Macro-Instruction holds
( (
ProperBodyWhile=0 b
2,b
3,
Initialize b
1 or b
3 is
parahalting ) &
WithVariantWhile=0 b
2,b
3,
Initialize b
1 implies
(IExec (while=0 b2,b3),b1) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile=0 b2,b3,(Initialize b1)) . (ExitsAtWhile=0 b2,b3,(Initialize b1))) | (Int-Locations \/ FinSeq-Locations ) )
Lemma25:
for b1 being Int-Location
for b2 being Macro-Instruction holds
( insloc ((card b2) + 4) in dom (if>0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) & (if>0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) . (insloc ((card b2) + 4)) = goto ((insloc 0) + ((card b2) + 4)) )
Lemma26:
for b1 being Int-Location
for b2 being Macro-Instruction holds UsedIntLoc (if>0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) = UsedIntLoc ((if>0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) +* ((insloc ((card b2) + 4)) .--> (goto (insloc 0))))
Lemma27:
for b1 being Int-Location
for b2 being Macro-Instruction holds UsedInt*Loc (if>0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) = UsedInt*Loc ((if>0 b1,(b2 ';' (Goto (insloc 0))),SCM+FSA-Stop ) +* ((insloc ((card b2) + 4)) .--> (goto (insloc 0))))
theorem Th30: :: SCMFSA9A:30
theorem Th31: :: SCMFSA9A:31
definition
let c
4 be
State of
SCM+FSA ;
let c
5 be
read-write Int-Location ;
let c
6 be
Macro-Instruction;
pred ProperBodyWhile>0 c
2,c
3,c
1 means :
Def4:
:: SCMFSA9A:def 4
for b
1 being
Nat holds
(
((StepWhile>0 a2,a3,a1) . b1) . a
2 > 0 implies ( a
3 is_closed_on (StepWhile>0 a2,a3,a1) . b
1 & a
3 is_halting_on (StepWhile>0 a2,a3,a1) . b
1 ) );
pred WithVariantWhile>0 c
2,c
3,c
1 means :
Def5:
:: SCMFSA9A:def 5
ex b
1 being
Function of
product the
Object-Kind of
SCM+FSA ,
NAT st
for b
2 being
Nat holds
not ( not b
1 . ((StepWhile>0 a2,a3,a1) . (b2 + 1)) < b
1 . ((StepWhile>0 a2,a3,a1) . b2) & not
((StepWhile>0 a2,a3,a1) . b2) . a
2 <= 0 );
end;
:: deftheorem Def4 defines ProperBodyWhile>0 SCMFSA9A:def 4 :
:: deftheorem Def5 defines WithVariantWhile>0 SCMFSA9A:def 5 :
theorem Th32: :: SCMFSA9A:32
theorem Th33: :: SCMFSA9A:33
theorem Th34: :: SCMFSA9A:34
theorem Th35: :: SCMFSA9A:35
theorem Th36: :: SCMFSA9A:36
theorem Th37: :: SCMFSA9A:37
theorem Th38: :: SCMFSA9A:38
for b
1 being
State of
SCM+FSA for b
2 being
read-write Int-Location for b
3 being
Macro-Instructionfor b
4 being
Nat holds
( ( ( b
3 is_halting_on Initialize ((StepWhile>0 b2,b3,b1) . b4) & b
3 is_closed_on Initialize ((StepWhile>0 b2,b3,b1) . b4) ) or b
3 is
parahalting ) &
((StepWhile>0 b2,b3,b1) . b4) . b
2 > 0 &
((StepWhile>0 b2,b3,b1) . b4) . (intloc 0) = 1 implies
((StepWhile>0 b2,b3,b1) . (b4 + 1)) | (Int-Locations \/ FinSeq-Locations ) = (IExec b3,((StepWhile>0 b2,b3,b1) . b4)) | (Int-Locations \/ FinSeq-Locations ) )
theorem Th39: :: SCMFSA9A:39
theorem Th40: :: SCMFSA9A:40
definition
let c
4 be
State of
SCM+FSA ;
let c
5 be
read-write Int-Location ;
let c
6 be
Macro-Instruction;
assume that E39:
(
ProperBodyWhile>0 c
5,c
6,c
4 or c
6 is
parahalting )
and E40:
WithVariantWhile>0 c
5,c
6,c
4
;
func ExitsAtWhile>0 c
2,c
3,c
1 -> Nat means :
Def6:
:: SCMFSA9A:def 6
ex b
1 being
Nat st
( a
4 = b
1 &
((StepWhile>0 a2,a3,a1) . b1) . a
2 <= 0 & ( for b
2 being
Nat holds
(
((StepWhile>0 a2,a3,a1) . b2) . a
2 <= 0 implies b
1 <= b
2 ) ) &
((Computation (a1 +* ((while>0 a2,a3) +* (Start-At (insloc 0))))) . (LifeSpan (a1 +* ((while>0 a2,a3) +* (Start-At (insloc 0)))))) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile>0 a2,a3,a1) . b1) | (Int-Locations \/ FinSeq-Locations ) );
existence
ex b1, b2 being Nat st
( b1 = b2 & ((StepWhile>0 c5,c6,c4) . b2) . c5 <= 0 & ( for b3 being Nat holds
( ((StepWhile>0 c5,c6,c4) . b3) . c5 <= 0 implies b2 <= b3 ) ) & ((Computation (c4 +* ((while>0 c5,c6) +* (Start-At (insloc 0))))) . (LifeSpan (c4 +* ((while>0 c5,c6) +* (Start-At (insloc 0)))))) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile>0 c5,c6,c4) . b2) | (Int-Locations \/ FinSeq-Locations ) )
uniqueness
for b1, b2 being Nat holds
( ex b3 being Nat st
( b1 = b3 & ((StepWhile>0 c5,c6,c4) . b3) . c5 <= 0 & ( for b4 being Nat holds
( ((StepWhile>0 c5,c6,c4) . b4) . c5 <= 0 implies b3 <= b4 ) ) & ((Computation (c4 +* ((while>0 c5,c6) +* (Start-At (insloc 0))))) . (LifeSpan (c4 +* ((while>0 c5,c6) +* (Start-At (insloc 0)))))) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile>0 c5,c6,c4) . b3) | (Int-Locations \/ FinSeq-Locations ) ) & ex b3 being Nat st
( b2 = b3 & ((StepWhile>0 c5,c6,c4) . b3) . c5 <= 0 & ( for b4 being Nat holds
( ((StepWhile>0 c5,c6,c4) . b4) . c5 <= 0 implies b3 <= b4 ) ) & ((Computation (c4 +* ((while>0 c5,c6) +* (Start-At (insloc 0))))) . (LifeSpan (c4 +* ((while>0 c5,c6) +* (Start-At (insloc 0)))))) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile>0 c5,c6,c4) . b3) | (Int-Locations \/ FinSeq-Locations ) ) implies b1 = b2 )
end;
:: deftheorem Def6 defines ExitsAtWhile>0 SCMFSA9A:def 6 :
for b
1 being
State of
SCM+FSA for b
2 being
read-write Int-Location for b
3 being
Macro-Instruction holds
( (
ProperBodyWhile>0 b
2,b
3,b
1 or b
3 is
parahalting ) &
WithVariantWhile>0 b
2,b
3,b
1 implies for b
4 being
Nat holds
( b
4 = ExitsAtWhile>0 b
2,b
3,b
1 iff ex b
5 being
Nat st
( b
4 = b
5 &
((StepWhile>0 b2,b3,b1) . b5) . b
2 <= 0 & ( for b
6 being
Nat holds
(
((StepWhile>0 b2,b3,b1) . b6) . b
2 <= 0 implies b
5 <= b
6 ) ) &
((Computation (b1 +* ((while>0 b2,b3) +* (Start-At (insloc 0))))) . (LifeSpan (b1 +* ((while>0 b2,b3) +* (Start-At (insloc 0)))))) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile>0 b2,b3,b1) . b5) | (Int-Locations \/ FinSeq-Locations ) ) ) );
theorem Th41: :: SCMFSA9A:41
theorem Th42: :: SCMFSA9A:42
for b
1 being
State of
SCM+FSA for b
2 being
read-write Int-Location for b
3 being
Macro-Instruction holds
( (
ProperBodyWhile>0 b
2,b
3,
Initialize b
1 or b
3 is
parahalting ) &
WithVariantWhile>0 b
2,b
3,
Initialize b
1 implies
(IExec (while>0 b2,b3),b1) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile>0 b2,b3,(Initialize b1)) . (ExitsAtWhile>0 b2,b3,(Initialize b1))) | (Int-Locations \/ FinSeq-Locations ) )
theorem Th43: :: SCMFSA9A:43
theorem Th44: :: SCMFSA9A:44
Lemma42:
for b1 being State of SCM+FSA
for b2 being Macro-Instruction holds
( b1 . (intloc 0) = 1 implies ( b2 is_closed_on b1 iff b2 is_closed_on Initialize b1 ) )
Lemma43:
for b1 being State of SCM+FSA
for b2 being Macro-Instruction holds
( b1 . (intloc 0) = 1 implies ( ( b2 is_closed_on b1 & b2 is_halting_on b1 implies ( b2 is_closed_on Initialize b1 & b2 is_halting_on Initialize b1 ) ) & ( b2 is_closed_on Initialize b1 & b2 is_halting_on Initialize b1 implies ( b2 is_closed_on b1 & b2 is_halting_on b1 ) ) ) )
theorem Th45: :: SCMFSA9A:45
for b
1 being
State of
SCM+FSA for b
2 being
read-write Int-Location for b
3 being
good Macro-Instruction holds
( b
1 . (intloc 0) = 1 &
ProperBodyWhile>0 b
2,b
3,b
1 &
WithVariantWhile>0 b
2,b
3,b
1 implies for b
4, b
5 being
Nat holds
( b
4 <> b
5 & b
4 <= ExitsAtWhile>0 b
2,b
3,b
1 & b
5 <= ExitsAtWhile>0 b
2,b
3,b
1 implies (
(StepWhile>0 b2,b3,b1) . b
4 <> (StepWhile>0 b2,b3,b1) . b
5 &
((StepWhile>0 b2,b3,b1) . b4) | (Int-Locations \/ FinSeq-Locations ) <> ((StepWhile>0 b2,b3,b1) . b5) | (Int-Locations \/ FinSeq-Locations ) ) ) )
:: deftheorem Def7 defines on_data_only SCMFSA9A:def 7 :
theorem Th46: :: SCMFSA9A:46
for b
1 being
State of
SCM+FSA for b
2 being
read-write Int-Location for b
3 being
good Macro-Instruction holds
not ( b
1 . (intloc 0) = 1 &
ProperBodyWhile>0 b
2,b
3,b
1 &
WithVariantWhile>0 b
2,b
3,b
1 & ( for b
4 being
Function of
product the
Object-Kind of
SCM+FSA ,
NAT holds
not ( b
4 is
on_data_only & ( for b
5 being
Nat holds
not ( not b
4 . ((StepWhile>0 b2,b3,b1) . (b5 + 1)) < b
4 . ((StepWhile>0 b2,b3,b1) . b5) & not
((StepWhile>0 b2,b3,b1) . b5) . b
2 <= 0 ) ) ) ) )
theorem Th47: :: SCMFSA9A:47
definition
let c
4, c
5 be
Int-Location ;
set c
6 = 1
-stRWNotIn {c4,c5};
set c
7 = 2
-ndRWNotIn {c4,c5};
set c
8 = 3
-rdRWNotIn {c4,c5};
func Fusc_macro c
1,c
2 -> Macro-Instruction equals :: SCMFSA9A:def 8
(((SubFrom a2,a2) ';' ((1 -stRWNotIn {a1,a2}) := (intloc 0))) ';' ((2 -ndRWNotIn {a1,a2}) := a1)) ';' (while>0 (2 -ndRWNotIn {a1,a2}),((((3 -rdRWNotIn {a1,a2}) := 2) ';' (Divide (2 -ndRWNotIn {a1,a2}),(3 -rdRWNotIn {a1,a2}))) ';' (if=0 (3 -rdRWNotIn {a1,a2}),(Macro (AddTo (1 -stRWNotIn {a1,a2}),a2)),(Macro (AddTo a2,(1 -stRWNotIn {a1,a2}))))));
correctness
coherence
(((SubFrom c5,c5) ';' ((1 -stRWNotIn {c4,c5}) := (intloc 0))) ';' ((2 -ndRWNotIn {c4,c5}) := c4)) ';' (while>0 (2 -ndRWNotIn {c4,c5}),((((3 -rdRWNotIn {c4,c5}) := 2) ';' (Divide (2 -ndRWNotIn {c4,c5}),(3 -rdRWNotIn {c4,c5}))) ';' (if=0 (3 -rdRWNotIn {c4,c5}),(Macro (AddTo (1 -stRWNotIn {c4,c5}),c5)),(Macro (AddTo c5,(1 -stRWNotIn {c4,c5})))))) is Macro-Instruction;
;
end;
:: deftheorem Def8 defines Fusc_macro SCMFSA9A:def 8 :
for b
1, b
2 being
Int-Location holds
Fusc_macro b
1,b
2 = (((SubFrom b2,b2) ';' ((1 -stRWNotIn {b1,b2}) := (intloc 0))) ';' ((2 -ndRWNotIn {b1,b2}) := b1)) ';' (while>0 (2 -ndRWNotIn {b1,b2}),((((3 -rdRWNotIn {b1,b2}) := 2) ';' (Divide (2 -ndRWNotIn {b1,b2}),(3 -rdRWNotIn {b1,b2}))) ';' (if=0 (3 -rdRWNotIn {b1,b2}),(Macro (AddTo (1 -stRWNotIn {b1,b2}),b2)),(Macro (AddTo b2,(1 -stRWNotIn {b1,b2}))))));
theorem Th48: :: SCMFSA9A:48