begin
:: deftheorem Def1 defines good SFMASTR1:def 1 :
for i being Instruction of SCM+FSA holds
( i is good iff Macro i is good );
theorem Th1:
begin
set D = Data-Locations SCM+FSA;
set SAt = Start-At (0,SCM+FSA);
theorem Th2:
theorem Th3:
theorem Th4:
for
P being the
Instructions of
SCM+FSA -valued ManySortedSet of
NAT for
S being
State of
SCM+FSA for
I,
J being
Program of
SCM+FSA st
I is_halting_on Initialized S,
P &
J is_halting_on IExec (
I,
P,
S),
P &
I is_closed_on Initialized S,
P &
J is_closed_on IExec (
I,
P,
S),
P holds
I ';' J is_halting_on Initialized S,
P
theorem Th5:
LmY:
for I being Program of SCM+FSA holds
( (Initialize ((intloc 0) .--> 1)) . (intloc 0) = 1 & (Initialize ((intloc 0) .--> 1)) . (IC ) = 0 )
Lm1:
for p being the Instructions of SCM+FSA -valued ManySortedSet of NAT
for I being good Program of SCM+FSA
for J being Program of SCM+FSA
for s being State of SCM+FSA st s . (intloc 0) = 1 & I is_halting_on s,p & J is_halting_on IExec (I,p,s),p & I is_closed_on s,p & J is_closed_on IExec (I,p,s),p & 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 (Initialized (Comput ((p +* I),s,(LifeSpan ((p +* I),s))))) & 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),(Initialized (Result ((p +* I),s))))) & ( J is good implies (Result (p,s)) . (intloc 0) = 1 ) )
theorem Th6:
for
p being the
Instructions of
SCM+FSA -valued ManySortedSet of
NAT for
s being
State of
SCM+FSA for
J being
Program of
SCM+FSA for
Ig being
good Program of
SCM+FSA st
Ig is_halting_on Initialized s,
p &
J is_halting_on IExec (
Ig,
p,
s),
p &
Ig is_closed_on Initialized s,
p &
J is_closed_on IExec (
Ig,
p,
s),
p holds
LifeSpan (
(p +* (Ig ';' J)),
(s +* (Initialize ((intloc 0) .--> 1))))
= ((LifeSpan ((p +* Ig),(s +* (Initialize ((intloc 0) .--> 1))))) + 1) + (LifeSpan (((p +* Ig) +* J),((Result ((p +* Ig),(s +* (Initialize ((intloc 0) .--> 1))))) +* (Initialize ((intloc 0) .--> 1)))))
theorem Th7:
for
p being the
Instructions of
SCM+FSA -valued ManySortedSet of
NAT for
s being
State of
SCM+FSA for
J being
Program of
SCM+FSA for
Ig being
good Program of
SCM+FSA st
Ig is_halting_on Initialized s,
p &
J is_halting_on IExec (
Ig,
p,
s),
p &
Ig is_closed_on Initialized s,
p &
J is_closed_on IExec (
Ig,
p,
s),
p holds
IExec (
(Ig ';' J),
p,
s)
= (IExec (J,p,(IExec (Ig,p,s)))) +* (Start-At (((IC (IExec (J,p,(IExec (Ig,p,s))))) + (card Ig)),SCM+FSA))
theorem Th8:
for
p being the
Instructions of
SCM+FSA -valued ManySortedSet of
NAT for
s being
State of
SCM+FSA for
J being
Program of
SCM+FSA for
Ig being
good Program of
SCM+FSA for
a being
Int-Location st (
Ig is
parahalting or (
Ig is_halting_on Initialized s,
p &
Ig is_closed_on Initialized s,
p ) ) & (
J is
parahalting or (
J is_halting_on IExec (
Ig,
p,
s),
p &
J is_closed_on IExec (
Ig,
p,
s),
p ) ) holds
(IExec ((Ig ';' J),p,s)) . a = (IExec (J,p,(IExec (Ig,p,s)))) . a
theorem Th9:
for
p being the
Instructions of
SCM+FSA -valued ManySortedSet of
NAT for
s being
State of
SCM+FSA for
J being
Program of
SCM+FSA for
Ig being
good Program of
SCM+FSA for
f being
FinSeq-Location st (
Ig is
parahalting or (
Ig is_halting_on Initialized s,
p &
Ig is_closed_on Initialized s,
p ) ) & (
J is
parahalting or (
J is_halting_on IExec (
Ig,
p,
s),
p &
J is_closed_on IExec (
Ig,
p,
s),
p ) ) holds
(IExec ((Ig ';' J),p,s)) . f = (IExec (J,p,(IExec (Ig,p,s)))) . f
theorem
for
p being the
Instructions of
SCM+FSA -valued ManySortedSet of
NAT for
s being
State of
SCM+FSA for
J being
Program of
SCM+FSA for
Ig being
good Program of
SCM+FSA st (
Ig is
parahalting or (
Ig is_halting_on Initialized s,
p &
Ig is_closed_on Initialized s,
p ) ) & (
J is
parahalting or (
J is_halting_on IExec (
Ig,
p,
s),
p &
J is_closed_on IExec (
Ig,
p,
s),
p ) ) holds
DataPart (IExec ((Ig ';' J),p,s)) = DataPart (IExec (J,p,(IExec (Ig,p,s))))
theorem Th11:
theorem Th12:
theorem Th13:
theorem
theorem
canceled;
theorem
canceled;
theorem
canceled;
begin
definition
let d be
Int-Location ;
{redefine func {d} -> Subset of
Int-Locations;
coherence
{d} is Subset of Int-Locations
let e be
Int-Location ;
{redefine func {d,e} -> Subset of
Int-Locations;
coherence
{d,e} is Subset of Int-Locations
let f be
Int-Location ;
{redefine func {d,e,f} -> Subset of
Int-Locations;
coherence
{d,e,f} is Subset of Int-Locations
let g be
Int-Location ;
{redefine func {d,e,f,g} -> Subset of
Int-Locations;
coherence
{d,e,f,g} is Subset of Int-Locations
end;
:: deftheorem Def2 defines RWNotIn-seq SFMASTR1:def 2 :
for L being finite Subset of Int-Locations
for b2 being Function of NAT,(bool NAT) holds
( b2 = RWNotIn-seq L iff ( b2 . 0 = { k where k is Element of NAT : ( not intloc k in L & k <> 0 ) } & ( for i being Element of NAT
for sn being non empty Subset of NAT st b2 . i = sn holds
b2 . (i + 1) = sn \ {(min sn)} ) & ( for i being Element of NAT holds not b2 . i is finite ) ) );
theorem Th18:
theorem Th19:
theorem Th20:
:: deftheorem defines -thRWNotIn SFMASTR1:def 3 :
for n being Element of NAT
for L being finite Subset of Int-Locations holds n -thRWNotIn L = intloc (min ((RWNotIn-seq L) . n));
theorem Th21:
theorem Th22:
:: deftheorem defines -thNotUsed SFMASTR1:def 4 :
for n being Element of NAT
for p being preProgram of SCM+FSA holds n -thNotUsed p = n -thRWNotIn (UsedIntLoc p);
begin
theorem Th23:
definition
let N,
result be
Int-Location ;
func Fib_macro (
N,
result)
-> Program of
SCM+FSA equals
((((((2 -ndRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))) := N) ';' (SubFrom (result,result))) ';' ((1 -stRWNotIn {N,result}) := (intloc 0))) ';' ((1 -stRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))) := (2 -ndRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))))) ';' (Times ((1 -stRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))),((AddTo (result,(1 -stRWNotIn {N,result}))) ';' (swap (result,(1 -stRWNotIn {N,result}))))))) ';' (N := (2 -ndRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))));
correctness
coherence
((((((2 -ndRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))) := N) ';' (SubFrom (result,result))) ';' ((1 -stRWNotIn {N,result}) := (intloc 0))) ';' ((1 -stRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))) := (2 -ndRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))))) ';' (Times ((1 -stRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))),((AddTo (result,(1 -stRWNotIn {N,result}))) ';' (swap (result,(1 -stRWNotIn {N,result}))))))) ';' (N := (2 -ndRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result})))))) is Program of SCM+FSA;
;
end;
:: deftheorem defines Fib_macro SFMASTR1:def 5 :
for N, result being Int-Location holds Fib_macro (N,result) = ((((((2 -ndRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))) := N) ';' (SubFrom (result,result))) ';' ((1 -stRWNotIn {N,result}) := (intloc 0))) ';' ((1 -stRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))) := (2 -ndRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))))) ';' (Times ((1 -stRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))),((AddTo (result,(1 -stRWNotIn {N,result}))) ';' (swap (result,(1 -stRWNotIn {N,result}))))))) ';' (N := (2 -ndRWNotIn (UsedIntLoc (swap (result,(1 -stRWNotIn {N,result}))))));
theorem
theorem
theorem