begin
definition
let N be
set ;
func Trivial-COM N -> strict COM-Struct of
N means :
Def2:
( the
carrier of
it = succ NAT & the
Instruction-Counter of
it = NAT & the
Instructions of
it = {[0 ,{} ,{} ]} & the
haltF of
it = [0 ,{} ,{} ] & the
Object-Kind of
it = (NAT --> {[0 ,{} ,{} ]}) +* (NAT .--> NAT ) );
existence
ex b1 being strict COM-Struct of N st
( the carrier of b1 = succ NAT & the Instruction-Counter of b1 = NAT & the Instructions of b1 = {[0 ,{} ,{} ]} & the haltF of b1 = [0 ,{} ,{} ] & the Object-Kind of b1 = (NAT --> {[0 ,{} ,{} ]}) +* (NAT .--> NAT ) )
uniqueness
for b1, b2 being strict COM-Struct of N st the carrier of b1 = succ NAT & the Instruction-Counter of b1 = NAT & the Instructions of b1 = {[0 ,{} ,{} ]} & the haltF of b1 = [0 ,{} ,{} ] & the Object-Kind of b1 = (NAT --> {[0 ,{} ,{} ]}) +* (NAT .--> NAT ) & the carrier of b2 = succ NAT & the Instruction-Counter of b2 = NAT & the Instructions of b2 = {[0 ,{} ,{} ]} & the haltF of b2 = [0 ,{} ,{} ] & the Object-Kind of b2 = (NAT --> {[0 ,{} ,{} ]}) +* (NAT .--> NAT ) holds
b1 = b2
;
end;
:: deftheorem Def2 defines Trivial-COM COMPOS_1:def 1 :
for N being set
for b2 being strict COM-Struct of N holds
( b2 = Trivial-COM N iff ( the carrier of b2 = succ NAT & the Instruction-Counter of b2 = NAT & the Instructions of b2 = {[0 ,{} ,{} ]} & the haltF of b2 = [0 ,{} ,{} ] & the Object-Kind of b2 = (NAT --> {[0 ,{} ,{} ]}) +* (NAT .--> NAT ) ) );
:: deftheorem Def3 defines stored-program COMPOS_1:def 2 :
for N being set
for S being COM-Struct of N holds
( S is stored-program iff NAT c= the carrier of S );
:: deftheorem defines IC COMPOS_1:def 3 :
for N being set
for S being non empty COM-Struct of N holds IC S = the Instruction-Counter of S;
:: deftheorem defines ObjectKind COMPOS_1:def 4 :
for N being set
for S being non empty COM-Struct of N
for o being Object of S holds ObjectKind o = the Object-Kind of S . o;
:: deftheorem defines halt COMPOS_1:def 5 :
for N being set
for S being COM-Struct of N holds halt S = the haltF of S;
:: deftheorem Def11 defines IC-Ins-separated COMPOS_1:def 6 :
for N being set
for IT being non empty COM-Struct of N holds
( IT is IC-Ins-separated iff ObjectKind (IC IT) = NAT );
:: deftheorem defines halt-free COMPOS_1:def 7 :
for N being with_non-empty_elements set
for S being COM-Struct of N
for I being NAT -defined the Instructions of b2 -valued Function holds
( I is halt-free iff not halt S in rng I );
:: deftheorem Def14 defines definite COMPOS_1:def 8 :
for N being set
for IT being non empty stored-program COM-Struct of N holds
( IT is definite iff for l being Element of NAT holds the Object-Kind of IT . l = the Instructions of IT );
:: deftheorem defines IC COMPOS_1:def 9 :
for N being with_non-empty_elements set
for S being non empty IC-Ins-separated COM-Struct of N
for p being PartState of S holds IC p = p . (IC S);
theorem
begin
:: deftheorem defines CurInstr COMPOS_1:def 10 :
for N being with_non-empty_elements set
for S being non empty IC-Ins-separated COM-Struct of N
for p being the Instructions of b2 -valued Function
for s being State of S holds CurInstr p,s = p /. (IC s);
:: deftheorem defines ProgramPart COMPOS_1:def 11 :
for N being with_non-empty_elements set
for S being COM-Struct of N
for s being PartState of S holds ProgramPart s = s | NAT ;
BWL:
for N being with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite COM-Struct of N
for s being State of S
for i being natural number holds (ProgramPart s) . i = s . i
BWL2:
for N being with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite COM-Struct of N
for s being PartState of S
for i being natural number st i in dom s holds
(ProgramPart s) . i = s . i
LmU:
for N being with_non-empty_elements set
for S being non empty stored-program COM-Struct of N
for s being State of S holds dom (ProgramPart s) = NAT
BWL1:
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite COM-Struct of N
for s being State of S
for i being natural number holds (ProgramPart s) /. i = s . i
:: deftheorem Def21 defines realistic COMPOS_1:def 12 :
for N being set
for IT being COM-Struct of N holds
( IT is realistic iff not the Instruction-Counter of IT in NAT );
theorem
theorem
LmL:
for N being with_non-empty_elements set
for S being stored-program COM-Struct of N
for s being State of S holds NAT c= dom s
L94:
for N being with_non-empty_elements set
for S being non empty COM-Struct of N
for s being State of S holds IC S in dom s
begin
:: deftheorem defines FinPartSt COMPOS_1:def 13 :
for N being set
for S being COM-Struct of N holds FinPartSt S = { p where p is Element of sproduct the Object-Kind of S : p is finite } ;
:: deftheorem defines Data-Locations COMPOS_1:def 14 :
for N being set
for S being non empty COM-Struct of N holds Data-Locations S = the carrier of S \ ({(IC S)} \/ NAT );
theorem Th58:
theorem Th59:
:: deftheorem defines Start-At COMPOS_1:def 15 :
for N being non empty with_non-empty_elements set
for S being non empty IC-Ins-separated COM-Struct of N
for l being Nat holds Start-At l,S = (IC S) .--> l;
begin
theorem
:: deftheorem Def41 defines -started COMPOS_1:def 16 :
for N being with_non-empty_elements set
for S being non empty IC-Ins-separated COM-Struct of N
for l being Nat
for p being PartState of S holds
( p is l -started iff ( IC S in dom p & IC p = l ) );
begin
:: deftheorem Def32 defines standard-ins COMPOS_1:def 17 :
for N being set
for S being COM-Struct of N holds
( S is standard-ins iff ex X being non empty set st the Instructions of S c= [:NAT ,(NAT * ),(X * ):] );
:: deftheorem defines InsCodes COMPOS_1:def 18 :
for N being set
for S being standard-ins COM-Struct of N holds InsCodes S = proj1 (proj1 the Instructions of S);
begin
LMT:
for N being with_non-empty_elements set
for S being COM-Struct of N
for p being FinPartState of S holds p in FinPartSt S
theorem
:: deftheorem Def42 defines halts_at COMPOS_1:def 19 :
for N being with_non-empty_elements set
for S being COM-Struct of N
for p being NAT -defined the Instructions of b2 -valued Function
for l being set holds
( p halts_at l iff ( l in dom p & p . l = halt S ) );
:: deftheorem defines -started COMPOS_1:def 20 :
for N being non empty with_non-empty_elements set
for S being non empty IC-Ins-separated COM-Struct of N
for l being Nat
for s being State of S holds
( s is l -started iff IC s = l );
:: deftheorem Def45 defines halts_at COMPOS_1:def 21 :
for N being with_non-empty_elements set
for S being non empty COM-Struct of N
for s being the Instructions of b2 -valued ManySortedSet of NAT
for l being Nat holds
( s halts_at l iff s . l = halt S );
theorem
theorem Th94:
theorem
:: deftheorem defines DataPart COMPOS_1:def 22 :
for N being set
for S being non empty COM-Struct of N
for p being PartState of S holds DataPart p = p | (Data-Locations S);
:: deftheorem Def50 defines data-only COMPOS_1:def 23 :
for N being set
for S being non empty COM-Struct of N
for IT being PartState of S holds
( IT is data-only iff dom IT misses {(IC S)} \/ NAT );
theorem Th100:
theorem Th101:
theorem Th102:
theorem Th103:
theorem Th104:
theorem Th106:
theorem
theorem Th108:
:: deftheorem defines data-only COMPOS_1:def 24 :
for N being non empty with_non-empty_elements set
for S being non empty IC-Ins-separated COM-Struct of N
for IT being PartFunc of (FinPartSt S),(FinPartSt S) holds
( IT is data-only iff for p being PartState of S st p in dom IT holds
( p is data-only & ( for q being PartState of S st q = IT . p holds
q is data-only ) ) );
theorem
theorem
theorem
theorem
theorem
theorem
theorem
theorem Th134:
theorem Th135:
theorem
theorem
theorem Th138:
theorem Th139:
theorem
theorem
theorem
theorem
theorem
theorem
theorem
theorem
theorem Th155:
begin
theorem
begin
begin
:: deftheorem Def22 defines halt-ending COMPOS_1:def 25 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite COM-Struct of N
for F being non empty NAT -defined FinPartState of holds
( F is halt-ending iff F . (LastLoc F) = halt S );
:: deftheorem Def23 defines unique-halt COMPOS_1:def 26 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite COM-Struct of N
for F being non empty NAT -defined FinPartState of holds
( F is unique-halt iff for f being Element of NAT st F . f = halt S & f in dom F holds
f = LastLoc F );
theorem
begin
theorem
theorem
begin
:: deftheorem defines Stop COMPOS_1:def 27 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program definite COM-Struct of N holds Stop S = <%(halt S)%>;
theorem
theorem
:: deftheorem defines IncrIC COMPOS_1:def 28 :
for N being non empty with_non-empty_elements set
for S being non empty IC-Ins-separated COM-Struct of N
for p being PartState of S
for k being Nat holds IncrIC p,k = p +* (Start-At ((IC p) + k),S);
theorem
theorem
theorem Th13:
theorem
theorem Th15:
theorem Th17:
theorem Th18:
theorem Th19:
theorem
theorem Th21:
theorem Th22:
theorem Th23:
theorem Th24:
theorem
theorem
theorem
theorem
theorem
:: deftheorem Defx defines program-free COMPOS_1:def 29 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite realistic COM-Struct of N
for p being PartState of S holds
( p is program-free iff p | NAT = {} );
:: deftheorem defines NPP COMPOS_1:def 30 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite realistic COM-Struct of N
for p being PartState of S holds NPP p = p \ (ProgramPart p);
theorem Th40:
theorem
theorem
theorem Th43:
theorem
theorem Th45:
theorem
theorem Th47:
theorem
theorem Th49:
theorem
begin
:: deftheorem defines Initialize COMPOS_1:def 31 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite realistic COM-Struct of N
for p being PartState of S holds Initialize p = p +* (Start-At 0 ,S);
theorem Th27:
theorem Th28: