begin
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:
Start-At (0,SCM+FSA) c= Initialize ((intloc 0) .--> 1)
by FUNCT_4:25;
Lm3: 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)))
by FUNCOP_1:13
.=
{(intloc 0)} \/ {(IC )}
by FUNCOP_1:13
;
theorem Th6:
for
s1,
s2 being
State of
SCM+FSA for
p1,
p2 being
Instruction-Sequence of
SCM+FSA for
J being
InitHalting Program of
SCM+FSA st
Initialize ((intloc 0) .--> 1) c= s1 &
J c= p1 holds
for
n being
Element of
NAT st
Reloc (
J,
n)
c= p2 &
IC s2 = n &
DataPart s1 = DataPart s2 holds
for
i being
Element of
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 Th7:
for
s1,
s2 being
State of
SCM+FSA for
p1,
p2 being
Instruction-Sequence of
SCM+FSA for
I being
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
Element of
NAT holds
(
Comput (
p1,
s1,
k)
= Comput (
p2,
s2,
k) &
CurInstr (
p1,
(Comput (p1,s1,k)))
= CurInstr (
p2,
(Comput (p2,s2,k))) )
theorem Th15:
for
p being
Instruction-Sequence of
SCM+FSA for
I being
InitHalting keepInt0_1 Program of
SCM+FSA for
J being
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 Th16:
for
s being
State of
SCM+FSA for
p being
Instruction-Sequence of
SCM+FSA for
I being
keepInt0_1 Program of
SCM+FSA st
p +* I halts_on s holds
for
J being
InitClosed 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))
theorem Th34:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I,
J being
Program of
SCM+FSA for
a being
read-write Int-Location st
s . a = 0 &
I is_closed_onInit s,
p &
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))
theorem Th36:
for
p being
Instruction-Sequence of
SCM+FSA for
I,
J being
Program of
SCM+FSA for
a being
read-write Int-Location for
s being
State of
SCM+FSA st
s . a <> 0 &
J is_closed_onInit s,
p &
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))
theorem Th37:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I,
J being
InitHalting Program 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
InitHalting Program 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 Th40:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I,
J being
Program of
SCM+FSA for
a being
read-write Int-Location st
s . a > 0 &
I is_closed_onInit s,
p &
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))
theorem Th42:
for
p being
Instruction-Sequence of
SCM+FSA for
I,
J being
Program of
SCM+FSA for
a being
read-write Int-Location for
s being
State of
SCM+FSA st
s . a <= 0 &
J is_closed_onInit s,
p &
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))
theorem Th43:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I,
J being
InitHalting Program 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
InitHalting Program 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 Th45:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I,
J being
Program of
SCM+FSA for
a being
read-write Int-Location st
s . a < 0 &
I is_closed_onInit s,
p &
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)) + (card J)) + 7),SCM+FSA))
theorem Th46:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I,
J being
Program of
SCM+FSA for
a being
read-write Int-Location st
s . a = 0 &
J is_closed_onInit s,
p &
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)) + (card J)) + 7),SCM+FSA))
theorem Th47:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I,
J being
Program of
SCM+FSA for
a being
read-write Int-Location st
s . a > 0 &
J is_closed_onInit s,
p &
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)) + (card J)) + 7),SCM+FSA))
theorem Th48:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I,
J being
InitHalting Program 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)) + (card J)) + 7),SCM+FSA)) ) & (
s . a >= 0 implies
IExec (
(if<0 (a,I,J)),
p,
s)
= (IExec (J,p,s)) +* (Start-At (((((card I) + (card J)) + (card J)) + 7),SCM+FSA)) ) )
set A = NAT ;
set D = Data-Locations ;
theorem Th59:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I being
Program of
SCM+FSA st
I is_closed_onInit s,
p &
I is_halting_onInit s,
p holds
(
CurInstr (
(p +* (loop I)),
(Comput ((p +* (loop I)),(Initialized s),(LifeSpan ((p +* I),(Initialized s))))))
= goto 0 & ( for
m being
Element of
NAT st
m <= LifeSpan (
(p +* I),
(Initialized s)) holds
CurInstr (
(p +* (loop I)),
(Comput ((p +* (loop I)),(Initialized s),m)))
<> halt SCM+FSA ) )
theorem Th64:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I being
good InitHalting Program of
SCM+FSA for
a being
read-write Int-Location st not
I destroys a &
s . a > 0 holds
ex
s2 being
State of
SCM+FSA ex
p2 being
Instruction-Sequence of
SCM+FSA ex
k being
Element of
NAT st
(
s2 = Initialized s &
p2 = p +* (loop (if=0 (a,(Goto 2),(I ";" (SubFrom (a,(intloc 0))))))) &
k = (LifeSpan ((p +* (if=0 (a,(Goto 2),(I ";" (SubFrom (a,(intloc 0))))))),(Initialized s))) + 1 &
(Comput (p2,s2,k)) . a = (s . a) - 1 &
(Comput (p2,s2,k)) . (intloc 0) = 1 & ( for
b being
read-write Int-Location st
b <> a holds
(Comput (p2,s2,k)) . b = (IExec (I,p,s)) . b ) & ( for
f being
FinSeq-Location holds
(Comput (p2,s2,k)) . f = (IExec (I,p,s)) . f ) &
IC (Comput (p2,s2,k)) = 0 & ( for
n being
Element of
NAT st
n <= k holds
IC (Comput (p2,s2,n)) in dom (loop (if=0 (a,(Goto 2),(I ";" (SubFrom (a,(intloc 0))))))) ) )
theorem Th66:
for
p being
Instruction-Sequence of
SCM+FSA for
s being
State of
SCM+FSA for
I being
good InitHalting Program of
SCM+FSA for
a being
read-write Int-Location st not
I destroys a &
s . a > 0 holds
(
(IExec ((I ";" (SubFrom (a,(intloc 0)))),p,s)) . a = (s . a) - 1 &
DataPart (IExec ((Times (a,I)),p,s)) = DataPart (IExec ((Times (a,I)),p,(IExec ((I ";" (SubFrom (a,(intloc 0)))),p,s)))) )