:: SCMPDS_4 semantic presentation

definition
mode Program-block is programmed initial FinPartState of SCMPDS ;
end;

definition
let c1 be Instruction of SCMPDS ;
func Load c1 -> Program-block equals :: SCMPDS_4:def 1
(inspos 0) .--> a1;
coherence
(inspos 0) .--> c1 is Program-block
proof end;
correctness
;
end;

:: deftheorem Def1 defines Load SCMPDS_4:def 1 :
for b1 being Instruction of SCMPDS holds Load b1 = (inspos 0) .--> b1;

registration
let c1 be Instruction of SCMPDS ;
cluster Load a1 -> non empty ;
coherence
not Load c1 is empty
;
end;

theorem Th1: :: SCMPDS_4:1
for b1 being Program-block
for b2 being Nat holds
( b2 < card b1 iff inspos b2 in dom b1 )
proof end;

registration
let c1 be initial FinPartState of SCMPDS ;
cluster ProgramPart a1 -> initial ;
coherence
ProgramPart c1 is initial
proof end;
end;

theorem Th2: :: SCMPDS_4:2
for b1, b2 being Program-block holds dom b1 misses dom (Shift b2,(card b1))
proof end;

theorem Th3: :: SCMPDS_4:3
for b1 being Nat
for b2 being programmed FinPartState of SCMPDS holds card (Shift b2,b1) = card b2
proof end;

theorem Th4: :: SCMPDS_4:4
for b1, b2 being FinPartState of SCMPDS holds ProgramPart (b1 +* b2) = (ProgramPart b1) +* (ProgramPart b2)
proof end;

theorem Th5: :: SCMPDS_4:5
for b1 being Nat
for b2, b3 being FinPartState of SCMPDS holds Shift (ProgramPart (b2 +* b3)),b1 = (Shift (ProgramPart b2),b1) +* (Shift (ProgramPart b3),b1)
proof end;

definition
let c1 be Program-block;
func Initialized c1 -> FinPartState of SCMPDS equals :: SCMPDS_4:def 2
a1 +* (Start-At (inspos 0));
coherence
c1 +* (Start-At (inspos 0)) is FinPartState of SCMPDS
;
correctness
;
end;

:: deftheorem Def2 defines Initialized SCMPDS_4:def 2 :
for b1 being Program-block holds Initialized b1 = b1 +* (Start-At (inspos 0));

theorem Th6: :: SCMPDS_4:6
for b1 being Instruction of SCMPDS
for b2 being State of SCMPDS holds
( InsCode b1 in {0,1,4,5,6} or (Exec b1,b2) . (IC SCMPDS ) = Next (IC b2) )
proof end;

theorem Th7: :: SCMPDS_4:7
for b1 being Program-block holds IC SCMPDS in dom (Initialized b1)
proof end;

theorem Th8: :: SCMPDS_4:8
for b1 being Program-block holds IC (Initialized b1) = inspos 0
proof end;

theorem Th9: :: SCMPDS_4:9
for b1 being Program-block holds b1 c= Initialized b1
proof end;

theorem Th10: :: SCMPDS_4:10
canceled;

theorem Th11: :: SCMPDS_4:11
for b1, b2 being State of SCMPDS st IC b1 = IC b2 & ( for b3 being Int_position holds b1 . b3 = b2 . b3 ) holds
b1,b2 equal_outside the Instruction-Locations of SCMPDS
proof end;

theorem Th12: :: SCMPDS_4:12
canceled;

theorem Th13: :: SCMPDS_4:13
for b1, b2 being State of SCMPDS st b1,b2 equal_outside the Instruction-Locations of SCMPDS holds
for b3 being Int_position holds b1 . b3 = b2 . b3
proof end;

theorem Th14: :: SCMPDS_4:14
for b1 being Int_position
for b2, b3 being State of SCMPDS
for b4 being Integer st b2,b3 equal_outside the Instruction-Locations of SCMPDS holds
b2 . (DataLoc (b2 . b1),b4) = b3 . (DataLoc (b3 . b1),b4)
proof end;

theorem Th15: :: SCMPDS_4:15
for b1 being Instruction of SCMPDS
for b2, b3 being State of SCMPDS st b2,b3 equal_outside the Instruction-Locations of SCMPDS holds
Exec b1,b2, Exec b1,b3 equal_outside the Instruction-Locations of SCMPDS
proof end;

theorem Th16: :: SCMPDS_4:16
for b1 being Program-block holds (Initialized b1) | the Instruction-Locations of SCMPDS = b1
proof end;

theorem Th17: :: SCMPDS_4:17
for b1, b2 being Nat st b1 <> b2 holds
DataLoc b1,0 <> DataLoc b2,0
proof end;

theorem Th18: :: SCMPDS_4:18
for b1 being Int_position ex b2 being Nat st b1 = DataLoc b2,0
proof end;

scheme :: SCMPDS_4:sch 1
s1{ F1( set ) -> Instruction of SCMPDS , F2( set ) -> Integer, F3() -> Instruction-Location of SCMPDS } :
ex b1 being State of SCMPDS st
( IC b1 = F3() & ( for b2 being Nat holds
( b1 . (inspos b2) = F1(b2) & b1 . (DataLoc b2,0) = F2(b2) ) ) )
proof end;

theorem Th19: :: SCMPDS_4:19
for b1 being State of SCMPDS holds dom b1 = ({(IC SCMPDS )} \/ SCM-Data-Loc ) \/ the Instruction-Locations of SCMPDS by AMI_3:36, SCMPDS_3:5;

theorem Th20: :: SCMPDS_4:20
for b1 being State of SCMPDS
for b2 being set holds
( not b2 in dom b1 or b2 is Int_position or b2 = IC SCMPDS or b2 is Instruction-Location of SCMPDS )
proof end;

theorem Th21: :: SCMPDS_4:21
for b1, b2 being State of SCMPDS holds
( ( for b3 being Instruction-Location of SCMPDS holds b1 . b3 = b2 . b3 ) iff b1 | the Instruction-Locations of SCMPDS = b2 | the Instruction-Locations of SCMPDS )
proof end;

theorem Th22: :: SCMPDS_4:22
for b1 being Instruction-Location of SCMPDS holds not b1 in SCM-Data-Loc by SCMPDS_2:10, XBOOLE_0:3;

theorem Th23: :: SCMPDS_4:23
for b1, b2 being State of SCMPDS holds
( ( for b3 being Int_position holds b1 . b3 = b2 . b3 ) iff b1 | SCM-Data-Loc = b2 | SCM-Data-Loc )
proof end;

theorem Th24: :: SCMPDS_4:24
for b1, b2 being State of SCMPDS st b1,b2 equal_outside the Instruction-Locations of SCMPDS holds
b1 | SCM-Data-Loc = b2 | SCM-Data-Loc
proof end;

theorem Th25: :: SCMPDS_4:25
for b1, b2 being State of SCMPDS
for b3 being set holds (b2 +* (b1 | b3)) | b3 = b1 | b3
proof end;

theorem Th26: :: SCMPDS_4:26
for b1, b2 being Program-block holds b1,b2 equal_outside the Instruction-Locations of SCMPDS
proof end;

theorem Th27: :: SCMPDS_4:27
for b1 being Program-block holds dom (Initialized b1) = (dom b1) \/ {(IC SCMPDS )}
proof end;

theorem Th28: :: SCMPDS_4:28
for b1 being Program-block
for b2 being set holds
( not b2 in dom (Initialized b1) or b2 in dom b1 or b2 = IC SCMPDS )
proof end;

theorem Th29: :: SCMPDS_4:29
for b1 being Program-block holds (Initialized b1) . (IC SCMPDS ) = inspos 0
proof end;

theorem Th30: :: SCMPDS_4:30
for b1 being Program-block holds not IC SCMPDS in dom b1
proof end;

theorem Th31: :: SCMPDS_4:31
for b1 being Program-block
for b2 being Int_position holds not b2 in dom (Initialized b1)
proof end;

theorem Th32: :: SCMPDS_4:32
for b1 being Nat
for b2 being Program-block
for b3 being set st b3 in dom b2 holds
b2 . b3 = (b2 +* (Start-At (inspos b1))) . b3
proof end;

theorem Th33: :: SCMPDS_4:33
for b1 being Program-block
for b2 being set st b2 in dom b1 holds
b1 . b2 = (Initialized b1) . b2 by Th32;

theorem Th34: :: SCMPDS_4:34
for b1, b2 being Program-block
for b3 being State of SCMPDS st Initialized b2 c= b3 holds
b3 +* (Initialized b1) = b3 +* b1
proof end;

theorem Th35: :: SCMPDS_4:35
for b1, b2 being Program-block
for b3 being State of SCMPDS st Initialized b2 c= b3 holds
Initialized b1 c= b3 +* b1
proof end;

theorem Th36: :: SCMPDS_4:36
for b1, b2 being Program-block
for b3 being State of SCMPDS holds b3 +* (Initialized b1),b3 +* (Initialized b2) equal_outside the Instruction-Locations of SCMPDS
proof end;

definition
let c1, c2 be Program-block;
func c1 ';' c2 -> Program-block equals :: SCMPDS_4:def 3
a1 +* (Shift a2,(card a1));
coherence
c1 +* (Shift c2,(card c1)) is Program-block
proof end;
correctness
;
end;

:: deftheorem Def3 defines ';' SCMPDS_4:def 3 :
for b1, b2 being Program-block holds b1 ';' b2 = b1 +* (Shift b2,(card b1));

theorem Th37: :: SCMPDS_4:37
for b1, b2 being Program-block
for b3 being Instruction-Location of SCMPDS st b3 in dom b1 holds
(b1 ';' b2) . b3 = b1 . b3
proof end;

theorem Th38: :: SCMPDS_4:38
for b1, b2 being Program-block
for b3 being Instruction-Location of SCMPDS st b3 in dom b2 holds
(b1 ';' b2) . (b3 + (card b1)) = b2 . b3
proof end;

theorem Th39: :: SCMPDS_4:39
for b1, b2 being Program-block holds dom b1 c= dom (b1 ';' b2)
proof end;

theorem Th40: :: SCMPDS_4:40
for b1, b2 being Program-block holds b1 c= b1 ';' b2
proof end;

theorem Th41: :: SCMPDS_4:41
for b1, b2 being Program-block holds b1 +* (b1 ';' b2) = b1 ';' b2
proof end;

theorem Th42: :: SCMPDS_4:42
for b1, b2 being Program-block holds (Initialized b1) +* (b1 ';' b2) = Initialized (b1 ';' b2)
proof end;

definition
let c1 be Instruction of SCMPDS ;
let c2 be Program-block;
func c1 ';' c2 -> Program-block equals :: SCMPDS_4:def 4
(Load a1) ';' a2;
correctness
coherence
(Load c1) ';' c2 is Program-block
;
;
end;

:: deftheorem Def4 defines ';' SCMPDS_4:def 4 :
for b1 being Instruction of SCMPDS
for b2 being Program-block holds b1 ';' b2 = (Load b1) ';' b2;

definition
let c1 be Program-block;
let c2 be Instruction of SCMPDS ;
func c1 ';' c2 -> Program-block equals :: SCMPDS_4:def 5
a1 ';' (Load a2);
correctness
coherence
c1 ';' (Load c2) is Program-block
;
;
end;

:: deftheorem Def5 defines ';' SCMPDS_4:def 5 :
for b1 being Program-block
for b2 being Instruction of SCMPDS holds b1 ';' b2 = b1 ';' (Load b2);

definition
let c1, c2 be Instruction of SCMPDS ;
func c1 ';' c2 -> Program-block equals :: SCMPDS_4:def 6
(Load a1) ';' (Load a2);
correctness
coherence
(Load c1) ';' (Load c2) is Program-block
;
;
end;

:: deftheorem Def6 defines ';' SCMPDS_4:def 6 :
for b1, b2 being Instruction of SCMPDS holds b1 ';' b2 = (Load b1) ';' (Load b2);

theorem Th43: :: SCMPDS_4:43
for b1, b2 being Instruction of SCMPDS holds b1 ';' b2 = (Load b1) ';' b2 ;

theorem Th44: :: SCMPDS_4:44
for b1, b2 being Instruction of SCMPDS holds b1 ';' b2 = b1 ';' (Load b2) ;

theorem Th45: :: SCMPDS_4:45
for b1, b2 being Program-block holds card (b1 ';' b2) = (card b1) + (card b2)
proof end;

theorem Th46: :: SCMPDS_4:46
for b1, b2, b3 being Program-block holds (b1 ';' b2) ';' b3 = b1 ';' (b2 ';' b3)
proof end;

theorem Th47: :: SCMPDS_4:47
for b1 being Instruction of SCMPDS
for b2, b3 being Program-block holds (b2 ';' b3) ';' b1 = b2 ';' (b3 ';' b1) by Th46;

theorem Th48: :: SCMPDS_4:48
for b1 being Instruction of SCMPDS
for b2, b3 being Program-block holds (b2 ';' b1) ';' b3 = b2 ';' (b1 ';' b3) by Th46;

theorem Th49: :: SCMPDS_4:49
for b1, b2 being Instruction of SCMPDS
for b3 being Program-block holds (b3 ';' b1) ';' b2 = b3 ';' (b1 ';' b2)
proof end;

theorem Th50: :: SCMPDS_4:50
for b1 being Instruction of SCMPDS
for b2, b3 being Program-block holds (b1 ';' b2) ';' b3 = b1 ';' (b2 ';' b3) by Th46;

theorem Th51: :: SCMPDS_4:51
for b1, b2 being Instruction of SCMPDS
for b3 being Program-block holds (b1 ';' b3) ';' b2 = b1 ';' (b3 ';' b2) by Th47;

theorem Th52: :: SCMPDS_4:52
for b1, b2 being Instruction of SCMPDS
for b3 being Program-block holds (b1 ';' b2) ';' b3 = b1 ';' (b2 ';' b3)
proof end;

theorem Th53: :: SCMPDS_4:53
for b1, b2, b3 being Instruction of SCMPDS holds (b1 ';' b2) ';' b3 = b1 ';' (b2 ';' b3)
proof end;

theorem Th54: :: SCMPDS_4:54
for b1 being Nat
for b2 being Program-block holds dom b2 misses dom (Start-At (inspos b1))
proof end;

theorem Th55: :: SCMPDS_4:55
for b1 being Program-block holds Start-At (inspos 0) c= Initialized b1 by FUNCT_4:26;

theorem Th56: :: SCMPDS_4:56
for b1 being Nat
for b2 being Program-block
for b3 being State of SCMPDS st b2 +* (Start-At (inspos b1)) c= b3 holds
b2 c= b3
proof end;

theorem Th57: :: SCMPDS_4:57
for b1 being Program-block
for b2 being State of SCMPDS st Initialized b1 c= b2 holds
b1 c= b2 by Th56;

theorem Th58: :: SCMPDS_4:58
for b1 being Nat
for b2 being Program-block holds (b2 +* (Start-At (inspos b1))) | the Instruction-Locations of SCMPDS = b2
proof end;

theorem Th59: :: SCMPDS_4:59
for b1 being Int_position
for b2 being Instruction-Location of SCMPDS holds not b1 in dom (Start-At b2)
proof end;

theorem Th60: :: SCMPDS_4:60
for b1, b2 being Instruction-Location of SCMPDS holds not b1 in dom (Start-At b2)
proof end;

theorem Th61: :: SCMPDS_4:61
for b1 being Program-block
for b2 being Int_position
for b3 being Instruction-Location of SCMPDS holds not b2 in dom (b1 +* (Start-At b3))
proof end;

theorem Th62: :: SCMPDS_4:62
for b1 being Program-block
for b2 being State of SCMPDS holds (b2 +* b1) +* (Start-At (inspos 0)) = (b2 +* (Start-At (inspos 0))) +* b1
proof end;

definition
let c1 be State of SCMPDS ;
let c2 be Int_position ;
let c3 be Integer;
redefine func +* as c1 +* c2,c3 -> State of SCMPDS ;
coherence
c1 +* c2,c3 is State of SCMPDS
proof end;
end;

definition
let c1 be Program-block;
func stop c1 -> Program-block equals :: SCMPDS_4:def 7
a1 ';' SCMPDS-Stop ;
coherence
c1 ';' SCMPDS-Stop is Program-block
;
end;

:: deftheorem Def7 defines stop SCMPDS_4:def 7 :
for b1 being Program-block holds stop b1 = b1 ';' SCMPDS-Stop ;

definition
let c1 be Program-block;
let c2 be State of SCMPDS ;
func IExec c1,c2 -> State of SCMPDS equals :: SCMPDS_4:def 8
(Result (a2 +* (Initialized (stop a1)))) +* (a2 | the Instruction-Locations of SCMPDS );
coherence
(Result (c2 +* (Initialized (stop c1)))) +* (c2 | the Instruction-Locations of SCMPDS ) is State of SCMPDS
by AMI_5:82;
end;

:: deftheorem Def8 defines IExec SCMPDS_4:def 8 :
for b1 being Program-block
for b2 being State of SCMPDS holds IExec b1,b2 = (Result (b2 +* (Initialized (stop b1)))) +* (b2 | the Instruction-Locations of SCMPDS );

definition
let c1 be Program-block;
attr a1 is paraclosed means :Def9: :: SCMPDS_4:def 9
for b1 being State of SCMPDS
for b2 being Nat st Initialized (stop a1) c= b1 holds
IC ((Computation b1) . b2) in dom (stop a1);
attr a1 is parahalting means :Def10: :: SCMPDS_4:def 10
Initialized (stop a1) is halting;
end;

:: deftheorem Def9 defines paraclosed SCMPDS_4:def 9 :
for b1 being Program-block holds
( b1 is paraclosed iff for b2 being State of SCMPDS
for b3 being Nat st Initialized (stop b1) c= b2 holds
IC ((Computation b2) . b3) in dom (stop b1) );

:: deftheorem Def10 defines parahalting SCMPDS_4:def 10 :
for b1 being Program-block holds
( b1 is parahalting iff Initialized (stop b1) is halting );

Lemma37: Load (halt SCMPDS ) is parahalting
proof end;

registration
cluster parahalting FinPartState of SCMPDS ;
existence
ex b1 being Program-block st b1 is parahalting
by Lemma37;
end;

theorem Th63: :: SCMPDS_4:63
for b1 being State of SCMPDS
for b2 being parahalting Program-block st Initialized (stop b2) c= b1 holds
b1 is halting
proof end;

registration
let c1 be parahalting Program-block;
cluster Initialized (stop a1) -> halting ;
coherence
Initialized (stop c1) is halting
proof end;
end;

definition
let c1, c2 be Instruction-Location of SCMPDS ;
let c3, c4 be Instruction of SCMPDS ;
redefine func --> as c1,c2 --> c3,c4 -> FinPartState of SCMPDS ;
coherence
c1,c2 --> c3,c4 is FinPartState of SCMPDS
proof end;
end;

theorem Th64: :: SCMPDS_4:64
canceled;

theorem Th65: :: SCMPDS_4:65
for b1 being State of SCMPDS holds IC b1 <> Next (IC b1)
proof end;

theorem Th66: :: SCMPDS_4:66
for b1 being State of SCMPDS holds not b1 +* ((IC b1),(Next (IC b1)) --> (goto 1),(goto (- 1))) is halting
proof end;

theorem Th67: :: SCMPDS_4:67
for b1 being Nat
for b2 being Program-block
for b3, b4 being State of SCMPDS st b3,b4 equal_outside the Instruction-Locations of SCMPDS & b2 c= b3 & b2 c= b4 & ( for b5 being Nat st b5 < b1 holds
IC ((Computation b4) . b5) in dom b2 ) holds
for b5 being Nat st b5 <= b1 holds
(Computation b3) . b5,(Computation b4) . b5 equal_outside the Instruction-Locations of SCMPDS
proof end;

theorem Th68: :: SCMPDS_4:68
for b1 being State of SCMPDS
for b2 being Instruction-Location of SCMPDS holds b2 in dom b1
proof end;

theorem Th69: :: SCMPDS_4:69
for b1 being State of SCMPDS
for b2, b3 being Instruction-Location of SCMPDS
for b4, b5 being Instruction of SCMPDS holds b1 +* (b2,b3 --> b4,b5) = (b1 +* b2,b4) +* b3,b5
proof end;

theorem Th70: :: SCMPDS_4:70
for b1 being Nat holds Next (inspos b1) = inspos (b1 + 1)
proof end;

theorem Th71: :: SCMPDS_4:71
for b1 being Program-block
for b2 being State of SCMPDS st not IC b2 in dom b1 holds
not Next (IC b2) in dom b1
proof end;

registration
cluster parahalting -> paraclosed FinPartState of SCMPDS ;
coherence
for b1 being Program-block st b1 is parahalting holds
b1 is paraclosed
proof end;
end;

theorem Th72: :: SCMPDS_4:72
dom SCMPDS-Stop = {(inspos 0)} by CQC_LANG:5;

theorem Th73: :: SCMPDS_4:73
( inspos 0 in dom SCMPDS-Stop & SCMPDS-Stop . (inspos 0) = halt SCMPDS ) by Th72, CQC_LANG:6, TARSKI:def 1;

theorem Th74: :: SCMPDS_4:74
card SCMPDS-Stop = 1
proof end;

theorem Th75: :: SCMPDS_4:75
for b1 being Program-block holds inspos 0 in dom (stop b1)
proof end;

theorem Th76: :: SCMPDS_4:76
for b1 being programmed FinPartState of SCMPDS
for b2 being Nat
for b3 being Instruction-Location of SCMPDS st b3 in dom b1 holds
b3 + b2 in dom (Shift b1,b2)
proof end;

definition
let c1 be Instruction of SCMPDS ;
let c2 be Nat;
pred c1 valid_at c2 means :Def11: :: SCMPDS_4:def 11
( ( InsCode a1 = 0 implies ex b1 being Integer st
( a1 = goto b1 & a2 + b1 >= 0 ) ) & ( InsCode a1 = 4 implies ex b1 being Int_position ex b2, b3 being Integer st
( a1 = b1,b2 <>0_goto b3 & a2 + b3 >= 0 ) ) & ( InsCode a1 = 5 implies ex b1 being Int_position ex b2, b3 being Integer st
( a1 = b1,b2 <=0_goto b3 & a2 + b3 >= 0 ) ) & ( InsCode a1 = 6 implies ex b1 being Int_position ex b2, b3 being Integer st
( a1 = b1,b2 >=0_goto b3 & a2 + b3 >= 0 ) ) );
end;

:: deftheorem Def11 defines valid_at SCMPDS_4:def 11 :
for b1 being Instruction of SCMPDS
for b2 being Nat holds
( b1 valid_at b2 iff ( ( InsCode b1 = 0 implies ex b3 being Integer st
( b1 = goto b3 & b2 + b3 >= 0 ) ) & ( InsCode b1 = 4 implies ex b3 being Int_position ex b4, b5 being Integer st
( b1 = b3,b4 <>0_goto b5 & b2 + b5 >= 0 ) ) & ( InsCode b1 = 5 implies ex b3 being Int_position ex b4, b5 being Integer st
( b1 = b3,b4 <=0_goto b5 & b2 + b5 >= 0 ) ) & ( InsCode b1 = 6 implies ex b3 being Int_position ex b4, b5 being Integer st
( b1 = b3,b4 >=0_goto b5 & b2 + b5 >= 0 ) ) ) );

theorem Th77: :: SCMPDS_4:77
for b1 being Instruction of SCMPDS
for b2, b3 being Nat st b1 valid_at b2 & b2 <= b3 holds
b1 valid_at b3
proof end;

definition
let c1 be FinPartState of SCMPDS ;
attr a1 is shiftable means :Def12: :: SCMPDS_4:def 12
for b1 being Nat
for b2 being Instruction of SCMPDS st inspos b1 in dom a1 & b2 = a1 . (inspos b1) holds
( InsCode b2 <> 1 & InsCode b2 <> 3 & b2 valid_at b1 );
end;

:: deftheorem Def12 defines shiftable SCMPDS_4:def 12 :
for b1 being FinPartState of SCMPDS holds
( b1 is shiftable iff for b2 being Nat
for b3 being Instruction of SCMPDS st inspos b2 in dom b1 & b3 = b1 . (inspos b2) holds
( InsCode b3 <> 1 & InsCode b3 <> 3 & b3 valid_at b2 ) );

Lemma53: Load (halt SCMPDS ) is shiftable
proof end;

registration
cluster paraclosed parahalting shiftable FinPartState of SCMPDS ;
existence
ex b1 being Program-block st
( b1 is parahalting & b1 is shiftable )
by Lemma37, Lemma53;
end;

definition
let c1 be Instruction of SCMPDS ;
attr a1 is shiftable means :Def13: :: SCMPDS_4:def 13
( InsCode a1 = 2 or InsCode a1 > 6 );
end;

:: deftheorem Def13 defines shiftable SCMPDS_4:def 13 :
for b1 being Instruction of SCMPDS holds
( b1 is shiftable iff ( InsCode b1 = 2 or InsCode b1 > 6 ) );

registration
cluster shiftable Element of the Instructions of SCMPDS ;
existence
ex b1 being Instruction of SCMPDS st b1 is shiftable
proof end;
end;

registration
let c1 be Int_position ;
let c2 be Integer;
cluster a1 := a2 -> shiftable ;
coherence
c1 := c2 is shiftable
proof end;
end;

registration
let c1 be Int_position ;
let c2, c3 be Integer;
cluster a1,a2 := a3 -> shiftable ;
coherence
c1,c2 := c3 is shiftable
proof end;
end;

registration
let c1 be Int_position ;
let c2, c3 be Integer;
cluster AddTo a1,a2,a3 -> shiftable ;
coherence
AddTo c1,c2,c3 is shiftable
proof end;
end;

registration
let c1, c2 be Int_position ;
let c3, c4 be Integer;
cluster AddTo a1,a3,a2,a4 -> shiftable ;
coherence
AddTo c1,c3,c2,c4 is shiftable
proof end;
cluster SubFrom a1,a3,a2,a4 -> shiftable ;
coherence
SubFrom c1,c3,c2,c4 is shiftable
proof end;
cluster MultBy a1,a3,a2,a4 -> shiftable ;
coherence
MultBy c1,c3,c2,c4 is shiftable
proof end;
cluster Divide a1,a3,a2,a4 -> shiftable ;
coherence
Divide c1,c3,c2,c4 is shiftable
proof end;
cluster a1,a3 := a2,a4 -> shiftable ;
coherence
c1,c3 := c2,c4 is shiftable
proof end;
end;

registration
let c1, c2 be shiftable Program-block;
cluster a1 ';' a2 -> shiftable ;
coherence
c1 ';' c2 is shiftable
proof end;
end;

registration
let c1 be shiftable Instruction of SCMPDS ;
cluster Load a1 -> non empty shiftable ;
coherence
Load c1 is shiftable
proof end;
end;

registration
let c1 be shiftable Instruction of SCMPDS ;
let c2 be shiftable Program-block;
cluster a1 ';' a2 -> shiftable ;
coherence
c1 ';' c2 is shiftable
;
end;

registration
let c1 be shiftable Program-block;
let c2 be shiftable Instruction of SCMPDS ;
cluster a1 ';' a2 -> shiftable ;
coherence
c1 ';' c2 is shiftable
;
end;

registration
let c1, c2 be shiftable Instruction of SCMPDS ;
cluster a1 ';' a2 -> shiftable ;
coherence
c1 ';' c2 is shiftable
;
end;

registration
cluster SCMPDS-Stop -> paraclosed parahalting shiftable ;
coherence
( SCMPDS-Stop is parahalting & SCMPDS-Stop is shiftable )
by Lemma37, Lemma53;
end;

registration
let c1 be shiftable Program-block;
cluster stop a1 -> shiftable ;
coherence
stop c1 is shiftable
;
end;

theorem Th78: :: SCMPDS_4:78
for b1 being shiftable Program-block
for b2 being Integer st (card b1) + b2 >= 0 holds
b1 ';' (goto b2) is shiftable
proof end;

registration
let c1 be Nat;
cluster Load (goto a1) -> non empty shiftable ;
coherence
Load (goto c1) is shiftable
proof end;
end;

theorem Th79: :: SCMPDS_4:79
for b1 being shiftable Program-block
for b2, b3 being Integer
for b4 being Int_position st (card b1) + b3 >= 0 holds
b1 ';' (b4,b2 <>0_goto b3) is shiftable
proof end;

registration
let c1 be Integer;
let c2 be Int_position ;
let c3 be Nat;
cluster Load (a2,a1 <>0_goto a3) -> non empty shiftable ;
coherence
Load (c2,c1 <>0_goto c3) is shiftable
proof end;
end;

theorem Th80: :: SCMPDS_4:80
for b1 being shiftable Program-block
for b2, b3 being Integer
for b4 being Int_position st (card b1) + b3 >= 0 holds
b1 ';' (b4,b2 <=0_goto b3) is shiftable
proof end;

registration
let c1 be Integer;
let c2 be Int_position ;
let c3 be Nat;
cluster Load (a2,a1 <=0_goto a3) -> non empty shiftable ;
coherence
Load (c2,c1 <=0_goto c3) is shiftable
proof end;
end;

theorem Th81: :: SCMPDS_4:81
for b1 being shiftable Program-block
for b2, b3 being Integer
for b4 being Int_position st (card b1) + b3 >= 0 holds
b1 ';' (b4,b2 >=0_goto b3) is shiftable
proof end;

registration
let c1 be Integer;
let c2 be Int_position ;
let c3 be Nat;
cluster Load (a2,a1 >=0_goto a3) -> non empty shiftable ;
coherence
Load (c2,c1 >=0_goto c3) is shiftable
proof end;
end;

theorem Th82: :: SCMPDS_4:82
for b1, b2 being State of SCMPDS
for b3, b4 being Nat
for b5 being Integer st IC b1 = inspos b4 & b4 + b5 >= 0 & (IC b1) + b3 = IC b2 holds
(ICplusConst b1,b5) + b3 = ICplusConst b2,b5
proof end;

theorem Th83: :: SCMPDS_4:83
for b1, b2 being State of SCMPDS
for b3, b4 being Nat
for b5 being Instruction of SCMPDS st IC b1 = inspos b4 & b5 valid_at b4 & InsCode b5 <> 1 & InsCode b5 <> 3 & (IC b1) + b3 = IC b2 & b1 | SCM-Data-Loc = b2 | SCM-Data-Loc holds
( (IC (Exec b5,b1)) + b3 = IC (Exec b5,b2) & (Exec b5,b1) | SCM-Data-Loc = (Exec b5,b2) | SCM-Data-Loc )
proof end;

theorem Th84: :: SCMPDS_4:84
for b1, b2 being State of SCMPDS
for b3 being parahalting shiftable Program-block st Initialized (stop b3) c= b1 holds
for b4 being Nat st Shift (stop b3),b4 c= b2 & IC b2 = inspos b4 & b1 | SCM-Data-Loc = b2 | SCM-Data-Loc holds
for b5 being Nat holds
( (IC ((Computation b1) . b5)) + b4 = IC ((Computation b2) . b5) & CurInstr ((Computation b1) . b5) = CurInstr ((Computation b2) . b5) & ((Computation b1) . b5) | SCM-Data-Loc = ((Computation b2) . b5) | SCM-Data-Loc )
proof end;