begin
set D = Data-Locations SCM+FSA;
theorem Th1:
theorem
theorem
theorem Th4:
theorem Th5:
theorem Th6:
theorem Th7:
begin
:: deftheorem defines times* SFMASTR2:def 1 :
for a being Int-Location
for I being Program of SCM+FSA holds times* (a,I) = while>0 ((1 -stRWNotIn ({a} \/ (UsedIntLoc I))),(I ';' (SubFrom ((1 -stRWNotIn ({a} \/ (UsedIntLoc I))),(intloc 0)))));
:: deftheorem defines times SFMASTR2:def 2 :
for a being Int-Location
for I being Program of SCM+FSA holds times (a,I) = ((1 -stRWNotIn ({a} \/ (UsedIntLoc I))) := a) ';' (times* (a,I));
theorem
theorem
definition
let p be the
Instructions of
SCM+FSA -valued ManySortedSet of
NAT ;
let s be
State of
SCM+FSA;
let I be
Program of
SCM+FSA;
let a be
Int-Location ;
func StepTimes (
a,
I,
p,
s)
-> Function of
NAT,
(product the Object-Kind of SCM+FSA) equals
StepWhile>0 (
(1 -stRWNotIn ({a} \/ (UsedIntLoc I))),
(I ';' (SubFrom ((1 -stRWNotIn ({a} \/ (UsedIntLoc I))),(intloc 0)))),
p,
(Exec (((1 -stRWNotIn ({a} \/ (UsedIntLoc I))) := a),(Initialized s))));
correctness
coherence
StepWhile>0 ((1 -stRWNotIn ({a} \/ (UsedIntLoc I))),(I ';' (SubFrom ((1 -stRWNotIn ({a} \/ (UsedIntLoc I))),(intloc 0)))),p,(Exec (((1 -stRWNotIn ({a} \/ (UsedIntLoc I))) := a),(Initialized s)))) is Function of NAT,(product the Object-Kind of SCM+FSA);
;
end;
:: deftheorem defines StepTimes SFMASTR2:def 3 :
for p being the Instructions of SCM+FSA -valued ManySortedSet of NAT
for s being State of SCM+FSA
for I being Program of SCM+FSA
for a being Int-Location holds StepTimes (a,I,p,s) = StepWhile>0 ((1 -stRWNotIn ({a} \/ (UsedIntLoc I))),(I ';' (SubFrom ((1 -stRWNotIn ({a} \/ (UsedIntLoc I))),(intloc 0)))),p,(Exec (((1 -stRWNotIn ({a} \/ (UsedIntLoc I))) := a),(Initialized s))));
theorem
theorem
theorem Th12:
for
s being
State of
SCM+FSA for
p being the
Instructions of
SCM+FSA -valued ManySortedSet of
NAT for
a being
Int-Location for
J being
good Program of
SCM+FSA for
k being
Element of
NAT st
((StepTimes (a,J,p,s)) . k) . (intloc 0) = 1 &
J is_closed_on (StepTimes (a,J,p,s)) . k,
p +* (times* (a,J)) &
J is_halting_on (StepTimes (a,J,p,s)) . k,
p +* (times* (a,J)) holds
(
((StepTimes (a,J,p,s)) . (k + 1)) . (intloc 0) = 1 & (
((StepTimes (a,J,p,s)) . k) . (1 -stRWNotIn ({a} \/ (UsedIntLoc J))) > 0 implies
((StepTimes (a,J,p,s)) . (k + 1)) . (1 -stRWNotIn ({a} \/ (UsedIntLoc J))) = (((StepTimes (a,J,p,s)) . k) . (1 -stRWNotIn ({a} \/ (UsedIntLoc J)))) - 1 ) )
theorem
theorem
definition
let p be the
Instructions of
SCM+FSA -valued ManySortedSet of
NAT ;
let s be
State of
SCM+FSA;
let a be
Int-Location ;
let I be
Program of
SCM+FSA;
pred ProperTimesBody a,
I,
s,
p means :
Def4:
for
k being
Element of
NAT st
k < s . a holds
(
I is_closed_on (StepTimes (a,I,p,s)) . k,
p +* (times* (a,I)) &
I is_halting_on (StepTimes (a,I,p,s)) . k,
p +* (times* (a,I)) );
end;
:: deftheorem Def4 defines ProperTimesBody SFMASTR2:def 4 :
for p being the Instructions of SCM+FSA -valued ManySortedSet of NAT
for s being State of SCM+FSA
for a being Int-Location
for I being Program of SCM+FSA holds
( ProperTimesBody a,I,s,p iff for k being Element of NAT st k < s . a holds
( I is_closed_on (StepTimes (a,I,p,s)) . k,p +* (times* (a,I)) & I is_halting_on (StepTimes (a,I,p,s)) . k,p +* (times* (a,I)) ) );
theorem Th15:
theorem Th16:
theorem Th17:
theorem
theorem
theorem Th20:
for
s being
State of
SCM+FSA for
p being the
Instructions of
SCM+FSA -valued ManySortedSet of
NAT for
a being
Int-Location for
J being
good Program of
SCM+FSA for
k being
Element of
NAT st
((StepTimes (a,J,p,s)) . k) . (intloc 0) = 1 &
J is_halting_on Initialized ((StepTimes (a,J,p,s)) . k),
p +* (times* (a,J)) &
J is_closed_on Initialized ((StepTimes (a,J,p,s)) . k),
p +* (times* (a,J)) &
((StepTimes (a,J,p,s)) . k) . (1 -stRWNotIn ({a} \/ (UsedIntLoc J))) > 0 holds
((StepTimes (a,J,p,s)) . (k + 1)) | ((UsedIntLoc J) \/ FinSeq-Locations) = (IExec (J,(p +* (times* (a,J))),((StepTimes (a,J,p,s)) . k))) | ((UsedIntLoc J) \/ FinSeq-Locations)
theorem
for
s being
State of
SCM+FSA for
p being the
Instructions of
SCM+FSA -valued ManySortedSet of
NAT for
a being
Int-Location for
J being
good Program of
SCM+FSA for
k being
Element of
NAT st (
ProperTimesBody a,
J,
s,
p or
J is
parahalting ) &
k < s . a & (
s . (intloc 0) = 1 or not
a is
read-only ) holds
((StepTimes (a,J,p,s)) . (k + 1)) | ((UsedIntLoc J) \/ FinSeq-Locations) = (IExec (J,(p +* (times* (a,J))),((StepTimes (a,J,p,s)) . k))) | ((UsedIntLoc J) \/ FinSeq-Locations)
theorem
canceled;
theorem
canceled;
theorem
canceled;
begin
:: deftheorem defines triv-times SFMASTR2:def 5 :
for d being read-write Int-Location holds triv-times d = times (d,((while=0 (d,(Macro (d := d)))) ';' (SubFrom (d,(intloc 0)))));
theorem
canceled;
theorem
canceled;
begin
definition
let N,
result be
Int-Location ;
func Fib-macro (
N,
result)
-> Program of
SCM+FSA equals
(((((1 -stNotUsed (times (N,((AddTo (result,(1 -stRWNotIn {N,result}))) ';' (swap (result,(1 -stRWNotIn {N,result}))))))) := N) ';' (SubFrom (result,result))) ';' ((1 -stRWNotIn {N,result}) := (intloc 0))) ';' (times (N,((AddTo (result,(1 -stRWNotIn {N,result}))) ';' (swap (result,(1 -stRWNotIn {N,result}))))))) ';' (N := (1 -stNotUsed (times (N,((AddTo (result,(1 -stRWNotIn {N,result}))) ';' (swap (result,(1 -stRWNotIn {N,result}))))))));
correctness
coherence
(((((1 -stNotUsed (times (N,((AddTo (result,(1 -stRWNotIn {N,result}))) ';' (swap (result,(1 -stRWNotIn {N,result}))))))) := N) ';' (SubFrom (result,result))) ';' ((1 -stRWNotIn {N,result}) := (intloc 0))) ';' (times (N,((AddTo (result,(1 -stRWNotIn {N,result}))) ';' (swap (result,(1 -stRWNotIn {N,result}))))))) ';' (N := (1 -stNotUsed (times (N,((AddTo (result,(1 -stRWNotIn {N,result}))) ';' (swap (result,(1 -stRWNotIn {N,result})))))))) is Program of SCM+FSA;
;
end;
:: deftheorem defines Fib-macro SFMASTR2:def 6 :
for N, result being Int-Location holds Fib-macro (N,result) = (((((1 -stNotUsed (times (N,((AddTo (result,(1 -stRWNotIn {N,result}))) ';' (swap (result,(1 -stRWNotIn {N,result}))))))) := N) ';' (SubFrom (result,result))) ';' ((1 -stRWNotIn {N,result}) := (intloc 0))) ';' (times (N,((AddTo (result,(1 -stRWNotIn {N,result}))) ';' (swap (result,(1 -stRWNotIn {N,result}))))))) ';' (N := (1 -stNotUsed (times (N,((AddTo (result,(1 -stRWNotIn {N,result}))) ';' (swap (result,(1 -stRWNotIn {N,result}))))))));