begin
Lm1:
for p1, p2, p3, p4 being XFinSequence holds
( ((p1 ^ p2) ^ p3) ^ p4 = (p1 ^ p2) ^ (p3 ^ p4) & ((p1 ^ p2) ^ p3) ^ p4 = p1 ^ ((p2 ^ p3) ^ p4) & ((p1 ^ p2) ^ p3) ^ p4 = p1 ^ (p2 ^ (p3 ^ p4)) & ((p1 ^ p2) ^ p3) ^ p4 = (p1 ^ (p2 ^ p3)) ^ p4 )
Lm2:
for p1, p2, p3, p4, p5 being XFinSequence holds
( (((p1 ^ p2) ^ p3) ^ p4) ^ p5 = ((p1 ^ p2) ^ p3) ^ (p4 ^ p5) & (((p1 ^ p2) ^ p3) ^ p4) ^ p5 = (p1 ^ p2) ^ ((p3 ^ p4) ^ p5) & (((p1 ^ p2) ^ p3) ^ p4) ^ p5 = (p1 ^ p2) ^ (p3 ^ (p4 ^ p5)) & (((p1 ^ p2) ^ p3) ^ p4) ^ p5 = p1 ^ (((p2 ^ p3) ^ p4) ^ p5) & (((p1 ^ p2) ^ p3) ^ p4) ^ p5 = p1 ^ ((p2 ^ p3) ^ (p4 ^ p5)) & (((p1 ^ p2) ^ p3) ^ p4) ^ p5 = p1 ^ (p2 ^ ((p3 ^ p4) ^ p5)) & (((p1 ^ p2) ^ p3) ^ p4) ^ p5 = p1 ^ (p2 ^ (p3 ^ (p4 ^ p5))) & (((p1 ^ p2) ^ p3) ^ p4) ^ p5 = ((p1 ^ p2) ^ (p3 ^ p4)) ^ p5 & (((p1 ^ p2) ^ p3) ^ p4) ^ p5 = (p1 ^ ((p2 ^ p3) ^ p4)) ^ p5 & (((p1 ^ p2) ^ p3) ^ p4) ^ p5 = (p1 ^ (p2 ^ (p3 ^ p4))) ^ p5 & (((p1 ^ p2) ^ p3) ^ p4) ^ p5 = p1 ^ ((p2 ^ (p3 ^ p4)) ^ p5) )
deffunc H1( Element of NAT ) -> Element of NAT = $1 -' 1;
:: deftheorem SCMFSA_7:def 1 :
canceled;
:: deftheorem Def2 defines := SCMFSA_7:def 2 :
for a being Int-Location
for k being Integer
for b3 being FinPartState of SCM+FSA holds
( ( k > 0 implies ( b3 = a := k iff ex k1 being Element of NAT st
( k1 + 1 = k & b3 = (<%(a := (intloc 0))%> ^ (k1 --> (AddTo (a,(intloc 0))))) ^ <%(halt SCM+FSA)%> ) ) ) & ( not k > 0 implies ( b3 = a := k iff ex k1 being Element of NAT st
( k1 + k = 1 & b3 = (<%(a := (intloc 0))%> ^ (k1 --> (SubFrom (a,(intloc 0))))) ^ <%(halt SCM+FSA)%> ) ) ) );
definition
let a be
Int-Location ;
let k be
Integer;
func aSeq (
a,
k)
-> XFinSequence of the
Instructions of
SCM+FSA means :
Def3:
ex
k1 being
Element of
NAT st
(
k1 + 1
= k &
it = <%(a := (intloc 0))%> ^ (k1 --> (AddTo (a,(intloc 0)))) )
if k > 0 otherwise ex
k1 being
Element of
NAT st
(
k1 + k = 1 &
it = <%(a := (intloc 0))%> ^ (k1 --> (SubFrom (a,(intloc 0)))) );
existence
( ( k > 0 implies ex b1 being XFinSequence of the Instructions of SCM+FSA ex k1 being Element of NAT st
( k1 + 1 = k & b1 = <%(a := (intloc 0))%> ^ (k1 --> (AddTo (a,(intloc 0)))) ) ) & ( not k > 0 implies ex b1 being XFinSequence of the Instructions of SCM+FSA ex k1 being Element of NAT st
( k1 + k = 1 & b1 = <%(a := (intloc 0))%> ^ (k1 --> (SubFrom (a,(intloc 0)))) ) ) )
uniqueness
for b1, b2 being XFinSequence of the Instructions of SCM+FSA holds
( ( k > 0 & ex k1 being Element of NAT st
( k1 + 1 = k & b1 = <%(a := (intloc 0))%> ^ (k1 --> (AddTo (a,(intloc 0)))) ) & ex k1 being Element of NAT st
( k1 + 1 = k & b2 = <%(a := (intloc 0))%> ^ (k1 --> (AddTo (a,(intloc 0)))) ) implies b1 = b2 ) & ( not k > 0 & ex k1 being Element of NAT st
( k1 + k = 1 & b1 = <%(a := (intloc 0))%> ^ (k1 --> (SubFrom (a,(intloc 0)))) ) & ex k1 being Element of NAT st
( k1 + k = 1 & b2 = <%(a := (intloc 0))%> ^ (k1 --> (SubFrom (a,(intloc 0)))) ) implies b1 = b2 ) )
;
correctness
consistency
for b1 being XFinSequence of the Instructions of SCM+FSA holds verum;
;
end;
:: deftheorem Def3 defines aSeq SCMFSA_7:def 3 :
for a being Int-Location
for k being Integer
for b3 being XFinSequence of the Instructions of SCM+FSA holds
( ( k > 0 implies ( b3 = aSeq (a,k) iff ex k1 being Element of NAT st
( k1 + 1 = k & b3 = <%(a := (intloc 0))%> ^ (k1 --> (AddTo (a,(intloc 0)))) ) ) ) & ( not k > 0 implies ( b3 = aSeq (a,k) iff ex k1 being Element of NAT st
( k1 + k = 1 & b3 = <%(a := (intloc 0))%> ^ (k1 --> (SubFrom (a,(intloc 0)))) ) ) ) );
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
canceled;
theorem
definition
let f be
FinSeq-Location ;
let p be
FinSequence of
INT ;
func aSeq (
f,
p)
-> XFinSequence of the
Instructions of
SCM+FSA means :
Def4:
ex
pp being
XFinSequence of the
Instructions of
SCM+FSA ^omega st
(
len pp = len p & ( for
k being
Element of
NAT st
k < len pp holds
ex
i being
Integer st
(
i = p . (k + 1) &
pp . k = ((aSeq ((intloc 1),(k + 1))) ^ (aSeq ((intloc 2),i))) ^ <%((f,(intloc 1)) := (intloc 2))%> ) ) &
it = FlattenSeq pp );
existence
ex b1 being XFinSequence of the Instructions of SCM+FSA ex pp being XFinSequence of the Instructions of SCM+FSA ^omega st
( len pp = len p & ( for k being Element of NAT st k < len pp holds
ex i being Integer st
( i = p . (k + 1) & pp . k = ((aSeq ((intloc 1),(k + 1))) ^ (aSeq ((intloc 2),i))) ^ <%((f,(intloc 1)) := (intloc 2))%> ) ) & b1 = FlattenSeq pp )
uniqueness
for b1, b2 being XFinSequence of the Instructions of SCM+FSA st ex pp being XFinSequence of the Instructions of SCM+FSA ^omega st
( len pp = len p & ( for k being Element of NAT st k < len pp holds
ex i being Integer st
( i = p . (k + 1) & pp . k = ((aSeq ((intloc 1),(k + 1))) ^ (aSeq ((intloc 2),i))) ^ <%((f,(intloc 1)) := (intloc 2))%> ) ) & b1 = FlattenSeq pp ) & ex pp being XFinSequence of the Instructions of SCM+FSA ^omega st
( len pp = len p & ( for k being Element of NAT st k < len pp holds
ex i being Integer st
( i = p . (k + 1) & pp . k = ((aSeq ((intloc 1),(k + 1))) ^ (aSeq ((intloc 2),i))) ^ <%((f,(intloc 1)) := (intloc 2))%> ) ) & b2 = FlattenSeq pp ) holds
b1 = b2
correctness
;
end;
:: deftheorem Def4 defines aSeq SCMFSA_7:def 4 :
for f being FinSeq-Location
for p being FinSequence of INT
for b3 being XFinSequence of the Instructions of SCM+FSA holds
( b3 = aSeq (f,p) iff ex pp being XFinSequence of the Instructions of SCM+FSA ^omega st
( len pp = len p & ( for k being Element of NAT st k < len pp holds
ex i being Integer st
( i = p . (k + 1) & pp . k = ((aSeq ((intloc 1),(k + 1))) ^ (aSeq ((intloc 2),i))) ^ <%((f,(intloc 1)) := (intloc 2))%> ) ) & b3 = FlattenSeq pp ) );
:: deftheorem defines := SCMFSA_7:def 5 :
for f being FinSeq-Location
for p being FinSequence of INT holds f := p = (((aSeq ((intloc 1),(len p))) ^ <%(f :=<0,...,0> (intloc 1))%>) ^ (aSeq (f,p))) ^ <%(halt SCM+FSA)%>;
theorem
theorem
theorem Th36:
for
P being the
Instructions of
SCM+FSA -valued ManySortedSet of
NAT for
c0 being
Element of
NAT for
s being
b2 -started State of
SCM+FSA st
s . (intloc 0) = 1 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 = P . (c0 + c) ) holds
( ( for
i being
Element of
NAT st
i <= len (aSeq (a,k)) holds
(
IC (Comput (P,s,i)) = c0 + i & ( for
b being
Int-Location st
b <> a holds
(Comput (P,s,i)) . b = s . b ) & ( for
f being
FinSeq-Location holds
(Comput (P,s,i)) . f = s . f ) ) ) &
(Comput (P,s,(len (aSeq (a,k))))) . a = k )
theorem Th37:
for
P being the
Instructions of
SCM+FSA -valued ManySortedSet of
NAT for
s being
0 -started State of
SCM+FSA st
s . (intloc 0) = 1 holds
for
a being
Int-Location for
k being
Integer st
aSeq (
a,
k)
c= P &
a <> intloc 0 holds
( ( for
i being
Element of
NAT st
i <= len (aSeq (a,k)) holds
(
IC (Comput (P,s,i)) = i & ( for
b being
Int-Location st
b <> a holds
(Comput (P,s,i)) . b = s . b ) & ( for
f being
FinSeq-Location holds
(Comput (P,s,i)) . f = s . f ) ) ) &
(Comput (P,s,(len (aSeq (a,k))))) . a = k )
theorem
theorem