:: SFMASTR3 semantic presentation
theorem Th1: :: SFMASTR3:1
theorem Th2: :: SFMASTR3:2
definition
canceled;let F be
FinSequence of
INT ;
let m be
Element of
NAT ,
n be
Element of
NAT ;
assume E34:
( 1
<= m &
m <= n &
n <= len F )
;
canceled;func min_at c1,
c2,
c3 -> Element of
NAT means :
Def3:
:: SFMASTR3:def 3
ex
X being non
empty finite Subset of
INT st
(
X = rng (m,n -cut F) &
it + 1
= ((min X) .. (m,n -cut F)) + m );
existence
ex b1 being Element of NAT ex X being non empty finite Subset of INT st
( X = rng (m,n -cut F) & b1 + 1 = ((min X) .. (m,n -cut F)) + m )
uniqueness
for b1, b2 being Element of NAT st ex X being non empty finite Subset of INT st
( X = rng (m,n -cut F) & b1 + 1 = ((min X) .. (m,n -cut F)) + m ) & ex X being non empty finite Subset of INT st
( X = rng (m,n -cut F) & b2 + 1 = ((min X) .. (m,n -cut F)) + m ) holds
b1 = b2
;
end;
:: deftheorem Def1 SFMASTR3:def 1 :
canceled;
:: deftheorem Def2 SFMASTR3:def 2 :
canceled;
:: deftheorem Def3 defines min_at SFMASTR3:def 3 :
theorem Th3: :: SFMASTR3:3
theorem Th4: :: SFMASTR3:4
:: deftheorem Def4 defines is_non_decreasing_on SFMASTR3:def 4 :
:: deftheorem Def5 defines is_split_at SFMASTR3:def 5 :
theorem Th5: :: SFMASTR3:5
theorem Th6: :: SFMASTR3:6
theorem Th7: :: SFMASTR3:7
theorem Th8: :: SFMASTR3:8
theorem Th9: :: SFMASTR3:9
theorem Th10: :: SFMASTR3:10
theorem Th11: :: SFMASTR3:11
theorem Th12: :: SFMASTR3:12
theorem Th13: :: SFMASTR3:13
theorem Th14: :: SFMASTR3:14
theorem Th15: :: SFMASTR3:15
definition
let a be
Int-Location ,
b be
Int-Location ,
c be
Int-Location ;
let I be
Macro-Instruction;
let s be
State of
SCM+FSA ;
func StepForUp c1,
c2,
c3,
c4,
c5 -> Function of
NAT ,
product the
Object-Kind of
SCM+FSA equals :: SFMASTR3:def 6
StepWhile>0 (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),
((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),(intloc 0))),
((s +* (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),(((s . c) - (s . b)) + 1)) +* a,(s . b));
coherence
StepWhile>0 (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),(((s . c) - (s . b)) + 1)) +* a,(s . b)) is Function of NAT , product the Object-Kind of SCM+FSA
;
end;
:: deftheorem Def6 defines StepForUp SFMASTR3:def 6 :
for
a,
b,
c being
Int-Location for
I being
Macro-Instruction for
s being
State of
SCM+FSA holds
StepForUp a,
b,
c,
I,
s = StepWhile>0 (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),
((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),(intloc 0))),
((s +* (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),(((s . c) - (s . b)) + 1)) +* a,(s . b));
theorem Th16: :: SFMASTR3:16
theorem Th17: :: SFMASTR3:17
theorem Th18: :: SFMASTR3:18
theorem Th19: :: SFMASTR3:19
theorem Th20: :: SFMASTR3:20
theorem Th21: :: SFMASTR3:21
theorem Th22: :: SFMASTR3:22
definition
let a be
Int-Location ,
b be
Int-Location ,
c be
Int-Location ;
let I be
Macro-Instruction;
let s be
State of
SCM+FSA ;
pred ProperForUpBody c1,
c2,
c3,
c4,
c5 means :
Def7:
:: SFMASTR3:def 7
for
i being
Element of
NAT st
i < ((s . c) - (s . b)) + 1 holds
(
I is_closed_on (StepForUp a,b,c,I,s) . i &
I is_halting_on (StepForUp a,b,c,I,s) . i );
end;
:: deftheorem Def7 defines ProperForUpBody SFMASTR3:def 7 :
for
a,
b,
c being
Int-Location for
I being
Macro-Instruction for
s being
State of
SCM+FSA holds
(
ProperForUpBody a,
b,
c,
I,
s iff for
i being
Element of
NAT st
i < ((s . c) - (s . b)) + 1 holds
(
I is_closed_on (StepForUp a,b,c,I,s) . i &
I is_halting_on (StepForUp a,b,c,I,s) . i ) );
theorem Th23: :: SFMASTR3:23
theorem Th24: :: SFMASTR3:24
for
s being
State of
SCM+FSA for
a being
read-write Int-Location for
bb,
cc being
Int-Location for
Ig being
good Macro-Instruction for
k being
Element of
NAT st
((StepForUp a,bb,cc,Ig,s) . k) . (intloc 0) = 1 &
Ig is_closed_on (StepForUp a,bb,cc,Ig,s) . k &
Ig is_halting_on (StepForUp a,bb,cc,Ig,s) . k holds
((StepForUp a,bb,cc,Ig,s) . (k + 1)) . (intloc 0) = 1
theorem Th25: :: SFMASTR3:25
for
s being
State of
SCM+FSA for
a being
read-write Int-Location for
bb,
cc being
Int-Location for
Ig being
good Macro-Instruction st
s . (intloc 0) = 1 &
ProperForUpBody a,
bb,
cc,
Ig,
s holds
for
k being
Element of
NAT st
k <= ((s . cc) - (s . bb)) + 1 holds
(
((StepForUp a,bb,cc,Ig,s) . k) . (intloc 0) = 1 & (
Ig does_not_destroy a implies (
((StepForUp a,bb,cc,Ig,s) . k) . a = k + (s . bb) &
((StepForUp a,bb,cc,Ig,s) . k) . a <= (s . cc) + 1 ) ) &
(((StepForUp a,bb,cc,Ig,s) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc Ig)))) + k = ((s . cc) - (s . bb)) + 1 )
theorem Th26: :: SFMASTR3:26
for
s being
State of
SCM+FSA for
a being
read-write Int-Location for
bb,
cc being
Int-Location for
Ig being
good Macro-Instruction st
s . (intloc 0) = 1 &
ProperForUpBody a,
bb,
cc,
Ig,
s holds
for
k being
Element of
NAT holds
(
((StepForUp a,bb,cc,Ig,s) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc Ig))) > 0 iff
k < ((s . cc) - (s . bb)) + 1 )
theorem Th27: :: SFMASTR3:27
for
s being
State of
SCM+FSA for
a being
read-write Int-Location for
bb,
cc being
Int-Location for
Ig being
good Macro-Instruction for
k being
Element of
NAT st
s . (intloc 0) = 1 &
ProperForUpBody a,
bb,
cc,
Ig,
s &
k < ((s . cc) - (s . bb)) + 1 holds
((StepForUp a,bb,cc,Ig,s) . (k + 1)) | (({a,bb,cc} \/ (UsedIntLoc Ig)) \/ FinSeq-Locations ) = (IExec (Ig ';' (AddTo a,(intloc 0))),((StepForUp a,bb,cc,Ig,s) . k)) | (({a,bb,cc} \/ (UsedIntLoc Ig)) \/ FinSeq-Locations )
definition
let a be
Int-Location ,
b be
Int-Location ,
c be
Int-Location ;
let I be
Macro-Instruction;
set aux = 1
-stRWNotIn ({a,b,c} \/ (UsedIntLoc I));
func for-up c1,
c2,
c3,
c4 -> Macro-Instruction equals :: SFMASTR3:def 8
(((((1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))) := c) ';' (SubFrom (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),b)) ';' (AddTo (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := b)) ';' (while>0 (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),(intloc 0))));
coherence
(((((1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))) := c) ';' (SubFrom (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),b)) ';' (AddTo (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := b)) ';' (while>0 (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),(intloc 0)))) is Macro-Instruction
;
end;
:: deftheorem Def8 defines for-up SFMASTR3:def 8 :
for
a,
b,
c being
Int-Location for
I being
Macro-Instruction holds
for-up a,
b,
c,
I = (((((1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))) := c) ';' (SubFrom (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),b)) ';' (AddTo (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := b)) ';' (while>0 (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,b,c} \/ (UsedIntLoc I))),(intloc 0))));
theorem Th28: :: SFMASTR3:28
theorem Th29: :: SFMASTR3:29
theorem Th30: :: SFMASTR3:30
for
s being
State of
SCM+FSA for
a being
read-write Int-Location for
bb,
cc being
Int-Location for
I being
Macro-Instruction st
s . (intloc 0) = 1 &
s . bb > s . cc holds
( ( for
x being
Int-Location st
x <> a &
x in {bb,cc} \/ (UsedIntLoc I) holds
(IExec (for-up a,bb,cc,I),s) . x = s . x ) & ( for
f being
FinSeq-Location holds
(IExec (for-up a,bb,cc,I),s) . f = s . f ) )
E182:
now
let s be
State of
SCM+FSA ;
let a be
read-write Int-Location ;
let bb be
Int-Location ;
let cc be
Int-Location ;
set D =
Int-Locations \/ FinSeq-Locations ;
let I be
good Macro-Instruction;
assume that E34:
s . (intloc 0) = 1
and E35:
(
ProperForUpBody a,
bb,
cc,
I,
s or
I is
parahalting )
;
E36:
ProperForUpBody a,
bb,
cc,
I,
s
by E37, Th1;
set aux = 1
-stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I));
set i0 =
(1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc;
set i1 =
SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),
bb;
set i2 =
AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),
(intloc 0);
set i3 =
a := bb;
set IB =
(I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0));
set s1 =
IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),
s;
set s2 =
(s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,
(s . bb);
E37:
(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s) | (Int-Locations \/ FinSeq-Locations ) = ((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb)) | (Int-Locations \/ FinSeq-Locations )
by E36, ;
set IB2 =
(AddTo a,(intloc 0)) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0));
set SW1 =
StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),
((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),
(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s);
set SW2 =
StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),
((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),
((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb));
set SF =
StepForUp a,
bb,
cc,
I,
s;
set scb1 =
((s . cc) - (s . bb)) + 1;
E38:
(I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)) = I ';' ((AddTo a,(intloc 0)) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)))
by SCMFSA6A:65;
E39:
StepForUp a,
bb,
cc,
I,
s = StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),
((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),
((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))
;
E40:
ProperBodyWhile>0 1
-stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I)),
(I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)),
(s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,
(s . bb)
proof
let k be
Element of
NAT ;
:: according to SCMFSA9A:def 4
assume
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) > 0
;
then E41:
k < ((s . cc) - (s . bb)) + 1
by E36, E38, E41, ;
then E42:
((StepForUp a,bb,cc,I,s) . k) . (intloc 0) = 1
by E36, E38, ;
E43:
I is_closed_on (StepForUp a,bb,cc,I,s) . k
by E38, E43, ;
then E44:
I is_closed_on Initialize ((StepForUp a,bb,cc,I,s) . k)
by E44, SFMASTR2:4;
I is_halting_on (StepForUp a,bb,cc,I,s) . k
by E38, E43, ;
then E46:
I is_halting_on Initialize ((StepForUp a,bb,cc,I,s) . k)
by E44, , SFMASTR2:5;
E47:
(AddTo a,(intloc 0)) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)) is_closed_on IExec I,
((StepForUp a,bb,cc,I,s) . k)
by SCMFSA7B:24;
then E49:
(I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)) is_closed_on Initialize ((StepForUp a,bb,cc,I,s) . k)
by E40, E46, E47, SFMASTR1:3;
hence
(I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)) is_closed_on (StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . k
by E44, SFMASTR2:4;
(AddTo a,(intloc 0)) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)) is_halting_on IExec I,
((StepForUp a,bb,cc,I,s) . k)
by SCMFSA7B:25;
then
(I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)) is_halting_on Initialize ((StepForUp a,bb,cc,I,s) . k)
by E40, E46, E47, , SFMASTR1:4;
hence
(I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)) is_halting_on (StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . k
by E44, E49, SFMASTR2:5;
end;
thus
ProperBodyWhile>0 1
-stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I)),
(I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)),
IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),
s
proof
let k be
Element of
NAT ;
:: according to SCMFSA9A:def 4
assume E50:
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) > 0
;
E51:
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . k) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k) | (Int-Locations \/ FinSeq-Locations )
by E39, , SCMFSA9A:40;
then E54:
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) = ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I)))
by SCMFSA6A:38;
then E55:
(I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)) is_closed_on (StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . k
by , , SCMFSA9A:def 4;
E56:
(I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)) is_halting_on (StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . k
by , , , SCMFSA9A:def 4;
thus
(I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)) is_closed_on (StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k
by , , SCMFSA8B:6;
thus
(I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)) is_halting_on (StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k
by , , , SCMFSA8B:8;
end;
deffunc H1(
Element of
product the
Object-Kind of
SCM+FSA )
-> Element of
NAT =
abs (a1 . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))));
consider f being
Function of
product the
Object-Kind of
SCM+FSA ,
NAT such that E57:
for
x being
Element of
product the
Object-Kind of
SCM+FSA holds
f . x = H1(
x)
from FUNCT_2:sch 4();
E58:
for
k being
Element of
NAT holds
(
f . ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) < f . ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k) or
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) <= 0 )
proof
let k be
Element of
NAT ;
E59:
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . k) | (Int-Locations \/ FinSeq-Locations )
by E39, , SCMFSA9A:40;
then E60:
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) = ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I)))
by SCMFSA6A:38;
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . (k + 1)) | (Int-Locations \/ FinSeq-Locations ) = ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) | (Int-Locations \/ FinSeq-Locations )
by E39, , SCMFSA9A:40;
then E61:
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) = ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . (k + 1)) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I)))
by SCMFSA6A:38;
now
assume E62:
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) > 0
;
E63:
f . ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k) =
abs (((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))))
by
.=
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I)))
by , , ABSVALUE:def 1
;
k < ((s . cc) - (s . bb)) + 1
by E36, E38, , , , ;
then E82:
(((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I)))) + k = ((s . cc) - (s . bb)) + 1
by E36, E38, , ;
E83:
k < ((s . cc) - (s . bb)) + 1
by E36, E38, , , , ;
0
<= ((s . cc) - (s . bb)) + 1
by ;
then reconsider scb1 =
((s . cc) - (s . bb)) + 1 as
Element of
NAT by INT_1:16;
E84:
k + 1
<= scb1
by , NAT_1:38;
then E85:
(((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . (k + 1)) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I)))) + (k + 1) = ((s . cc) - (s . bb)) + 1
by E36, E38, , ;
per cases
( ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) > 0 or ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) <= 0 )
;
suppose E86:
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) > 0
;
E87:
f . ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) =
abs (((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))))
by
.=
(scb1 - k) - 1
by , , , ABSVALUE:def 1
;
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) = scb1 - k
by ;
hence
f . ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) < f . ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k)
by , , XREAL_1:148;
end;
suppose E90:
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) <= 0
;
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),((s +* (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(((s . cc) - (s . bb)) + 1)) +* a,(s . bb))) . (k + 1)) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) = scb1 - (k + 1)
by ;
then E91:
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) = 0
by , , , XREAL_1:50;
f . ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) =
abs (((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))))
by
.=
0
by , ABSVALUE:def 1
;
hence
f . ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) < f . ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k)
by , , , SCMFSA6A:38;
end;
end;
end;
hence
(
f . ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (k + 1)) < f . ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k) or
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . k) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) <= 0 )
;
end;
thus
WithVariantWhile>0 1
-stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I)),
(I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0)),
IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),
s
proof
take
f
;
:: according to SCMFSA9A:def 5
thus
for
b1 being
Element of
NAT holds
( not
f . ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . b1) <= f . ((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . (b1 + 1)) or
((StepWhile>0 (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),((I ';' (AddTo a,(intloc 0))) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))),(IExec (((((1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) := cc) ';' (SubFrom (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),bb)) ';' (AddTo (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))),(intloc 0))) ';' (a := bb)),s)) . b1) . (1 -stRWNotIn ({a,bb,cc} \/ (UsedIntLoc I))) <= 0 )
by ;
end;
end;
theorem Th31: :: SFMASTR3:31
for
s being
State of
SCM+FSA for
a being
read-write Int-Location for
cc,
bb being
Int-Location for
Ig being
good Macro-Instruction for
k being
Element of
NAT st
s . (intloc 0) = 1 &
k = ((s . cc) - (s . bb)) + 1 & (
ProperForUpBody a,
bb,
cc,
Ig,
s or
Ig is
parahalting ) holds
(IExec (for-up a,bb,cc,Ig),s) | (Int-Locations \/ FinSeq-Locations ) = ((StepForUp a,bb,cc,Ig,s) . k) | (Int-Locations \/ FinSeq-Locations )
theorem Th32: :: SFMASTR3:32
for
s being
State of
SCM+FSA for
a being
read-write Int-Location for
bb,
cc being
Int-Location for
Ig being
good Macro-Instruction st
s . (intloc 0) = 1 & (
ProperForUpBody a,
bb,
cc,
Ig,
s or
Ig is
parahalting ) holds
(
for-up a,
bb,
cc,
Ig is_closed_on s &
for-up a,
bb,
cc,
Ig is_halting_on s )
definition
let start be
Int-Location ,
finish be
Int-Location ,
minpos be
Int-Location ;
let f be
FinSeq-Location ;
set aux1 = 1
-stRWNotIn {start,finish,minpos};
set aux2 = 2
-ndRWNotIn {start,finish,minpos};
set cv = 3
-rdRWNotIn {start,finish,minpos};
func FinSeqMin c4,
c1,
c2,
c3 -> Macro-Instruction equals :: SFMASTR3:def 9
(minpos := start) ';' (for-up (3 -rdRWNotIn {start,finish,minpos}),start,finish,((((1 -stRWNotIn {start,finish,minpos}) := f,(3 -rdRWNotIn {start,finish,minpos})) ';' ((2 -ndRWNotIn {start,finish,minpos}) := f,minpos)) ';' (if>0 (2 -ndRWNotIn {start,finish,minpos}),(1 -stRWNotIn {start,finish,minpos}),(Macro (minpos := (3 -rdRWNotIn {start,finish,minpos}))),SCM+FSA-Stop )));
coherence
(minpos := start) ';' (for-up (3 -rdRWNotIn {start,finish,minpos}),start,finish,((((1 -stRWNotIn {start,finish,minpos}) := f,(3 -rdRWNotIn {start,finish,minpos})) ';' ((2 -ndRWNotIn {start,finish,minpos}) := f,minpos)) ';' (if>0 (2 -ndRWNotIn {start,finish,minpos}),(1 -stRWNotIn {start,finish,minpos}),(Macro (minpos := (3 -rdRWNotIn {start,finish,minpos}))),SCM+FSA-Stop ))) is Macro-Instruction
;
end;
:: deftheorem Def9 defines FinSeqMin SFMASTR3:def 9 :
for
start,
finish,
minpos being
Int-Location for
f being
FinSeq-Location holds
FinSeqMin f,
start,
finish,
minpos = (minpos := start) ';' (for-up (3 -rdRWNotIn {start,finish,minpos}),start,finish,((((1 -stRWNotIn {start,finish,minpos}) := f,(3 -rdRWNotIn {start,finish,minpos})) ';' ((2 -ndRWNotIn {start,finish,minpos}) := f,minpos)) ';' (if>0 (2 -ndRWNotIn {start,finish,minpos}),(1 -stRWNotIn {start,finish,minpos}),(Macro (minpos := (3 -rdRWNotIn {start,finish,minpos}))),SCM+FSA-Stop )));
theorem Th33: :: SFMASTR3:33
theorem Th34: :: SFMASTR3:34
theorem Th35: :: SFMASTR3:35
theorem Th36: :: SFMASTR3:36
for
s being
State of
SCM+FSA for
c being
read-write Int-Location for
aa,
bb being
Int-Location for
f being
FinSeq-Location st
aa <> c &
bb <> c &
s . (intloc 0) = 1 holds
(
(IExec (FinSeqMin f,aa,bb,c),s) . f = s . f &
(IExec (FinSeqMin f,aa,bb,c),s) . aa = s . aa &
(IExec (FinSeqMin f,aa,bb,c),s) . bb = s . bb )
theorem Th37: :: SFMASTR3:37
definition
let f be
FinSeq-Location ;
let a be
Int-Location ,
b be
Int-Location ;
set aux1 = 1
-stRWNotIn {a,b};
set aux2 = 2
-ndRWNotIn {a,b};
func swap c1,
c2,
c3 -> Macro-Instruction equals :: SFMASTR3:def 10
((((1 -stRWNotIn {a,b}) := f,a) ';' ((2 -ndRWNotIn {a,b}) := f,b)) ';' (f,a := (2 -ndRWNotIn {a,b}))) ';' (f,b := (1 -stRWNotIn {a,b}));
coherence
((((1 -stRWNotIn {a,b}) := f,a) ';' ((2 -ndRWNotIn {a,b}) := f,b)) ';' (f,a := (2 -ndRWNotIn {a,b}))) ';' (f,b := (1 -stRWNotIn {a,b})) is Macro-Instruction
;
end;
:: deftheorem Def10 defines swap SFMASTR3:def 10 :
for
f being
FinSeq-Location for
a,
b being
Int-Location holds
swap f,
a,
b = ((((1 -stRWNotIn {a,b}) := f,a) ';' ((2 -ndRWNotIn {a,b}) := f,b)) ';' (f,a := (2 -ndRWNotIn {a,b}))) ';' (f,b := (1 -stRWNotIn {a,b}));
theorem Th38: :: SFMASTR3:38
theorem Th39: :: SFMASTR3:39
theorem Th40: :: SFMASTR3:40
theorem Th41: :: SFMASTR3:41
theorem Th42: :: SFMASTR3:42
definition
let f be
FinSeq-Location ;
set cv = 1
-stRWNotIn ({} Int-Locations );
set minpos = 2
-ndRWNotIn ({} Int-Locations );
func Selection-sort c1 -> Macro-Instruction equals :: SFMASTR3:def 11
((1 -stNotUsed (swap f,(1 -stRWNotIn ({} Int-Locations )),(2 -ndRWNotIn ({} Int-Locations )))) :=len f) ';' (for-up (1 -stRWNotIn ({} Int-Locations )),(intloc 0),(1 -stNotUsed (swap f,(1 -stRWNotIn ({} Int-Locations )),(2 -ndRWNotIn ({} Int-Locations )))),((FinSeqMin f,(1 -stRWNotIn ({} Int-Locations )),(1 -stNotUsed (swap f,(1 -stRWNotIn ({} Int-Locations )),(2 -ndRWNotIn ({} Int-Locations )))),(2 -ndRWNotIn ({} Int-Locations ))) ';' (swap f,(1 -stRWNotIn ({} Int-Locations )),(2 -ndRWNotIn ({} Int-Locations )))));
coherence
((1 -stNotUsed (swap f,(1 -stRWNotIn ({} Int-Locations )),(2 -ndRWNotIn ({} Int-Locations )))) :=len f) ';' (for-up (1 -stRWNotIn ({} Int-Locations )),(intloc 0),(1 -stNotUsed (swap f,(1 -stRWNotIn ({} Int-Locations )),(2 -ndRWNotIn ({} Int-Locations )))),((FinSeqMin f,(1 -stRWNotIn ({} Int-Locations )),(1 -stNotUsed (swap f,(1 -stRWNotIn ({} Int-Locations )),(2 -ndRWNotIn ({} Int-Locations )))),(2 -ndRWNotIn ({} Int-Locations ))) ';' (swap f,(1 -stRWNotIn ({} Int-Locations )),(2 -ndRWNotIn ({} Int-Locations ))))) is Macro-Instruction
;
end;
:: deftheorem Def11 defines Selection-sort SFMASTR3:def 11 :
for
f being
FinSeq-Location holds
Selection-sort f = ((1 -stNotUsed (swap f,(1 -stRWNotIn ({} Int-Locations )),(2 -ndRWNotIn ({} Int-Locations )))) :=len f) ';' (for-up (1 -stRWNotIn ({} Int-Locations )),(intloc 0),(1 -stNotUsed (swap f,(1 -stRWNotIn ({} Int-Locations )),(2 -ndRWNotIn ({} Int-Locations )))),((FinSeqMin f,(1 -stRWNotIn ({} Int-Locations )),(1 -stNotUsed (swap f,(1 -stRWNotIn ({} Int-Locations )),(2 -ndRWNotIn ({} Int-Locations )))),(2 -ndRWNotIn ({} Int-Locations ))) ';' (swap f,(1 -stRWNotIn ({} Int-Locations )),(2 -ndRWNotIn ({} Int-Locations )))));
theorem Th43: :: SFMASTR3:43