let s be State of SCMPDS ; for I being Program of SCMPDS
for a being Int_position
for k1 being Integer st s . (DataLoc (s . a),k1) >= 0 holds
( if<0 a,k1,I is_closed_on s & if<0 a,k1,I is_halting_on s )
let I be Program of SCMPDS ; for a being Int_position
for k1 being Integer st s . (DataLoc (s . a),k1) >= 0 holds
( if<0 a,k1,I is_closed_on s & if<0 a,k1,I is_halting_on s )
let a be Int_position ; for k1 being Integer st s . (DataLoc (s . a),k1) >= 0 holds
( if<0 a,k1,I is_closed_on s & if<0 a,k1,I is_halting_on s )
let k1 be Integer; ( s . (DataLoc (s . a),k1) >= 0 implies ( if<0 a,k1,I is_closed_on s & if<0 a,k1,I is_halting_on s ) )
set b = DataLoc (s . a),k1;
assume A1:
s . (DataLoc (s . a),k1) >= 0
; ( if<0 a,k1,I is_closed_on s & if<0 a,k1,I is_halting_on s )
set i = a,k1 >=0_goto ((card I) + 1);
set IF = if<0 a,k1,I;
set pIF = stop (if<0 a,k1,I);
set IsIF = Initialized (stop (if<0 a,k1,I));
set s3 = s +* (Initialized (stop (if<0 a,k1,I)));
set s4 = Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),1;
A2:
IC (s +* (Initialized (stop (if<0 a,k1,I)))) = 0
by FUNCT_4:26, SCMPDS_5:18;
A3:
not DataLoc (s . a),k1 in dom (Initialized (stop (if<0 a,k1,I)))
by SCMPDS_4:31;
not a in dom (Initialized (stop (if<0 a,k1,I)))
by SCMPDS_4:31;
then A4: (s +* (Initialized (stop (if<0 a,k1,I)))) . (DataLoc ((s +* (Initialized (stop (if<0 a,k1,I)))) . a),k1) =
(s +* (Initialized (stop (if<0 a,k1,I)))) . (DataLoc (s . a),k1)
by FUNCT_4:12
.=
s . (DataLoc (s . a),k1)
by A3, FUNCT_4:12
;
Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),(0 + 1) =
Following (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),0 )
by AMI_1:14
.=
Following (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I))))
by AMI_1:13
.=
Exec (a,k1 >=0_goto ((card I) + 1)),(s +* (Initialized (stop (if<0 a,k1,I))))
by Th22
;
then A5: IC (Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),1) =
ICplusConst (s +* (Initialized (stop (if<0 a,k1,I)))),((card I) + 1)
by A1, A4, SCMPDS_2:69
.=
0 + ((card I) + 1)
by A2, Th23
;
A6:
card (if<0 a,k1,I) = (card I) + 1
by Th15;
then A7:
(card I) + 1 in dom (stop (if<0 a,k1,I))
by Th25;
Y:
(ProgramPart (Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),1)) /. (IC (Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),1)) = (Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),1) . (IC (Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),1))
by AMI_1:150;
Initialized (stop (if<0 a,k1,I)) c= s +* (Initialized (stop (if<0 a,k1,I)))
by FUNCT_4:26;
then
stop (if<0 a,k1,I) c= Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),1
by AMI_1:81, SCMPDS_4:57;
then (Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),1) . ((card I) + 1) =
(stop (if<0 a,k1,I)) . ((card I) + 1)
by A7, GRFUNC_1:8
.=
halt SCMPDS
by A6, Th25
;
then A8:
CurInstr (ProgramPart (Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),1)),(Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),1) = halt SCMPDS
by A5, Y;
now let k be
Element of
NAT ;
IC (Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),b1) in dom (stop (if<0 a,k1,I))TX:
ProgramPart (s +* (Initialized (stop (if<0 a,k1,I)))) = ProgramPart (Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),1)
by AMI_1:144;
per cases
( 0 < k or k = 0 )
;
suppose
0 < k
;
IC (Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),b1) in dom (stop (if<0 a,k1,I))then
1
+ 0 <= k
by INT_1:20;
hence
IC (Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),k) in dom (stop (if<0 a,k1,I))
by A7, A5, A8, AMI_1:52, TX;
verum end; suppose
k = 0
;
IC (Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),b1) in dom (stop (if<0 a,k1,I))then
Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),
(s +* (Initialized (stop (if<0 a,k1,I)))),
k = s +* (Initialized (stop (if<0 a,k1,I)))
by AMI_1:13;
hence
IC (Comput (ProgramPart (s +* (Initialized (stop (if<0 a,k1,I))))),(s +* (Initialized (stop (if<0 a,k1,I)))),k) in dom (stop (if<0 a,k1,I))
by A2, SCMPDS_4:75;
verum end; end; end;
hence
if<0 a,k1,I is_closed_on s
by Def2; if<0 a,k1,I is_halting_on s
ProgramPart (s +* (Initialized (stop (if<0 a,k1,I)))) halts_on s +* (Initialized (stop (if<0 a,k1,I)))
by A8, AMI_1:146;
hence
if<0 a,k1,I is_halting_on s
by Def3; verum