set SA0 = Start-At (0,SCM+FSA);
set iS = Initialize ((intloc 0) .--> 1);
reconsider EP = {} as PartState of SCM+FSA by FUNCT_1:104, RELAT_1:171;
Lm1:
IC (Initialize ((intloc 0) .--> 1)) = 0
by MEMSTR_0:def 11;
Lm2: dom (Initialize ((intloc 0) .--> 1)) =
(dom ((intloc 0) .--> 1)) \/ (dom (Start-At (0,SCM+FSA)))
by FUNCT_4:def 1
.=
{(intloc 0)} \/ (dom (Start-At (0,SCM+FSA)))
.=
{(intloc 0)} \/ {(IC )}
;
canceled;
theorem Th4:
for
s1,
s2 being
State of
SCM+FSA for
p1,
p2 being
Instruction-Sequence of
SCM+FSA for
J being
really-closed InitHalting Program of
SCM+FSA st
Initialize ((intloc 0) .--> 1) c= s1 &
J c= p1 holds
for
n being
Nat st
Reloc (
J,
n)
c= p2 &
IC s2 = n &
DataPart s1 = DataPart s2 holds
for
i being
Nat holds
(
(IC (Comput (p1,s1,i))) + n = IC (Comput (p2,s2,i)) &
IncAddr (
(CurInstr (p1,(Comput (p1,s1,i)))),
n)
= CurInstr (
p2,
(Comput (p2,s2,i))) &
DataPart (Comput (p1,s1,i)) = DataPart (Comput (p2,s2,i)) )
theorem Th5:
for
s1,
s2 being
State of
SCM+FSA for
p1,
p2 being
Instruction-Sequence of
SCM+FSA for
I being
really-closed InitHalting Program of
SCM+FSA st
Initialize ((intloc 0) .--> 1) c= s1 &
Initialize ((intloc 0) .--> 1) c= s2 &
I c= p1 &
I c= p2 &
s1 = s2 holds
for
k being
Nat holds
(
Comput (
p1,
s1,
k)
= Comput (
p2,
s2,
k) &
CurInstr (
p1,
(Comput (p1,s1,k)))
= CurInstr (
p2,
(Comput (p2,s2,k))) )
theorem Th13:
for
p being
Instruction-Sequence of
SCM+FSA for
I being
really-closed InitHalting keepInt0_1 Program of
SCM+FSA for
J being
really-closed InitHalting Program of
SCM+FSA for
s being
State of
SCM+FSA st
Initialize ((intloc 0) .--> 1) c= s &
I ";" J c= p holds
(
IC (Comput (p,s,((LifeSpan ((p +* I),s)) + 1))) = card I &
DataPart (Comput (p,s,((LifeSpan ((p +* I),s)) + 1))) = DataPart ((Comput ((p +* I),s,(LifeSpan ((p +* I),s)))) +* (Initialize ((intloc 0) .--> 1))) &
Reloc (
J,
(card I))
c= p &
(Comput (p,s,((LifeSpan ((p +* I),s)) + 1))) . (intloc 0) = 1 &
p halts_on s &
LifeSpan (
p,
s)
= ((LifeSpan ((p +* I),s)) + 1) + (LifeSpan (((p +* I) +* J),((Result ((p +* I),s)) +* (Initialize ((intloc 0) .--> 1))))) & (
J is
keeping_0 implies
(Result (p,s)) . (intloc 0) = 1 ) )
theorem Th14:
for
s being
State of
SCM+FSA for
p being
Instruction-Sequence of
SCM+FSA for
I being
really-closed keepInt0_1 Program of
SCM+FSA st
p +* I halts_on s holds
for
J being
really-closed Program of
SCM+FSA st
Initialize ((intloc 0) .--> 1) c= s &
I ";" J c= p holds
for
k being
Element of
NAT holds
(Comput (((p +* I) +* J),((Result ((p +* I),s)) +* (Initialize ((intloc 0) .--> 1))),k)) +* (Start-At (((IC (Comput (((p +* I) +* J),((Result ((p +* I),s)) +* (Initialize ((intloc 0) .--> 1))),k))) + (card I)),SCM+FSA)) = Comput (
(p +* (I ";" J)),
s,
(((LifeSpan ((p +* I),s)) + 1) + k))
canceled;
theorem Th32:
for
p being
Instruction-Sequence of
SCM+FSA for
I,
J being
really-closed MacroInstruction of
SCM+FSA for
a being
read-write Int-Location for
s being
State of
SCM+FSA st
s . a <> 0 &
J is_halting_onInit s,
p holds
IExec (
(if=0 (a,I,J)),
p,
s)
= (IExec (J,p,s)) +* (Start-At ((((card I) + (card J)) + 3),SCM+FSA)) by Th27, SCMFSA8B:16;
theorem Th33:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I,
J being
really-closed InitHalting MacroInstruction of
SCM+FSA for
a being
read-write Int-Location holds
(
if=0 (
a,
I,
J) is
InitHalting & (
s . a = 0 implies
IExec (
(if=0 (a,I,J)),
p,
s)
= (IExec (I,p,s)) +* (Start-At ((((card I) + (card J)) + 3),SCM+FSA)) ) & (
s . a <> 0 implies
IExec (
(if=0 (a,I,J)),
p,
s)
= (IExec (J,p,s)) +* (Start-At ((((card I) + (card J)) + 3),SCM+FSA)) ) )
theorem
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I,
J being
really-closed InitHalting MacroInstruction of
SCM+FSA for
a being
read-write Int-Location holds
(
IC (IExec ((if=0 (a,I,J)),p,s)) = ((card I) + (card J)) + 3 & (
s . a = 0 implies ( ( for
d being
Int-Location holds
(IExec ((if=0 (a,I,J)),p,s)) . d = (IExec (I,p,s)) . d ) & ( for
f being
FinSeq-Location holds
(IExec ((if=0 (a,I,J)),p,s)) . f = (IExec (I,p,s)) . f ) ) ) & (
s . a <> 0 implies ( ( for
d being
Int-Location holds
(IExec ((if=0 (a,I,J)),p,s)) . d = (IExec (J,p,s)) . d ) & ( for
f being
FinSeq-Location holds
(IExec ((if=0 (a,I,J)),p,s)) . f = (IExec (J,p,s)) . f ) ) ) )
theorem Th36:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I,
J being
really-closed MacroInstruction of
SCM+FSA for
a being
read-write Int-Location st
s . a > 0 &
I is_halting_onInit s,
p holds
IExec (
(if>0 (a,I,J)),
p,
s)
= (IExec (I,p,s)) +* (Start-At ((((card I) + (card J)) + 3),SCM+FSA)) by Th27, SCMFSA8B:20;
theorem Th38:
for
p being
Instruction-Sequence of
SCM+FSA for
I,
J being
really-closed MacroInstruction of
SCM+FSA for
a being
read-write Int-Location for
s being
State of
SCM+FSA st
s . a <= 0 &
J is_halting_onInit s,
p holds
IExec (
(if>0 (a,I,J)),
p,
s)
= (IExec (J,p,s)) +* (Start-At ((((card I) + (card J)) + 3),SCM+FSA)) by Th27, SCMFSA8B:22;
theorem Th39:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I,
J being
really-closed InitHalting MacroInstruction of
SCM+FSA for
a being
read-write Int-Location holds
(
if>0 (
a,
I,
J) is
InitHalting & (
s . a > 0 implies
IExec (
(if>0 (a,I,J)),
p,
s)
= (IExec (I,p,s)) +* (Start-At ((((card I) + (card J)) + 3),SCM+FSA)) ) & (
s . a <= 0 implies
IExec (
(if>0 (a,I,J)),
p,
s)
= (IExec (J,p,s)) +* (Start-At ((((card I) + (card J)) + 3),SCM+FSA)) ) )
theorem
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I,
J being
really-closed InitHalting MacroInstruction of
SCM+FSA for
a being
read-write Int-Location holds
(
IC (IExec ((if>0 (a,I,J)),p,s)) = ((card I) + (card J)) + 3 & (
s . a > 0 implies ( ( for
d being
Int-Location holds
(IExec ((if>0 (a,I,J)),p,s)) . d = (IExec (I,p,s)) . d ) & ( for
f being
FinSeq-Location holds
(IExec ((if>0 (a,I,J)),p,s)) . f = (IExec (I,p,s)) . f ) ) ) & (
s . a <= 0 implies ( ( for
d being
Int-Location holds
(IExec ((if>0 (a,I,J)),p,s)) . d = (IExec (J,p,s)) . d ) & ( for
f being
FinSeq-Location holds
(IExec ((if>0 (a,I,J)),p,s)) . f = (IExec (J,p,s)) . f ) ) ) )
set A = NAT ;
set D = Data-Locations ;
Lm3:
for p being Instruction-Sequence of SCM+FSA
for s being 0 -started State of SCM+FSA
for I being really-closed good InitHalting MacroInstruction of SCM+FSA
for a being read-write Int-Location st not I destroys a & s . (intloc 0) = 1 holds
for k being Nat holds
( ((StepTimes (a,I,p,s)) . k) . (intloc 0) = 1 & I is_halting_on (StepTimes (a,I,p,s)) . k,p +* (Times (a,I)) )
Lm4:
for P1, P2 being Instruction-Sequence of SCM+FSA
for s being State of SCM+FSA
for I being really-closed InitHalting Program of SCM+FSA st Initialize ((intloc 0) .--> 1) c= s & I c= P1 & I c= P2 holds
for k being Nat holds
( Comput (P1,s,k) = Comput (P2,s,k) & CurInstr (P1,(Comput (P1,s,k))) = CurInstr (P2,(Comput (P2,s,k))) )
Lm5:
for P1, P2 being Instruction-Sequence of SCM+FSA
for s being State of SCM+FSA
for I being really-closed InitHalting Program of SCM+FSA st Initialize ((intloc 0) .--> 1) c= s & I c= P1 & I c= P2 holds
( LifeSpan (P1,s) = LifeSpan (P2,s) & Result (P1,s) = Result (P2,s) )
by Th6;
Lm6:
for P being Instruction-Sequence of SCM+FSA
for s being State of SCM+FSA
for I being really-closed MacroInstruction of SCM+FSA
for a being read-write Int-Location st s . a <= 0 holds
while>0 (a,I) is_halting_onInit s,P
Lm7:
for P being Instruction-Sequence of SCM+FSA
for s being State of SCM+FSA
for I being really-closed MacroInstruction of SCM+FSA
for a being read-write Int-Location st I is_halting_onInit s,P & s . a > 0 holds
( IC (Comput ((P +* (while>0 (a,I))),(Initialized s),((LifeSpan ((P +* I),(Initialized s))) + 2))) = 0 & DataPart (Comput ((P +* (while>0 (a,I))),(Initialized s),((LifeSpan ((P +* I),(Initialized s))) + 2))) = DataPart (Comput ((P +* I),(Initialized s),(LifeSpan ((P +* I),(Initialized s))))) )
Lm8:
for P being Instruction-Sequence of SCM+FSA
for s being State of SCM+FSA
for I being really-closed good InitHalting MacroInstruction of SCM+FSA
for a being read-write Int-Location st s . a > 0 & while>0 (a,I) is InitHalting holds
DataPart (IExec ((while>0 (a,I)),P,s)) = DataPart (IExec ((while>0 (a,I)),P,(IExec (I,P,s))))
Lm9:
for I being really-closed good InitHalting MacroInstruction of SCM+FSA
for a being read-write Int-Location st ( for s being State of SCM+FSA
for P being Instruction-Sequence of SCM+FSA st s . a > 0 holds
(IExec (I,P,s)) . a < s . a ) holds
while>0 (a,I) is InitHalting
Lm10:
for p being Instruction-Sequence of SCM+FSA
for s being State of SCM+FSA
for I being really-closed good InitHalting Program of SCM+FSA
for a being read-write Int-Location st not I destroys a holds
(IExec ((I ";" (SubFrom (a,(intloc 0)))),p,s)) . a = (s . a) - 1
theorem Th48:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I being
really-closed good InitHalting MacroInstruction of
SCM+FSA for
a being
read-write Int-Location st not
I destroys a holds
(
(IExec ((I ";" (SubFrom (a,(intloc 0)))),p,s)) . a = (s . a) - 1 & (
s . a > 0 implies
DataPart (IExec ((Times (a,I)),p,s)) = DataPart (IExec ((Times (a,I)),p,(IExec ((I ";" (SubFrom (a,(intloc 0)))),p,s)))) ) )
theorem
for
P1,
P2 being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I being
really-closed InitHalting Program of
SCM+FSA st
Initialize ((intloc 0) .--> 1) c= s &
I c= P1 &
I c= P2 holds
for
k being
Nat holds
(
Comput (
P1,
s,
k)
= Comput (
P2,
s,
k) &
CurInstr (
P1,
(Comput (P1,s,k)))
= CurInstr (
P2,
(Comput (P2,s,k))) )
by Lm4;
theorem
for
P being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I being
really-closed MacroInstruction of
SCM+FSA for
a being
read-write Int-Location st
I is_halting_onInit s,
P &
s . a > 0 holds
(
IC (Comput ((P +* (while>0 (a,I))),(Initialized s),((LifeSpan ((P +* I),(Initialized s))) + 2))) = 0 &
DataPart (Comput ((P +* (while>0 (a,I))),(Initialized s),((LifeSpan ((P +* I),(Initialized s))) + 2))) = DataPart (Comput ((P +* I),(Initialized s),(LifeSpan ((P +* I),(Initialized s))))) )
by Lm7;