:: AMISTD_2 semantic presentation

Lemma1: for b1 being Relation st dom b1 <> {} holds
b1 <> {}
by RELAT_1:60;

registration
let c1 be Function;
let c2 be non empty Function;
cluster a1 +* a2 -> non empty ;
coherence
not c1 +* c2 is empty
proof end;
cluster a2 +* a1 -> non empty ;
coherence
not c2 +* c1 is empty
proof end;
end;

registration
let c1, c2 be finite Function;
cluster a1 +* a2 -> finite ;
coherence
c1 +* c2 is finite
proof end;
end;

theorem Th1: :: AMISTD_2:1
for b1, b2 being Function holds
( dom b1, dom b2 are_equipotent iff b1,b2 are_equipotent )
proof end;

theorem Th2: :: AMISTD_2:2
for b1, b2 being finite Function st dom b1 misses dom b2 holds
card (b1 +* b2) = (card b1) + (card b2)
proof end;

registration
let c1 be Function;
let c2 be set ;
cluster a1 \ a2 -> Relation-like Function-like ;
coherence
( c1 \ c2 is Function-like & c1 \ c2 is Relation-like )
by GRFUNC_1:38;
end;

theorem Th3: :: AMISTD_2:3
for b1 being set
for b2, b3 being Function st b1 in (dom b2) \ (dom b3) holds
(b2 \ b3) . b1 = b2 . b1
proof end;

theorem Th4: :: AMISTD_2:4
for b1 being non empty finite set holds (card b1) - 1 = (card b1) -' 1
proof end;

definition
let c1 be functional set ;
func PA c1 -> Function means :Def1: :: AMISTD_2:def 1
( ( for b1 being set holds
( b1 in dom a2 iff for b2 being Function st b2 in a1 holds
b1 in dom b2 ) ) & ( for b1 being set st b1 in dom a2 holds
a2 . b1 = pi a1,b1 ) ) if not a1 is empty
otherwise a2 = {} ;
existence
( ( not c1 is empty implies ex b1 being Function st
( ( for b2 being set holds
( b2 in dom b1 iff for b3 being Function st b3 in c1 holds
b2 in dom b3 ) ) & ( for b2 being set st b2 in dom b1 holds
b1 . b2 = pi c1,b2 ) ) ) & ( c1 is empty implies ex b1 being Function st b1 = {} ) )
proof end;
uniqueness
for b1, b2 being Function holds
( ( not c1 is empty & ( for b3 being set holds
( b3 in dom b1 iff for b4 being Function st b4 in c1 holds
b3 in dom b4 ) ) & ( for b3 being set st b3 in dom b1 holds
b1 . b3 = pi c1,b3 ) & ( for b3 being set holds
( b3 in dom b2 iff for b4 being Function st b4 in c1 holds
b3 in dom b4 ) ) & ( for b3 being set st b3 in dom b2 holds
b2 . b3 = pi c1,b3 ) implies b1 = b2 ) & ( c1 is empty & b1 = {} & b2 = {} implies b1 = b2 ) )
proof end;
consistency
for b1 being Function holds verum
;
end;

:: deftheorem Def1 defines PA AMISTD_2:def 1 :
for b1 being functional set
for b2 being Function holds
( ( not b1 is empty implies ( b2 = PA b1 iff ( ( for b3 being set holds
( b3 in dom b2 iff for b4 being Function st b4 in b1 holds
b3 in dom b4 ) ) & ( for b3 being set st b3 in dom b2 holds
b2 . b3 = pi b1,b3 ) ) ) ) & ( b1 is empty implies ( b2 = PA b1 iff b2 = {} ) ) );

theorem Th5: :: AMISTD_2:5
for b1 being non empty functional set holds dom (PA b1) = meet { (dom b2) where B is Element of b1 : verum }
proof end;

theorem Th6: :: AMISTD_2:6
for b1 being non empty functional set
for b2 being set st b2 in dom (PA b1) holds
(PA b1) . b2 = { (b3 . b2) where B is Element of b1 : verum }
proof end;

definition
let c1 be set ;
attr a1 is product-like means :Def2: :: AMISTD_2:def 2
ex b1 being Function st a1 = product b1;
end;

:: deftheorem Def2 defines product-like AMISTD_2:def 2 :
for b1 being set holds
( b1 is product-like iff ex b2 being Function st b1 = product b2 );

registration
let c1 be Function;
cluster product a1 -> product-like ;
coherence
product c1 is product-like
by Def2;
end;

registration
cluster product-like -> functional with_common_domain set ;
coherence
for b1 being set st b1 is product-like holds
( b1 is functional & b1 is with_common_domain )
proof end;
end;

registration
cluster non empty functional with_common_domain product-like set ;
existence
ex b1 being set st
( b1 is product-like & not b1 is empty )
proof end;
end;

theorem Th7: :: AMISTD_2:7
for b1 being functional with_common_domain set holds dom (PA b1) = DOM b1
proof end;

theorem Th8: :: AMISTD_2:8
for b1 being functional set
for b2 being set st b2 in dom (PA b1) holds
(PA b1) . b2 = pi b1,b2
proof end;

theorem Th9: :: AMISTD_2:9
for b1 being functional with_common_domain set holds b1 c= product (PA b1)
proof end;

theorem Th10: :: AMISTD_2:10
for b1 being non empty product-like set holds b1 = product (PA b1)
proof end;

registration
let c1 be set ;
cluster -> functional FinSequenceSet of a1;
coherence
for b1 being FinSequenceSet of c1 holds b1 is functional
proof end;
end;

registration
let c1 be Nat;
let c2 be set ;
cluster a1 -tuples_on a2 -> functional with_common_domain ;
coherence
c1 -tuples_on c2 is with_common_domain
proof end;
end;

registration
let c1 be Nat;
let c2 be set ;
cluster a1 -tuples_on a2 -> functional with_common_domain product-like ;
coherence
c1 -tuples_on c2 is product-like
proof end;
end;

Lemma11: for b1 being natural number holds - 1 < b1
proof end;

Lemma12: for b1 being natural number
for b2, b3, b4 being Nat st 1 <= b2 & 2 <= b3 & not b1 < b2 - 1 & not ( b2 <= b1 & b1 <= (b2 + b3) - 3 ) & not b1 = (b2 + b3) - 2 & not (b2 + b3) - 2 < b1 holds
b1 = b2 - 1
proof end;

theorem Th11: :: AMISTD_2:11
for b1, b2 being set
for b3 being AMI-Struct of b2
for b4 being FinPartState of b3 holds b4 \ b1 is FinPartState of b3
proof end;

theorem Th12: :: AMISTD_2:12
for b1 being set
for b2 being with_non-empty_elements set
for b3 being non empty non void IC-Ins-separated definite AMI-Struct of b2
for b4 being programmed FinPartState of b3 holds b4 \ b1 is programmed FinPartState of b3
proof end;

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite AMI-Struct of c1;
let c3, c4 be Instruction-Location of c2;
let c5, c6 be Element of the Instructions of c2;
redefine func --> as c3,c4 --> c5,c6 -> FinPartState of a2;
coherence
c3,c4 --> c5,c6 is FinPartState of c2
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non void halting AMI-Struct of c1;
cluster halting Element of the Instructions of a2;
existence
ex b1 being Instruction of c2 st b1 is halting
proof end;
end;

theorem Th13: :: AMISTD_2:13
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being programmed lower FinPartState of b2
for b4 being programmed FinPartState of b2 st dom b3 = dom b4 holds
b4 is lower
proof end;

theorem Th14: :: AMISTD_2:14
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being programmed lower FinPartState of b2
for b4 being Instruction-Location of b2 st b4 in dom b3 holds
locnum b4 < card b3
proof end;

theorem Th15: :: AMISTD_2:15
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being programmed lower FinPartState of b2 holds dom b3 = { (il. b2,b4) where B is Nat : b4 < card b3 }
proof end;

definition
let c1 be set ;
let c2 be AMI-Struct of c1;
let c3 be Element of the Instructions of c2;
func AddressPart c3 -> set equals :: AMISTD_2:def 3
a3 `2 ;
coherence
c3 `2 is set
;
end;

:: deftheorem Def3 defines AddressPart AMISTD_2:def 3 :
for b1 being set
for b2 being AMI-Struct of b1
for b3 being Element of the Instructions of b2 holds AddressPart b3 = b3 `2 ;

definition
let c1 be set ;
let c2 be AMI-Struct of c1;
let c3 be Element of the Instructions of c2;
redefine func AddressPart as AddressPart c3 -> FinSequence of (union a1) \/ the carrier of a2;
coherence
AddressPart c3 is FinSequence of (union c1) \/ the carrier of c2
by FINSEQ_1:def 11;
end;

theorem Th16: :: AMISTD_2:16
for b1 being set
for b2 being AMI-Struct of b1
for b3, b4 being Element of the Instructions of b2 st InsCode b3 = InsCode b4 & AddressPart b3 = AddressPart b4 holds
b3 = b4
proof end;

definition
let c1 be set ;
let c2 be AMI-Struct of c1;
attr a2 is homogeneous means :Def4: :: AMISTD_2:def 4
for b1, b2 being Instruction of a2 st InsCode b1 = InsCode b2 holds
dom (AddressPart b1) = dom (AddressPart b2);
end;

:: deftheorem Def4 defines homogeneous AMISTD_2:def 4 :
for b1 being set
for b2 being AMI-Struct of b1 holds
( b2 is homogeneous iff for b3, b4 being Instruction of b2 st InsCode b3 = InsCode b4 holds
dom (AddressPart b3) = dom (AddressPart b4) );

theorem Th17: :: AMISTD_2:17
for b1 being with_non-empty_elements set
for b2 being Instruction of (STC b1) holds AddressPart b2 = 0
proof end;

definition
let c1 be set ;
let c2 be AMI-Struct of c1;
let c3 be InsType of c2;
func AddressParts c3 -> set equals :: AMISTD_2:def 5
{ (AddressPart b1) where B is Instruction of a2 : InsCode b1 = a3 } ;
coherence
{ (AddressPart b1) where B is Instruction of c2 : InsCode b1 = c3 } is set
;
end;

:: deftheorem Def5 defines AddressParts AMISTD_2:def 5 :
for b1 being set
for b2 being AMI-Struct of b1
for b3 being InsType of b2 holds AddressParts b3 = { (AddressPart b4) where B is Instruction of b2 : InsCode b4 = b3 } ;

registration
let c1 be set ;
let c2 be AMI-Struct of c1;
let c3 be InsType of c2;
cluster AddressParts a3 -> functional ;
coherence
AddressParts c3 is functional
proof end;
end;

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite AMI-Struct of c1;
let c3 be Instruction of c2;
attr a3 is with_explicit_jumps means :Def6: :: AMISTD_2:def 6
for b1 being set st b1 in JUMP a3 holds
ex b2 being set st
( b2 in dom (AddressPart a3) & b1 = (AddressPart a3) . b2 & (PA (AddressParts (InsCode a3))) . b2 = the Instruction-Locations of a2 );
attr a3 is without_implicit_jumps means :Def7: :: AMISTD_2:def 7
for b1 being set st ex b2 being set st
( b2 in dom (AddressPart a3) & b1 = (AddressPart a3) . b2 & (PA (AddressParts (InsCode a3))) . b2 = the Instruction-Locations of a2 ) holds
b1 in JUMP a3;
end;

:: deftheorem Def6 defines with_explicit_jumps AMISTD_2:def 6 :
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite AMI-Struct of b1
for b3 being Instruction of b2 holds
( b3 is with_explicit_jumps iff for b4 being set st b4 in JUMP b3 holds
ex b5 being set st
( b5 in dom (AddressPart b3) & b4 = (AddressPart b3) . b5 & (PA (AddressParts (InsCode b3))) . b5 = the Instruction-Locations of b2 ) );

:: deftheorem Def7 defines without_implicit_jumps AMISTD_2:def 7 :
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite AMI-Struct of b1
for b3 being Instruction of b2 holds
( b3 is without_implicit_jumps iff for b4 being set st ex b5 being set st
( b5 in dom (AddressPart b3) & b4 = (AddressPart b3) . b5 & (PA (AddressParts (InsCode b3))) . b5 = the Instruction-Locations of b2 ) holds
b4 in JUMP b3 );

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite AMI-Struct of c1;
attr a2 is with_explicit_jumps means :Def8: :: AMISTD_2:def 8
for b1 being Instruction of a2 holds b1 is with_explicit_jumps;
attr a2 is without_implicit_jumps means :Def9: :: AMISTD_2:def 9
for b1 being Instruction of a2 holds b1 is without_implicit_jumps;
end;

:: deftheorem Def8 defines with_explicit_jumps AMISTD_2:def 8 :
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite AMI-Struct of b1 holds
( b2 is with_explicit_jumps iff for b3 being Instruction of b2 holds b3 is with_explicit_jumps );

:: deftheorem Def9 defines without_implicit_jumps AMISTD_2:def 9 :
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite AMI-Struct of b1 holds
( b2 is without_implicit_jumps iff for b3 being Instruction of b2 holds b3 is without_implicit_jumps );

definition
let c1 be set ;
let c2 be AMI-Struct of c1;
attr a2 is with-non-trivial-Instruction-Locations means :Def10: :: AMISTD_2:def 10
not the Instruction-Locations of a2 is trivial;
end;

:: deftheorem Def10 defines with-non-trivial-Instruction-Locations AMISTD_2:def 10 :
for b1 being set
for b2 being AMI-Struct of b1 holds
( b2 is with-non-trivial-Instruction-Locations iff not the Instruction-Locations of b2 is trivial );

registration
let c1 be with_non-empty_elements set ;
cluster non empty non void IC-Ins-separated definite standard -> non empty non void IC-Ins-separated definite with-non-trivial-Instruction-Locations AMI-Struct of a1;
coherence
for b1 being non empty non void IC-Ins-separated definite AMI-Struct of c1 st b1 is standard holds
b1 is with-non-trivial-Instruction-Locations
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
cluster non empty non void IC-Ins-separated definite standard with-non-trivial-Instruction-Locations AMI-Struct of a1;
existence
ex b1 being non empty non void IC-Ins-separated definite AMI-Struct of c1 st b1 is standard
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be with-non-trivial-Instruction-Locations AMI-Struct of c1;
cluster the Instruction-Locations of a2 -> non trivial ;
coherence
not the Instruction-Locations of c2 is trivial
by Def10;
end;

theorem Th18: :: AMISTD_2:18
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being Instruction of b2 st ( for b4 being Instruction-Location of b2 holds NIC b3,b4 = {(NextLoc b4)} ) holds
JUMP b3 is empty
proof end;

registration
let c1 be with_non-empty_elements set ;
let c2 be Instruction of (STC c1);
cluster JUMP a2 -> empty ;
coherence
JUMP c2 is empty
proof end;
end;

definition
let c1 be set ;
let c2 be AMI-Struct of c1;
attr a2 is regular means :Def11: :: AMISTD_2:def 11
for b1 being InsType of a2 holds AddressParts b1 is product-like;
end;

:: deftheorem Def11 defines regular AMISTD_2:def 11 :
for b1 being set
for b2 being AMI-Struct of b1 holds
( b2 is regular iff for b3 being InsType of b2 holds AddressParts b3 is product-like );

registration
let c1 be set ;
cluster regular -> homogeneous AMI-Struct of a1;
coherence
for b1 being AMI-Struct of c1 st b1 is regular holds
b1 is homogeneous
proof end;
end;

theorem Th19: :: AMISTD_2:19
for b1 being with_non-empty_elements set
for b2 being InsType of (STC b1) holds AddressParts b2 = {0}
proof end;

registration
let c1 be with_non-empty_elements set ;
cluster STC a1 -> homogeneous with_explicit_jumps without_implicit_jumps with-non-trivial-Instruction-Locations regular ;
coherence
( STC c1 is with_explicit_jumps & STC c1 is without_implicit_jumps & STC c1 is regular )
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
cluster non empty non void halting IC-Ins-separated steady-programmed definite realistic programmable standard homogeneous with_explicit_jumps without_implicit_jumps with-non-trivial-Instruction-Locations regular AMI-Struct of a1;
existence
ex b1 being non empty non void IC-Ins-separated definite AMI-Struct of c1 st
( b1 is standard & b1 is regular & b1 is halting & b1 is realistic & b1 is steady-programmed & b1 is programmable & b1 is with_explicit_jumps & b1 is without_implicit_jumps )
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be regular AMI-Struct of c1;
let c3 be InsType of c2;
cluster AddressParts a3 -> functional with_common_domain product-like ;
coherence
AddressParts c3 is product-like
by Def11;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be homogeneous AMI-Struct of c1;
let c3 be InsType of c2;
cluster AddressParts a3 -> functional with_common_domain ;
coherence
AddressParts c3 is with_common_domain
proof end;
end;

theorem Th20: :: AMISTD_2:20
for b1 being with_non-empty_elements set
for b2 being non empty non void homogeneous AMI-Struct of b1
for b3 being Instruction of b2
for b4 being set st b4 in dom (AddressPart b3) & (PA (AddressParts (InsCode b3))) . b4 = the Instruction-Locations of b2 holds
(AddressPart b3) . b4 is Instruction-Location of b2
proof end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite with_explicit_jumps AMI-Struct of c1;
cluster -> with_explicit_jumps Element of the Instructions of a2;
coherence
for b1 being Instruction of c2 holds b1 is with_explicit_jumps
by Def8;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite without_implicit_jumps AMI-Struct of c1;
cluster -> without_implicit_jumps Element of the Instructions of a2;
coherence
for b1 being Instruction of c2 holds b1 is without_implicit_jumps
by Def9;
end;

theorem Th21: :: AMISTD_2:21
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite realistic with-non-trivial-Instruction-Locations AMI-Struct of b1
for b3 being Instruction of b2 st b3 is halting holds
JUMP b3 is empty
proof end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated definite realistic with-non-trivial-Instruction-Locations AMI-Struct of c1;
let c3 be halting Instruction of c2;
cluster JUMP a3 -> empty ;
coherence
JUMP c3 is empty
by Th21;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite with-non-trivial-Instruction-Locations AMI-Struct of c1;
cluster programmed non trivial FinPartState of a2;
existence
ex b1 being FinPartState of c2 st
( not b1 is trivial & b1 is programmed )
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated definite standard AMI-Struct of c1;
cluster non empty programmed trivial -> non empty programmed unique-halt FinPartState of a2;
coherence
for b1 being non empty programmed FinPartState of c2 st b1 is trivial holds
b1 is unique-halt
proof end;
end;

definition
let c1 be set ;
let c2 be AMI-Struct of c1;
let c3 be Instruction of c2;
attr a3 is ins-loc-free means :Def12: :: AMISTD_2:def 12
for b1 being set st b1 in dom (AddressPart a3) holds
(PA (AddressParts (InsCode a3))) . b1 <> the Instruction-Locations of a2;
end;

:: deftheorem Def12 defines ins-loc-free AMISTD_2:def 12 :
for b1 being set
for b2 being AMI-Struct of b1
for b3 being Instruction of b2 holds
( b3 is ins-loc-free iff for b4 being set st b4 in dom (AddressPart b3) holds
(PA (AddressParts (InsCode b3))) . b4 <> the Instruction-Locations of b2 );

theorem Th22: :: AMISTD_2:22
for b1 being with_non-empty_elements set
for b2 being non empty non void halting IC-Ins-separated definite realistic with_explicit_jumps with-non-trivial-Instruction-Locations AMI-Struct of b1
for b3 being Instruction of b2 st b3 is ins-loc-free holds
JUMP b3 is empty
proof end;

theorem Th23: :: AMISTD_2:23
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite realistic without_implicit_jumps with-non-trivial-Instruction-Locations AMI-Struct of b1
for b3 being Instruction of b2 st b3 is halting holds
b3 is ins-loc-free
proof end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite realistic without_implicit_jumps with-non-trivial-Instruction-Locations AMI-Struct of c1;
cluster halting -> without_implicit_jumps ins-loc-free Element of the Instructions of a2;
coherence
for b1 being Instruction of c2 st b1 is halting holds
b1 is ins-loc-free
by Th23;
end;

theorem Th24: :: AMISTD_2:24
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard without_implicit_jumps AMI-Struct of b1
for b3 being Instruction of b2 st b3 is sequential holds
b3 is ins-loc-free
proof end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard without_implicit_jumps AMI-Struct of c1;
cluster sequential -> without_implicit_jumps ins-loc-free Element of the Instructions of a2;
coherence
for b1 being Instruction of c2 st b1 is sequential holds
b1 is ins-loc-free
by Th24;
end;

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated definite standard AMI-Struct of c1;
func Stop c2 -> FinPartState of a2 equals :: AMISTD_2:def 13
(il. a2,0) .--> (halt a2);
coherence
(il. c2,0) .--> (halt c2) is FinPartState of c2
;
end;

:: deftheorem Def13 defines Stop AMISTD_2:def 13 :
for b1 being with_non-empty_elements set
for b2 being non empty non void halting IC-Ins-separated definite standard AMI-Struct of b1 holds Stop b2 = (il. b2,0) .--> (halt b2);

E34: now
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated definite standard AMI-Struct of c1;
thus dom (Stop c2) = dom ((il. c2,0) .--> (halt c2))
.= {(il. c2,0)} by CQC_LANG:5 ;
hence il. c2,0 in dom (Stop c2) by TARSKI:def 1;
end;

Lemma35: for b1 being with_non-empty_elements set
for b2 being non empty non void halting IC-Ins-separated definite standard AMI-Struct of b1 holds (Stop b2) . (il. b2,0) = halt b2
by CQC_LANG:6;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated definite standard AMI-Struct of c1;
cluster Stop a2 -> non empty programmed lower unique-halt trivial ;
coherence
( Stop c2 is lower & not Stop c2 is empty & Stop c2 is programmed & Stop c2 is trivial )
by AMISTD_1:48;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated definite realistic standard AMI-Struct of c1;
cluster Stop a2 -> non empty programmed closed lower unique-halt trivial ;
coherence
Stop c2 is closed
by AMISTD_1:46;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated steady-programmed definite standard AMI-Struct of c1;
cluster Stop a2 -> non empty autonomic programmed lower unique-halt trivial ;
coherence
Stop c2 is autonomic
by AMISTD_1:12;
end;

theorem Th25: :: AMISTD_2:25
for b1 being with_non-empty_elements set
for b2 being non empty non void halting IC-Ins-separated definite standard AMI-Struct of b1 holds card (Stop b2) = 1
proof end;

theorem Th26: :: AMISTD_2:26
for b1 being with_non-empty_elements set
for b2 being non empty non void halting IC-Ins-separated definite standard AMI-Struct of b1
for b3 being pre-Macro of b2 st card b3 = 1 holds
b3 = Stop b2
proof end;

Lemma38: for b1 being with_non-empty_elements set
for b2 being non empty non void halting IC-Ins-separated definite standard AMI-Struct of b1 holds (card (Stop b2)) -' 1 = 0
proof end;

theorem Th27: :: AMISTD_2:27
for b1 being with_non-empty_elements set
for b2 being non empty non void halting IC-Ins-separated definite standard AMI-Struct of b1 holds LastLoc (Stop b2) = il. b2,0
proof end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated definite standard AMI-Struct of c1;
cluster Stop a2 -> non empty programmed lower halt-ending unique-halt trivial ;
coherence
( Stop c2 is halt-ending & Stop c2 is unique-halt )
proof end;
end;

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated definite standard AMI-Struct of c1;
redefine func Stop as Stop c2 -> pre-Macro of a2;
coherence
Stop c2 is pre-Macro of c2
;
end;

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard regular AMI-Struct of c1;
let c3 be Element of the Instructions of c2;
let c4 be natural number ;
func IncAddr c3,c4 -> Instruction of a2 means :Def14: :: AMISTD_2:def 14
( InsCode a5 = InsCode a3 & dom (AddressPart a5) = dom (AddressPart a3) & ( for b1 being set st b1 in dom (AddressPart a3) holds
( ( (PA (AddressParts (InsCode a3))) . b1 = the Instruction-Locations of a2 implies ex b2 being Instruction-Location of a2 st
( b2 = (AddressPart a3) . b1 & (AddressPart a5) . b1 = il. a2,(a4 + (locnum b2)) ) ) & ( (PA (AddressParts (InsCode a3))) . b1 <> the Instruction-Locations of a2 implies (AddressPart a5) . b1 = (AddressPart a3) . b1 ) ) ) );
existence
ex b1 being Instruction of c2 st
( InsCode b1 = InsCode c3 & dom (AddressPart b1) = dom (AddressPart c3) & ( for b2 being set st b2 in dom (AddressPart c3) holds
( ( (PA (AddressParts (InsCode c3))) . b2 = the Instruction-Locations of c2 implies ex b3 being Instruction-Location of c2 st
( b3 = (AddressPart c3) . b2 & (AddressPart b1) . b2 = il. c2,(c4 + (locnum b3)) ) ) & ( (PA (AddressParts (InsCode c3))) . b2 <> the Instruction-Locations of c2 implies (AddressPart b1) . b2 = (AddressPart c3) . b2 ) ) ) )
proof end;
uniqueness
for b1, b2 being Instruction of c2 st InsCode b1 = InsCode c3 & dom (AddressPart b1) = dom (AddressPart c3) & ( for b3 being set st b3 in dom (AddressPart c3) holds
( ( (PA (AddressParts (InsCode c3))) . b3 = the Instruction-Locations of c2 implies ex b4 being Instruction-Location of c2 st
( b4 = (AddressPart c3) . b3 & (AddressPart b1) . b3 = il. c2,(c4 + (locnum b4)) ) ) & ( (PA (AddressParts (InsCode c3))) . b3 <> the Instruction-Locations of c2 implies (AddressPart b1) . b3 = (AddressPart c3) . b3 ) ) ) & InsCode b2 = InsCode c3 & dom (AddressPart b2) = dom (AddressPart c3) & ( for b3 being set st b3 in dom (AddressPart c3) holds
( ( (PA (AddressParts (InsCode c3))) . b3 = the Instruction-Locations of c2 implies ex b4 being Instruction-Location of c2 st
( b4 = (AddressPart c3) . b3 & (AddressPart b2) . b3 = il. c2,(c4 + (locnum b4)) ) ) & ( (PA (AddressParts (InsCode c3))) . b3 <> the Instruction-Locations of c2 implies (AddressPart b2) . b3 = (AddressPart c3) . b3 ) ) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def14 defines IncAddr AMISTD_2:def 14 :
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3 being Element of the Instructions of b2
for b4 being natural number
for b5 being Instruction of b2 holds
( b5 = IncAddr b3,b4 iff ( InsCode b5 = InsCode b3 & dom (AddressPart b5) = dom (AddressPart b3) & ( for b6 being set st b6 in dom (AddressPart b3) holds
( ( (PA (AddressParts (InsCode b3))) . b6 = the Instruction-Locations of b2 implies ex b7 being Instruction-Location of b2 st
( b7 = (AddressPart b3) . b6 & (AddressPart b5) . b6 = il. b2,(b4 + (locnum b7)) ) ) & ( (PA (AddressParts (InsCode b3))) . b6 <> the Instruction-Locations of b2 implies (AddressPart b5) . b6 = (AddressPart b3) . b6 ) ) ) ) );

theorem Th28: :: AMISTD_2:28
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3 being Element of the Instructions of b2 holds IncAddr b3,0 = b3
proof end;

theorem Th29: :: AMISTD_2:29
for b1 being natural number
for b2 being with_non-empty_elements set
for b3 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b2
for b4 being Instruction of b3 st b4 is ins-loc-free holds
IncAddr b4,b1 = b4
proof end;

theorem Th30: :: AMISTD_2:30
for b1 being natural number
for b2 being with_non-empty_elements set
for b3 being non empty non void halting IC-Ins-separated definite realistic standard without_implicit_jumps regular AMI-Struct of b2 holds IncAddr (halt b3),b1 = halt b3 by Th29;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated definite realistic standard without_implicit_jumps regular AMI-Struct of c1;
let c3 be halting Instruction of c2;
let c4 be natural number ;
cluster IncAddr a3,a4 -> halting without_implicit_jumps ins-loc-free ;
coherence
IncAddr c3,c4 is halting
by Th29;
end;

theorem Th31: :: AMISTD_2:31
for b1 being natural number
for b2 being with_non-empty_elements set
for b3 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b2
for b4 being Instruction of b3 holds AddressParts (InsCode b4) = AddressParts (InsCode (IncAddr b4,b1))
proof end;

theorem Th32: :: AMISTD_2:32
for b1 being set
for b2 being with_non-empty_elements set
for b3 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b2
for b4, b5 being Instruction of b3 st ex b6 being natural number st IncAddr b4,b6 = IncAddr b5,b6 & (PA (AddressParts (InsCode b4))) . b1 = the Instruction-Locations of b3 holds
(PA (AddressParts (InsCode b5))) . b1 = the Instruction-Locations of b3
proof end;

theorem Th33: :: AMISTD_2:33
for b1 being set
for b2 being with_non-empty_elements set
for b3 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b2
for b4, b5 being Instruction of b3 st ex b6 being natural number st IncAddr b4,b6 = IncAddr b5,b6 & (PA (AddressParts (InsCode b4))) . b1 <> the Instruction-Locations of b3 holds
(PA (AddressParts (InsCode b5))) . b1 <> the Instruction-Locations of b3
proof end;

theorem Th34: :: AMISTD_2:34
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3, b4 being Instruction of b2 st ex b5 being natural number st IncAddr b3,b5 = IncAddr b4,b5 holds
b3 = b4
proof end;

theorem Th35: :: AMISTD_2:35
for b1 being natural number
for b2 being with_non-empty_elements set
for b3 being non empty non void halting IC-Ins-separated definite realistic standard without_implicit_jumps regular AMI-Struct of b2
for b4 being Instruction of b3 st IncAddr b4,b1 = halt b3 holds
b4 = halt b3
proof end;

theorem Th36: :: AMISTD_2:36
for b1 being natural number
for b2 being with_non-empty_elements set
for b3 being non empty non void halting IC-Ins-separated definite realistic standard without_implicit_jumps regular AMI-Struct of b2
for b4 being Instruction of b3 st b4 is sequential holds
IncAddr b4,b1 is sequential
proof end;

theorem Th37: :: AMISTD_2:37
for b1, b2 being natural number
for b3 being with_non-empty_elements set
for b4 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b3
for b5 being Instruction of b4 holds IncAddr (IncAddr b5,b1),b2 = IncAddr b5,(b1 + b2)
proof end;

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard regular AMI-Struct of c1;
let c3 be programmed FinPartState of c2;
let c4 be natural number ;
E49: dom c3 c= the Instruction-Locations of c2 by AMI_3:def 13;
func IncAddr c3,c4 -> FinPartState of a2 means :Def15: :: AMISTD_2:def 15
( dom a5 = dom a3 & ( for b1 being natural number st il. a2,b1 in dom a3 holds
a5 . (il. a2,b1) = IncAddr (pi a3,(il. a2,b1)),a4 ) );
existence
ex b1 being FinPartState of c2 st
( dom b1 = dom c3 & ( for b2 being natural number st il. c2,b2 in dom c3 holds
b1 . (il. c2,b2) = IncAddr (pi c3,(il. c2,b2)),c4 ) )
proof end;
uniqueness
for b1, b2 being FinPartState of c2 st dom b1 = dom c3 & ( for b3 being natural number st il. c2,b3 in dom c3 holds
b1 . (il. c2,b3) = IncAddr (pi c3,(il. c2,b3)),c4 ) & dom b2 = dom c3 & ( for b3 being natural number st il. c2,b3 in dom c3 holds
b2 . (il. c2,b3) = IncAddr (pi c3,(il. c2,b3)),c4 ) holds
b1 = b2
proof end;
end;

:: deftheorem Def15 defines IncAddr AMISTD_2:def 15 :
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3 being programmed FinPartState of b2
for b4 being natural number
for b5 being FinPartState of b2 holds
( b5 = IncAddr b3,b4 iff ( dom b5 = dom b3 & ( for b6 being natural number st il. b2,b6 in dom b3 holds
b5 . (il. b2,b6) = IncAddr (pi b3,(il. b2,b6)),b4 ) ) );

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard regular AMI-Struct of c1;
let c3 be programmed FinPartState of c2;
let c4 be natural number ;
cluster IncAddr a3,a4 -> programmed ;
coherence
IncAddr c3,c4 is programmed
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard regular AMI-Struct of c1;
let c3 be empty programmed FinPartState of c2;
let c4 be natural number ;
cluster IncAddr a3,a4 -> empty programmed ;
coherence
IncAddr c3,c4 is empty
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard regular AMI-Struct of c1;
let c3 be non empty programmed FinPartState of c2;
let c4 be natural number ;
cluster IncAddr a3,a4 -> non empty programmed ;
coherence
not IncAddr c3,c4 is empty
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard regular AMI-Struct of c1;
let c3 be programmed lower FinPartState of c2;
let c4 be natural number ;
cluster IncAddr a3,a4 -> programmed lower ;
coherence
IncAddr c3,c4 is lower
proof end;
end;

theorem Th38: :: AMISTD_2:38
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3 being programmed FinPartState of b2 holds IncAddr b3,0 = b3
proof end;

theorem Th39: :: AMISTD_2:39
for b1, b2 being natural number
for b3 being with_non-empty_elements set
for b4 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b3
for b5 being programmed lower FinPartState of b4 holds IncAddr (IncAddr b5,b1),b2 = IncAddr b5,(b1 + b2)
proof end;

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard AMI-Struct of c1;
let c3 be FinPartState of c2;
let c4 be natural number ;
func Shift c3,c4 -> FinPartState of a2 means :Def16: :: AMISTD_2:def 16
( dom a5 = { (il. a2,(b1 + a4)) where B is Nat : il. a2,b1 in dom a3 } & ( for b1 being Nat st il. a2,b1 in dom a3 holds
a5 . (il. a2,(b1 + a4)) = a3 . (il. a2,b1) ) );
existence
ex b1 being FinPartState of c2 st
( dom b1 = { (il. c2,(b2 + c4)) where B is Nat : il. c2,b2 in dom c3 } & ( for b2 being Nat st il. c2,b2 in dom c3 holds
b1 . (il. c2,(b2 + c4)) = c3 . (il. c2,b2) ) )
proof end;
uniqueness
for b1, b2 being FinPartState of c2 st dom b1 = { (il. c2,(b3 + c4)) where B is Nat : il. c2,b3 in dom c3 } & ( for b3 being Nat st il. c2,b3 in dom c3 holds
b1 . (il. c2,(b3 + c4)) = c3 . (il. c2,b3) ) & dom b2 = { (il. c2,(b3 + c4)) where B is Nat : il. c2,b3 in dom c3 } & ( for b3 being Nat st il. c2,b3 in dom c3 holds
b2 . (il. c2,(b3 + c4)) = c3 . (il. c2,b3) ) holds
b1 = b2
proof end;
end;

:: deftheorem Def16 defines Shift AMISTD_2:def 16 :
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being FinPartState of b2
for b4 being natural number
for b5 being FinPartState of b2 holds
( b5 = Shift b3,b4 iff ( dom b5 = { (il. b2,(b6 + b4)) where B is Nat : il. b2,b6 in dom b3 } & ( for b6 being Nat st il. b2,b6 in dom b3 holds
b5 . (il. b2,(b6 + b4)) = b3 . (il. b2,b6) ) ) );

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard AMI-Struct of c1;
let c3 be FinPartState of c2;
let c4 be natural number ;
cluster Shift a3,a4 -> programmed ;
coherence
Shift c3,c4 is programmed
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard AMI-Struct of c1;
let c3 be empty FinPartState of c2;
let c4 be natural number ;
cluster Shift a3,a4 -> empty programmed ;
coherence
Shift c3,c4 is empty
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard AMI-Struct of c1;
let c3 be non empty programmed FinPartState of c2;
let c4 be natural number ;
cluster Shift a3,a4 -> non empty programmed ;
coherence
not Shift c3,c4 is empty
proof end;
end;

theorem Th40: :: AMISTD_2:40
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being programmed FinPartState of b2 holds Shift b3,0 = b3
proof end;

theorem Th41: :: AMISTD_2:41
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being FinPartState of b2
for b4 being natural number st b4 > 0 holds
not il. b2,0 in dom (Shift b3,b4)
proof end;

theorem Th42: :: AMISTD_2:42
for b1, b2 being natural number
for b3 being with_non-empty_elements set
for b4 being non empty non void IC-Ins-separated definite standard AMI-Struct of b3
for b5 being FinPartState of b4 holds Shift (Shift b5,b1),b2 = Shift b5,(b1 + b2)
proof end;

theorem Th43: :: AMISTD_2:43
for b1 being natural number
for b2 being with_non-empty_elements set
for b3 being non empty non void IC-Ins-separated definite standard AMI-Struct of b2
for b4 being programmed FinPartState of b3 holds dom b4, dom (Shift b4,b1) are_equipotent
proof end;

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard regular AMI-Struct of c1;
let c3 be Instruction of c2;
attr a3 is IC-good means :Def17: :: AMISTD_2:def 17
for b1 being natural number
for b2, b3 being State of a2 st b3 = b2 +* ((IC a2) .--> ((IC b2) + b1)) holds
(IC (Exec a3,b2)) + b1 = IC (Exec (IncAddr a3,b1),b3);
end;

:: deftheorem Def17 defines IC-good AMISTD_2:def 17 :
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3 being Instruction of b2 holds
( b3 is IC-good iff for b4 being natural number
for b5, b6 being State of b2 st b6 = b5 +* ((IC b2) .--> ((IC b5) + b4)) holds
(IC (Exec b3,b5)) + b4 = IC (Exec (IncAddr b3,b4),b6) );

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard regular AMI-Struct of c1;
attr a2 is IC-good means :Def18: :: AMISTD_2:def 18
for b1 being Instruction of a2 holds b1 is IC-good;
end;

:: deftheorem Def18 defines IC-good AMISTD_2:def 18 :
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1 holds
( b2 is IC-good iff for b3 being Instruction of b2 holds b3 is IC-good );

definition
let c1 be with_non-empty_elements set ;
let c2 be non void AMI-Struct of c1;
let c3 be Instruction of c2;
attr a3 is Exec-preserving means :Def19: :: AMISTD_2:def 19
for b1, b2 being State of a2 st b1,b2 equal_outside the Instruction-Locations of a2 holds
Exec a3,b1, Exec a3,b2 equal_outside the Instruction-Locations of a2;
end;

:: deftheorem Def19 defines Exec-preserving AMISTD_2:def 19 :
for b1 being with_non-empty_elements set
for b2 being non void AMI-Struct of b1
for b3 being Instruction of b2 holds
( b3 is Exec-preserving iff for b4, b5 being State of b2 st b4,b5 equal_outside the Instruction-Locations of b2 holds
Exec b3,b4, Exec b3,b5 equal_outside the Instruction-Locations of b2 );

definition
let c1 be with_non-empty_elements set ;
let c2 be non void AMI-Struct of c1;
attr a2 is Exec-preserving means :Def20: :: AMISTD_2:def 20
for b1 being Instruction of a2 holds b1 is Exec-preserving;
end;

:: deftheorem Def20 defines Exec-preserving AMISTD_2:def 20 :
for b1 being with_non-empty_elements set
for b2 being non void AMI-Struct of b1 holds
( b2 is Exec-preserving iff for b3 being Instruction of b2 holds b3 is Exec-preserving );

theorem Th44: :: AMISTD_2:44
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard without_implicit_jumps regular AMI-Struct of b1
for b3 being Instruction of b2 st b3 is sequential holds
b3 is IC-good
proof end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard without_implicit_jumps regular AMI-Struct of c1;
cluster sequential -> without_implicit_jumps IC-good Element of the Instructions of a2;
coherence
for b1 being Instruction of c2 st b1 is sequential holds
b1 is IC-good
by Th44;
end;

theorem Th45: :: AMISTD_2:45
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite realistic standard without_implicit_jumps regular AMI-Struct of b1
for b3 being Instruction of b2 st b3 is halting holds
b3 is IC-good
proof end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite realistic standard without_implicit_jumps regular AMI-Struct of c1;
cluster halting -> without_implicit_jumps IC-good Element of the Instructions of a2;
coherence
for b1 being Instruction of c2 st b1 is halting holds
b1 is IC-good
by Th45;
end;

theorem Th46: :: AMISTD_2:46
for b1 being with_non-empty_elements set
for b2 being non void AMI-Struct of b1
for b3 being Instruction of b2 st b3 is halting holds
b3 is Exec-preserving
proof end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non void AMI-Struct of c1;
cluster halting -> Exec-preserving Element of the Instructions of a2;
coherence
for b1 being Instruction of c2 st b1 is halting holds
b1 is Exec-preserving
by Th46;
end;

registration
let c1 be with_non-empty_elements set ;
cluster STC a1 -> homogeneous with_explicit_jumps without_implicit_jumps with-non-trivial-Instruction-Locations regular IC-good Exec-preserving ;
coherence
( STC c1 is IC-good & STC c1 is Exec-preserving )
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
cluster non empty non void halting IC-Ins-separated steady-programmed definite realistic programmable standard homogeneous with_explicit_jumps without_implicit_jumps with-non-trivial-Instruction-Locations regular IC-good Exec-preserving AMI-Struct of a1;
existence
ex b1 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of c1 st
( b1 is halting & b1 is realistic & b1 is steady-programmed & b1 is programmable & b1 is with_explicit_jumps & b1 is without_implicit_jumps & b1 is IC-good & b1 is Exec-preserving )
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard regular IC-good AMI-Struct of c1;
cluster -> IC-good Element of the Instructions of a2;
coherence
for b1 being Instruction of c2 holds b1 is IC-good
by Def18;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non void Exec-preserving AMI-Struct of c1;
cluster -> Exec-preserving Element of the Instructions of a2;
coherence
for b1 being Instruction of c2 holds b1 is Exec-preserving
by Def20;
end;

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard AMI-Struct of c1;
let c3 be non empty programmed FinPartState of c2;
func CutLastLoc c3 -> FinPartState of a2 equals :: AMISTD_2:def 21
a3 \ ((LastLoc a3) .--> (a3 . (LastLoc a3)));
coherence
c3 \ ((LastLoc c3) .--> (c3 . (LastLoc c3))) is FinPartState of c2
by Th11;
end;

:: deftheorem Def21 defines CutLastLoc AMISTD_2:def 21 :
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being non empty programmed FinPartState of b2 holds CutLastLoc b3 = b3 \ ((LastLoc b3) .--> (b3 . (LastLoc b3)));

Lemma62: for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being non empty programmed FinPartState of b2 holds CutLastLoc b3 c= b3
by XBOOLE_1:36;

theorem Th47: :: AMISTD_2:47
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being non empty programmed FinPartState of b2 holds dom (CutLastLoc b3) = (dom b3) \ {(LastLoc b3)}
proof end;

theorem Th48: :: AMISTD_2:48
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being non empty programmed FinPartState of b2 holds dom b3 = (dom (CutLastLoc b3)) \/ {(LastLoc b3)}
proof end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard AMI-Struct of c1;
let c3 be non empty programmed trivial FinPartState of c2;
cluster CutLastLoc a3 -> empty ;
coherence
CutLastLoc c3 is empty
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard AMI-Struct of c1;
let c3 be non empty programmed FinPartState of c2;
cluster CutLastLoc a3 -> programmed ;
coherence
CutLastLoc c3 is programmed
by Th12;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard AMI-Struct of c1;
let c3 be non empty programmed lower FinPartState of c2;
cluster CutLastLoc a3 -> programmed lower ;
coherence
CutLastLoc c3 is lower
proof end;
end;

theorem Th49: :: AMISTD_2:49
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard AMI-Struct of b1
for b3 being non empty programmed FinPartState of b2 holds card (CutLastLoc b3) = (card b3) - 1
proof end;

theorem Th50: :: AMISTD_2:50
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3 being non empty programmed lower FinPartState of b2
for b4 being non empty programmed FinPartState of b2 holds dom (CutLastLoc b3) misses dom (Shift (IncAddr b4,((card b3) -' 1)),((card b3) -' 1))
proof end;

theorem Th51: :: AMISTD_2:51
for b1 being with_non-empty_elements set
for b2 being non empty non void halting IC-Ins-separated definite standard AMI-Struct of b1
for b3 being non empty programmed lower unique-halt FinPartState of b2
for b4 being Instruction-Location of b2 st b4 in dom (CutLastLoc b3) holds
(CutLastLoc b3) . b4 <> halt b2
proof end;

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard regular AMI-Struct of c1;
let c3, c4 be non empty programmed FinPartState of c2;
func c3 ';' c4 -> FinPartState of a2 equals :: AMISTD_2:def 22
(CutLastLoc a3) +* (Shift (IncAddr a4,((card a3) -' 1)),((card a3) -' 1));
coherence
(CutLastLoc c3) +* (Shift (IncAddr c4,((card c3) -' 1)),((card c3) -' 1)) is FinPartState of c2
;
end;

:: deftheorem Def22 defines ';' AMISTD_2:def 22 :
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3, b4 being non empty programmed FinPartState of b2 holds b3 ';' b4 = (CutLastLoc b3) +* (Shift (IncAddr b4,((card b3) -' 1)),((card b3) -' 1));

Lemma68: for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3, b4 being non empty programmed FinPartState of b2 holds dom (b3 ';' b4) = (dom (CutLastLoc b3)) \/ (dom (Shift (IncAddr b4,((card b3) -' 1)),((card b3) -' 1)))
by FUNCT_4:def 1;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard regular AMI-Struct of c1;
let c3, c4 be non empty programmed FinPartState of c2;
cluster a3 ';' a4 -> non empty programmed ;
coherence
( not c3 ';' c4 is empty & c3 ';' c4 is programmed )
;
end;

theorem Th52: :: AMISTD_2:52
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3 being non empty programmed lower FinPartState of b2
for b4 being non empty programmed FinPartState of b2 holds
( card (b3 ';' b4) = ((card b3) + (card b4)) - 1 & card (b3 ';' b4) = ((card b3) + (card b4)) -' 1 )
proof end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void IC-Ins-separated definite standard regular AMI-Struct of c1;
let c3, c4 be non empty programmed lower FinPartState of c2;
cluster a3 ';' a4 -> non empty programmed lower ;
coherence
c3 ';' c4 is lower
proof end;
end;

theorem Th53: :: AMISTD_2:53
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3, b4 being non empty programmed lower FinPartState of b2 holds dom b3 c= dom (b3 ';' b4)
proof end;

theorem Th54: :: AMISTD_2:54
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3, b4 being non empty programmed lower FinPartState of b2 holds CutLastLoc b3 c= CutLastLoc (b3 ';' b4)
proof end;

theorem Th55: :: AMISTD_2:55
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3, b4 being non empty programmed lower FinPartState of b2 holds (b3 ';' b4) . (LastLoc b3) = (IncAddr b4,((card b3) -' 1)) . (il. b2,0)
proof end;

theorem Th56: :: AMISTD_2:56
for b1 being with_non-empty_elements set
for b2 being non empty non void IC-Ins-separated definite standard regular AMI-Struct of b1
for b3, b4 being non empty programmed lower FinPartState of b2
for b5 being Instruction-Location of b2 st locnum b5 < (card b3) - 1 holds
(IncAddr b3,((card b3) -' 1)) . b5 = (IncAddr (b3 ';' b4),((card b3) -' 1)) . b5
proof end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated steady-programmed definite realistic standard without_implicit_jumps regular AMI-Struct of c1;
let c3 be non empty programmed lower FinPartState of c2;
let c4 be non empty programmed lower halt-ending FinPartState of c2;
cluster a3 ';' a4 -> non empty programmed lower halt-ending ;
coherence
c3 ';' c4 is halt-ending
proof end;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated steady-programmed definite realistic standard without_implicit_jumps regular AMI-Struct of c1;
let c3, c4 be non empty programmed lower halt-ending unique-halt FinPartState of c2;
cluster a3 ';' a4 -> non empty programmed lower halt-ending unique-halt ;
coherence
c3 ';' c4 is unique-halt
proof end;
end;

definition
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated steady-programmed definite realistic standard without_implicit_jumps regular AMI-Struct of c1;
let c3, c4 be pre-Macro of c2;
redefine func ';' as c3 ';' c4 -> pre-Macro of a2;
coherence
c3 ';' c4 is pre-Macro of c2
;
end;

registration
let c1 be with_non-empty_elements set ;
let c2 be non empty non void halting IC-Ins-separated steady-programmed definite realistic standard regular IC-good Exec-preserving AMI-Struct of c1;
let c3, c4 be non empty programmed closed lower FinPartState of c2;
cluster a3 ';' a4 -> non empty programmed closed lower ;
coherence
c3 ';' c4 is closed
proof end;
end;

theorem Th57: :: AMISTD_2:57
for b1 being natural number
for b2 being with_non-empty_elements set
for b3 being non empty non void halting IC-Ins-separated definite realistic standard without_implicit_jumps regular AMI-Struct of b2 holds IncAddr (Stop b3),b1 = Stop b3
proof end;

theorem Th58: :: AMISTD_2:58
for b1 being natural number
for b2 being with_non-empty_elements set
for b3 being non empty non void halting IC-Ins-separated definite standard AMI-Struct of b2 holds Shift (Stop b3),b1 = (il. b3,b1) .--> (halt b3)
proof end;

theorem Th59: :: AMISTD_2:59
for b1 being with_non-empty_elements set
for b2 being non empty non void halting IC-Ins-separated definite realistic standard without_implicit_jumps regular AMI-Struct of b1
for b3 being pre-Macro of b2 holds b3 ';' (Stop b2) = b3
proof end;

theorem Th60: :: AMISTD_2:60
for b1 being with_non-empty_elements set
for b2 being non empty non void halting IC-Ins-separated definite standard regular AMI-Struct of b1
for b3 being pre-Macro of b2 holds (Stop b2) ';' b3 = b3
proof end;

theorem Th61: :: AMISTD_2:61
for b1 being with_non-empty_elements set
for b2 being non empty non void halting IC-Ins-separated steady-programmed definite realistic standard without_implicit_jumps regular AMI-Struct of b1
for b3, b4, b5 being pre-Macro of b2 holds (b3 ';' b4) ';' b5 = b3 ';' (b4 ';' b5)
proof end;