let s be State of SCM+FSA ; ( s . (intloc 0 ) = 1 implies for c0 being Element of NAT st IC s = c0 holds
for a being Int-Location
for k being Integer st a <> intloc 0 & ( for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . ((c0 + c) -' 1) ) holds
( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Comput (ProgramPart s),s,i) = c0 + i & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,i) . f = s . f ) ) ) & (Comput (ProgramPart s),s,(len (aSeq a,k))) . a = k ) )
assume A1:
s . (intloc 0 ) = 1
; for c0 being Element of NAT st IC s = c0 holds
for a being Int-Location
for k being Integer st a <> intloc 0 & ( for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . ((c0 + c) -' 1) ) holds
( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Comput (ProgramPart s),s,i) = c0 + i & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,i) . f = s . f ) ) ) & (Comput (ProgramPart s),s,(len (aSeq a,k))) . a = k )
let c0 be Element of NAT ; ( IC s = c0 implies for a being Int-Location
for k being Integer st a <> intloc 0 & ( for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . ((c0 + c) -' 1) ) holds
( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Comput (ProgramPart s),s,i) = c0 + i & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,i) . f = s . f ) ) ) & (Comput (ProgramPart s),s,(len (aSeq a,k))) . a = k ) )
assume A2:
IC s = c0
; for a being Int-Location
for k being Integer st a <> intloc 0 & ( for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . ((c0 + c) -' 1) ) holds
( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Comput (ProgramPart s),s,i) = c0 + i & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,i) . f = s . f ) ) ) & (Comput (ProgramPart s),s,(len (aSeq a,k))) . a = k )
let a be Int-Location ; for k being Integer st a <> intloc 0 & ( for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . ((c0 + c) -' 1) ) holds
( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Comput (ProgramPart s),s,i) = c0 + i & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,i) . f = s . f ) ) ) & (Comput (ProgramPart s),s,(len (aSeq a,k))) . a = k )
let k be Integer; ( a <> intloc 0 & ( for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . ((c0 + c) -' 1) ) implies ( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Comput (ProgramPart s),s,i) = c0 + i & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,i) . f = s . f ) ) ) & (Comput (ProgramPart s),s,(len (aSeq a,k))) . a = k ) )
assume that
A3:
a <> intloc 0
and
A4:
for c being Element of NAT st c in dom (aSeq a,k) holds
(aSeq a,k) . c = s . ((c0 + c) -' 1)
; ( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Comput (ProgramPart s),s,i) = c0 + i & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,i) . f = s . f ) ) ) & (Comput (ProgramPart s),s,(len (aSeq a,k))) . a = k )
per cases
( k > 0 or k <= 0 )
;
suppose A5:
k > 0
;
( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Comput (ProgramPart s),s,i) = c0 + i & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,i) . f = s . f ) ) ) & (Comput (ProgramPart s),s,(len (aSeq a,k))) . a = k )then reconsider k9 =
k as
Element of
NAT by INT_1:16;
consider k1 being
Element of
NAT such that A6:
k1 + 1
= k9
and A7:
aSeq a,
k9 = <*(a := (intloc 0 ))*> ^ (k1 |-> (AddTo a,(intloc 0 )))
by A5, Def3;
defpred S1[
Nat]
means ( $1
<= k9 implies (
IC (Comput (ProgramPart s),s,$1) = c0 + $1 & ( 1
<= $1 implies
(Comput (ProgramPart s),s,$1) . a = $1 ) & ( for
b being
Int-Location st
b <> a holds
(Comput (ProgramPart s),s,$1) . b = s . b ) & ( for
f being
FinSeq-Location holds
(Comput (ProgramPart s),s,$1) . f = s . f ) ) );
A8:
len (aSeq a,k9) =
(len <*(a := (intloc 0 ))*>) + (len (k1 |-> (AddTo a,(intloc 0 ))))
by A7, FINSEQ_1:35
.=
1
+ (len (k1 |-> (AddTo a,(intloc 0 ))))
by FINSEQ_1:56
.=
k9
by A6, FINSEQ_1:def 18
;
A9:
for
i being
Element of
NAT st
i <= len (aSeq a,k9) holds
(
IC (Comput (ProgramPart s),s,i) = c0 + i & ( 1
<= i implies
(Comput (ProgramPart s),s,i) . a = i ) & ( for
b being
Int-Location st
b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for
f being
FinSeq-Location holds
(Comput (ProgramPart s),s,i) . f = s . f ) )
proof
then A13:
s . (c0 + 0 ) =
(aSeq a,k9) . (0 + 1)
by A5
.=
a := (intloc 0 )
by A7, FINSEQ_1:58
;
A14:
now let n be
Element of
NAT ;
( n = 0 implies ( Comput (ProgramPart s),s,n = s & CurInstr (ProgramPart (Comput (ProgramPart s),s,n)),(Comput (ProgramPart s),s,n) = a := (intloc 0 ) & Comput (ProgramPart s),s,(n + 1) = Exec (a := (intloc 0 )),s ) )Y:
(ProgramPart (Comput (ProgramPart s),s,n)) /. (IC (Comput (ProgramPart s),s,n)) = (Comput (ProgramPart s),s,n) . (IC (Comput (ProgramPart s),s,n))
by COMPOS_1:38;
assume
n = 0
;
( Comput (ProgramPart s),s,n = s & CurInstr (ProgramPart (Comput (ProgramPart s),s,n)),(Comput (ProgramPart s),s,n) = a := (intloc 0 ) & Comput (ProgramPart s),s,(n + 1) = Exec (a := (intloc 0 )),s )hence A15:
Comput (ProgramPart s),
s,
n = s
by AMI_1:13;
( CurInstr (ProgramPart (Comput (ProgramPart s),s,n)),(Comput (ProgramPart s),s,n) = a := (intloc 0 ) & Comput (ProgramPart s),s,(n + 1) = Exec (a := (intloc 0 )),s )hence
CurInstr (ProgramPart (Comput (ProgramPart s),s,n)),
(Comput (ProgramPart s),s,n) = a := (intloc 0 )
by A2, A13, Y;
Comput (ProgramPart s),s,(n + 1) = Exec (a := (intloc 0 )),sthus Comput (ProgramPart s),
s,
(n + 1) =
Following (ProgramPart s),
(Comput (ProgramPart s),s,n)
by AMI_1:14
.=
Exec (a := (intloc 0 )),
s
by A2, A13, A15, Y
;
verum end;
A16:
now let i be
Element of
NAT ;
( 1 < i & i <= k9 implies (aSeq a,k9) . i = AddTo a,(intloc 0 ) )assume that A17:
1
< i
and A18:
i <= k9
;
(aSeq a,k9) . i = AddTo a,(intloc 0 )A19:
1
<= i - 1
by A17, INT_1:79;
then reconsider i1 =
i - 1 as
Element of
NAT by INT_1:16;
i - 1
<= k9 - 1
by A18, XREAL_1:11;
then A20:
i1 in Seg k1
by A6, A19;
len <*(a := (intloc 0 ))*> = 1
by FINSEQ_1:56;
hence (aSeq a,k9) . i =
(k1 |-> (AddTo a,(intloc 0 ))) . (i - 1)
by A7, A8, A17, A18, FINSEQ_1:37
.=
AddTo a,
(intloc 0 )
by A20, FUNCOP_1:13
;
verum end;
A25:
for
n being
Element of
NAT st
S1[
n] holds
S1[
n + 1]
proof
let n be
Element of
NAT ;
( S1[n] implies S1[n + 1] )
assume A26:
S1[
n]
;
S1[n + 1]
assume A27:
n + 1
<= k9
;
( IC (Comput (ProgramPart s),s,(n + 1)) = c0 + (n + 1) & ( 1 <= n + 1 implies (Comput (ProgramPart s),s,(n + 1)) . a = n + 1 ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f ) )
per cases
( n = 0 or n > 0 )
;
suppose A28:
n = 0
;
( IC (Comput (ProgramPart s),s,(n + 1)) = c0 + (n + 1) & ( 1 <= n + 1 implies (Comput (ProgramPart s),s,(n + 1)) . a = n + 1 ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f ) )hence IC (Comput (ProgramPart s),s,(n + 1)) =
(Exec (a := (intloc 0 )),s) . (IC SCM+FSA )
by A14
.=
succ (c0 + n)
by A2, A28, SCMFSA_2:89
.=
(c0 + n) + 1
by NAT_1:39
.=
c0 + (n + 1)
;
( ( 1 <= n + 1 implies (Comput (ProgramPart s),s,(n + 1)) . a = n + 1 ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f ) )let f be
FinSeq-Location ;
(Comput (ProgramPart s),s,(n + 1)) . f = s . fthus (Comput (ProgramPart s),s,(n + 1)) . f =
(Exec (a := (intloc 0 )),s) . f
by A14, A28
.=
s . f
by SCMFSA_2:89
;
verum end; suppose A30:
n > 0
;
( IC (Comput (ProgramPart s),s,(n + 1)) = c0 + (n + 1) & ( 1 <= n + 1 implies (Comput (ProgramPart s),s,(n + 1)) . a = n + 1 ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f ) )A31:
n < k9
by A27, NAT_1:13;
Y:
(ProgramPart (Comput (ProgramPart s),s,n)) /. (IC (Comput (ProgramPart s),s,n)) = (Comput (ProgramPart s),s,n) . (IC (Comput (ProgramPart s),s,n))
by COMPOS_1:38;
A32:
n + 0 <= n + 1
by XREAL_1:9;
then A33:
CurInstr (ProgramPart (Comput (ProgramPart s),s,n)),
(Comput (ProgramPart s),s,n) =
s . (c0 + n)
by A26, A27, Y, AMI_1:54, XXREAL_0:2
.=
AddTo a,
(intloc 0 )
by A21, A30, A31
;
T:
ProgramPart s = ProgramPart (Comput (ProgramPart s),s,n)
by AMI_1:123;
A34:
Comput (ProgramPart s),
s,
(n + 1) =
Following (ProgramPart s),
(Comput (ProgramPart s),s,n)
by AMI_1:14
.=
Exec (AddTo a,(intloc 0 )),
(Comput (ProgramPart s),s,n)
by A33, T
;
hence IC (Comput (ProgramPart s),s,(n + 1)) =
succ (IC (Comput (ProgramPart s),s,n))
by SCMFSA_2:90
.=
(c0 + n) + 1
by A26, A27, A32, NAT_1:39, XXREAL_0:2
.=
c0 + (n + 1)
;
( ( 1 <= n + 1 implies (Comput (ProgramPart s),s,(n + 1)) . a = n + 1 ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f ) )A35:
0 + 1
<= n
by A30, INT_1:20;
hereby ( ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f ) )
assume
1
<= n + 1
;
(Comput (ProgramPart s),s,(n + 1)) . a = n + 1thus (Comput (ProgramPart s),s,(n + 1)) . a =
n + ((Comput (ProgramPart s),s,n) . (intloc 0 ))
by A26, A27, A35, A32, A34, SCMFSA_2:90, XXREAL_0:2
.=
n + 1
by A1, A3, A26, A27, A32, XXREAL_0:2
;
verum
end; hereby for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f
let b be
Int-Location ;
( b <> a implies (Comput (ProgramPart s),s,(n + 1)) . b = s . b )assume A36:
b <> a
;
(Comput (ProgramPart s),s,(n + 1)) . b = s . bhence (Comput (ProgramPart s),s,(n + 1)) . b =
(Comput (ProgramPart s),s,n) . b
by A34, SCMFSA_2:90
.=
s . b
by A26, A27, A32, A36, XXREAL_0:2
;
verum
end; let f be
FinSeq-Location ;
(Comput (ProgramPart s),s,(n + 1)) . f = s . fthus (Comput (ProgramPart s),s,(n + 1)) . f =
(Comput (ProgramPart s),s,n) . f
by A34, SCMFSA_2:90
.=
s . f
by A26, A27, A32, XXREAL_0:2
;
verum end; end;
end;
A37:
S1[
0 ]
by A2, AMI_1:13;
A38:
for
i being
Element of
NAT holds
S1[
i]
from NAT_1:sch 1(A37, A25);
let i be
Element of
NAT ;
( i <= len (aSeq a,k9) implies ( IC (Comput (ProgramPart s),s,i) = c0 + i & ( 1 <= i implies (Comput (ProgramPart s),s,i) . a = i ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,i) . f = s . f ) ) )
assume
i <= len (aSeq a,k9)
;
( IC (Comput (ProgramPart s),s,i) = c0 + i & ( 1 <= i implies (Comput (ProgramPart s),s,i) . a = i ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,i) . f = s . f ) )
hence
(
IC (Comput (ProgramPart s),s,i) = c0 + i & ( 1
<= i implies
(Comput (ProgramPart s),s,i) . a = i ) & ( for
b being
Int-Location st
b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for
f being
FinSeq-Location holds
(Comput (ProgramPart s),s,i) . f = s . f ) )
by A8, A38;
verum
end; hence
for
i being
Element of
NAT st
i <= len (aSeq a,k) holds
(
IC (Comput (ProgramPart s),s,i) = c0 + i & ( for
b being
Int-Location st
b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for
f being
FinSeq-Location holds
(Comput (ProgramPart s),s,i) . f = s . f ) )
;
(Comput (ProgramPart s),s,(len (aSeq a,k))) . a = k
1
<= len (aSeq a,k)
by A6, A8, NAT_1:11;
hence
(Comput (ProgramPart s),s,(len (aSeq a,k))) . a = k
by A8, A9;
verum end; suppose A39:
k <= 0
;
( ( for i being Element of NAT st i <= len (aSeq a,k) holds
( IC (Comput (ProgramPart s),s,i) = c0 + i & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,i) . f = s . f ) ) ) & (Comput (ProgramPart s),s,(len (aSeq a,k))) . a = k )then reconsider mk =
- k as
Element of
NAT by INT_1:16;
defpred S1[
Nat]
means ( $1
<= (mk + 1) + 1 implies (
IC (Comput (ProgramPart s),s,$1) = c0 + $1 & ( 1
<= $1 implies
(Comput (ProgramPart s),s,$1) . a = ((- $1) + 1) + 1 ) & ( for
b being
Int-Location st
b <> a holds
(Comput (ProgramPart s),s,$1) . b = s . b ) & ( for
f being
FinSeq-Location holds
(Comput (ProgramPart s),s,$1) . f = s . f ) ) );
consider k1 being
Element of
NAT such that A40:
k1 + k = 1
and A41:
aSeq a,
k = <*(a := (intloc 0 ))*> ^ (k1 |-> (SubFrom a,(intloc 0 )))
by A39, Def3;
A42:
len (aSeq a,k) =
(len <*(a := (intloc 0 ))*>) + (len (k1 |-> (SubFrom a,(intloc 0 ))))
by A41, FINSEQ_1:35
.=
1
+ (len (k1 |-> (SubFrom a,(intloc 0 ))))
by FINSEQ_1:56
.=
(mk + 1) + 1
by A40, FINSEQ_1:def 18
;
A43:
for
i being
Element of
NAT st
i <= len (aSeq a,k) holds
(
IC (Comput (ProgramPart s),s,i) = c0 + i & ( 1
<= i implies
(Comput (ProgramPart s),s,i) . a = ((- i) + 1) + 1 ) & ( for
b being
Int-Location st
b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for
f being
FinSeq-Location holds
(Comput (ProgramPart s),s,i) . f = s . f ) )
proof
then A47:
s . (c0 + 0 ) =
(aSeq a,k) . (0 + 1)
.=
a := (intloc 0 )
by A41, FINSEQ_1:58
;
A48:
for
n being
Element of
NAT st
n = 0 holds
(
Comput (ProgramPart s),
s,
n = s &
CurInstr (ProgramPart (Comput (ProgramPart s),s,n)),
(Comput (ProgramPart s),s,n) = a := (intloc 0 ) &
Comput (ProgramPart s),
s,
(n + 1) = Exec (a := (intloc 0 )),
s )
proof
let n be
Element of
NAT ;
( n = 0 implies ( Comput (ProgramPart s),s,n = s & CurInstr (ProgramPart (Comput (ProgramPart s),s,n)),(Comput (ProgramPart s),s,n) = a := (intloc 0 ) & Comput (ProgramPart s),s,(n + 1) = Exec (a := (intloc 0 )),s ) )
Y:
(ProgramPart (Comput (ProgramPart s),s,n)) /. (IC (Comput (ProgramPart s),s,n)) = (Comput (ProgramPart s),s,n) . (IC (Comput (ProgramPart s),s,n))
by COMPOS_1:38;
assume
n = 0
;
( Comput (ProgramPart s),s,n = s & CurInstr (ProgramPart (Comput (ProgramPart s),s,n)),(Comput (ProgramPart s),s,n) = a := (intloc 0 ) & Comput (ProgramPart s),s,(n + 1) = Exec (a := (intloc 0 )),s )
hence A49:
Comput (ProgramPart s),
s,
n = s
by AMI_1:13;
( CurInstr (ProgramPart (Comput (ProgramPart s),s,n)),(Comput (ProgramPart s),s,n) = a := (intloc 0 ) & Comput (ProgramPart s),s,(n + 1) = Exec (a := (intloc 0 )),s )
hence
CurInstr (ProgramPart (Comput (ProgramPart s),s,n)),
(Comput (ProgramPart s),s,n) = a := (intloc 0 )
by A2, A47, Y;
Comput (ProgramPart s),s,(n + 1) = Exec (a := (intloc 0 )),s
thus Comput (ProgramPart s),
s,
(n + 1) =
Following (ProgramPart s),
(Comput (ProgramPart s),s,n)
by AMI_1:14
.=
Exec (a := (intloc 0 )),
s
by A2, A47, A49, Y
;
verum
end;
A50:
now let i be
Element of
NAT ;
( 1 < i & i <= (mk + 1) + 1 implies (aSeq a,k) . i = SubFrom a,(intloc 0 ) )assume that A51:
1
< i
and A52:
i <= (mk + 1) + 1
;
(aSeq a,k) . i = SubFrom a,(intloc 0 )A53:
i - 1
<= ((mk + 1) + 1) - 1
by A52, XREAL_1:11;
A54:
1
- 1
< i - 1
by A51, XREAL_1:11;
then reconsider i1 =
i - 1 as
Element of
NAT by INT_1:16;
(1 - 1) + 1
<= i - 1
by A54, INT_1:20;
then A55:
i1 in Seg k1
by A40, A53;
len <*(a := (intloc 0 ))*> = 1
by FINSEQ_1:56;
hence (aSeq a,k) . i =
(k1 |-> (SubFrom a,(intloc 0 ))) . (i - 1)
by A41, A42, A51, A52, FINSEQ_1:37
.=
SubFrom a,
(intloc 0 )
by A55, FUNCOP_1:13
;
verum end;
A60:
for
n being
Element of
NAT st
S1[
n] holds
S1[
n + 1]
proof
let n be
Element of
NAT ;
( S1[n] implies S1[n + 1] )
assume A61:
S1[
n]
;
S1[n + 1]
assume A62:
n + 1
<= (mk + 1) + 1
;
( IC (Comput (ProgramPart s),s,(n + 1)) = c0 + (n + 1) & ( 1 <= n + 1 implies (Comput (ProgramPart s),s,(n + 1)) . a = ((- (n + 1)) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f ) )
per cases
( n = 0 or n > 0 )
;
suppose A63:
n = 0
;
( IC (Comput (ProgramPart s),s,(n + 1)) = c0 + (n + 1) & ( 1 <= n + 1 implies (Comput (ProgramPart s),s,(n + 1)) . a = ((- (n + 1)) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f ) )hence IC (Comput (ProgramPart s),s,(n + 1)) =
(Exec (a := (intloc 0 )),s) . (IC SCM+FSA )
by A48
.=
succ (c0 + n)
by A2, A63, SCMFSA_2:89
.=
(c0 + n) + 1
by NAT_1:39
.=
c0 + (n + 1)
;
( ( 1 <= n + 1 implies (Comput (ProgramPart s),s,(n + 1)) . a = ((- (n + 1)) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f ) )let f be
FinSeq-Location ;
(Comput (ProgramPart s),s,(n + 1)) . f = s . fthus (Comput (ProgramPart s),s,(n + 1)) . f =
(Exec (a := (intloc 0 )),s) . f
by A48, A63
.=
s . f
by SCMFSA_2:89
;
verum end; suppose A65:
n > 0
;
( IC (Comput (ProgramPart s),s,(n + 1)) = c0 + (n + 1) & ( 1 <= n + 1 implies (Comput (ProgramPart s),s,(n + 1)) . a = ((- (n + 1)) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f ) )A66:
n < (mk + 1) + 1
by A62, NAT_1:13;
Y:
(ProgramPart (Comput (ProgramPart s),s,n)) /. (IC (Comput (ProgramPart s),s,n)) = (Comput (ProgramPart s),s,n) . (IC (Comput (ProgramPart s),s,n))
by COMPOS_1:38;
A67:
n + 0 <= n + 1
by XREAL_1:9;
then A68:
CurInstr (ProgramPart (Comput (ProgramPart s),s,n)),
(Comput (ProgramPart s),s,n) =
s . (c0 + n)
by A61, A62, Y, AMI_1:54, XXREAL_0:2
.=
SubFrom a,
(intloc 0 )
by A56, A65, A66
;
T:
ProgramPart s = ProgramPart (Comput (ProgramPart s),s,n)
by AMI_1:123;
A69:
Comput (ProgramPart s),
s,
(n + 1) =
Following (ProgramPart s),
(Comput (ProgramPart s),s,n)
by AMI_1:14
.=
Exec (SubFrom a,(intloc 0 )),
(Comput (ProgramPart s),s,n)
by A68, T
;
hence IC (Comput (ProgramPart s),s,(n + 1)) =
succ (IC (Comput (ProgramPart s),s,n))
by SCMFSA_2:91
.=
(c0 + n) + 1
by A61, A62, A67, NAT_1:39, XXREAL_0:2
.=
c0 + (n + 1)
;
( ( 1 <= n + 1 implies (Comput (ProgramPart s),s,(n + 1)) . a = ((- (n + 1)) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f ) )A70:
0 + 1
< n + 1
by A65, XREAL_1:8;
hereby ( ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,(n + 1)) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f ) )
assume
1
<= n + 1
;
(Comput (ProgramPart s),s,(n + 1)) . a = ((- (n + 1)) + 1) + 1thus (Comput (ProgramPart s),s,(n + 1)) . a =
(((- n) + 1) + 1) - ((Comput (ProgramPart s),s,n) . (intloc 0 ))
by A61, A62, A70, A69, NAT_1:13, SCMFSA_2:91
.=
(((- n) + 1) + 1) - (s . (intloc 0 ))
by A3, A61, A62, A67, XXREAL_0:2
.=
((- (n + 1)) + 1) + 1
by A1
;
verum
end; hereby for f being FinSeq-Location holds (Comput (ProgramPart s),s,(n + 1)) . f = s . f
let b be
Int-Location ;
( b <> a implies (Comput (ProgramPart s),s,(n + 1)) . b = s . b )assume A71:
b <> a
;
(Comput (ProgramPart s),s,(n + 1)) . b = s . bhence (Comput (ProgramPart s),s,(n + 1)) . b =
(Comput (ProgramPart s),s,n) . b
by A69, SCMFSA_2:91
.=
s . b
by A61, A62, A67, A71, XXREAL_0:2
;
verum
end; let f be
FinSeq-Location ;
(Comput (ProgramPart s),s,(n + 1)) . f = s . fthus (Comput (ProgramPart s),s,(n + 1)) . f =
(Comput (ProgramPart s),s,n) . f
by A69, SCMFSA_2:91
.=
s . f
by A61, A62, A67, XXREAL_0:2
;
verum end; end;
end;
A72:
S1[
0 ]
by A2, AMI_1:13;
A73:
for
i being
Element of
NAT holds
S1[
i]
from NAT_1:sch 1(A72, A60);
let i be
Element of
NAT ;
( i <= len (aSeq a,k) implies ( IC (Comput (ProgramPart s),s,i) = c0 + i & ( 1 <= i implies (Comput (ProgramPart s),s,i) . a = ((- i) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,i) . f = s . f ) ) )
assume
i <= len (aSeq a,k)
;
( IC (Comput (ProgramPart s),s,i) = c0 + i & ( 1 <= i implies (Comput (ProgramPart s),s,i) . a = ((- i) + 1) + 1 ) & ( for b being Int-Location st b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for f being FinSeq-Location holds (Comput (ProgramPart s),s,i) . f = s . f ) )
hence
(
IC (Comput (ProgramPart s),s,i) = c0 + i & ( 1
<= i implies
(Comput (ProgramPart s),s,i) . a = ((- i) + 1) + 1 ) & ( for
b being
Int-Location st
b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for
f being
FinSeq-Location holds
(Comput (ProgramPart s),s,i) . f = s . f ) )
by A42, A73;
verum
end; hence
for
i being
Element of
NAT st
i <= len (aSeq a,k) holds
(
IC (Comput (ProgramPart s),s,i) = c0 + i & ( for
b being
Int-Location st
b <> a holds
(Comput (ProgramPart s),s,i) . b = s . b ) & ( for
f being
FinSeq-Location holds
(Comput (ProgramPart s),s,i) . f = s . f ) )
;
(Comput (ProgramPart s),s,(len (aSeq a,k))) . a = k
1
<= len (aSeq a,k)
by A42, NAT_1:11;
hence (Comput (ProgramPart s),s,(len (aSeq a,k))) . a =
((- ((- k) + (1 + 1))) + 1) + 1
by A42, A43
.=
k
;
verum end; end;