theorem Th8:
for
S being non
empty non
void ManySortedSign for
A1,
A2,
B1 being
MSAlgebra over
S for
B2 being
non-empty MSAlgebra over
S st
MSAlgebra(# the
Sorts of
A1, the
Charact of
A1 #)
= MSAlgebra(# the
Sorts of
A2, the
Charact of
A2 #) &
MSAlgebra(# the
Sorts of
B1, the
Charact of
B1 #)
= MSAlgebra(# the
Sorts of
B2, the
Charact of
B2 #) holds
for
h1 being
ManySortedFunction of
A1,
B1 for
h2 being
ManySortedFunction of
A2,
B2 st
h1 = h2 &
h1 is_epimorphism A1,
B1 holds
h2 is_epimorphism A2,
B2 by MSAFREE4:30;
definition
let S be non
empty non
void bool-correct 4,1
integer BoolSignature ;
let X be
V3()
ManySortedSet of the
carrier of
S;
let T be
X,
S -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S;
let G be
basic GeneratorSystem over
S,
X,
T;
let A be
IfWhileAlgebra of the
generators of
G;
let b be
pure Element of the
generators of
G . the
bool-sort of
S;
let I be
integer SortSymbol of
S;
let t1,
t2 be
Element of
T,
I;
coherence
b := ((leq (t1,t2)),A) is Algorithm of A
;
coherence
b := ((\not (leq (t1,t2))),A) is Algorithm of A
;
end;
::
deftheorem defines
leq AOFA_A01:def 8 :
for S being non empty non void bool-correct 4,1 integer BoolSignature
for X being V3() ManySortedSet of the carrier of S
for T being b2,b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over S
for G being basic GeneratorSystem over S,X,T
for A being IfWhileAlgebra of the generators of G
for b being pure Element of the generators of G . the bool-sort of S
for I being integer SortSymbol of S
for t1, t2 being Element of T,I holds b leq (t1,t2,A) = b := ((leq (t1,t2)),A);
::
deftheorem defines
gt AOFA_A01:def 9 :
for S being non empty non void bool-correct 4,1 integer BoolSignature
for X being V3() ManySortedSet of the carrier of S
for T being b2,b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over S
for G being basic GeneratorSystem over S,X,T
for A being IfWhileAlgebra of the generators of G
for b being pure Element of the generators of G . the bool-sort of S
for I being integer SortSymbol of S
for t1, t2 being Element of T,I holds b gt (t1,t2,A) = b := ((\not (leq (t1,t2))),A);
definition
let S be non
empty non
void bool-correct 4,1
integer BoolSignature ;
let X be
V3()
ManySortedSet of the
carrier of
S;
let T be
X,
S -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S;
let G be
basic GeneratorSystem over
S,
X,
T;
let A be
IfWhileAlgebra of the
generators of
G;
let b be
pure Element of the
generators of
G . the
bool-sort of
S;
let I be
integer SortSymbol of
S;
let t be
Element of
T,
I;
coherence
b gt ((t mod (\2 (T,I))),(\0 (T,I)),A) is Algorithm of A
;
coherence
b leq ((t mod (\2 (T,I))),(\0 (T,I)),A) is Algorithm of A
;
end;
::
deftheorem defines
is_odd AOFA_A01:def 11 :
for S being non empty non void bool-correct 4,1 integer BoolSignature
for X being V3() ManySortedSet of the carrier of S
for T being b2,b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over S
for G being basic GeneratorSystem over S,X,T
for A being IfWhileAlgebra of the generators of G
for b being pure Element of the generators of G . the bool-sort of S
for I being integer SortSymbol of S
for t being Element of T,I holds t is_odd (b,A) = b gt ((t mod (\2 (T,I))),(\0 (T,I)),A);
::
deftheorem defines
is_even AOFA_A01:def 12 :
for S being non empty non void bool-correct 4,1 integer BoolSignature
for X being V3() ManySortedSet of the carrier of S
for T being b2,b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over S
for G being basic GeneratorSystem over S,X,T
for A being IfWhileAlgebra of the generators of G
for b being pure Element of the generators of G . the bool-sort of S
for I being integer SortSymbol of S
for t being Element of T,I holds t is_even (b,A) = b leq ((t mod (\2 (T,I))),(\0 (T,I)),A);
theorem Th27:
for
S being non
empty non
void ManySortedSign for
A,
B being
non-empty MSAlgebra over
S for
s1,
s2,
s3 being
SortSymbol of
S for
a being
Element of
A,
s1 for
b being
Element of
A,
s2 for
c being
Element of
A,
s3 for
h being
ManySortedFunction of
A,
B for
o being
OperSymbol of
S st
the_arity_of o = <*s1,s2,s3*> holds
for
p being
Element of
Args (
o,
A) st
p = <*a,b,c*> holds
h # p = <*((h . s1) . a),((h . s2) . b),((h . s3) . c)*>
theorem
for
S being non
empty non
void bool-correct 4,1
integer BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S for
C being
bool-correct 4,1
integer image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
s being
Element of
C -States the
generators of
G for
t1,
t2 being
Element of
T, the
bool-sort of
S holds
(t1 \and t2) value_at (
C,
s)
= (t1 value_at (C,s)) \and (t2 value_at (C,s))
theorem Th39:
for
S being non
empty non
void bool-correct 4,1
integer BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S for
C being
bool-correct 4,1
integer image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
t1,
t2 being
Element of
T,
I for
s being
Element of
C -States the
generators of
G holds
(t1 + t2) value_at (
C,
s)
= (t1 value_at (C,s)) + (t2 value_at (C,s))
theorem Th41:
for
S being non
empty non
void bool-correct 4,1
integer BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S for
C being
bool-correct 4,1
integer image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
t1,
t2 being
Element of
T,
I for
s being
Element of
C -States the
generators of
G holds
(t1 - t2) value_at (
C,
s)
= (t1 value_at (C,s)) - (t2 value_at (C,s))
theorem Th42:
for
S being non
empty non
void bool-correct 4,1
integer BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S for
C being
bool-correct 4,1
integer image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
t1,
t2 being
Element of
T,
I for
s being
Element of
C -States the
generators of
G holds
(t1 * t2) value_at (
C,
s)
= (t1 value_at (C,s)) * (t2 value_at (C,s))
theorem Th43:
for
S being non
empty non
void bool-correct 4,1
integer BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S for
C being
bool-correct 4,1
integer image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
t1,
t2 being
Element of
T,
I for
s being
Element of
C -States the
generators of
G holds
(t1 div t2) value_at (
C,
s)
= (t1 value_at (C,s)) div (t2 value_at (C,s))
theorem Th44:
for
S being non
empty non
void bool-correct 4,1
integer BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S for
C being
bool-correct 4,1
integer image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
t1,
t2 being
Element of
T,
I for
s being
Element of
C -States the
generators of
G holds
(t1 mod t2) value_at (
C,
s)
= (t1 value_at (C,s)) mod (t2 value_at (C,s))
theorem Th45:
for
S being non
empty non
void bool-correct 4,1
integer BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S for
C being
bool-correct 4,1
integer image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
t1,
t2 being
Element of
T,
I for
s being
Element of
C -States the
generators of
G holds
(leq (t1,t2)) value_at (
C,
s)
= leq (
(t1 value_at (C,s)),
(t2 value_at (C,s)))
theorem
for
S being non
empty non
void bool-correct 4,1
integer BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S for
C being
bool-correct 4,1
integer image of
T for
I being
integer SortSymbol of
S for
t1,
t2 being
Element of
T,
I for
u being
ManySortedFunction of
FreeGen T, the
Sorts of
C holds
(leq (t1,t2)) value_at (
C,
u)
= leq (
(t1 value_at (C,u)),
(t2 value_at (C,u)))
theorem Th65:
for
S being non
empty non
void bool-correct 4,1
integer BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S for
C being
bool-correct 4,1
integer image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
A being
IfWhileAlgebra of the
generators of
G for
b being
pure Element of the
generators of
G . the
bool-sort of
S for
s being
Element of
C -States the
generators of
G for
f being
ExecutionFunction of
A,
C -States the
generators of
G,
(\false C) -States ( the
generators of
G,
b) st
G is
C -supported &
f in C -Execution (
A,
b,
(\false C)) holds
for
a being
SortSymbol of
S for
x being
pure Element of the
generators of
G . a for
t being
Element of
T,
a holds
(
((f . (s,(x := (t,A)))) . a) . x = t value_at (
C,
s) & ( for
z being
pure Element of the
generators of
G . a st
z <> x holds
((f . (s,(x := (t,A)))) . a) . z = (s . a) . z ) & ( for
b being
SortSymbol of
S st
a <> b holds
for
z being
pure Element of the
generators of
G . b holds
((f . (s,(x := (t,A)))) . b) . z = (s . b) . z ) )
theorem Th66:
for
S being non
empty non
void bool-correct 4,1
integer BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S for
C being
bool-correct 4,1
integer image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
A being
IfWhileAlgebra of the
generators of
G for
I being
integer SortSymbol of
S for
b being
pure Element of the
generators of
G . the
bool-sort of
S for
t1,
t2 being
Element of
T,
I for
s being
Element of
C -States the
generators of
G for
f being
ExecutionFunction of
A,
C -States the
generators of
G,
(\false C) -States ( the
generators of
G,
b) st
G is
C -supported &
f in C -Execution (
A,
b,
(\false C)) holds
( (
t1 value_at (
C,
s)
< t2 value_at (
C,
s) implies
f . (
s,
(b gt (t2,t1,A)))
in (\false C) -States ( the
generators of
G,
b) ) & (
f . (
s,
(b gt (t2,t1,A)))
in (\false C) -States ( the
generators of
G,
b) implies
t1 value_at (
C,
s)
< t2 value_at (
C,
s) ) & (
t1 value_at (
C,
s)
<= t2 value_at (
C,
s) implies
f . (
s,
(b leq (t1,t2,A)))
in (\false C) -States ( the
generators of
G,
b) ) & (
f . (
s,
(b leq (t1,t2,A)))
in (\false C) -States ( the
generators of
G,
b) implies
t1 value_at (
C,
s)
<= t2 value_at (
C,
s) ) & ( for
x being
pure Element of the
generators of
G . I holds
(
((f . (s,(b gt (t1,t2,A)))) . I) . x = (s . I) . x &
((f . (s,(b leq (t1,t2,A)))) . I) . x = (s . I) . x ) ) & ( for
c being
pure Element of the
generators of
G . the
bool-sort of
S st
c <> b holds
(
((f . (s,(b gt (t1,t2,A)))) . the bool-sort of S) . c = (s . the bool-sort of S) . c &
((f . (s,(b leq (t1,t2,A)))) . the bool-sort of S) . c = (s . the bool-sort of S) . c ) ) )
theorem Th67:
for
S being non
empty non
void bool-correct 4,1
integer BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S for
C being
bool-correct 4,1
integer image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
A being
IfWhileAlgebra of the
generators of
G for
I being
integer SortSymbol of
S for
b being
pure Element of the
generators of
G . the
bool-sort of
S for
t being
Element of
T,
I for
s being
Element of
C -States the
generators of
G for
f being
ExecutionFunction of
A,
C -States the
generators of
G,
(\false C) -States ( the
generators of
G,
b) st
G is
C -supported &
f in C -Execution (
A,
b,
(\false C)) holds
(
((f . (s,(t is_odd (b,A)))) . the bool-sort of S) . b = (t value_at (C,s)) mod 2 &
((f . (s,(t is_even (b,A)))) . the bool-sort of S) . b = ((t value_at (C,s)) + 1) mod 2 & ( for
z being
pure Element of the
generators of
G . I holds
(
((f . (s,(t is_odd (b,A)))) . I) . z = (s . I) . z &
((f . (s,(t is_even (b,A)))) . I) . z = (s . I) . z ) ) )
theorem
for
S being non
empty non
void bool-correct 4,1
integer BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S for
C being
bool-correct 4,1
integer image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
x,
y,
m being
pure Element of the
generators of
G . I for
b being
pure Element of the
generators of
G . the
bool-sort of
S for
A being
elementary IfWhileAlgebra of the
generators of
G for
f being
ExecutionFunction of
A,
C -States the
generators of
G,
(\false C) -States ( the
generators of
G,
b) st
G is
C -supported &
f in C -Execution (
A,
b,
(\false C)) & ex
d being
Function st
(
d . x = 1 &
d . y = 2 &
d . m = 3 ) holds
(y := ((\1 (T,I)),A)) \; (while ((b gt ((@ m),(\0 (T,I)),A)),(((if-then (((@ m) is_odd (b,A)),(y := (((@ y) * (@ x)),A)))) \; (m := (((@ m) div (\2 (T,I))),A))) \; (x := (((@ x) * (@ x)),A))))) is_terminating_wrt f,
{ s where s is Element of C -States the generators of G : (s . I) . m >= 0 }
theorem
for
S being non
empty non
void bool-correct 4,1
integer BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer VarMSAlgebra over
S for
C being
bool-correct 4,1
integer image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
A being
IfWhileAlgebra of the
generators of
G for
I being
integer SortSymbol of
S for
x,
y,
m being
pure Element of the
generators of
G . I for
b being
pure Element of the
generators of
G . the
bool-sort of
S for
f being
ExecutionFunction of
A,
C -States the
generators of
G,
(\false C) -States ( the
generators of
G,
b) st
G is
C -supported & ex
d being
Function st
(
d . b = 0 &
d . x = 1 &
d . y = 2 &
d . m = 3 ) holds
for
s being
Element of
C -States the
generators of
G for
n being
Nat st
n = (s . I) . m &
f in C -Execution (
A,
b,
(\false C)) holds
((f . (s,((y := ((\1 (T,I)),A)) \; (while ((b gt ((@ m),(\0 (T,I)),A)),(((if-then (((@ m) is_odd (b,A)),(y := (((@ y) * (@ x)),A)))) \; (m := (((@ m) div (\2 (T,I))),A))) \; (x := (((@ x) * (@ x)),A)))))))) . I) . y = ((s . I) . x) |^ n
theorem Th73:
for
S being non
empty non
void bool-correct 11,1,1
-array 11
array-correct BoolSignature for
I being
integer SortSymbol of
S holds
(
the_array_sort_of S <> I & the
connectives of
S . 11
is_of_type <*(the_array_sort_of S),I*>,
I & the
connectives of
S . (11 + 1) is_of_type <*(the_array_sort_of S),I,I*>,
the_array_sort_of S & the
connectives of
S . (11 + 2) is_of_type <*(the_array_sort_of S)*>,
I & the
connectives of
S . (11 + 3) is_of_type <*I,I*>,
the_array_sort_of S )
theorem Th74:
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
I being
integer SortSymbol of
S for
A being
non-empty bool-correct 4,1
integer 11,1,1
-array MSAlgebra over
S holds
( the
Sorts of
A . (the_array_sort_of S) = INT ^omega & ( for
i,
j being
Element of
A,
I st
i is non
negative Integer holds
init.array (
i,
j)
= (Segm i) --> j ) & ( for
a being
Element of the
Sorts of
A . (the_array_sort_of S) holds
(
length (
a,
I)
= card a & ( for
i being
Element of
A,
I for
f being
Function st
f = a &
i in dom f holds
(
a . i = f . i & ( for
x being
Element of
A,
I holds (
a,
i)
<- x = f +* (
i,
x) ) ) ) ) ) )
theorem Th79:
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
s being
Element of
C -States the
generators of
G for
t being
Element of
T,
(the_array_sort_of S) for
t1 being
Element of
T,
I holds
(t . t1) value_at (
C,
s)
= (t value_at (C,s)) . (t1 value_at (C,s))
theorem Th80:
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
s being
Element of
C -States the
generators of
G for
t being
Element of
T,
(the_array_sort_of S) for
t1,
t2 being
Element of
T,
I holds
((t,t1) <- t2) value_at (
C,
s)
= (
(t value_at (C,s)),
(t1 value_at (C,s)))
<- (t2 value_at (C,s))
theorem Th81:
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
s being
Element of
C -States the
generators of
G for
t being
Element of
T,
(the_array_sort_of S) holds
(length (t,I)) value_at (
C,
s)
= length (
(t value_at (C,s)),
I)
theorem
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
s being
Element of
C -States the
generators of
G for
t1,
t2 being
Element of
T,
I holds
(init.array (t1,t2)) value_at (
C,
s)
= init.array (
(t1 value_at (C,s)),
(t2 value_at (C,s)))
theorem
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
I being
integer SortSymbol of
S for
u being
ManySortedFunction of
FreeGen T, the
Sorts of
C for
t being
Element of
T,
(the_array_sort_of S) for
t1 being
Element of
T,
I holds
(t . t1) value_at (
C,
u)
= (t value_at (C,u)) . (t1 value_at (C,u))
theorem Th84:
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
I being
integer SortSymbol of
S for
u being
ManySortedFunction of
FreeGen T, the
Sorts of
C for
t being
Element of
T,
(the_array_sort_of S) for
t1,
t2 being
Element of
T,
I holds
((t,t1) <- t2) value_at (
C,
u)
= (
(t value_at (C,u)),
(t1 value_at (C,u)))
<- (t2 value_at (C,u))
theorem
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
I being
integer SortSymbol of
S for
u being
ManySortedFunction of
FreeGen T, the
Sorts of
C for
t being
Element of
T,
(the_array_sort_of S) holds
(length (t,I)) value_at (
C,
u)
= length (
(t value_at (C,u)),
I)
theorem
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
I being
integer SortSymbol of
S for
u being
ManySortedFunction of
FreeGen T, the
Sorts of
C for
t1,
t2 being
Element of
T,
I holds
(init.array (t1,t2)) value_at (
C,
u)
= init.array (
(t1 value_at (C,u)),
(t2 value_at (C,u)))
Lm1:
now for S being non empty non void 1-1-connectives bool-correct 4,1 integer 11,1,1 -array 11 array-correct BoolSignature
for X being V3() ManySortedSet of the carrier of S
for T being non-empty b2,b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over S
for I being integer SortSymbol of S
for i being Integer
for f1 being Function of INT,( the Sorts of T . I) st f1 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f1 . j = t holds
( f1 . (j + 1) = t + (\1 (T,I)) & f1 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
for f2 being Function of INT,( the Sorts of T . I) st f2 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f2 . j = t holds
( f2 . (j + 1) = t + (\1 (T,I)) & f2 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
f1 = f2
let S be non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature ;
for X being V3() ManySortedSet of the carrier of S
for T being non-empty b1,S -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over S
for I being integer SortSymbol of S
for i being Integer
for f1 being Function of INT,( the Sorts of T . I) st f1 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f1 . j = t holds
( f1 . (j + 1) = t + (\1 (T,I)) & f1 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
for f2 being Function of INT,( the Sorts of T . I) st f2 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f2 . j = t holds
( f2 . (j + 1) = t + (\1 (T,I)) & f2 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
f1 = f2let X be
V3()
ManySortedSet of the
carrier of
S;
for T being non-empty X,S -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over S
for I being integer SortSymbol of S
for i being Integer
for f1 being Function of INT,( the Sorts of T . I) st f1 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f1 . j = t holds
( f1 . (j + 1) = t + (\1 (T,I)) & f1 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
for f2 being Function of INT,( the Sorts of T . I) st f2 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f2 . j = t holds
( f2 . (j + 1) = t + (\1 (T,I)) & f2 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
f1 = f2let T be
non-empty X,
S -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S;
for I being integer SortSymbol of S
for i being Integer
for f1 being Function of INT,( the Sorts of T . I) st f1 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f1 . j = t holds
( f1 . (j + 1) = t + (\1 (T,I)) & f1 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
for f2 being Function of INT,( the Sorts of T . I) st f2 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f2 . j = t holds
( f2 . (j + 1) = t + (\1 (T,I)) & f2 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
f1 = f2let I be
integer SortSymbol of
S;
for i being Integer
for f1 being Function of INT,( the Sorts of T . I) st f1 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f1 . j = t holds
( f1 . (j + 1) = t + (\1 (T,I)) & f1 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
for f2 being Function of INT,( the Sorts of T . I) st f2 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f2 . j = t holds
( f2 . (j + 1) = t + (\1 (T,I)) & f2 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
f1 = f2let i be
Integer;
for f1 being Function of INT,( the Sorts of T . I) st f1 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f1 . j = t holds
( f1 . (j + 1) = t + (\1 (T,I)) & f1 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
for f2 being Function of INT,( the Sorts of T . I) st f2 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f2 . j = t holds
( f2 . (j + 1) = t + (\1 (T,I)) & f2 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
f1 = f2let f1 be
Function of
INT,
( the Sorts of T . I);
( f1 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f1 . j = t holds
( f1 . (j + 1) = t + (\1 (T,I)) & f1 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) implies for f2 being Function of INT,( the Sorts of T . I) st f2 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f2 . j = t holds
( f2 . (j + 1) = t + (\1 (T,I)) & f2 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
f1 = f2 )assume A1:
(
f1 . 0 = \0 (
T,
I) & ( for
j being
Nat for
t being
Element of
T,
I st
f1 . j = t holds
(
f1 . (j + 1) = t + (\1 (T,I)) &
f1 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) )
;
for f2 being Function of INT,( the Sorts of T . I) st f2 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f2 . j = t holds
( f2 . (j + 1) = t + (\1 (T,I)) & f2 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) holds
f1 = f2let f2 be
Function of
INT,
( the Sorts of T . I);
( f2 . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f2 . j = t holds
( f2 . (j + 1) = t + (\1 (T,I)) & f2 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) implies f1 = f2 )assume A2:
(
f2 . 0 = \0 (
T,
I) & ( for
j being
Nat for
t being
Element of
T,
I st
f2 . j = t holds
(
f2 . (j + 1) = t + (\1 (T,I)) &
f2 . (- (j + 1)) = - (t + (\1 (T,I))) ) ) )
;
f1 = f2defpred S1[
Nat]
means f1 . $1
= f2 . $1;
A3:
S1[
0 ]
by A1, A2;
A4:
for
i being
Nat st
S1[
i] holds
S1[
i + 1]
A6:
for
i being
Nat holds
S1[
i]
from NAT_1:sch 2(A3, A4);
hence
f1 = f2
;
verum
end;
definition
let S be non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature ;
let X be
V3()
ManySortedSet of the
carrier of
S;
let T be
non-empty X,
S -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S;
let I be
integer SortSymbol of
S;
let i be
Integer;
existence
ex b1 being Element of T,I ex f being Function of INT,( the Sorts of T . I) st
( b1 = f . i & f . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f . j = t holds
( f . (j + 1) = t + (\1 (T,I)) & f . (- (j + 1)) = - (t + (\1 (T,I))) ) ) )
uniqueness
for b1, b2 being Element of T,I st ex f being Function of INT,( the Sorts of T . I) st
( b1 = f . i & f . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f . j = t holds
( f . (j + 1) = t + (\1 (T,I)) & f . (- (j + 1)) = - (t + (\1 (T,I))) ) ) ) & ex f being Function of INT,( the Sorts of T . I) st
( b2 = f . i & f . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f . j = t holds
( f . (j + 1) = t + (\1 (T,I)) & f . (- (j + 1)) = - (t + (\1 (T,I))) ) ) ) holds
b1 = b2
by Lm1;
end;
::
deftheorem Def15 defines
^ AOFA_A01:def 15 :
for S being non empty non void 1-1-connectives bool-correct 4,1 integer 11,1,1 -array 11 array-correct BoolSignature
for X being V3() ManySortedSet of the carrier of S
for T being non-empty b2,b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over S
for I being integer SortSymbol of S
for i being Integer
for b6 being Element of T,I holds
( b6 = ^ (i,T,I) iff ex f being Function of INT,( the Sorts of T . I) st
( b6 = f . i & f . 0 = \0 (T,I) & ( for j being Nat
for t being Element of T,I st f . j = t holds
( f . (j + 1) = t + (\1 (T,I)) & f . (- (j + 1)) = - (t + (\1 (T,I))) ) ) ) );
theorem Th88:
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
I being
integer SortSymbol of
S for
n being
Nat holds
(
^ (
(n + 1),
T,
I)
= (^ (n,T,I)) + (\1 (T,I)) &
^ (
(- (n + 1)),
T,
I)
= - (^ ((n + 1),T,I)) )
theorem Th90:
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
s being
Element of
C -States the
generators of
G for
i being
Integer holds
(^ (i,T,I)) value_at (
C,
s)
= i
theorem
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
M being
pure Element of the
generators of
G . (the_array_sort_of S) for
s being
Element of
C -States the
generators of
G for
j being
Integer st
j in dom ((s . (the_array_sort_of S)) . M) &
M . (
j,
I)
in the
generators of
G . I holds
((s . (the_array_sort_of S)) . M) . j = (s . I) . (M . (j,I))
theorem
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
i being
pure Element of the
generators of
G . I for
M being
pure Element of the
generators of
G . (the_array_sort_of S) for
s being
Element of
C -States the
generators of
G for
j being
Integer st
j in dom ((s . (the_array_sort_of S)) . M) &
(@ M) . (@ i) in the
generators of
G . I &
j = (@ i) value_at (
C,
s) holds
((s . (the_array_sort_of S)) . M) . ((@ i) value_at (C,s)) = (s . I) . ((@ M) . (@ i))
theorem
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
A being
IfWhileAlgebra of the
generators of
G for
I being
integer SortSymbol of
S for
m,
i being
pure Element of the
generators of
G . I for
M being
pure Element of the
generators of
G . (the_array_sort_of S) for
b being
pure Element of the
generators of
G . the
bool-sort of
S for
s being
Element of
C -States the
generators of
G for
f being
ExecutionFunction of
A,
C -States the
generators of
G,
(\false C) -States ( the
generators of
G,
b) st
f in C -Execution (
A,
b,
(\false C)) &
G is
C -supported &
i <> m &
(s . (the_array_sort_of S)) . M <> {} holds
for
n being
Nat st
((f . (s,((m := ((\0 (T,I)),A)) \; (for-do ((i := ((\1 (T,I)),A)),(b gt ((length ((@ M),I)),(@ i),A)),(i := (((@ i) + (\1 (T,I))),A)),(if-then ((b gt (((@ M) . (@ i)),((@ M) . (@ m)),A)),(m := ((@ i),A))))))))) . I) . m = n holds
for
X being non
empty finite integer-membered set st
X = rng ((s . (the_array_sort_of S)) . M) holds
(M . (n,I)) value_at (
C,
s)
= max X
theorem Th94:
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
i being
pure Element of the
generators of
G . I for
b being
pure Element of the
generators of
G . the
bool-sort of
S for
A being
elementary IfWhileAlgebra of the
generators of
G for
f being
ExecutionFunction of
A,
C -States the
generators of
G,
(\false C) -States ( the
generators of
G,
b) st
f in C -Execution (
A,
b,
(\false C)) &
G is
C -supported holds
for
t0,
t1 being
Element of
T,
I for
J being
Algorithm of
A for
P being
set st
P is_invariant_wrt i := (
t0,
A),
f &
P is_invariant_wrt b gt (
t1,
(@ i),
A),
f &
P is_invariant_wrt i := (
((@ i) + (\1 (T,I))),
A),
f &
P is_invariant_wrt J,
f &
J is_terminating_wrt f,
P & ( for
s being
Element of
C -States the
generators of
G holds
(
((f . (s,J)) . I) . i = (s . I) . i &
((f . (s,(b gt (t1,(@ i),A)))) . I) . i = (s . I) . i &
t1 value_at (
C,
(f . (s,(b gt (t1,(@ i),A)))))
= t1 value_at (
C,
s) &
t1 value_at (
C,
(f . (s,(J \; (i := (((@ i) + (\1 (T,I))),A))))))
= t1 value_at (
C,
s) ) ) holds
for-do (
(i := (t0,A)),
(b gt (t1,(@ i),A)),
(i := (((@ i) + (\1 (T,I))),A)),
J)
is_terminating_wrt f,
P
theorem
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
m,
i being
pure Element of the
generators of
G . I for
M being
pure Element of the
generators of
G . (the_array_sort_of S) for
b being
pure Element of the
generators of
G . the
bool-sort of
S for
A being
elementary IfWhileAlgebra of the
generators of
G for
f being
ExecutionFunction of
A,
C -States the
generators of
G,
(\false C) -States ( the
generators of
G,
b) st
f in C -Execution (
A,
b,
(\false C)) &
G is
C -supported &
i <> m holds
(m := ((\0 (T,I)),A)) \; (for-do ((i := ((\1 (T,I)),A)),(b gt ((length ((@ M),I)),(@ i),A)),(i := (((@ i) + (\1 (T,I))),A)),(if-then ((b gt (((@ M) . (@ i)),((@ M) . (@ m)),A)),(m := ((@ i),A)))))) is_terminating_wrt f,
{ s where s is Element of C -States the generators of G : (s . (the_array_sort_of S)) . M <> {} }
::
deftheorem defines
integer-array AOFA_A01:def 17 :
for S being non empty non void 1-1-connectives bool-correct 4,1 integer 11,1,1 -array 11 array-correct BoolSignature
for X being V3() ManySortedSet of the carrier of S
for T being non-empty b2,b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over S
for G being basic GeneratorSystem over S,X,T holds
( G is integer-array iff for I being integer SortSymbol of S holds
( { ((@ M) . t) where M is pure Element of the generators of G . (the_array_sort_of S), t is Element of T,I : verum } c= the generators of G . I & ( for M being pure Element of the generators of G . (the_array_sort_of S)
for t being Element of T,I
for g being Element of G,I st g = (@ M) . t holds
ex x being pure Element of the generators of G . I st
( x nin (vf t) . I & supp-var g = x & ((supp-term g) . (the_array_sort_of S)) . M = ((@ M),t) <- (@ x) & ( for s being SortSymbol of S
for y being pure Element of the generators of G . I st y in (vf g) . s & ( s = the_array_sort_of S implies y <> M ) holds
((supp-term g) . s) . y = y ) ) ) ) );
::
deftheorem Def19 defines
:= AOFA_A01:def 19 :
for S being non empty non void 1-1-connectives bool-correct 4,1 integer 11,1,1 -array 11 array-correct BoolSignature
for X being V3() ManySortedSet of the carrier of S
for T being non-empty b2,b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over S
for G being basic GeneratorSystem over S,X,T
for A being elementary IfWhileAlgebra of the generators of G
for a being SortSymbol of S
for t1, t2 being Element of T,a st t1 in the generators of G . a holds
t1 := (t2,A) = the assignments of A . [t1,t2];
theorem Th99:
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
i being
pure Element of the
generators of
G . I for
M being
pure Element of the
generators of
G . (the_array_sort_of S) for
b being
pure Element of the
generators of
G . the
bool-sort of
S for
s being
Element of
C -States the
generators of
G for
A being
elementary IfWhileAlgebra of the
generators of
G for
f being
ExecutionFunction of
A,
C -States the
generators of
G,
(\false C) -States ( the
generators of
G,
b) st
G is
integer-array &
G is
C -supported &
f in C -Execution (
A,
b,
(\false C)) &
X is
countable & not
T is
array-degenerated holds
for
t being
Element of
T,
I holds
f . (
s,
(((@ M) . (@ i)) := (t,A)))
= f . (
s,
(M := ((((@ M),(@ i)) <- t),A)))
theorem
for
S being non
empty non
void 1-1-connectives bool-correct 4,1
integer 11,1,1
-array 11
array-correct BoolSignature for
X being
V3()
ManySortedSet of the
carrier of
S for
T being
non-empty b2,
b1 -terms all_vars_including inheriting_operations free_in_itself vf-free integer-array VarMSAlgebra over
S for
C being
bool-correct 4,1
integer 11,1,1
-array image of
T for
G being
basic GeneratorSystem over
S,
X,
T for
I being
integer SortSymbol of
S for
y being
pure Element of the
generators of
G . I for
M being
pure Element of the
generators of
G . (the_array_sort_of S) for
b being
pure Element of the
generators of
G . the
bool-sort of
S for
s being
Element of
C -States the
generators of
G for
i1,
i2 being
pure Element of the
generators of
G . I for
A being
elementary IfWhileAlgebra of the
generators of
G for
f being
ExecutionFunction of
A,
C -States the
generators of
G,
(\false C) -States ( the
generators of
G,
b) st
G is
integer-array &
G is
C -supported &
f in C -Execution (
A,
b,
(\false C)) & not
T is
array-degenerated &
X is
countable holds
for
J being
Algorithm of
A st ( for
s being
Element of
C -States the
generators of
G holds
(
((f . (s,J)) . (the_array_sort_of S)) . M = (s . (the_array_sort_of S)) . M & ( for
D being
array of
(#INT,<=#) st
D = (s . (the_array_sort_of S)) . M holds
( (
D <> {} implies (
((f . (s,J)) . I) . i1 in dom D &
((f . (s,J)) . I) . i2 in dom D ) ) & (
inversions D <> {} implies
[(((f . (s,J)) . I) . i1),(((f . (s,J)) . I) . i2)] in inversions D ) & (
((f . (s,J)) . the bool-sort of S) . b = TRUE implies
inversions D <> {} ) & (
inversions D <> {} implies
((f . (s,J)) . the bool-sort of S) . b = TRUE ) ) ) ) ) holds
for
D being
finite 0 -based array of
(#INT,<=#) st
D = (s . (the_array_sort_of S)) . M &
y <> i1 &
y <> i2 holds
(
((f . (s,(while (J,(((y := (((@ M) . (@ i1)),A)) \; (((@ M) . (@ i1)) := (((@ M) . (@ i2)),A))) \; (((@ M) . (@ i2)) := ((@ y),A))))))) . (the_array_sort_of S)) . M is
ascending permutation of
D & (
J is
absolutely-terminating implies
while (
J,
(((y := (((@ M) . (@ i1)),A)) \; (((@ M) . (@ i1)) := (((@ M) . (@ i2)),A))) \; (((@ M) . (@ i2)) := ((@ y),A))))
is_terminating_wrt f,
{ s1 where s1 is Element of C -States the generators of G : (s1 . (the_array_sort_of S)) . M <> {} } ) )