:: SCPQSORT semantic presentation
Lemma1:
for b1 being State of SCMPDS
for b2, b3 being shiftable Program-block
for b4 being Nat holds (b2 ';' (Goto b4)) ';' b3 is shiftable
theorem Th1: :: SCPQSORT:1
set c1 = the Instruction-Locations of SCMPDS ;
set c2 = SCM-Data-Loc ;
Lemma3:
for b1 being Int_position
for b2 being Integer
for b3 being Program-block holds while>0 b1,b2,b3 = (b1,b2 <=0_goto ((card b3) + 2)) ';' (b3 ';' (goto (- ((card b3) + 1))))
Lemma4:
for b1 being Program-block
for b2 being Int_position
for b3 being Integer holds Shift b1,1 c= while>0 b2,b3,b1
theorem Th2: :: SCPQSORT:2
theorem Th3: :: SCPQSORT:3
theorem Th4: :: SCPQSORT:4
theorem Th5: :: SCPQSORT:5
for b
1 being
State of
SCMPDS for b
2 being
shiftable No-StopCode Program-blockfor b
3, b
4, b
5 being
Int_position for b
6, b
7 being
Integer holds
(
card b
2 > 0 & b
1 . b
4 >= b
7 + (b1 . (DataLoc (b1 . b3),b6)) & ( for b
8 being
State of
SCMPDS holds
( b
8 . b
4 >= b
7 + (b8 . (DataLoc (b1 . b3),b6)) & b
8 . b
5 = b
1 . b
5 & b
8 . b
3 = b
1 . b
3 & b
8 . (DataLoc (b1 . b3),b6) > 0 implies (
(IExec b2,b8) . b
3 = b
8 . b
3 & b
2 is_closed_on b
8 & b
2 is_halting_on b
8 &
(IExec b2,b8) . (DataLoc (b1 . b3),b6) < b
8 . (DataLoc (b1 . b3),b6) &
(IExec b2,b8) . b
4 >= b
7 + ((IExec b2,b8) . (DataLoc (b1 . b3),b6)) &
(IExec b2,b8) . b
5 = b
8 . b
5 ) ) ) implies (
while>0 b
3,b
6,b
2 is_closed_on b
1 &
while>0 b
3,b
6,b
2 is_halting_on b
1 & ( b
1 . (DataLoc (b1 . b3),b6) > 0 implies
IExec (while>0 b3,b6,b2),b
1 = IExec (while>0 b3,b6,b2),
(IExec b2,b1) ) ) )
theorem Th6: :: SCPQSORT:6
for b
1 being
State of
SCMPDS for b
2 being
shiftable No-StopCode Program-blockfor b
3, b
4, b
5 being
Int_position for b
6, b
7 being
Integer holds
(
card b
2 > 0 & b
1 . b
4 >= b
7 & ( for b
8 being
State of
SCMPDS holds
( b
8 . b
4 >= b
7 & b
8 . b
5 = b
1 . b
5 & b
8 . b
3 = b
1 . b
3 & b
8 . (DataLoc (b1 . b3),b6) > 0 implies (
(IExec b2,b8) . b
3 = b
8 . b
3 & b
2 is_closed_on b
8 & b
2 is_halting_on b
8 &
(IExec b2,b8) . (DataLoc (b1 . b3),b6) < b
8 . (DataLoc (b1 . b3),b6) &
(IExec b2,b8) . b
4 >= b
7 &
(IExec b2,b8) . b
5 = b
8 . b
5 ) ) ) implies (
while>0 b
3,b
6,b
2 is_closed_on b
1 &
while>0 b
3,b
6,b
2 is_halting_on b
1 & ( b
1 . (DataLoc (b1 . b3),b6) > 0 implies
IExec (while>0 b3,b6,b2),b
1 = IExec (while>0 b3,b6,b2),
(IExec b2,b1) ) ) )
theorem Th7: :: SCPQSORT:7
for b
1 being
State of
SCMPDS for b
2 being
shiftable No-StopCode Program-blockfor b
3, b
4, b
5, b
6, b
7 being
Int_position for b
8, b
9, b
10 being
Integer holds
(
card b
2 > 0 & b
1 . b
7 = ((b1 . b6) - b9) + (b1 . b4) & b
10 <= (b1 . b6) - b
9 & ( for b
11 being
State of
SCMPDS holds
( b
11 . b
7 = ((b11 . b6) - b9) + (b11 . b4) & b
10 <= (b11 . b6) - b
9 & b
11 . b
5 = b
1 . b
5 & b
11 . b
3 = b
1 . b
3 & b
11 . (DataLoc (b1 . b3),b8) > 0 implies (
(IExec b2,b11) . b
3 = b
11 . b
3 & b
2 is_closed_on b
11 & b
2 is_halting_on b
11 &
(IExec b2,b11) . (DataLoc (b1 . b3),b8) < b
11 . (DataLoc (b1 . b3),b8) &
(IExec b2,b11) . b
7 = (((IExec b2,b11) . b6) - b9) + ((IExec b2,b11) . b4) & b
10 <= ((IExec b2,b11) . b6) - b
9 &
(IExec b2,b11) . b
5 = b
11 . b
5 ) ) ) implies (
while>0 b
3,b
8,b
2 is_closed_on b
1 &
while>0 b
3,b
8,b
2 is_halting_on b
1 & ( b
1 . (DataLoc (b1 . b3),b8) > 0 implies
IExec (while>0 b3,b8,b2),b
1 = IExec (while>0 b3,b8,b2),
(IExec b2,b1) ) ) )
theorem Th8: :: SCPQSORT:8
theorem Th9: :: SCPQSORT:9
theorem Th10: :: SCPQSORT:10
theorem Th11: :: SCPQSORT:11
Lemma15:
for b1 being State of SCMPDS
for b2 being shiftable No-StopCode Program-block
for b3 being Int_position
for b4, b5 being Integer
for b6, b7 being FinSequence of INT
for b8, b9, b10 being Nat holds
( card b2 > 0 & b1 . b3 = b5 & len b6 = b9 & len b7 = b9 & b6 is_FinSequence_on b1,b8 & b7 is_FinSequence_on IExec (while>0 b3,b4,b2),b1,b8 & 1 = b1 . (DataLoc b5,b4) & b10 = (b8 + b9) + 1 & b8 + 1 = b1 . (intpos b10) & b8 + b9 = b1 . (intpos (b10 + 1)) & ( for b11 being State of SCMPDS
for b12, b13 being FinSequence of INT
for b14, b15, b16, b17 being Nat holds
( b11 . b3 = b5 & (2 * b14) + 1 = b11 . (DataLoc b5,b4) & b15 = ((b8 + b9) + (2 * b14)) + 1 & b8 + b16 = b11 . (intpos b15) & b8 + b17 = b11 . (intpos (b15 + 1)) & ( ( 1 <= b16 & b17 <= b9 ) or b16 >= b17 ) implies ( b2 is_closed_on b11 & b2 is_halting_on b11 & (IExec b2,b11) . b3 = b11 . b3 & ( for b18 being Nat holds
( 1 <= b18 & b18 < (2 * b14) + 1 implies (IExec b2,b11) . (intpos ((b8 + b9) + b18)) = b11 . (intpos ((b8 + b9) + b18)) ) ) & ( b16 >= b17 implies ( (IExec b2,b11) . (DataLoc b5,b4) = (2 * b14) - 1 & ( for b18 being Nat holds
( 1 <= b18 & b18 <= b9 implies (IExec b2,b11) . (intpos (b8 + b18)) = b11 . (intpos (b8 + b18)) ) ) ) ) & ( b16 < b17 implies ( (IExec b2,b11) . (DataLoc b5,b4) = (2 * b14) + 3 & ( for b18 being Nat holds
( ( ( 1 <= b18 & b18 < b16 ) or ( b17 < b18 & b18 <= b9 ) ) implies (IExec b2,b11) . (intpos (b8 + b18)) = b11 . (intpos (b8 + b18)) ) ) & ex b18 being Nat st
( b16 <= b18 & b18 <= b17 & b8 + b16 = (IExec b2,b11) . (intpos b15) & (b8 + b18) - 1 = (IExec b2,b11) . (intpos (b15 + 1)) & (b8 + b18) + 1 = (IExec b2,b11) . (intpos (b15 + 2)) & b8 + b17 = (IExec b2,b11) . (intpos (b15 + 3)) & ( for b19 being Nat holds
( b16 <= b19 & b19 < b18 implies (IExec b2,b11) . (intpos (b8 + b19)) <= (IExec b2,b11) . (intpos (b8 + b18)) ) ) & ( for b19 being Nat holds
( b18 < b19 & b19 <= b17 implies (IExec b2,b11) . (intpos (b8 + b19)) >= (IExec b2,b11) . (intpos (b8 + b18)) ) ) ) ) ) & ( b12 is_FinSequence_on b11,b8 & b13 is_FinSequence_on IExec b2,b11,b8 & len b12 = b9 & len b13 = b9 implies b12,b13 are_fiberwise_equipotent ) ) ) ) implies ( while>0 b3,b4,b2 is_halting_on b1 & b6,b7 are_fiberwise_equipotent & b7 is_non_decreasing_on 1,b9 ) )
Lemma16:
for b1 being State of SCMPDS
for b2 being shiftable No-StopCode Program-block
for b3 being Int_position
for b4, b5 being Integer
for b6, b7, b8 being Nat holds
( card b2 > 0 & b1 . b3 = b5 & 1 = b1 . (DataLoc b5,b4) & b8 = (b6 + b7) + 1 & b6 + 1 = b1 . (intpos b8) & b6 + b7 = b1 . (intpos (b8 + 1)) & ( for b9 being State of SCMPDS
for b10, b11 being FinSequence of INT
for b12, b13, b14, b15 being Nat holds
( b9 . b3 = b5 & (2 * b12) + 1 = b9 . (DataLoc b5,b4) & b13 = ((b6 + b7) + (2 * b12)) + 1 & b6 + b14 = b9 . (intpos b13) & b6 + b15 = b9 . (intpos (b13 + 1)) & ( ( 1 <= b14 & b15 <= b7 ) or b14 >= b15 ) implies ( b2 is_closed_on b9 & b2 is_halting_on b9 & (IExec b2,b9) . b3 = b9 . b3 & ( for b16 being Nat holds
( 1 <= b16 & b16 < (2 * b12) + 1 implies (IExec b2,b9) . (intpos ((b6 + b7) + b16)) = b9 . (intpos ((b6 + b7) + b16)) ) ) & ( b14 >= b15 implies ( (IExec b2,b9) . (DataLoc b5,b4) = (2 * b12) - 1 & ( for b16 being Nat holds
( 1 <= b16 & b16 <= b7 implies (IExec b2,b9) . (intpos (b6 + b16)) = b9 . (intpos (b6 + b16)) ) ) ) ) & ( b14 < b15 implies ( (IExec b2,b9) . (DataLoc b5,b4) = (2 * b12) + 3 & ( for b16 being Nat holds
( ( ( 1 <= b16 & b16 < b14 ) or ( b15 < b16 & b16 <= b7 ) ) implies (IExec b2,b9) . (intpos (b6 + b16)) = b9 . (intpos (b6 + b16)) ) ) & ex b16 being Nat st
( b14 <= b16 & b16 <= b15 & b6 + b14 = (IExec b2,b9) . (intpos b13) & (b6 + b16) - 1 = (IExec b2,b9) . (intpos (b13 + 1)) & (b6 + b16) + 1 = (IExec b2,b9) . (intpos (b13 + 2)) & b6 + b15 = (IExec b2,b9) . (intpos (b13 + 3)) & ( for b17 being Nat holds
( b14 <= b17 & b17 < b16 implies (IExec b2,b9) . (intpos (b6 + b17)) <= (IExec b2,b9) . (intpos (b6 + b16)) ) ) & ( for b17 being Nat holds
( b16 < b17 & b17 <= b15 implies (IExec b2,b9) . (intpos (b6 + b17)) >= (IExec b2,b9) . (intpos (b6 + b16)) ) ) ) ) ) & ( b10 is_FinSequence_on b9,b6 & b11 is_FinSequence_on IExec b2,b9,b6 & len b10 = b7 & len b11 = b7 implies b10,b11 are_fiberwise_equipotent ) ) ) ) implies while>0 b3,b4,b2 is_halting_on b1 )
Lemma17:
for b1 being State of SCMPDS
for b2 being shiftable No-StopCode Program-block
for b3 being Int_position
for b4, b5 being Integer
for b6, b7, b8 being Nat holds
( card b2 > 0 & b1 . b3 = b5 & 1 = b1 . (DataLoc b5,b4) & b8 = (b6 + b7) + 1 & b6 + 1 = b1 . (intpos b8) & b6 + b7 = b1 . (intpos (b8 + 1)) & ( for b9 being State of SCMPDS
for b10, b11 being FinSequence of INT
for b12, b13, b14, b15 being Nat holds
( b9 . b3 = b5 & (2 * b12) + 1 = b9 . (DataLoc b5,b4) & b13 = ((b6 + b7) + (2 * b12)) + 1 & b6 + b14 = b9 . (intpos b13) & b6 + b15 = b9 . (intpos (b13 + 1)) & ( ( 1 <= b14 & b15 <= b7 ) or b14 >= b15 ) implies ( b2 is_closed_on b9 & b2 is_halting_on b9 & (IExec b2,b9) . b3 = b9 . b3 & ( for b16 being Nat holds
( 1 <= b16 & b16 < (2 * b12) + 1 implies (IExec b2,b9) . (intpos ((b6 + b7) + b16)) = b9 . (intpos ((b6 + b7) + b16)) ) ) & ( b14 >= b15 implies ( (IExec b2,b9) . (DataLoc b5,b4) = (2 * b12) - 1 & ( for b16 being Nat holds
( 1 <= b16 & b16 <= b7 implies (IExec b2,b9) . (intpos (b6 + b16)) = b9 . (intpos (b6 + b16)) ) ) ) ) & ( b14 < b15 implies ( (IExec b2,b9) . (DataLoc b5,b4) = (2 * b12) + 3 & ( for b16 being Nat holds
( ( ( 1 <= b16 & b16 < b14 ) or ( b15 < b16 & b16 <= b7 ) ) implies (IExec b2,b9) . (intpos (b6 + b16)) = b9 . (intpos (b6 + b16)) ) ) & ex b16 being Nat st
( b14 <= b16 & b16 <= b15 & b6 + b14 = (IExec b2,b9) . (intpos b13) & (b6 + b16) - 1 = (IExec b2,b9) . (intpos (b13 + 1)) & (b6 + b16) + 1 = (IExec b2,b9) . (intpos (b13 + 2)) & b6 + b15 = (IExec b2,b9) . (intpos (b13 + 3)) & ( for b17 being Nat holds
( b14 <= b17 & b17 < b16 implies (IExec b2,b9) . (intpos (b6 + b17)) <= (IExec b2,b9) . (intpos (b6 + b16)) ) ) & ( for b17 being Nat holds
( b16 < b17 & b17 <= b15 implies (IExec b2,b9) . (intpos (b6 + b17)) >= (IExec b2,b9) . (intpos (b6 + b16)) ) ) ) ) ) & ( b10 is_FinSequence_on b9,b6 & b11 is_FinSequence_on IExec b2,b9,b6 & len b10 = b7 & len b11 = b7 implies b10,b11 are_fiberwise_equipotent ) ) ) ) implies ( while>0 b3,b4,b2 is_halting_on b1 & while>0 b3,b4,b2 is_closed_on b1 ) )
definition
func Partition -> Program-block equals :: SCPQSORT:def 1
(((((((GBP ,5 := GBP ,4) ';' (SubFrom GBP ,5,GBP ,2)) ';' (GBP ,3 := GBP ,2)) ';' (AddTo GBP ,3,1)) ';' (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))))) ';' (GBP ,6 := (intpos 4),0)) ';' ((intpos 4),0 := (intpos 2),0)) ';' ((intpos 2),0 := GBP ,6);
coherence
(((((((GBP ,5 := GBP ,4) ';' (SubFrom GBP ,5,GBP ,2)) ';' (GBP ,3 := GBP ,2)) ';' (AddTo GBP ,3,1)) ';' (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))))) ';' (GBP ,6 := (intpos 4),0)) ';' ((intpos 4),0 := (intpos 2),0)) ';' ((intpos 2),0 := GBP ,6) is Program-block
;
end;
:: deftheorem Def1 defines Partition SCPQSORT:def 1 :
Partition = (((((((GBP ,5 := GBP ,4) ';' (SubFrom GBP ,5,GBP ,2)) ';' (GBP ,3 := GBP ,2)) ';' (AddTo GBP ,3,1)) ';' (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))))) ';' (GBP ,6 := (intpos 4),0)) ';' ((intpos 4),0 := (intpos 2),0)) ';' ((intpos 2),0 := GBP ,6);
definition
let c
3, c
4 be
Nat;
set c
5 = c
4 + c
3;
func QuickSort c
1,c
2 -> Program-block equals :: SCPQSORT:def 2
((((GBP := 0) ';' (SBP := 1)) ';' (SBP ,(a2 + a1) := (a2 + 1))) ';' (SBP ,((a2 + a1) + 1) := (a2 + a1))) ';' (while>0 GBP ,1,(((GBP ,2 := SBP ,((a2 + a1) + 1)) ';' (SubFrom GBP ,2,SBP ,(a2 + a1))) ';' (if>0 GBP ,2,((((GBP ,2 := SBP ,(a2 + a1)) ';' (GBP ,4 := SBP ,((a2 + a1) + 1))) ';' Partition ) ';' ((((((SBP ,((a2 + a1) + 3) := SBP ,((a2 + a1) + 1)) ';' (SBP ,((a2 + a1) + 1) := GBP ,4)) ';' (SBP ,((a2 + a1) + 2) := GBP ,4)) ';' (AddTo SBP ,((a2 + a1) + 1),(- 1))) ';' (AddTo SBP ,((a2 + a1) + 2),1)) ';' (AddTo GBP ,1,2))),(Load (AddTo GBP ,1,(- 2))))));
coherence
((((GBP := 0) ';' (SBP := 1)) ';' (SBP ,(c4 + c3) := (c4 + 1))) ';' (SBP ,((c4 + c3) + 1) := (c4 + c3))) ';' (while>0 GBP ,1,(((GBP ,2 := SBP ,((c4 + c3) + 1)) ';' (SubFrom GBP ,2,SBP ,(c4 + c3))) ';' (if>0 GBP ,2,((((GBP ,2 := SBP ,(c4 + c3)) ';' (GBP ,4 := SBP ,((c4 + c3) + 1))) ';' Partition ) ';' ((((((SBP ,((c4 + c3) + 3) := SBP ,((c4 + c3) + 1)) ';' (SBP ,((c4 + c3) + 1) := GBP ,4)) ';' (SBP ,((c4 + c3) + 2) := GBP ,4)) ';' (AddTo SBP ,((c4 + c3) + 1),(- 1))) ';' (AddTo SBP ,((c4 + c3) + 2),1)) ';' (AddTo GBP ,1,2))),(Load (AddTo GBP ,1,(- 2)))))) is Program-block
;
end;
:: deftheorem Def2 defines QuickSort SCPQSORT:def 2 :
for b
1, b
2 being
Nat holds
QuickSort b
1,b
2 = ((((GBP := 0) ';' (SBP := 1)) ';' (SBP ,(b2 + b1) := (b2 + 1))) ';' (SBP ,((b2 + b1) + 1) := (b2 + b1))) ';' (while>0 GBP ,1,(((GBP ,2 := SBP ,((b2 + b1) + 1)) ';' (SubFrom GBP ,2,SBP ,(b2 + b1))) ';' (if>0 GBP ,2,((((GBP ,2 := SBP ,(b2 + b1)) ';' (GBP ,4 := SBP ,((b2 + b1) + 1))) ';' Partition ) ';' ((((((SBP ,((b2 + b1) + 3) := SBP ,((b2 + b1) + 1)) ';' (SBP ,((b2 + b1) + 1) := GBP ,4)) ';' (SBP ,((b2 + b1) + 2) := GBP ,4)) ';' (AddTo SBP ,((b2 + b1) + 1),(- 1))) ';' (AddTo SBP ,((b2 + b1) + 2),1)) ';' (AddTo GBP ,1,2))),(Load (AddTo GBP ,1,(- 2))))));
set c3 = GBP ,7 := GBP ,5;
set c4 = AddTo GBP ,5,(- 1);
set c5 = GBP ,6 := (intpos 4),0;
set c6 = SubFrom GBP ,6,(intpos 2),0;
set c7 = AddTo GBP ,4,(- 1);
set c8 = AddTo GBP ,7,(- 1);
set c9 = Load (GBP ,5 := 0);
set c10 = if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0));
set c11 = ((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)));
set c12 = while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))));
set c13 = GBP ,5 := GBP ,7;
set c14 = AddTo GBP ,7,(- 1);
set c15 = GBP ,6 := (intpos 2),0;
set c16 = SubFrom GBP ,6,(intpos 3),0;
set c17 = AddTo GBP ,3,1;
set c18 = AddTo GBP ,5,(- 1);
set c19 = Load (GBP ,7 := 0);
set c20 = if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0));
set c21 = ((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)));
set c22 = while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))));
set c23 = GBP ,5 := GBP ,4;
set c24 = SubFrom GBP ,5,GBP ,2;
set c25 = GBP ,3 := GBP ,2;
set c26 = AddTo GBP ,3,1;
set c27 = (((GBP ,5 := GBP ,4) ';' (SubFrom GBP ,5,GBP ,2)) ';' (GBP ,3 := GBP ,2)) ';' (AddTo GBP ,3,1);
set c28 = GBP ,6 := (intpos 4),0;
set c29 = (intpos 4),0 := (intpos 3),0;
set c30 = (intpos 3),0 := GBP ,6;
set c31 = AddTo GBP ,5,(- 2);
set c32 = AddTo GBP ,3,1;
set c33 = AddTo GBP ,4,(- 1);
set c34 = if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)));
set c35 = ((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))));
set c36 = while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))));
set c37 = GBP ,6 := (intpos 4),0;
set c38 = (intpos 4),0 := (intpos 2),0;
set c39 = (intpos 2),0 := GBP ,6;
set c40 = intpos 1;
set c41 = intpos 2;
set c42 = intpos 3;
set c43 = intpos 4;
set c44 = intpos 5;
set c45 = intpos 6;
set c46 = intpos 7;
Lemma18:
card (((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))) = 9
Lemma19:
for b1 being State of SCMPDS
for b2, b3 being Nat holds
( b1 . (intpos 2) = b2 & b1 . (intpos 4) = b3 & b2 >= 8 & b3 >= 8 & b1 . GBP = 0 & b1 . (intpos 5) > 0 implies ( (IExec (((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))),b1) . GBP = 0 & (IExec (((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))),b1) . (intpos 1) = b1 . (intpos 1) & (IExec (((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))),b1) . (intpos 2) = b1 . (intpos 2) & (IExec (((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))),b1) . (intpos 3) = b1 . (intpos 3) & ( for b4 being Nat holds
( b4 >= 8 implies (IExec (((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))),b1) . (intpos b4) = b1 . (intpos b4) ) ) & ( b1 . (intpos b2) < b1 . (intpos b3) implies ( (IExec (((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))),b1) . (intpos 5) = (b1 . (intpos 5)) - 1 & (IExec (((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))),b1) . (intpos 4) = (b1 . (intpos 4)) - 1 & (IExec (((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))),b1) . (intpos 7) = (b1 . (intpos 5)) - 1 ) ) & ( b1 . (intpos b2) >= b1 . (intpos b3) implies ( (IExec (((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))),b1) . (intpos 5) = 0 & (IExec (((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))),b1) . (intpos 4) = b1 . (intpos 4) & (IExec (((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))),b1) . (intpos 7) = b1 . (intpos 5) ) ) ) )
Lemma20:
for b1 being State of SCMPDS
for b2, b3 being Nat holds
( b1 . GBP = 0 & b1 . (intpos 5) > 0 & b1 . (intpos 4) = b2 + (b1 . (intpos 5)) & b2 >= 8 & b1 . (intpos 2) = b3 & b3 >= 8 implies ( (IExec (while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))),b1) . GBP = 0 & (IExec (while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))),b1) . (intpos 1) = b1 . (intpos 1) & (IExec (while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))),b1) . (intpos 5) = 0 & (IExec (while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))),b1) . (intpos 2) = b1 . (intpos 2) & (IExec (while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))),b1) . (intpos 3) = b1 . (intpos 3) & ( for b4 being Nat holds
( b4 >= 8 implies (IExec (while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))),b1) . (intpos b4) = b1 . (intpos b4) ) ) & ex b4 being Nat st
( b4 = (IExec (while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))),b1) . (intpos 7) & (IExec (while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))),b1) . (intpos 4) = b2 + b4 & b4 <= b1 . (intpos 5) & ( for b5 being Nat holds
not ( b2 + b4 < b5 & b5 <= b1 . (intpos 4) & not (IExec (while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))),b1) . (intpos b3) < (IExec (while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))),b1) . (intpos b5) ) ) & ( b4 = 0 or (IExec (while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))),b1) . (intpos b3) >= (IExec (while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))),b1) . (intpos (b2 + b4)) ) ) ) )
Lemma21:
for b1 being State of SCMPDS
for b2, b3 being Nat holds
( b1 . GBP = 0 & b1 . (intpos 5) > 0 & b1 . (intpos 4) = b2 + (b1 . (intpos 5)) & b2 >= 8 & b1 . (intpos 2) = b3 & b3 >= 8 implies ( while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))) is_closed_on b1 & while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0)))) is_halting_on b1 ) )
Lemma22:
card (while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) = 11
Lemma23:
card (((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))) = 9
Lemma24:
card (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))))) = 11
Lemma25:
for b1 being State of SCMPDS
for b2, b3 being Nat holds
( b1 . (intpos 2) = b2 & b1 . (intpos 3) = b3 & b2 >= 8 & b3 >= 8 & b1 . GBP = 0 & b1 . (intpos 7) > 0 implies ( (IExec (((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))),b1) . GBP = 0 & (IExec (((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))),b1) . (intpos 1) = b1 . (intpos 1) & (IExec (((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))),b1) . (intpos 2) = b1 . (intpos 2) & (IExec (((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))),b1) . (intpos 4) = b1 . (intpos 4) & ( for b4 being Nat holds
( b4 >= 8 implies (IExec (((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))),b1) . (intpos b4) = b1 . (intpos b4) ) ) & ( b1 . (intpos b2) > b1 . (intpos b3) implies ( (IExec (((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))),b1) . (intpos 7) = (b1 . (intpos 7)) - 1 & (IExec (((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))),b1) . (intpos 3) = (b1 . (intpos 3)) + 1 & (IExec (((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))),b1) . (intpos 5) = (b1 . (intpos 7)) - 1 ) ) & ( b1 . (intpos b2) <= b1 . (intpos b3) implies ( (IExec (((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))),b1) . (intpos 7) = 0 & (IExec (((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))),b1) . (intpos 3) = b1 . (intpos 3) & (IExec (((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))),b1) . (intpos 5) = b1 . (intpos 7) ) ) ) )
Lemma26:
for b1 being State of SCMPDS
for b2, b3 being Nat holds
( b1 . GBP = 0 & b1 . (intpos 7) > 0 & (b1 . (intpos 3)) + (b1 . (intpos 7)) = b2 & b1 . (intpos 3) >= 8 & b1 . (intpos 2) = b3 & b3 >= 8 implies ( (IExec (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))))),b1) . GBP = 0 & (IExec (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))))),b1) . (intpos 1) = b1 . (intpos 1) & (IExec (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))))),b1) . (intpos 7) = 0 & (IExec (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))))),b1) . (intpos 2) = b1 . (intpos 2) & (IExec (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))))),b1) . (intpos 4) = b1 . (intpos 4) & ( for b4 being Nat holds
( b4 >= 8 implies (IExec (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))))),b1) . (intpos b4) = b1 . (intpos b4) ) ) & ex b4, b5 being Nat st
( b4 = (IExec (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))))),b1) . (intpos 5) & (IExec (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))))),b1) . (intpos 3) = b5 & b5 + b4 = b2 & b4 <= b1 . (intpos 7) & ( for b6 being Nat holds
not ( b1 . (intpos 3) <= b6 & b6 < b5 & not (IExec (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))))),b1) . (intpos b3) > (IExec (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))))),b1) . (intpos b6) ) ) & ( b4 = 0 or (IExec (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))))),b1) . (intpos b3) <= (IExec (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0))))),b1) . (intpos b5) ) ) ) )
Lemma27:
for b1 being State of SCMPDS
for b2 being Nat holds
( b1 . GBP = 0 & b1 . (intpos 7) > 0 & b1 . (intpos 3) >= 8 & b1 . (intpos 2) = b2 & b2 >= 8 implies ( while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))) is_closed_on b1 & while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))) is_halting_on b1 ) )
Lemma28:
card (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))) = 29
Lemma29:
card (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))) = 31
theorem Th12: :: SCPQSORT:12
Lemma31:
for b1 being State of SCMPDS
for b2, b3 being Nat holds
( b1 . GBP = 0 & b1 . (intpos 5) > 0 & b1 . (intpos 3) = b2 & b1 . (intpos 4) = b3 & b2 > 6 & b3 > 6 implies ( (IExec (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))),b1) . GBP = 0 & (IExec (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))),b1) . (intpos 1) = b1 . (intpos 1) & (IExec (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))),b1) . (intpos 2) = b1 . (intpos 2) & (IExec (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))),b1) . (intpos b2) = b1 . (intpos b3) & (IExec (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))),b1) . (intpos b3) = b1 . (intpos b2) & (IExec (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))),b1) . (intpos 3) = (b1 . (intpos 3)) + 1 & (IExec (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))),b1) . (intpos 4) = (b1 . (intpos 4)) - 1 & (IExec (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))),b1) . (intpos 5) = (b1 . (intpos 5)) - 2 & ( for b4 being Nat holds
( b4 >= 8 & b4 <> b2 & b4 <> b3 implies (IExec (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))),b1) . (intpos b4) = b1 . (intpos b4) ) ) ) )
Lemma32:
for b1 being State of SCMPDS
for b2, b3 being Nat holds
( b1 . GBP = 0 & b1 . (intpos 5) > 0 & b1 . (intpos 4) = b3 + (b1 . (intpos 5)) & b3 = (b1 . (intpos 3)) - 1 & b1 . (intpos 2) = b2 & b2 >= 8 & b2 <= b3 implies ( ((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))) is_closed_on b1 & ((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))) is_halting_on b1 & (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . GBP = 0 & (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos 1) = b1 . (intpos 1) & (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos 2) = b2 & (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos 3) >= b1 . (intpos 3) & (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos 4) <= b1 . (intpos 4) & (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos 4) >= b3 & (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos 5) < b1 . (intpos 5) & (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos 5) >= - 1 & (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos 4) = (((IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos 3)) - 1) + ((IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos 5)) & ex b4, b5 being Nat st
( b4 = ((IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos 3)) - 1 & b5 = ((IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos 4)) + 1 & ( for b6 being Nat holds
( b6 >= 8 & b6 <> b4 & b6 <> b5 implies (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos b6) = b1 . (intpos b6) ) ) & ( ( (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos b4) = b1 . (intpos b4) & (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos b5) = b1 . (intpos b5) ) or ( b4 >= b1 . (intpos 3) & b5 <= b1 . (intpos 4) & (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos b4) = b1 . (intpos b5) & (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos b5) = b1 . (intpos b4) ) ) & ( for b6 being Nat holds
( b1 . (intpos 3) <= b6 & b6 <= b4 implies (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos b2) >= (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos b6) ) ) & ( for b6 being Nat holds
( b5 <= b6 & b6 <= b1 . (intpos 4) implies (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos b2) <= (IExec (((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))),b1) . (intpos b6) ) ) ) ) )
Lemma33:
for b1 being Integer holds
not ( b1 >= - 1 & b1 <= 0 & not b1 = - 1 & not b1 = 0 )
Lemma34:
for b1, b2 being Integer
for b3, b4, b5 being Nat holds
( b1 >= - 1 & b1 <= 0 & b4 = b2 + 1 & b2 = b3 + b1 & b5 < b4 implies b5 <= b3 )
Lemma35:
for b1, b2 being Integer
for b3, b4 being Nat holds
( b1 >= - 1 & b4 = b2 + 1 & b2 = b3 + b1 implies b3 <= b4 )
Lemma36:
for b1, b2 being State of SCMPDS
for b3, b4, b5, b6 being Nat
for b7, b8 being FinSequence of INT holds
( b7 is_FinSequence_on b1,b3 & b8 is_FinSequence_on b2,b3 & len b7 = b6 & len b8 = b6 & ( for b9 being Nat holds
( b9 >= b3 + 1 & b9 <> b4 & b9 <> b5 implies b2 . (intpos b9) = b1 . (intpos b9) ) ) & ( ( b2 . (intpos b4) = b1 . (intpos b4) & b2 . (intpos b5) = b1 . (intpos b5) ) or ( b4 >= b3 + 1 & b5 >= b3 + 1 & b4 <= b3 + b6 & b5 <= b3 + b6 & b2 . (intpos b4) = b1 . (intpos b5) & b2 . (intpos b5) = b1 . (intpos b4) ) ) implies b7,b8 are_fiberwise_equipotent )
Lemma37:
for b1, b2 being State of SCMPDS
for b3, b4, b5 being Nat
for b6, b7 being Integer holds
( ( for b8 being Nat holds
( b8 >= b3 & b8 <> b4 & b8 <> b5 implies b2 . (intpos b8) = b1 . (intpos b8) ) ) & b4 <= b5 & ( ( b2 . (intpos b4) = b1 . (intpos b4) & b2 . (intpos b5) = b1 . (intpos b5) ) or ( b6 <= b4 & b5 <= b7 & b2 . (intpos b4) = b1 . (intpos b5) & b2 . (intpos b5) = b1 . (intpos b4) ) ) implies for b8 being Nat holds
( b8 >= b3 & not ( not b8 < b6 & not b8 > b7 ) implies b2 . (intpos b8) = b1 . (intpos b8) ) )
Lemma38:
for b1 being Nat
for b2 being State of SCMPDS
for b3, b4, b5 being Nat
for b6, b7 being FinSequence of INT holds
( b2 . GBP = 0 & b2 . (intpos 5) > 0 & b2 . (intpos 4) = b4 + (b2 . (intpos 5)) & b4 = (b2 . (intpos 3)) - 1 & b2 . (intpos 2) = b3 & b3 >= b5 + 1 & b3 <= b4 & b5 + 1 <= b2 . (intpos 3) & b2 . (intpos 4) <= b5 + b1 & b6 is_FinSequence_on b2,b5 & b7 is_FinSequence_on IExec (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))),b2,b5 & b5 >= 7 & len b6 = b1 & len b7 = b1 implies ( (IExec (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))),b2) . GBP = 0 & (IExec (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))),b2) . (intpos 1) = b2 . (intpos 1) & (IExec (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))),b2) . (intpos 2) = b3 & (IExec (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))),b2) . (intpos 4) >= b3 & (IExec (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))),b2) . (intpos 4) <= b2 . (intpos 4) & b6,b7 are_fiberwise_equipotent & ( for b8 being Nat holds
( b2 . (intpos 3) <= b8 & b8 <= (IExec (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))),b2) . (intpos 4) implies (IExec (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))),b2) . (intpos b3) >= (IExec (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))),b2) . (intpos b8) ) ) & ( for b8 being Nat holds
( (IExec (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))),b2) . (intpos 4) < b8 & b8 <= b2 . (intpos 4) implies (IExec (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))),b2) . (intpos b3) <= (IExec (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))),b2) . (intpos b8) ) ) & ( for b8 being Nat holds
( b8 >= b5 + 1 & not ( not b8 < b2 . (intpos 3) & not b8 > b2 . (intpos 4) ) implies (IExec (while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1)))))),b2) . (intpos b8) = b2 . (intpos b8) ) ) ) )
Lemma39:
for b1 being State of SCMPDS
for b2, b3, b4 being Nat holds
( b1 . GBP = 0 & b1 . (intpos 5) > 0 & b1 . (intpos 4) = b3 + (b1 . (intpos 5)) & b3 = (b1 . (intpos 3)) - 1 & b1 . (intpos 2) = b2 & b2 >= b4 + 1 & b2 <= b3 & b4 >= 7 implies ( while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))) is_closed_on b1 & while>0 GBP ,5,(((while>0 GBP ,5,(((((GBP ,7 := GBP ,5) ';' (AddTo GBP ,5,(- 1))) ';' (GBP ,6 := (intpos 4),0)) ';' (SubFrom GBP ,6,(intpos 2),0)) ';' (if>0 GBP ,6,((AddTo GBP ,4,(- 1)) ';' (AddTo GBP ,7,(- 1))),(Load (GBP ,5 := 0))))) ';' (while>0 GBP ,7,(((((GBP ,5 := GBP ,7) ';' (AddTo GBP ,7,(- 1))) ';' (GBP ,6 := (intpos 2),0)) ';' (SubFrom GBP ,6,(intpos 3),0)) ';' (if>0 GBP ,6,((AddTo GBP ,3,1) ';' (AddTo GBP ,5,(- 1))),(Load (GBP ,7 := 0)))))) ';' (if>0 GBP ,5,((((((GBP ,6 := (intpos 4),0) ';' ((intpos 4),0 := (intpos 3),0)) ';' ((intpos 3),0 := GBP ,6)) ';' (AddTo GBP ,5,(- 2))) ';' (AddTo GBP ,3,1)) ';' (AddTo GBP ,4,(- 1))))) is_halting_on b1 ) )
Lemma40:
for b1 being State of SCMPDS holds
( b1 . GBP = 0 implies ( (IExec ((((GBP ,5 := GBP ,4) ';' (SubFrom GBP ,5,GBP ,2)) ';' (GBP ,3 := GBP ,2)) ';' (AddTo GBP ,3,1)),b1) . GBP = 0 & (IExec ((((GBP ,5 := GBP ,4) ';' (SubFrom GBP ,5,GBP ,2)) ';' (GBP ,3 := GBP ,2)) ';' (AddTo GBP ,3,1)),b1) . (intpos 1) = b1 . (intpos 1) & (IExec ((((GBP ,5 := GBP ,4) ';' (SubFrom GBP ,5,GBP ,2)) ';' (GBP ,3 := GBP ,2)) ';' (AddTo GBP ,3,1)),b1) . (intpos 2) = b1 . (intpos 2) & (IExec ((((GBP ,5 := GBP ,4) ';' (SubFrom GBP ,5,GBP ,2)) ';' (GBP ,3 := GBP ,2)) ';' (AddTo GBP ,3,1)),b1) . (intpos 3) = (b1 . (intpos 2)) + 1 & (IExec ((((GBP ,5 := GBP ,4) ';' (SubFrom GBP ,5,GBP ,2)) ';' (GBP ,3 := GBP ,2)) ';' (AddTo GBP ,3,1)),b1) . (intpos 4) = b1 . (intpos 4) & (IExec ((((GBP ,5 := GBP ,4) ';' (SubFrom GBP ,5,GBP ,2)) ';' (GBP ,3 := GBP ,2)) ';' (AddTo GBP ,3,1)),b1) . (intpos 5) = (b1 . (intpos 4)) - (b1 . (intpos 2)) & ( for b2 being Nat holds
( b2 >= 8 implies (IExec ((((GBP ,5 := GBP ,4) ';' (SubFrom GBP ,5,GBP ,2)) ';' (GBP ,3 := GBP ,2)) ';' (AddTo GBP ,3,1)),b1) . (intpos b2) = b1 . (intpos b2) ) ) ) )
theorem Th13: :: SCPQSORT:13
theorem Th14: :: SCPQSORT:14
for b
1 being
State of
SCMPDS for b
2, b
3, b
4 being
Natfor b
5, b
6 being
FinSequence of
INT holds
( b
1 . GBP = 0 &
(b1 . (intpos 4)) - (b1 . (intpos 2)) > 0 & b
1 . (intpos 2) = b
2 & b
2 >= b
3 + 1 & b
1 . (intpos 4) <= b
3 + b
4 & b
3 >= 7 & b
5 is_FinSequence_on b
1,b
3 &
len b
5 = b
4 & b
6 is_FinSequence_on IExec Partition ,b
1,b
3 &
len b
6 = b
4 implies (
(IExec Partition ,b1) . GBP = 0 &
(IExec Partition ,b1) . (intpos 1) = b
1 . (intpos 1) & b
5,b
6 are_fiberwise_equipotent & ex b
7 being
Nat st
( b
7 = (IExec Partition ,b1) . (intpos 4) & b
2 <= b
7 & b
7 <= b
1 . (intpos 4) & ( for b
8 being
Nat holds
( b
2 <= b
8 & b
8 < b
7 implies
(IExec Partition ,b1) . (intpos b7) >= (IExec Partition ,b1) . (intpos b8) ) ) & ( for b
8 being
Nat holds
( b
7 < b
8 & b
8 <= b
1 . (intpos 4) implies
(IExec Partition ,b1) . (intpos b7) <= (IExec Partition ,b1) . (intpos b8) ) ) & ( for b
8 being
Nat holds
( b
8 >= b
3 + 1 & not ( not b
8 < b
1 . (intpos 2) & not b
8 > b
1 . (intpos 4) ) implies
(IExec Partition ,b1) . (intpos b8) = b
1 . (intpos b8) ) ) ) ) )
theorem Th15: :: SCPQSORT:15
Lemma43:
for b1 being State of SCMPDS
for b2, b3 being Nat holds
( card (QuickSort b3,b2) = 57 & ( b2 >= 7 implies ( QuickSort b3,b2 is_halting_on b1 & ex b4, b5 being FinSequence of INT st
( len b4 = b3 & b4 is_FinSequence_on b1,b2 & len b5 = b3 & b5 is_FinSequence_on IExec (QuickSort b3,b2),b1,b2 & b4,b5 are_fiberwise_equipotent & b5 is_non_decreasing_on 1,b3 ) ) ) )
theorem Th16: :: SCPQSORT:16
theorem Th17: :: SCPQSORT:17
theorem Th18: :: SCPQSORT:18