A characterisation of computable data types by means of a finite

A CHARACTERISATION OF COMPUTABLE DATA TYPES BY MEANS OF A FINITE
EQUATIONAL SPECIFICATION METHOD
J.A. BERGSTRA
Department of Computer Science,
University of Leiden,
Wassenaarseweg 80, 2300 RA LEIDEN,
The Netherlands
J.V. TUCKER
Department of Computer Science,
Mathematical Centre,
2e Boerhaavestraat 49, 1091 AL AMSTERDAM,
The Netherlands
INTRODUCTION
By redefining the construction of finite equational hidden function specifications
of data types, as these are made with the initial algebra methodology of the ADJ Group,
we are able to give an algebraic characterisation of the computable data types and
data structures. Our technical motivation are the simple notions of strong and weakly
normalised Church-Rosser replacement systems studied in the l-Calculus, and in plain
mathematical terms the theorem we prove is this.
THEOREM. Let A be a many-sorted
signature.
algebra finitely generated by elements named in its
Then the following statements are equivalent:
i. A is computable.
2. A possesses a finite, equational
which is Church-Rosser
3. A possesses a finite,
which is Church-Rosser
hidden enrichment replacement
system specification
and strongly normalising°
equational hidden enrichment replacement
system specification
and weakly normalising.
The unexplained concepts are carefully defined in Section 2, on replacement system
specifications, and in Section 3, on computable algebras. In Sections 4 and 5 we prove
the theorem. Section i explains in detail the theoretical issues to do with data types
which the theorem attempts to resolve.
This paper continues our studies on the adequacy and power of definition of algebraic specification methods for data t~rpes which we began in [i~, see also [53.
(It
is an edited version of [2]; subsequent papers are [3,43.) Here the reader is assumed
well versed in the initial algebra specification methods of the ADJ Group [63, see also KAMIN [73; knowledge of our [i~ is desirable but not, strictly speaking, essential.
Prior exposure to the l-calculus is no~ required, of course, but hopefully the reader
is acquainted with the Church-Rosser property from ROSEN [ii].
i. INITIAL ALGEBRA SEMANTICS AND DATA TYPES
A data structure
is defined to be a many-sorted algebra A finitely generated
77
from initial v a l u e s a l,...,a n ~ A n a m e d in its signature Z. A data type is d e f i n e d to
be any class K of such d a t a structures of common signature. A t the h e a r t of the ADJ
Group's theory of d a t a types is the idea that the semantics w h i c h e h a r a c t e r i s e a data
type K should be i n v e s t e d in the c o n s t r u c t i o n of an initial a l g e b r a I K for K w i t h the
result that every data structure A 6 K is u n i q u e l y definable, up to isomorphism,
as an
e p i m o r p h i c image of IK. In its turn, this initial a l g e b r a IK is u n i q u e l y definable,
a g a i n up to isomorphism, as a factor a l g e b r a of the s y n t a c t i c a l g e b r a T(Z) of all terms
over Z b e c a u s e T(Z)
is initial for the class ALG(Z) of all E-algebras. L e t IK ~ T ( Z ) / ~ K
w h e r e zK is a c o n g r u e n c e for w h i c h t £K t' m e a n s t h a t the terms t a n d t ' a r e
identical
syntactic e x p r e s s i o n s as far as the semantics of K is concerned. O b s e r v e that in these
c i r c u m s t a n c e s we may p l a u s i b l y call a d a t a type
(semantics for) K computable w h e n
K
is decidable on T(Z). And the p r o b l e m of s y n t a c t i c a l l y s p e c i f y i n g the data type K can
be i n v e s t i g a t e d through the p r o b l e m of s p e c i f y i n g the congruence =K"
The p r e f e r r e d m e t h o d of p r e s c r i b i n g ~K is to use a finite set of equations or
c o n d i t i o n a l e q u a t i o n s E over T(Z)
T(Z)
to e s t a b l i s h a b a s i c set of i d e n t i f i c a t i o n s D E c
x T(Z) and to take z K as the s m a l l e s t c o n g r u e n c e =E on T(Z)
containing DE
With
reference to our [13, it is k n o w n that this m e t h o d w i l l not define all C o m p u t a b l e data
types, b u t that it is able to define m a n y n o n - c o m p u t a b l e ones. E n r i c h i n g the m e t h o d
to a l l o w the use of a finite n u m b e r of h i d d e n functions does enable it to s p e c i f y any
c o m p u t a b l e data type, b u t can be shown to expand the n u m b e r of n o n - c o m p u t a b l e data
types it defines.
Our p r o p o s a l h e r e is to d e t e r m i n e the c o n g r u e n c e s for initial algebras b y m e a n s
of replacement systems. A r e p l a c e m e n t system is i n t e n d e d to formalise a system of deductions,
g o v e r n e d b y simple algebraic s u b s t i t u t i o n rules, w i t h i n w h i c h a d e d u c t i o n
t ÷ t' says that the rSle of t can be p l a y e d b y t' as far as the semantics of K is concerned, m e a n i n g t + t' implies t =K
- t' ' b u t n o t conversely. W h a t w e do is to m a k e an
analysis o f the c o n g r u e n c e =K t h r o u g h the s t r u c t u r a l b e h a v i o u r of a l g e b r a i c a l l y styled
"proof systems" for it a n d f r o m this, a n d an a p p r o p r i a t e s p e c i f i c a t i o n machinery, w e
are able to g u e s s the c l a s s i f i c a t i o n t h e o r e m for c o m p u t a b l e data types. T h a t this is
precisely the t h e o r e m stated in the I n t m o d ~ c t i o n comes from the r e f l e c t i o n that the
semantics of a type K is supposed to be u n i q u e l y d e t e r m i n e d up to i s o m o r p h i s m w i t h an
initial a l g e b r a IK, and n o t b y a p a r t i c u l a r s y n t a c t i c a l construction.
Since the comput-
ability of =K means the c o m p u t a b i l i t y of the algebra T(Z)/Z K u n d e r our d e f i n i t i o n and,
in particular,
since this notion of an algebra's c o m p u t a b i l i t y is an i s o m o r p h i s m in-
variant, we can erase all m e n t i o n of syntax in the semantical c o n c e p t of a c o m p u t a b l e
data type a n d i d e n t i f y these w i t h the c o m p u t a b l e algebras.
So w i t h r e g a r d to the c o n t e n t of our theorem, the r e a d e r m a y care to c o n s i d e r the
ease w i t h w h i c h s t a t e m e n t
(3) implies
(I) is p r o v e d as e v i d e n c e for the n a t u r a l signi-
ficance 6f strong and w e a k l y n o r m a l i s e d C h r u c h - R b s s e r r e p l a c e m e n t s y s t e m s p e c i f i c a t i o n s
w h i l e the i m p l i c a t i o n
(1) implies
(2) m a y b e c o n s i d e r e d as the h a r d w o n answer to the
q u e s t i o n a b o u t adequacy: Do these specifications define all the data types one wants?
B e c a u s e of the n o v e l t y of the s p e c i f i c a t i o n technique and the i n v o l v e d p r o o f of
78
the t h e o r e m we shall w o r k Q~t the m a t e r i a l
which
it b e c o m e s
m u c h easier
of the t h e o r e m in the m a n y - s o r t e d
In w h a t follows
2. R E P L A C E M E N T
The technical
relation.
~ denotes
SYSTEMS
in the case of a single-sorted
for us to explain,
and the reader
algebra after
to understand, the p r o o f
case.
the set of n a t u r a l
numbers.
AND T H E I R S P E C I F I C A T I O N
p o i n t of d e p a r t u r e
is the idea of a t r a v e r s a l
L e t A b e a set a n d ~ an e q u i v a l e n c e
relation
for an e q u i v a l e n c e
on A. A traversal for ~ is a set
J c A wherein
(i)
for e a c h a 6 A there is some t £ J such t h a t t H a; and
(ii)
if t,t'
Consider
6 J and t ~ t' then t ~ t'.
an initial
signature
algebra
specification
for a d a t a type K w h e r e
of K and E is some f o r m u l a or other for a x i o m a t i s ~ n g
the d e f i n i n g
congruence
H K is =E" The choice of a t r a v e r s a l
tional v i e w of the type as it is specified:
imagines
(Z,E)
having
completing
to use E to c a l c u l a t e
these d e d u c t i o n s
theory about algebraic
to a b s t r a c t
its p r o p e r t i e s
so that
J for H E fixes an opera-
g i v e n t,t'
E T(Z),
to decide
their p r e s c r i b e d
"normal
forms"
- t' one
t =E
n,n' e J a n d on
t +E n, t' + E n' one checks n = n'. T h e f o l l o w i n g b i t of
replacement
the b a r e e s s e n t i a l s
systems
is m a d e up w i t h this in m i n d and is m e a n t
of such an o p e r a t i o n a l
L e t A b e a set a n d let R b e a reflexive,
R as ÷ R so to d i s p l a y m e m b e r s h i p
to b or t h a t b is a reduct
Z gives the
(a,b)
v i e w o f d a t a type specification.
transitive
binary relation
e R b y a + R b and say a reduces
(under R or +R)
on A. We write
(under R or ÷ R )
of a; and we shall call R and + R a reduction
system or a replacement system on the set A. F o l l o w i n g the t e r m i n o l o g y of t h e l-Calculus we m a k e these distinctions:
An e l e m e n t
a c A is a normal form for + R if there is no b ~ A so t h a t a ~ b and
a + R b; the set of all normal
The reduction
forms
for + R is d e n o t e d NF(R).
s y s t e m + R is Church-Rosser
if for a n y a ~ A if there are b l , b 2 6 A
so t h a t a + R bl a n d a + R b2 then there is c e A so t h a t b I + R c a n d b 2 + R csystem ÷
is weakly normalising if for e a c h a £ A there is some
R
f o r m b e A so t h a t a ÷ R b.
The reduction
normal
The r e d u c t i o n
s y s t e m ÷ R is strongly normalising if there does n o t exist an infi-
nite chain
a0 + ~ a l ÷~ . . . .
wherein
R an
+~ ...
for i e ~, a i # ai+ I.
A reduction system is Church-Rosser and weakly normalising if, and only if, every
element reduces to a unique normal form. C l e a r l y s t r o n g n o r m a l i s a t i o n
ent&ilsweak
nor-
malisation.
L e t HR d e n o t e
exercise
the s m a l l e s t
to show that for a,a'
a HR a' ~=~ there
equivalence
is a s e q u e n c e
there exists
relation
on A c o n t a i n i n g
+R"
It is an e a s y
~ A
a = bl,...,bk
a c o m m o n r e d u c t ci,
= a' such t h a t for each p a i r b i , b i + 1
i ~ i ~ k-l.
79
Schematically:
a : bI
b2
cI
b3
c2
bk_ 1
b k = a'
Ck-i
U s i n g this c h a r a c t e r i s a t i o n of ~R it is s t r a i g h t f o r w a r d to p r o v e these facts.
2.1. LEPTA.
a,a'
The r e p l a c e m e n t s y s t e m ÷ R on A is C h u r c h - R o s s e r if, and only if, for any
{ A i f a ~R a' then there is c { A so that a ÷ R c and a' "+R c.
2.2. LEPTA. Let ÷
the set of normal
b e a C h u r c h - R o s s e r weakly n o r m a l i s i n g r e p l a c e m e n t system on A. Then
R
forms NF(R)
is a traversal for =R"
Suppose n o w t h a t A is an algebra. T h e n b y an a l g e b r a i c r e p l a c e m e n t s y s t e m + R on
the algebra A we m e a n a r e p l a c e m e n t system ÷ R on the domain of A w h i c h is closed u n d e r
its o p e r a t i o n s in the sense that for each k - a r y o p e r a t i o n c of A,
al +R bl . . . . . ak+R bk
implies g(al . . . . . ak) +R g<bl . . . . . bk)"
2.3. B A S I C LEMMA. I f ÷ R is an a l g e b r a i c r e p l a c e m e n t s y s t e m on an algebra A then z R is
a c o n g r u e n c e on A. I f + R is, in addition, C h u r c h - R o s s e r and weakly n o r m a l i s i n g then
the set o f normal forms o f + R is a traversal for ~ .
R
To achieve our goal of c o n s t r u c t i n g algebraic r e p l a c e m e n t systems on the algebra
T(E) we n e e d to e x p l a i n how a r e p l a c e m e n t s y s t e m is g e n e r a t e d b y a set of o n e - s t e p
r e d u c t i o n s and, furthermore, h o w these sets of o n e - s t e p reductions can be d e t e r m i n e d
from quite a r b i t r a r y sets. We m u s t b u i l t up this e q u i p m e n t for b o t h s e t - t h e o r e t i c and
a l g e b r a i c r e p l a c e m e n t systems.
Let ÷
R
b e a r e p l a c e m e n t s y s t e m on a set A. S c A × A is said to g e n e r a t e ÷ R as a
set o f o n e - s t e p r e d u c t i o n s if S is reflexive and ÷ R is the s m a l l e s t t r a n s i t i v e set
c o n t a i n i n g S, the so called t r a n s i t i v e c l o s u r e of S.
L e t + R be an a l g e b r a i c r e p l a c e m e n t system on an a l g e b r a A. S c A × A is said to
g e n e r a t e + R as a set o f a l g e b r a i c o n e - s t e p r e d u c t i o n s if S is reflexive,
u n d e r unit s u b s t i t u t i o n s in the f o l l o w i n g sense: w r i t i n g
S is closed
(a,b) £ S as a ÷S b, for any
k - a r y o p e r a t i o n ~ of A, for any I ~ i ~ k and a 1 , . . . , a i _ l , a i + 1 , . . . , a k c A, and a ÷S b
it follows that o ( a l , . . . , a i _ l , a , a i + 1 , . . . , a k) +S ~ ( a l ' ' ' ' ' a i - l ' b ' a i + l ' ' ' ' ' a k ) "
And ~ R
is the transitive closure of S.
In the s e t - t h e o r e t i c case any reflexive set d e t e r m i n e s a r e p l a c e m e n t s y s t e m in its
t r a n s i t i ~ e closure.
tufions,
In the algebraic case any reflexive set, closed u n d e r unit substi-
can be shown to determine an algebraic r e p l a c e m e n t system in its transitive
closure. Thus,
in e i t h e r case, s t a r t i n g w i t h a n a r b i t r a r y set D c A × A one can close
it up to the s m a l l e s t o n e - s t e p r e d u c t i o n r e l a t i o n c o n t a i n i n g it, w h i c h we w r i t e +D(1)'
and h e n c e to the s e t - t h e o r e t i c or algebraic r e p l a c e m e n t system "~D w h i c h is its transitive closure.
L e t us now a p p l y these ideas to s p e c i f y algebraic r e p l a c e m e n t systems on T(Z).
80
Let TE[XI,...,X n] be the set of all polynomials
over Z in indeterminates
Xl,...,X n.
Let Tz[X] = Unew Tz[XI' .... Xn]"
Given a set E e TE[X ] × Tz[X] first notice that if (t,t') £ E then w i t h o u t
of generality we can assume t,t' e T E [ X I , . . . , X n] for sufficiently
loss
large n. Then we can
define a set D E c T(Z) × T(E) b y
D E = {(t(sl,...,Sn),
t'(sl,...,Sn)):
(t,t')
£ E & sl,...,s n £ T(~)}
and so obtain the smallest set of algebraic one-step reductions
we write +E(1)'
and from it the algebraic
÷ . In these circumstances
E
replacement
we denote by NF(Z,E)
containing D E , which
relation it generates,
denoted
the set of all normal forms of ÷
and
E
by =E the congruence associated to +E" L e t T(Z,E) = T(E)/H E. Finally, if (t(X 1 .... ,Xn),
t'(Xl,...,Xn))
~ E then we prefer to write t(Xl,...,X n) ~ t'(Xl,...,X n) e E, which we
refer to as a reduction
equation.
From £hese definitions
we see how to equationally
specify algebraic
replacement
systems which in turn specify algebras.
An algebra A of signature
tem specification
T(E)
(~,E) if E = Z A and E is a finite set of reduction
such that the reduction
A b y T(~,E)
E A is said to have a finite equational
system + E on T(E)
defines a congruence
replacement
sys-
equations over
~E which specifies
~ A.
Recall that if A is an algebra of signature
E A and ~ c ZA then AIE is the algebra
obtained from A b y deleting the constants and operations
<A>E is smallest Z-algebra contained
An algebra A of signature
ment replacement
tions over T(E)
specification
of A not named in E.
in A.
E A is said to have a finite,
equational
hidden enrich-
(E,E) if EA c E and E is a finite set of reduction equa-
such that the reduction
system + E on T(E) determines
the algebra T(E,E)
and
T(~,E) I~A = <T(~,E)>~A ~ A .
Since the algebras which model data structures
in their signatures,
are finitely generated by elements named
any such algebra A is automatically minimal
in the sense that
AIZ A = <A>EA.
The structural properties
normalisation
acquaintance
properties,
of a specification
(Z,E), such as the Church-Rosser
are taken from those of its replacement
and
relation +E" To gain
with the specification method, we leave to the reader the proof of this
proposition.
2.4. LEMMA.
If A is a finite algebra then A possesses a finite, equational
system specification
which is Church-Rosser
And we conclude with a technical
fact about set-theoretic
replacement
use later on. Let A be a set. A set of one-step reductions ÷R(1)
duction system + R on A is said to be finitely branching
{b { A: a +R(1)b}
The reduction
replacement
and strongly normalising.
systems of
which generates
a re-
if for each a 6 A the set
is finite.
system + R on A together with its generating
set of one-step reduc-
81
tions +:~(i)is
a ÷R(1)b2
said to be weakly Church-Rosser if for any a £ A, if a ÷R(1)bl
and
then there is c E A such that b I ~ R c and b 2 + R c.
2.5. LEJ~MA. Let +R be a strongly normalising system on A generated by a finitely
branching set of one-step reductions +R(1)" I f + R is weakly Church-Rosser with respect
to ÷R(1)
PROOF.
then +R is Church-Rosser.
8y a chain of non-trivial
sequence a = a 0 ÷R(1)
one-step reductions
al ~R(1)''"
from a 6 A of length k we mean a
÷R(1)ak w h e r e i n a i ~ aj 0 ~ i,j ~ k. Define
liall =
m a x i m u m length of any such chain from a. This II.JJ: A ÷ ~ is a total function thanks to
K~nig's Infinity Lemma and the hypothesis
of strong normalisation.
We prove the propo-
sition b y induction on the value of Ilall.
The basis case is automatic b e c a u s e
As induction h y p o t h e s i s
b ~ A such that libll<lIJ.
llali = 0 iff a is a normal
assume the Church-Rosser
property
form.
true of all reducts of
Let a ÷ R bl and a + R b2" We take the non-trivial
case where
a,bl,b 2 are m u t u a l l y distinct.
Since +R(1)
generates + R choose al,a 2 such that for i = 1,2 a +R(1)
a i + R bi and
notice that llai~ ~ flail. L e t c O be a common reduct of al,a 2 supplied b y the weak ChurehRosser property.
By the induction hypothesis
applied to al,a 2 we can choose cl,e 2 as
common reducts of c0,b I and c0,b 2 respectively.
the induction hypothesis
also a common reduct of bl,b 2.
3. COMPUTABLE
since ]Ic0i[ <flail we can apply
Q.E:D.
ALGEBRAS
of a computable algebra is taken from M.O.
Our definition
MAL'CEV
Moreover
again to obtain c as a common reduet of cl,c 2. Clearly c is
[9], independent papers devoted to founding a general
algebraic
systems
RABIN [i0] and A.I.
theory of computable
and their computable morphisms.
An algebra A is said to be computable if there exists a recursive
numbers ~ and a surjection
responds
a recursive
~: ~ ÷ A such that to each k - a r y operation
tracking function $: k
A
k
k
wherein k(xl,...,x
a by x -
k) = (~x l , . . . , a x
y iff a(x) = a(y)
+ m which commutes
set of natural
u of A there cor-
the following diagram,
JA
~
k) . And, f u r t h e r m o r e ,
in A, is recursive.
the relation
In case this relation
~,
defined
on
~e is recursively
enumerable we ~ a y A is semicomputab~e.
Both notions,
of Algebra:
in these formal definitions,
isomorphism
invariants
become
so called finiteness conditions
possessed of all finite structures.
w o r t h y is %his other invariance p r o p e r t y
from M A L ' C E V
If A is a finitely generated algebra computable or semicomputable
~ ÷A
and ~: ~
ist recursive
And also note-
[9]:
under both ~:
÷ A then e and 8 are recursively equivalent in the sense that there exfunctions
f,g which commute the diagram:
82
A
g
See M A L ' C E V
[9].
G i v e n A computable u n d e r ~ then c o m b i n i n g the a s s o c i a t i n g t r a c k i n g functions on
dqe d o m a i n ~ makes up a recursive a l g e b r a of nun~ers from w h i c h ~ is an e p i m o r p h i s m
to A. A p p l y i n g the r e c u r s i v e n e s s of ~
to this o b s e r v a t i o n it is easy to p r o v e this
useful fact.
3.1. LEMMA. E v e r y c o m p u t a b l e algebra A is i s o m o r p h i c to a r e c u r s i v e n u m b e r algebra
whose domain is the set o f natrual numbers, ~, i f A is infinite, or else is the set
o f the f i r s t m natural numbers, ~ , i f A is finite of G a r d i n a l i t y m.
m
We p r o v e d this in its m a n y - s o r t e d v e r s i o n in [I]. Obviously, no such i s o m o r p h i c
r e p r e s e n t a t i o n is p o s s i b l e for the s e m i c o m p u t a b l e algebras for o t h e r w i s e t h e y w o u l d
b e computable.
If A is c o m p u t a b l e u n d e r ~ then a set S c A n is
able a c c o r d i n g l y as ~-I(S)
= {(Xl, .... X n ) ~ n :
(~-)comp~table or
(e-)semicomput-
(~Xl'''''~Xn)~S} is recursive or r.e.
3.2. LEMMA. Let A be a c o m p u t a b l e algebra and ~ a c o n g r u e n c e A. I f ~ is c o m p u t a b l e or
s e m i c o m p u t a b l e then the f a c t o r algebra A/H is c o m p u t a b l e or s e m i c o m p u t a b l e accordingly.
The a l g e b r a s T(Z) are always c o m p u t a b l e u n d e r any of their s t a n d a r d g 6 d e l numberings. O f course,
it was this fact we h a d in m i n d w h e n we spoke of a data type K b e i n g
computable w h e n its d e f i n i n g congruence =K is decidable. W h e r e v e r z K is s y n t a c t i c a l l y
d e t e r m i n e d b y some s p e c i f i c a t i o n m e c h a n i s m
or term p r o b l e m for
(Z,E) it is c u s t o m a r y to speak of the word
(E,E) and m e a n the d e c i d a b i l i t y of HK" In any case, through L e m m a
3.2 and i s o m o r p h i s m invariance, we can now r e d e f i n e a data type to b e c o m p u t a b l e w h e n
its initial & i g e b r a is computable.
R e l y i n g on the reader's e x p e r i e n c e in c o n s t r u c t i v e l y m a n i p u l a t i n g syntax, w e set
h i m or her the p r o o f s of these last lemmas as easy, though instructive,
3.3. LEMMA. Let
eXercises.
(Z,E) be a finite, equational r e p l a c e m e n t s y s t e m specification.
Then
the b a s i s set D E , the o n e - s t e p r e d u c t i o n r e l a t i o n -E(1)' the r e p l a c e m e n t s y s t e m +E,
the set o f normal forms NF(Z,E), and the c o n g r u e n c e E E are all semicomputable.
In
particular, T(Z,E) is a s e m i c o m p u t a b l e algebra.
3.4. PROPOSITION. Let (E,E) be a finite, equational r e p l a c e m e n t s y s t e m s p e c i f i c a t i o n
which is C h u r c h - R o s s e r and weakly normalising.
Then T(Z,E)
is a c o m p u t a b l e algebra.
3.5. LEMMA. Let A be a s e m i c o m p u t a b l e algebra w i t h s e m i c o m p u t a b l e c o n g r u e n c e ~. I f
there exists a s e m i c o m p u t a b l e traversal for ~ then the f a c t o r a l g e b r a A/H is a comp u t a b l e algebra.
4. P R O O F O F THE T H E O R E M
A s t r o n g l y n o r m a l i s i n g reduction system s p e c i f i c a t i o n is at the same time a
83
w e a k l y n o r m a l i s i n g reduction s y s t e m s p e c i f i c a t i o n so statement
implies statement
3.4 p r o v e s
(3) implies
p l i e s statement
(2) a u t o m a t i c a l l y
(3). S i n c e c o m p u t a b i l i t y is an i s o m o r p h i s m invariant, P r o p o s i t i o n
(i). Thus this section is d e v o t e d to p r o v i n g statement
(i) im-
(2). The case where A is finite the reader has p r o v e d as L e m m a 2.4
and so we assume A to be infinite.
By L e m m a 3.1, we can take A isomorphic to a reeursive n u m b e r algebra R =
(~;fl'''''fp'Cl'''''Cq)
and c o n c e n t r a t e on b u i l d i n g a r e p l a c e m e n t system s p e c i f i c a t i o n
for R. F i r s t we shall b u i l d a c o m p l i c a t e d r e c u r s i v e n u m b e r algebra R 0 b y a d d i n g to R
a v a r i e t y of recursive functions.
G i v e n a total r e c u r s i v e f u n c t i o n f: ~
k
÷ e then, b y the Kleene Normal Form Theo-
rem, this m a y be w r i t t e n f(x) = U(pz.T(e,x,z)) w h e r e U and T are the so c a l l e d Kleene
computation function and T-predicate, respectively,
and e is some index for f. Since
U and T are p r i m i t i v e r e c u r s i v e so are the functions
h(z,x)
= U(pz'
g(z,x) = f0
~i
~ z.[z' = z v T ( e , x , z ' ) ]
if Bz' ~ z. T(e,x,z)
otherwise.
F r o m these functions we can define a recursive function
t(z,x,0) = h(z,x)
t(z,x,y+1)
= t(z+l,x,g(z+i,x))
sO that f is f a c t o r i s e d into t , h , g in the sense that f(x) = t(0,x,l).
(The u n i n i t i a t e d
reader should c o n s u l t M. M A C H T E Y & P. Y O U N G [87.)
R 0 is c o n s t r u c t e d b y a d d i n g 0 and the successor f u n c t i o n x+l on ~ to R and, for
each recursive o p e r a t i o n f of R, a d d i n g the c o r r e s p o n d i n g f a c t o r i s i n g functions h , g , t
along w i t h the list A of all p r i m i t i v e r e c u r s i v e fthnctions used in the p r i m i t i v e recursive d e f i n i t i o n s o f h and g.
Clearly,
R01Z = <R0> ~ = R and so it is s u f f i c i e n t to show R 0 has a finite, equa-
tional r e p l a c e m e n t s y s t e m s p e c i f i c a t i o n w h i c h is C h u r c h - R o s s e r and s t r o n g l y n o r m a l i s ing. L e t Z 0 be the signature of R 0. The s p e c i f y i n g r e d u c t i o n equations E 0 in m i n d are
d e f i n e d as follows. F o r each o p e r a t i o n f,t,h,g of R 0, of the k i n d last mentioned,
if
f , t , h , g are their c o r r e s p o n d i n g f u n c t i o n symbols in ~0' then w e take w i t h X =
(x~ . . . . .
xk )
(-I)
fCx) ~ tC0,x,s(9))
(0)
~(z,x,0) ~ h(Z,X)
t(Z,X,S(Y)) ~ t(S(Z),X,g(S(Z),X))
For each f u n c t i o n symbol I ( Z0 c o r r e s p o n d i n g to a p r i m i t i v e r e c u r s i v e function
I in the list A u {h,g} we add equations d e t e r m i n e d b y these case distinctions.
(l)
If l(x I ..... ~ )
(2)
If l(y) = y+l t h e n add I(Y) ~ S(Y).
(3)
If l(x) = p(pl(x) ..... ~n(X))
w h e r e here x =
= x i then add ~(X I ..... X k) ~ X i
then add I(X) ~ ~(~I(X) ..... ~n(X))
(x I .... ,xk) and X = (XI, .... Xk).
84
(4)
If l(0,x) = ~l(x)
l(y+l,x)
= p2(Y,X,l(y,x))
then add
(9,x) ~ ~i(x)
~(S(Y),X)
~ ~2(Y,X,~(Y,X))
where, again, x and X are p o s s i b l y vectors.
Finally, we m u s t take care of the constants of E in E 0. If c names the numerical constant c then add c ~ sC(0). We n u m b e r this as equation
Thus
(5).
(Z0,E0) is a finite, equational r e p l a c e m e n t system s p e c i f i c a t i o n and it re-
m a i n s to v e r i f y the C h u r c h - R o s s e r p r o p e r t y and strong normalisation,
and to show
T ( Z 0 , E 0) ~ R0.
Call a term t ~ T(E) strongly normalising (with r e s p e c t to E 0) if there does n o t
exist an infinite chain t = t O + t I +
... + t
+ ... w h e r e for i,j • ~ t, ~ t. and +
n
•
3
is the r e d u c t i o n r e l a t i o n d e t e r m i n e d b y E 0. M o s t of the t h e o r e m is p r o v e d on showing
4.1. LEMMA. If t is strongly normalising then it possesses a unique normal form of
the kind sn(0)
for some n • ~.
4.2. LEMMA. Every term in T(~) is strongly normalising.
The p r o o f o f L e m m a 4.1 v e r i f i e s the C h u r c h - R o s s e r p r o p e r t y and c o m b i n e d w i t h
L e m m a 4.2 shows our s p e c i f i c a t i o n
~Z0,E 0) to be of the r e q u i r e d type. G i v e n these lem-
mas, w e k n o w from Basic L e ~ n a 2.3 that {sn(0) : n ~ &l} is a traversal for T(Z0,E0) , and
t o p r o v e this algebra isomorphic to R 0 we can use the m a p #(n) = [sn(0)]. Since # is
known to be a b i j e c t i o n R 0 + T(E0,E0) , all that m u s t be v e r i f i e d is that } is a homomorphism.
This r e q u i r e s an inductive a r g u m e n t o n the c o m p l e x i t y of terms along the
lines of the p r o o f of L e m m a 4.2. B e c a u s e the r e a s o n i n g is m u c h simpler than that for
L e m m a 4.2, and routine for any reader w i t h a little a l g e b r a i c experience, w e take the
liberty of o m i t t i n g it. Thus, to complete the t h e o r e m it remains for us to p r o v e Lemmas 4.1 and 4.2.
PROOF OF L E M M A 4.1. For t c T(Z 0) the r e s t r i c t i o n of + defines a r e p l a c e m e n t system
on the set Red(t)
= {s ~ T(Z0):
t + s} w h i c h is g e n e r a t e d by any set of o n e - s t e p re-
d u c t i o n s ÷i for + also r e s t r i c t e d to Red(t). If t is s t r o n g l y n o r m a l i s i n g w i t h r e s p e c t
to + then
(Red(t),+)
is a s t r o n g l y n o r m a l i s i n g s e t - t h e o r e t i c r e p l a c e m e n t system. It is
a routine m a t t e r to check that + is w e a k l y C h u r c h - R o s s e r w i t h r e s p e c t to +I b y considering t e r m complexity and to see that +i is finitely branching.
2.4todeduce
that
(Red(t),+)
So we m a y a p p l y L e m m a
is C h u r c h - R o s s e r as well as strongly normalising.
t o g e t h e r w i t h L e ~ n a 4.1 p r o v e s our s p e c i f i c a t i o n Church-Rosser:)
(This
A c o r o l l a r y of this
is the fact that t has a normal form w i t h r e s p e c t to + and it is unique.
N o w w e argue t h a t NF(E0,E0)
= {sn(0): n • m}. It is easy to see that {sn(0):
n c ~} c NF(Z0,E0) b e c a u s e a t e r m sn(0) cannot b e further r e d u c e d b y e q u a t i o n s f r o m
E 0. On the other h a n d we can rule out all other terms as n o r m a l forms by these case
distinctions.
Let t • T(E0).
85
If t = c e Z0' a c o n s t a n t naming c ~ 0, then equation
to sC(0)
(5) permits a reduction
and so since c can be reduced it is n o t a normal form.
If t = ~(sl,...,s k) where
there is a reduction
in the construction
Finally,
of E 0.
system).
PROOF OF L ~
some non-trivial
reduction
Q.E.D.
of t.
As basis consider all constants.
Let ~ 6 Z0 name the numerical
of E0, there is at most one reduction possible
normal form,
then since r
so does t (as ÷ is an algebraic
4.2. We prove that each t e T(Z 0) is strongly normalising by induction
on the complexity
inspection
symbol of Z0 except S then, again,
term to be had from the equations w r i t t e n down for
if t = sn(r), where r is a term of the first two kinds,
has been seen to possess
replacement
~ is any function
to a distinct
constant c. By
from t and this leads to a
viz. c ~ sC(0).
The induction
step is p r e c i s e l y
this lemma.
4.3. LE~V~A. Let sl,...,s k 6 T(Z 0) be strongly normalising
and let I be a k-ary func-
tion symbol of ~0" Then ~(sl,...,s k) is strongly normalising.
PROOF.
F i r s t we order the signature
the functions
factoring
used in the definitions
Z0" F o r each operation
f'l of R let h i , g i , t i be
f
and let A. b e the list of primitive recursive functions
!
1
of the h i and gi' those of h i p r e c e e d i n g those of ~i and each
of these two lists ordered b y the complexity
of the h i and gi respectively.
of the primitive
Thus we order the constants
recursive
definitions
and operations
of R 0 into
the list
0,cl,...,c q , x+I,AI,...,A P , hl,. "''hp'gl ,.. -,gp,tl,.-.,tp,f I ,...,fp
and let the signature
Z0 of R 0 be o r d e r e d in this way. We shall now prove the lemma
b y induction on the p o s i t i o n of ~ in the ordering of Z 0. One general remark,
term t = ~(sl~...,Sk) , is that an infinite reduction
involve a reduction
from t w h i c h does not
from E 0 d e t e r m i n e d b y ~ w o u l d require an infinite
quence from one of its subterms
strongly normalising.
in contradiction
For this reason the basis ~ = S is obvious.
confirms no reduction
So assume as induction hypothesis
into 6 cases c o n v e n i e n t l y
that they are
sequences
If t = S(r)
then inspection
of E 0
since r is irreducible.
that ~(Sl,...,s k) is strongly normalising
for
I in ~0" The p r o o f of the induction step divides
distinguished
= xi
se-
equations in E 0 written down for !"
from t determined by S to be possible
all function symbols ~ p r e c e e d i n g
l(xl,...,Xk)
to the assumption
reduction
Thus in the argument we need only consider reduction
from t = ~(sl,...,s k) which apply the reduction
where x =
sequence
for any
b y i (rather than I). The first 3 cases
l(y) = y+l
(Xl, .... x k) are straightforward
l(x) = Z(~l(x) .... ,~k(X))
and are omitted.
86
C A S E 4. l(0,x)
= ~l(X]
l(y+l,x)
= ~2(Y,X,l(y,x))
L e t t = l(~,s)
by Lemma
where
s =
(Sl, .... s k) c o r r e s p o n d i n g
4.1 any s t r o n g l y n o r m a l i s i n g
term T reduces
to x =
(x I .... ,Xk). N o w
to a unique n o r m a l
form sn(0)
from w h i c h we can d e f i n e the value of T to be val(T) = n. We do this case by an induction
argument
on the value of r.
F i r s t of all o b s e r v e
plied
that at the stage
r m u s t have b e e n r e d u c e d
b a s i s of the i n d u c t i o n
tion s~ol
for val(r)
~I w h i c h p r e c e e d s
C o n s i d e r val(r)
normalising
terms
in a r e d u c t i o n
to 0 or to some S(T).
= 0. T h e n e x t t e r m in the s e q u e n c e has l e a d i n g
= n > 0 a n d assume
T w i t h val(1)
as i n d u c t i o n h y p o t h e s i s
< n then l(T,s)
is s t r o n g l y
~ 0 we k n o w that on the first a p p l i c a t i o n
quence
f r o m t t h a t r has b e e n r e d u c e d
is ~2(T,S',I(T,S'))
s and r are s t r o n g l y
where
normalising
our latest induction hypothesis
CASE
this case covers
functions
5. l(z,x,0)
is s t r o n g l y
since val(T)
normalising.
shows the r e d u c t
strongly
< n, by
Since ~2 p r e c e e d s
normalising
and the
observe
(0) is a p p l i e d
where s =
corresponding
(s I ..... s k) c o r r e s p o n d i n g
in a r e d u c t i o n
it m u s t h a v e b e e n r e d u c e d
an i n f i n i t e
where
L e t val(T),
continuation
to h i , g i as w e l l as
b y the i n d u c t i o n
normalised
hypothesis
for T a s t r o n g l y n o r m a l i s i n g
= 0. C o n s i d e r
of e q u a t i o n
(0) p r o d u c e s
s ÷ s' w e h a v e x(r',s')
val(r')
~
equation
reducts
the n e x t e l e m e n t
of r a n d s and this
since h p r e c e e d s
is
term
~ in Z 0. T h e r e -
consideration.
term, b e j u s t as in C a s e 4. D e f i n e
for
= 0] : val(r)
(val(sl) , .... val(Sk)).
We do this case b y a c o n c i s e
w i t h x(r,s)
As b e -
the n u m b e r
x(r,s) = (Zz)[g(z,val(s))
abbreviates
(x I .... , ~ ) .
f r o m t at w h i c h
to 0 or to some S(T). T h e f i r s t p o s s i b i l i t y
of the s e o o n d k i n d n e e d c a r e f u l
any t e r m o f the k i n d t = l(r,s,u)
to x =
sequence
of the s e q u e n c e b e c a u s e
r' and s' are s t r o n g l y
is s t r o n g l y n o r m a l i s i n g
fore o n l y s e q u e n c e s
val(s)
symbols
= l(z+l,x,g(z+l,x))
t h a t at the f i r s t stage
does n o t p e r m i t
some h(r',s')
function
= h(z,x)
L e t t = l(r,s,u)
wherein
se-
in the
.,s~) and s i ÷ sl, i ~ i ~ k. N o w since
so are s' and T. Moreover,
~(T,s')
(4) in a r e d u c t i o n
A n d that the n e x t e l e m e n t
in A..
l
l(z,x,y+l)
fore,
'
(sl,..
Since
to terminate.
Remember
those
func-
t h a t for all s t r o n g l y
normalising.
of e q u a t i o n
to some S(T).
s' =
in Z0' the m a i n i n d u c t i o n h y p o t h e s i s
sequence
(4) is ap-
case we are in the
~ a n d so we are done b y the m a i n i n d u c t i o n hypothesis.
val(r)
sequence
f r o m t at w h i c h
In the former
induction
a reduction
on the v a l u e
sequence
l(S(r'),s',g(S(r),s'))
= 0 and
(pz)[g(z,val(s))
= 0].
x(r,s).
f r o m t in w h i c h
As b a s i s we h a v e t
the first a p p l i c a t i o n
from ~ ( r ' , s ' , S ( Y ) ) .
Since r + r',
87
And, thanks to the m a i n i n d u c t i o n hypothesis, we k n o w that all the subterms of
1(S(r'),s',g(S(r') ,s')) are s t r o n g l y normalising.
val(_g(S(r'),s'))
F r o m this i n f o r m a t i o n we can deduce
= 0 so if a second a p p l i c a t i o n of e q u a t i o n
quence then we will have a sequence of the k i n d considered,
o p e n i n g of this case; w h e r e a s if no s e c o n d a p p l i c a t i o n of
(0) is made in the seand p r o v e d finite, at the
(0) is made in the sequence
then the r e d u c t i o n s m u s t b e made to the k n o w n s t r o n g l y n o r m a l i s i n g subterms a n d so it
m u s t terminate as o b s e r v e d in the o p e n i n g of the i n d u c t i o n a r g u m e n t of L e m m a 4.3. The
c a l c u l a t i o n r e q u i r e d is this
val(g(S(r'),s'))
= g(val(r')+l,val(s'))
= g((~z)([g(z,val(s'))
= 03, val(s')))
= 0.
C o n s i d e r t = l(r,s,u) with x(r,s)
= n > 0 and assume as i n d u c t i o n h y p o t h e s i s
that if r l , s l , u I are s t r o n g l y n o r m a l i s i n g and X(rl,s I) < n then _l(rl,sl,u I) is strongly normalising.
equation
C o n s i d e r a r e d u c t i o n s e q u e n c e from t in w h i c h the f i r s t a p p l i c a t i o n of
(0) p r o d u c e s l(S(r'),s',_g(S(r'),s'))
from _l(r',s',S(T)) . B y our a s s u m p t i o n s
and the m a i n i n d u c t i o n h y p o t h e s i s all subterms of the n e w r e d u c t are s t r o n g l y n o r m a l ising. Moreover,
x(S(r'),s')
< x(r',s')
= X(r,s) = n and t h e r e f o r e b y the l a t e s t in-
d u c t i o n h y p o t h e s i s _i(S (r') ,s' ,g (S (r') ,s' ) ) is s t r o n g l y n o r m a l i s i n g a n d the r e d u c t i o n
s e q u e n c e m u s t terminate.
CASE 6. 1(x) = f(x) .
This is, by now, obvious.
H a v i n g c o n c l u d e d the p r o o f of L e m m a 4.3 we have also c o n t l u d e d the a r g u m e n t for
L e m m a 4.2.
Q.E.D.
5. T H E M A N Y SORTED CASE
We assume the r e a d e r t h o r o u g h l y a c q u a i n t e d w i t h the t e c h n i c a l foundations of
the a l g e b r a of m a n y - s o r t e d structures for w h i c h no r e f e r e n c e can b e t t e r s u b s t i t u t e
for the A D J ' s b a s i c p a p e r [6~.
In n o t a t i o n c o n s i s t e n t w i t h our [IX, we assume A to be a m a n y - s o ~ t e d a l g e b r a w i t h
domains A I , . . . , A n + m and o p e r a t i o n s of the form
~,~
= ~ l ' ' ' ' ' X k ;~
: A ~ I × . . . × A I k ,~,~ A
w h e r e I . ~ £ {l,...,n+m}, I ~ i ~ k.
1
The c o n c e p t s and m a c h i n e r y of Section 2 m u s t be reformulated,
difficult:
b u t this is not
An algebraic replacement system R on A consists of a c o l l e c t i o n of set-
theoretic r e p l a c e m e n t systems R I , . . . , R n on its domains w h i c h s a t i s f y the p r o p e r t y that
I,~
0Z A, w i t h arguments a l l , . . . , a l k and b11,...,blk, w h e r e
a
,b
e A
, If a
÷
b
,
,a
÷
b
then ~ l,~ (a , .. ,a ) ÷
~i li
li
"
11
R1
11 "'"
~k
Rk
~k
11 •
Ik
R~
I,~
(bll,...,blk). The c l a s s i f i c a t i o n of r e p l a c e m e n t systems a n d the d e f i n i t i o n s of
for each o p e r a t i o n ~
the a s s o c i a t e d congruence, o n e - s t e p r e d u c t i o n s and so on as families of single sorted
88
relations p r o c e e d along the lines established
single-sorted
mdchanisms
to m a n y - s o r t e d
for specifying
To lift Section
algebras;
replacement
for generalising
algebraic
this is true of their properties
ideas from
and of the
systems.
3 to computable m a n y - s o r t e d
algebras
is also quite straight-
forward and, in fact, has been virtually written out already in our [13. Those lemmas
pertaining
to replacement
tion of sort indices
system specifications
require only the appropriate
introduc-
into their proofs.
Up to and including the proofs that
full theorem in its m a n y - s o r t e d
(2) implies
(3), and
(3) implies
(i), for the
case, it m a y be truly said that no new ideas or tech-
niques are required.
Consider
the proof that
ject of this section)
(i) implies
(2). With the help of a trick
(the real sub-
we are able to construct this proof with the toolkit of Section
4. Dispensing with an easy case where all the domains of A are finite, we assume A to
be a m a n y - s o r t e d
computable
algebra with at least one domain infinite.
W i t h o u t loss of generality we can take these domains to be A I , . . . , A n, BI,...,B m
where the A i are infinite and the B.l are finite of cardinality b.l + I. The generalised
Lemma 3.1 provides
us with a recursive m a n y - s o r t e d
algebra of numbers R with domains
~l,...,~n and FI,...,F m where ~l = w for i ~ i ~ n, F i = {0,1,...,b i} for i -< i -< m,
and R is isomorphic
to A. When not interested
in the cardinality
of a domain of R we
refer to it as R., i ~ i ~ n+m. The aim is to give R a finite equational
I
tion replacement system specification.
hidden func-
The first task is to build a recursive number algebra R 0 by adding to R new constants and functions.
first infinite
ing functions
The main idea is to code the many-sorted
sort ~I by means of functions
R i ÷ ~1 and ~i ÷ Ri affd recursive
on ~I associated to the m u l t i s o r t e d
we shall dissolve
algebra R into its
operations
track-
of R. At the same time
the finite sorts b y adding them as sets of constants.
Here is the
formal construction.
For each infinite
and
as
the successor
new
sort i we add as a n e w constant of sort i the number 0 E ~i
function x+1. For each finite sort i we add
all
the elements of F.
l
constants.
Each domain R. is coded into ~1 by adding the function foldl(x) = x, and is re1
covered b y adding the function unfoldl: ~ + R , defined for infinite sorts i b y
1
unfoldl(x) = x, and for finite sorts i b y
unfoldl(x)
= ix
if x ~ b i
Ib i
otherwise.
Next we add for each operation
k
~i w h i c h commutes
f = fl,~ of R a recursive tracking function
the following diagram:
f
X1
fold x...×fold
Xk
Rxlx'''XRxk
~ i~
1
~ix...X~l
~
.....
~ el
unfoldp
f:
89
And,
just as in the s i n g l e - s o r t e d case, we factorise f into functions t , h , g and add
these a l o n g w i t h all the p r i m i t i v e recursive functions a r i s i n g from the p r i m i t i v e recursive d e f i n i t i o n s of h and g. T h a t is all. Observe R0] ~ = <R0> ~ = R, so it remains
to give a finite e q u a t i o n a l r e p l a c e m e n t s y s t e m s p e c i f i c a t i o n for R 0 w h i c h is ChurchRosser and strongly normalising. Let Z0 be the signature of R 0 in w h i c h 12, iS, FOLD l,
i
UNFOLD name the zero, successor function, and c o d i n g maps a s s o c i a t e d to sort i; for
c o n v e n i e n c e we d r o p the sort s u p e r s c r i p t in case i = i. Here are the requisite set of
e q u a t i o n s E0, b e g i n n i n g w i t h the o p e r a t i o n s of R.
Let f = fi,Z be an o p e r a t i o n of R n a m e d b y function symbol f { ~ c Z0 and let
be its a s s o c i a t e d t r a c k i n g m a p on ~i n a m e d b y _
f e Z0" First,
f o l l o w i n g the p r o c e d u r e
of Section 4, w r i t e out all the equations a s s i g n e d to f and its factorisation.
ly, add this e q u a t i o n to "eliminate"
f
1
f(Xll ..... Xlk)
~
Second-
UNFOLD~(~(FOLD
l(Xll) ....
,FOLD
1
k(Xlk))
w h e r e Xli is a v a r i a b l e of sort I i. D o this for e v e r y o p e r a t i o n of R.
T u r n i n g to the coding machinery,
c o n s i d e r first the f o l d i n g functions.
For each
infinite sort i add the equations,
FOLDI(IO)
~ 0
FOLml(iS(Xi )) ~ S(FOLDI(Xi ))
where X. is a v a r i a b l e of sort i.
1
For e a c h finite sort i, if i n E ~0
is a n e w c o n s t a n t of sort i d e n o t i n g num-
b e t c ~ r. then a d d
1
•
FOLD i (iC)
~ SO(O).
S e c o n d l y c o n s i d e r the u n f o l d i n g functions. For e a c h i n f i n i t e sort i add the equations,
UNFOLD 1 (0)
UNFOLD
i
~ i0
(S(X)) ~
iS(UNFOLDi(X) )
w h e r e X is a v a r i a b l e of sort i.
For e a c h finite sort i, if
UNFOLD i (Sc (0))
i
=c is as b e f o r e then a d d the equations
> ie
-
if c < b.
-> b.
=l
if c ~ b.
l
-
UNFOLD±(sC(x))
l
w h e r e b I• is the last e l e m e n t of F i and is n a m e d in ~ 0 - E b y b.=l; and X is a v a r i a b l e
of sort I.
A n d f i n a l l y we c o n s i d e r the equations for the constants. For each infinite sort
i, if
ic_
~ E denotes the n u m b e r c { ~i then add ic >- isC(u).
~
For each finite sort i,
if ic 6 ~ denotes the n u m b e r e £ F. and ic { Z0
i
remove the d u p l i c a t i o n b y adding ic
> c.
_
-
Z is its n e w c o n s t a n t symbol then we
T h i s completes the c o n s t r u c t i o n of E 0.
W h a t remains of the p r o o f follows c l o s e l y the arguments of Section 4. Here the
90
sets of normal forms are, of course,
{isC (i0) : c ~ }
when i is an infinite sort, and
{ic:cEFi} when i is a finite sort. And the arguments which lift Lemma 4.1 and 4.2 are
in all essential
respects the same. Given, then, that
(Z0,E0) is Church-Rosser
and
strongly normalising, the normal forms being a traversal for =E0, we can prove
~ T(E^, E ^) by using the mappings ~ i defined ~ i (c) = [ isC (0)
i ] f or i an infinite
R^• =
U
U
,U
.
sort and @l(c) = lc for i a finite sort.
REFERENCES
[13
BERGSTRA, J.A. & J.V. TUCKER, Algebraic specifications of computable and semicomputable data structures, Mathematical Centre, Department of Computer
Science Research Report IW 115, Amsterdam, 1979.
[23
~
, A characterisation of computable data types by means of a finite, equational specification method, Mathematical Centre, Department of Computer
Science Research Report IW 124, Amsterdam, 1979.
[33
~
, Equational specifications for computable data types: six hidden functions suffice and other sufficiency bounds, Mathematical Centre, Department of Computer Science Research Report IW 128, Amsterdam, 1980.
[4]
- -
, On bounds for the specification of finite data types by means of equations and conditional equations, Mathematical C e n ~ e , Department of Computer Science Research Report IW 131, Amsterdam, 1980.
[5]
- -
, On the adequacy of finite equational methods for data type specification, ACM-SIGPLAN Notices 14 (11) (1979) 13-18.
[6]
GOGUEN, J.A., J.W. THATCHER & E.G. WAGNER, An initial algebra approach to the
specification, correctness and implementation of abstract data types, in
R.T. YEH (ed.) Current trends in programming methodology IV, Data structuring, Prentice-Hall, Engelwood Cliffs, New Jersey, 1978, 80-149.
[7]
KAMIN, S., Some definitions for algebraic data type specifications,
Notices 14 (3) (1979) 28-37.
[8]
MACHTEY, M. & P. YOUNG, An introduction
North-Holland, New York, 1978.
[9]
MAL'CEV,
A.I., Constructive
algebras,
SIGPLAN
to the general theory of algorithms,
I., Russian Mathematical
Surveys,
16 (1961)
77-129.
[i03 RABIN, M.O., Computable algebra, general theory and the theory of computable
fields, Transactions American Mathematical Society, 95 (1960) 341-360.
[i13 ROSEN, B.K., Tree manipulating systems and Church-Rosser
tion Computing Machinery, 20 (1973) 160-187.
theorems,
J. Associa-