let s be State of SCM+FSA; for p being Instruction-Sequence of SCM+FSA
for a being read-write Int-Location
for J being good really-closed MacroInstruction of SCM+FSA st not J destroys a & ProperTimesBody a,J,s,p holds
for k being Nat st k <= s . a holds
(((StepTimes (a,J,p,s)) . k) . a) + k = s . a
let p be Instruction-Sequence of SCM+FSA; for a being read-write Int-Location
for J being good really-closed MacroInstruction of SCM+FSA st not J destroys a & ProperTimesBody a,J,s,p holds
for k being Nat st k <= s . a holds
(((StepTimes (a,J,p,s)) . k) . a) + k = s . a
let a be read-write Int-Location; for J being good really-closed MacroInstruction of SCM+FSA st not J destroys a & ProperTimesBody a,J,s,p holds
for k being Nat st k <= s . a holds
(((StepTimes (a,J,p,s)) . k) . a) + k = s . a
let J be good really-closed MacroInstruction of SCM+FSA ; ( not J destroys a & ProperTimesBody a,J,s,p implies for k being Nat st k <= s . a holds
(((StepTimes (a,J,p,s)) . k) . a) + k = s . a )
set I = J;
assume that
A1:
not J destroys a
and
A2:
ProperTimesBody a,J,s,p
; for k being Nat st k <= s . a holds
(((StepTimes (a,J,p,s)) . k) . a) + k = s . a
set Is = Initialized s;
set ST = StepTimes (a,J,p,s);
set SW = StepWhile>0 (a,(J ";" (SubFrom (a,(intloc 0)))),p,(Initialized s));
defpred S1[ Nat] means ( $1 <= s . a implies (((StepTimes (a,J,p,s)) . $1) . a) + $1 = s . a );
A3:
for k being Nat st S1[k] holds
S1[k + 1]
proof
let k be
Nat;
( S1[k] implies S1[k + 1] )
assume that A4:
(
k <= s . a implies
(((StepTimes (a,J,p,s)) . k) . a) + k = s . a )
and A5:
k + 1
<= s . a
;
(((StepTimes (a,J,p,s)) . (k + 1)) . a) + (k + 1) = s . a
reconsider sa =
s . a as
Element of
NAT by A5, INT_1:3;
A6:
k < sa
by A5, NAT_1:13;
then A7:
((StepTimes (a,J,p,s)) . k) . (intloc 0) = 1
by A1, A2, Th51;
A8:
now not ((StepWhile>0 (a,(J ";" (SubFrom (a,(intloc 0)))),p,(Initialized s))) . k) . a <= 0 assume
((StepWhile>0 (a,(J ";" (SubFrom (a,(intloc 0)))),p,(Initialized s))) . k) . a <= 0
;
contradictionthen
(((StepWhile>0 (a,(J ";" (SubFrom (a,(intloc 0)))),p,(Initialized s))) . k) . a) + k < (s . a) + 0
by A6, XREAL_1:8;
hence
contradiction
by A4, A6;
verum end;
J is_halting_on (StepTimes (a,J,p,s)) . k,
p +* (Times (a,J))
by A2, A6;
then A9:
J is_halting_on Initialized ((StepTimes (a,J,p,s)) . k),
p +* (Times (a,J))
by A7, SCMFSA8B:42;
Macro (SubFrom (a,(intloc 0))) is_halting_on IExec (
J,
(p +* (Times (a,J))),
((StepTimes (a,J,p,s)) . k)),
p +* (Times (a,J))
by SCMFSA7B:19;
then
J ";" (SubFrom (a,(intloc 0))) is_halting_on Initialized ((StepTimes (a,J,p,s)) . k),
p +* (Times (a,J))
by A9, SFMASTR1:3;
then
DataPart ((StepWhile>0 (a,(J ";" (SubFrom (a,(intloc 0)))),p,(Initialized s))) . (k + 1)) = DataPart (IExec ((J ";" (SubFrom (a,(intloc 0)))),(p +* (Times (a,J))),((StepTimes (a,J,p,s)) . k)))
by A7, A8, Th32;
then ((StepTimes (a,J,p,s)) . (k + 1)) . a =
(IExec ((J ";" (SubFrom (a,(intloc 0)))),(p +* (Times (a,J))),((StepTimes (a,J,p,s)) . k))) . a
by SCMFSA_M:2
.=
(Exec ((SubFrom (a,(intloc 0))),(IExec (J,(p +* (Times (a,J))),((StepTimes (a,J,p,s)) . k))))) . a
by A9, SFMASTR1:11
.=
((IExec (J,(p +* (Times (a,J))),((StepTimes (a,J,p,s)) . k))) . a) - ((IExec (J,(p +* (Times (a,J))),((StepTimes (a,J,p,s)) . k))) . (intloc 0))
by SCMFSA_2:65
.=
((IExec (J,(p +* (Times (a,J))),((StepTimes (a,J,p,s)) . k))) . a) - 1
by A9, SCMFSA8C:67
.=
((Initialized ((StepTimes (a,J,p,s)) . k)) . a) - 1
by A9, A1, SCMFSA8C:95
.=
(((StepTimes (a,J,p,s)) . k) . a) - 1
by SCMFSA_M:37
;
hence
(((StepTimes (a,J,p,s)) . (k + 1)) . a) + (k + 1) = s . a
by A4, A6;
verum
end;
A10:
S1[ 0 ]
thus
for k being Nat holds S1[k]
from NAT_1:sch 2(A10, A3); verum