begin
definition
let N be
set ;
func Trivial-AMI N -> strict AMI-Struct of
N means :
Def1:
( the
carrier of
it = succ NAT & the
ZeroF of
it = NAT & the
Instructions of
it = {[0,{},{}]} & the
haltF of
it = [0,{},{}] & the
Object-Kind of
it = (NAT --> {[0,{},{}]}) +* (NAT .--> NAT) & the
Execution of
it = [0,{},{}] .--> (id (product ((NAT --> {[0,{},{}]}) +* (NAT .--> NAT)))) );
existence
ex b1 being strict AMI-Struct of N st
( the carrier of b1 = succ NAT & the ZeroF of b1 = NAT & the Instructions of b1 = {[0,{},{}]} & the haltF of b1 = [0,{},{}] & the Object-Kind of b1 = (NAT --> {[0,{},{}]}) +* (NAT .--> NAT) & the Execution of b1 = [0,{},{}] .--> (id (product ((NAT --> {[0,{},{}]}) +* (NAT .--> NAT)))) )
uniqueness
for b1, b2 being strict AMI-Struct of N st the carrier of b1 = succ NAT & the ZeroF of b1 = NAT & the Instructions of b1 = {[0,{},{}]} & the haltF of b1 = [0,{},{}] & the Object-Kind of b1 = (NAT --> {[0,{},{}]}) +* (NAT .--> NAT) & the Execution of b1 = [0,{},{}] .--> (id (product ((NAT --> {[0,{},{}]}) +* (NAT .--> NAT)))) & the carrier of b2 = succ NAT & the ZeroF of b2 = NAT & the Instructions of b2 = {[0,{},{}]} & the haltF of b2 = [0,{},{}] & the Object-Kind of b2 = (NAT --> {[0,{},{}]}) +* (NAT .--> NAT) & the Execution of b2 = [0,{},{}] .--> (id (product ((NAT --> {[0,{},{}]}) +* (NAT .--> NAT)))) holds
b1 = b2
;
end;
:: deftheorem Def1 defines Trivial-AMI EXTPRO_1:def 1 :
for N being set
for b2 being strict AMI-Struct of N holds
( b2 = Trivial-AMI N iff ( the carrier of b2 = succ NAT & the ZeroF of b2 = NAT & the Instructions of b2 = {[0,{},{}]} & the haltF of b2 = [0,{},{}] & the Object-Kind of b2 = (NAT --> {[0,{},{}]}) +* (NAT .--> NAT) & the Execution of b2 = [0,{},{}] .--> (id (product ((NAT --> {[0,{},{}]}) +* (NAT .--> NAT)))) ) );
:: deftheorem defines Exec EXTPRO_1:def 2 :
for N being with_non-empty_elements set
for S being AMI-Struct of N
for I being Instruction of S
for s being State of S holds Exec (I,s) = ( the Execution of S . I) . s;
:: deftheorem Def3 defines halting EXTPRO_1:def 3 :
for N being with_non-empty_elements set
for S being AMI-Struct of N
for I being Instruction of S holds
( I is halting iff for s being State of S holds Exec (I,s) = s );
:: deftheorem Def4 defines halting EXTPRO_1:def 4 :
for N being with_non-empty_elements set
for S being AMI-Struct of N holds
( S is halting iff the haltF of S is halting );
theorem
theorem
begin
:: deftheorem defines Following EXTPRO_1:def 5 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite AMI-Struct of N
for s being State of S
for p being the Instructions of b2 -valued Function holds Following (p,s) = Exec ((CurInstr (p,s)),s);
definition
let N be non
empty with_non-empty_elements set ;
let S be non
empty stored-program IC-Ins-separated definite AMI-Struct of
N;
let p be
NAT -defined the
Instructions of
S -valued Function;
deffunc H1(
set ,
State of
S)
-> Element of
product the
Object-Kind of
S =
down (Following (p,$2));
let s be
State of
S;
let k be
Nat;
func Comput (
p,
s,
k)
-> State of
S means :
Def6:
ex
f being
Function of
NAT,
(product the Object-Kind of S) st
(
it = f . k &
f . 0 = s & ( for
i being
Nat holds
f . (i + 1) = Following (
p,
(f . i)) ) );
existence
ex b1 being State of S ex f being Function of NAT,(product the Object-Kind of S) st
( b1 = f . k & f . 0 = s & ( for i being Nat holds f . (i + 1) = Following (p,(f . i)) ) )
uniqueness
for b1, b2 being State of S st ex f being Function of NAT,(product the Object-Kind of S) st
( b1 = f . k & f . 0 = s & ( for i being Nat holds f . (i + 1) = Following (p,(f . i)) ) ) & ex f being Function of NAT,(product the Object-Kind of S) st
( b2 = f . k & f . 0 = s & ( for i being Nat holds f . (i + 1) = Following (p,(f . i)) ) ) holds
b1 = b2
end;
:: deftheorem Def6 defines Comput EXTPRO_1:def 6 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite AMI-Struct of N
for p being NAT -defined the Instructions of b2 -valued Function
for s being State of S
for k being Nat
for b6 being State of S holds
( b6 = Comput (p,s,k) iff ex f being Function of NAT,(product the Object-Kind of S) st
( b6 = f . k & f . 0 = s & ( for i being Nat holds f . (i + 1) = Following (p,(f . i)) ) ) );
:: deftheorem Def7 defines halts_on EXTPRO_1:def 7 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite halting AMI-Struct of N
for p being NAT -defined the Instructions of b2 -valued Function
for s being State of S holds
( p halts_on s iff ex k being Nat st
( IC (Comput (p,s,k)) in dom p & CurInstr (p,(Comput (p,s,k))) = halt S ) );
theorem Th3:
theorem Th4:
theorem Th5:
theorem Th6:
definition
let N be non
empty with_non-empty_elements set ;
let S be non
empty stored-program IC-Ins-separated definite halting AMI-Struct of
N;
let p be
NAT -defined the
Instructions of
S -valued Function;
let s be
State of
S;
assume A1:
p halts_on s
;
func Result (
p,
s)
-> State of
S means :
Def8:
ex
k being
Element of
NAT st
(
it = Comput (
p,
s,
k) &
CurInstr (
p,
it)
= halt S );
uniqueness
for b1, b2 being State of S st ex k being Element of NAT st
( b1 = Comput (p,s,k) & CurInstr (p,b1) = halt S ) & ex k being Element of NAT st
( b2 = Comput (p,s,k) & CurInstr (p,b2) = halt S ) holds
b1 = b2
correctness
existence
ex b1 being State of S ex k being Element of NAT st
( b1 = Comput (p,s,k) & CurInstr (p,b1) = halt S );
end;
:: deftheorem Def8 defines Result EXTPRO_1:def 8 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite halting AMI-Struct of N
for p being NAT -defined the Instructions of b2 -valued Function
for s being State of S st p halts_on s holds
for b5 being State of S holds
( b5 = Result (p,s) iff ex k being Element of NAT st
( b5 = Comput (p,s,k) & CurInstr (p,b5) = halt S ) );
theorem
theorem Th8:
theorem Th9:
:: deftheorem Def9 defines autonomic EXTPRO_1:def 9 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite AMI-Struct of N
for IT being PartState of S holds
( IT is autonomic iff for P, Q being the Instructions of b2 -valued ManySortedSet of NAT st ProgramPart IT c= P & ProgramPart IT c= Q holds
for s1, s2 being State of S st NPP IT c= s1 & NPP IT c= s2 holds
for i being Element of NAT holds (Comput (P,s1,i)) | (dom (NPP IT)) = (Comput (Q,s2,i)) | (dom (NPP IT)) );
:: deftheorem Def10 defines halting EXTPRO_1:def 10 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite halting AMI-Struct of N
for IT being PartState of S holds
( IT is halting iff for s being State of S st NPP IT c= s holds
for P being the Instructions of b2 -valued ManySortedSet of NAT st ProgramPart IT c= P holds
P halts_on s );
begin
theorem Th10:
theorem Th11:
theorem Th12:
:: deftheorem Def11 defines Autonomy EXTPRO_1:def 11 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite realistic halting AMI-Struct of N
for P being NAT -defined the Instructions of b2 -valued non halt-free Function
for b4 being FinPartState of S holds
( b4 is Autonomy of P iff ( b4 +* P is autonomic & b4 +* P is halting ) );
:: deftheorem defines Result EXTPRO_1:def 12 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite realistic halting AMI-Struct of N
for p being NAT -defined the Instructions of b2 -valued non halt-free Function
for d being FinPartState of S st d is Autonomy of p & p = ProgramPart d holds
for b5 being FinPartState of S holds
( b5 = Result (p,d) iff for P being the Instructions of b2 -valued ManySortedSet of NAT st p c= P holds
for s being State of S st d c= s holds
b5 = (Result (P,s)) | (dom (NPP d)) );
begin
:: deftheorem Def13 defines computes EXTPRO_1:def 13 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite realistic halting AMI-Struct of N
for p being NAT -defined the Instructions of b2 -valued non halt-free Function
for d being FinPartState of S
for F being Function holds
( p,d computes F iff for x being set st x in dom F holds
ex s being FinPartState of S st
( x = s & d +* s is Autonomy of p & F . s c= Result (p,(d +* s)) ) );
theorem
theorem
theorem
begin
begin
theorem Th16:
theorem Th17:
theorem Th18:
theorem Th19:
theorem
theorem
definition
let N be non
empty with_non-empty_elements set ;
let S be non
empty stored-program IC-Ins-separated definite halting AMI-Struct of
N;
let p be
NAT -defined the
Instructions of
S -valued Function;
let s be
State of
S;
assume A1:
p halts_on s
;
func LifeSpan (
p,
s)
-> Element of
NAT means :
Def14:
(
CurInstr (
p,
(Comput (p,s,it)))
= halt S & ( for
k being
Element of
NAT st
CurInstr (
p,
(Comput (p,s,k)))
= halt S holds
it <= k ) );
existence
ex b1 being Element of NAT st
( CurInstr (p,(Comput (p,s,b1))) = halt S & ( for k being Element of NAT st CurInstr (p,(Comput (p,s,k))) = halt S holds
b1 <= k ) )
uniqueness
for b1, b2 being Element of NAT st CurInstr (p,(Comput (p,s,b1))) = halt S & ( for k being Element of NAT st CurInstr (p,(Comput (p,s,k))) = halt S holds
b1 <= k ) & CurInstr (p,(Comput (p,s,b2))) = halt S & ( for k being Element of NAT st CurInstr (p,(Comput (p,s,k))) = halt S holds
b2 <= k ) holds
b1 = b2
end;
:: deftheorem Def14 defines LifeSpan EXTPRO_1:def 14 :
for N being non empty with_non-empty_elements set
for S being non empty stored-program IC-Ins-separated definite halting AMI-Struct of N
for p being NAT -defined the Instructions of b2 -valued Function
for s being State of S st p halts_on s holds
for b5 being Element of NAT holds
( b5 = LifeSpan (p,s) iff ( CurInstr (p,(Comput (p,s,b5))) = halt S & ( for k being Element of NAT st CurInstr (p,(Comput (p,s,k))) = halt S holds
b5 <= k ) ) );
theorem Th22:
theorem
theorem
theorem
theorem
theorem
theorem
theorem
theorem
theorem Th31:
theorem
theorem Th33:
theorem
theorem
theorem