ArticlePDF Available

Abstract

This paper contains examples of structured PL/I programs. For a number of years these programs were assigned to LGU students majoring in economics/math in their programming classes.This paper is designated for students and other people studying programming.
-27
-
I/O-COMPUTABLE DATA STRUCTURE
S
J
. A
. Bergstra and J
.-J . Ch
. Meye
r
Department of Computer Scienc
e
University of Leide
n
Wassenaarseweg 8
0
Postbus 951
2
2300 RA LEIDE
N
The Netherland
s
According to ADO [6] a data structure is a many-sorted algebra tha
t
satisfies various equations and conditional equations
. Several author
s
[3], [4], [5], [8], [9] have emphasised that visible and non-visible sort
s
should be distinguished ;objects that belong to an invisible sort show
a
so-called observable behaviour and all of the authors mentioned point ou
t
that on these sorts terminal equivalence rather than initial equivalenc
e
is the more interesting congruence relation
. Objects that have indistin-
guishable observable behaviour are made equivalent in this terminal congruence
.
We have in mind to present the reader with a survey of some terminolog
y
and several new definitions, notably that of an I/0-computable data structure
.
We shall define I/0-equivalence and prove that for each data structure A ther
e
is a computable data structure B that is I/O-equivalent to A
. This very simpl
e
result may prove to be significant
. First of all it shows the adequacy of th
e
concept of an I/0-computable data structure, as in principle all such dat
a
structures can practically exist
. Moreover this fact suggests that both initia
l
and terminal semantics of equations may differ from what actually occurs in a
n
implementation
. This means that both should be considered as theoretica
l
concepts that can be used to describe a data structure, given certain purposes
.
Certainly this result gives a post facto justification of the restrictio
n
to computable algebras that was made in 11] and l2]
.
Some technical terms have to be introduced in our discussion now
. Let
A
be an algebra with sort
s
We assume A to be finitely generated by its finite signature E (i
.e . A i
s
minimal)
. Se,
. .
.,Sk-1 are the visible sorts, Sk,
. .
.,5g-1 the invisible ones
.
The terminology visible-invisible being not so pleasant in the long run, w
e
propose to call the visible sorts
I/O-sorts
and the invisible sorts
interna
l
sorts
. Elements of I/O-sorts can be seen as
tokens
on which an equalit y
relation is fixed
. Elements of the internal sorts are the true data structures
.
It is on the internal sorts that investigating the variety of congruenc
e
relations that respect the I/0-behaviour (i
.e
. the word problem on the I/0
-
sorts) is interesting
.
-28
-
Coming back to the structure A the sorts SO,
.
.
.,Sk-1 are I/O-sorts an
d
Sk,
. .
.,Se-1
are internal sorts
. We choose
03
0 , . .
.,03
8-1
as disjoint copies o
f
w,
the non-negative integers . A co-ordinatization of A is a tuple of mapping
s
ao,
. .
.,ae-1
plus a collection of tracking functions
o
f
for all f
E
,
that satisfy the following conditions
:
a
i : w
. -+ S
i
a surjective mapping for each f E Z,f
: S
i1
x
. .
.xS
ik
--b S
µ
the diagram
f
S x
.
.
.
. x S
S
i
1
i
k
a
. X
. .
.Xa
.
a
1
1
l
k
w
x
. . .
. x
w
.
i
1
1
k
f
a
commutes
. Moreover, the functionsa
f
are computable
.
On each of the
w
i
a congruence - . is induced as follows
:
n
=a
m
p
a.(n)
= a
.(m)
.
Two important definitions can now be stated
.
DEFINITION
I
.
A
is
computable if there is a coordinatization
a
.,
6
r
(f
E
z
)
of A such that for each i the congruence relation
-a
is computable
.
DEFINITION
II
.
A
is _I/0-computable if there is a coordinatization
ai,
Qf
(f E E
)
of A such that for each i < k (i
.e
. for all I/0-sorts)
E .
is computable
.
These definitions are compatible with the definitions in [1] and [2]
.
We propose that a
data
structure
is an arbitrary I/0-computable minima
l
algebra
. The condition that the I/O-behaviour of a data structure is computabl
e
is justified in a deterministic context, as it is inconceivable that any othe
r
data structures have an effective implementation (realization)
.
An algebra A is semicomputable if for all sorts the word problem is semi
-
computable
. A is called
co-semicomputable if for all sorts the complement o
f
the word problem is semicomputable
. Clearly if
A
is a data structure thes
e
definitions refer to the internal sorts only
.
-29
-
Two data structures A and B are called
comparable,
according to KAMIN [3
]
if they have the same signature
.
DEFINITION III
.
Let A,B be comparable data structures . A and B are calle
d
I/0-equivalent if for all I/O-sorts S and for all terms
t
1 s
,
t2s
of sort S
:
A
I=
t1s
t25
B
t
1
s
=
t2
s
I/O-equivalence of A and B implies that both have identical word problems o
n
the I/0-sorts
.
A
data abstraction
K is a collection of I/O-equivalent data structures
. A E
K
is called an
implementation
of K
.
Given a data structure A we denote with G
I/0
(A) the set of all close
d
term identities t
1 s
= t2s that hold true in A for I/O-sorts S
. Obviously ou
r
convention implies that G
I/0
(A) is a decidable set of pairs of terms
.
Suppose that A satisfies equations (or conditional equations) E
. This lead
s
to a natural data abstraction
:
DA(G
I/0
(A) U E) =
{BIB
is
I/O-equivalent
with A, and
B
I=
E}
.
TERMINAL SEMANTICS
.
PROPOSITION
I
.
Let A be a data structure of signature E
. There exists a dat
a
structure B, I/0-equivalent to A with the following property
:
If C is I/O-equivalent to A then there is a homomorphism (p
: C -)- B
.
B is isomorphic to A/= for a congruence = that is usually called the termina
l
congruence on A
.
PROOF
.
See [4], [5], [7], [8]
.
T
z
denotes the term algebra of signature E
.
PROPOSITION
II
.
The terminal congruence on
A,E,
seen as a congruence on
T
z
,
is co-semicomputable
.
PROOF
.
Straightforward
.
-30
-
On the other hand, given
GI/0
(A) and a finite set of (conditional) equation
s
E the initial algebra of
GI/0
U E is semicomputable, as are all initia
l
algebras of decidable sets of axioms
.
In a forthcoming note we will show that a data structure A exists fo
r
which DA(G
I/0
(A) U E) has no computable element with E a set of equation
s
such that T
z,E
A
.
Here T
z'E
is the initial algebra in ALG(Z,E), or, differently
:
y=
E
wher
e
= E
is the congruence of E-provable equality on T
z
.
In this case there is no computable congruence between the initial and th
e
terminal one
.
COMPUTABLE IMPLEMENTATIONS
.
We will next consider the case, where G
I/0
(A) is given but E = 0
.
The question is
: must there exist a computable implementation of DA(GI/0(A))
?
This is indeed the case
:
PROPOSITION III
.
Let A be a data structure then T ,
is a computabl
e
algebra in DA(GI/0(A))
.
G
I/0
(
A
)
PROOF
.
Choose for each I/O-sort S a sequence tl such that all elements of
S
occur as the value of tS for exactly one i
. Moreover, the sequence ti must b
e
uniformly given from i . If S happens to be finite in A then the sequence i
s
finite as well
.
Introduce a function
f
s
for each S such that in a computable way
f s
:
T
z
-)
-
and A
I=
r = i
s
for
all
terms r of sort S
.
fs
(
r
)
Now one defines the congruence = on T
z
as follows
:
for an I/O-sort S
: i
s
r
s
iff A
1=
i
s
= r
s
(- G
I/0
(A)
i
s
= r
s
fS(tS) = f
s
(r
s
)
.
Notice that f
s (t
s
) is a unique normal form of i
s
under the rewrite rul
e
is -
fs
(
ts
)
for an internal sort S one
also introduces
a
unique
notation
F(T
s
)
fo
r
each term
T
s
.
F(T
s
)
results from
T
s
by
replacing
each of its
subterms t
To f
an I/O-sort T by f
T (t
T
)
.
We put i
s
= r
s
iff
F(T
s
)
= F(r
s
) (syntactic
equality
is meant here)
.
is a computable congruence relation that extends G
I/0
(A)
.
In fac
t
Tz /
E
=
Tz
GI/O(A)
E DA(GI/0(A))
.
-31
-
CONCLUDING REMARKS
.
In [1] and [2] a fruitful format of mathematical problems is as
follows
:
Given a computable algebra, allow the addition of hidden enrichmen
t
functionsand then investigate initial algebra specifications of the enriche
d
algebra
.
The present situation rather suggests to start with
G
110
(A) for some dat
a
structure A of signature E which has a specification (Z,E) with (conditional
)
equationsE
. The
problem
is now to find another specification (E,E
0
)
(of
a n
algebra B,1/0-equivalent to A) such that E
O
has some
additional
propertie
s
(for instance being sufficiently powerful to prove some partial correctnes
s
conditions)
.
The interesting issue here is that several of such requirements may b
e
incompatible
. This is the case with two specifications E
O
and E
1
of I/0
-
equivalent data structures A and B such that DA(G
1/0
(A)
E O
U E
1
) - 0
.
Of course this can only happen if E
O
or E
1
contain conditional equation
s
that are not preserved under homomorphisms
.
Mathematically speaking one introduces a collection SPEC(G
I/0 (A)) of al
l
finite sets of conditional equations E such that
T
7,E
is I/O-equivalent to A
.
On this collection there is a partial order C defined by E
0
C E
1
if
al
l
axioms in E
O
can be proved from E
1
. In the general case E will neither sho w
a smallest nor a largest element
. This setting seems appropriate for us fo
r
the mathematical investigation of specifications not allowing hidden functions
.
REFERENCE
S
[1] Bergstra, J
.A
. & J
.V
. Tucker, Algebraic specifications of computabl
e
and semicomputable data structures, Mathematical Centre, Depart-
ment of Computer Science Research Report IW 115, Amsterdam 1979
.
[2] Bergstra, J
.A
. & J
.V
. Tucker, Equational specifications for computabl
e
data types
: six hidden functions suffice and other sufficienc
y
bounds, Mathematical Centre, Department of Computer Science Researc
h
Report IW 128, Amsterdam 1980
.
[3] Botha, K
. Institutsbericht, Humboldt Universitat zu Berlin [1979]
.
[4]
Broy, M
. & M
. Wirsing, The theory of recursive functions as an abstrac
t
type and its semantical models
. Report, Institut fur Informatik
,
Technische Universitat Munchen [1980]
.
[5] Giarattana, F
. Gimona & V
. Montanari, Observability concepts in abstrac
t
data types specification, Proc
. of 5th MFCS symposium, LNCS 4
5
(576-587) 1976
.
-32
-
[6] Goguen, J
.A
., J
.W
. Thatcher & E
.G
. Wagner, An initial algebra approac
h
to the specification, correctness and implementation of abstrac
t
data types, in R
.T
. Yeh (ed
.)
. Current trends in programmin
g
methodology IV, Data Structures, Prentice Hall, Engelwood Cliffs
,
New Jersey, 1978, 80-149
.
[7] Hornung, G
. & P
. Raulefs, Terminal algebra semantics and retractions fo
r
abstract data types . Proceedings of ICALP '80, Spr
. LNCS 85
.
[8]
Kamin, S
., Final data type specifications : a new data type specificatio
n
method, 7th POPL Conference, Las Vegas, ACM 1980, 131-138
.
[9]
Kapur, D
. & M
.K
. Srivas, Expressiveness of the operation set of a dat
a
abstraction, in 7th ACM POPL Conference, Las Vegas, ACM 1980
.
... This definition generalizes various notions of behavioural equivalence in the literature: If OBS ~ sorts(E) + is a set of observable sorts, then two -S-algebras are considered to be behaviourally equivalent with respect to OBS if all computations yielding a result of observable sort give the same result in both algebras. There is some disagreement over which class of inputs these computations should be considered: ]Wr(VAR)loas-equivalence (all inputs) is behavioural equivalence according to [48,80,58]; ]Wz (VARoas)loBs-equivalence (inputs of observable sorts) is behavioural equivalence in the sense of [16,49,87]; and I W~ (O)loas-equivalence (no inputs) is the same as behavioural (or I/O) equivalence in [12,19,57] (and implied by [41]) except that in these papers only term-generated algebras are considered. There are other choices for W which yield interesting equivalences; one of these (used in the definition of the junk operation) is given in Section 5.5. ...
Article
A language called ASL for describing structured algebraic specifications is presented. ASL is a declarative higher-order language. It contains constructs for building (possibly infinite) signatures, sets of terms, and sets of formulas as well as constructs embodying primitive operations on algebraic specifications. In particular, ASL includes a very general ‘observability’ operation which can be used to behaviourally abstract from a specification. The expressive power of these operations allows the choice of a simple notion of implementation which is transitive and monotonic. Syntax and two different denotational semantics, a ‘presentation semantics’ and a ‘model class semantics’, are given. The presentation semantics is used for showing the existence of a complete (semiformal) proof system for specifications, whereas the model class semantics is fully abstract with respect to specification expressions. Both semantics are related by a homomorphism. Moreover, computability questions are studied. It is shown that any recursively enumerable signature and any class of algebras which is ‘pseudo-axiomatizable’ in a recursively enumerable way are definable in ASL; also, every computable transformation of specifications can be expressed in ASL.
Chapter
This section contains 870 papers with useful bibliographic informations. Each item consists of four parts: name(s) of author(s) and year of issue title kind(s) of publication (separated by a plus-sign ‘+’) (optional:) references to citations in Zentralblatt fur Mathematik, Section 68B, (ZfM), Mathematical Reviews, Section 68B, (MR), Current Mathematical Publications, Section 68B, (CMP), Computer Abstracts, Sections Computer Theory and Programming, (CA)
Chapter
Kern dieses Abschnitts ist eine möglichst reichhaltige Bibliographie über die algebraische Software-Spezifikation. Die im Text des Buches angegebenen Kürzel, z.B. [EKMP 82], beziehen sich in der Regel auf diese Bibliographie. Natürlich stecken einige persönliche Vorurteile in der Entscheidung der Frage, welche Arbeiten man der „algebraischen Software-Spezifikation“ zuordnen soll. Es sind einige Arbeiten enthalten, die nicht eigentlich algebraisch sind, sondern modelltheoretisch [BMM 78 — BMMW 79, Li 78] oder noch allgemeiner; andererseits sind Arbeiten enthalten, die zwar algebraisch sind, aber sich nicht direkt mit Software-Spezifikation beschäftigen [Bu 80, BG 81, BL 69, Go 78a]. Darüber hinaus sind einige Übersichtsartikel sowie Arbeiten über Termersetzungssysteme enthalten.
Article
Full-text available
The program development process is viewed as a sequence of implementation steps leading from a specification to a program. Based on an elementary notion of refinement, two notions of implementation are studied: constructor implementations which involve a construction on top of the implementing specification, and abstractor implementations which additionally provide for abstraction from some details of the implemented specification. These subsume most formal notions of implementation in the literature. Both kinds of implementations satisfy a vertical composition and a (modified) horizontal composition property. All the definitions and results are shown to generalise to the framework of an arbitrary institution, and a way of changing institutions during the implementation process is introduced. All this is illustrated by means of simple concrete examples.
Article
A formalism for constructing and using axiomatic specifications in an arbitrary logical system is presented. This builds on the framework provided by Goguen and Burstall's work on the notion of an institution as a formalisation of the concept of a logical system for writing specifications. We show how to introduce free variables into the sentences of an arbitrary institution and how to add quantifiers which bind them. We use this foundation to define a set of primitive operations for building specifications in an arbitrary institution based loosely on those in the ASL kernel specification language. We examine the set of operations which results when the definitions are instantiated in institutions of total and partial first-order logic and compare these with the operations found in existing specification languages. We present proof rules which allow proofs to be conducted in specifications built using the operations we define. Finally, we introduce a simple mechanism for defining and applying parameterised specifications and briefly discuss the program development process.
Article
The properties of a simple and natural notion of observational equivalence of algebras and the corresponding specification-building operation are studied. We begin with a definition of observational equivalence which is adequate to handle reachable algebras only, and show how to extend it to cope with unreachable algebras and also how it may be generalised to make sense under an arbitrary institution. Behavioural equivalence is treated as an important special case of observational equivalence, and its central role in program development is shown by means of an example.
Conference Paper
This paper studies some computability notions for abstract data types, and in particular compares cosemicomputable many-sorted algebras with a notion of finality to model minimal-state realizations of abstract (software) machines. Given a finite many-sorted signature and a set V of visible sorts, for every -algebra A with co-r.e. behavior and nontrivial, computable V-behavior, there is a finite signature extension of (without new sorts) and a finite set E of -equations such that A is isomorphic to a reduct of the final (, E)-algebra relative to V. This uses a theorem due to Bergstra and Tucker [3]. If A is computable, then A is also isomorphic to the reduct of the initial (, E)-algebra. We also prove some results on congruences of finitely generated free algebras. We show that for every finite signature , there are either countably many -congruences on the free -algebra or else there is a continuum of such congruences. There are several necessary and sufficient conditions which separate these two cases. We introduce the notion of the Turing degree of a minimal algebra. Using the results above prove that there is a fixed one-sorted signature such that for every r.e. degree d, there is a finite set E of -equations such the initial (, E)-algebra has degree d. There is a two-sorted signature 0 and a single visible sort such that for every r.e. degree d there is a finite set E of -equations such that the initial (, E, V)-algebra is computable and the final (, E, V)-algebra is cosemicomputable and has degree d.
Article
This paper studies some computability notions for abstract data types, and in particular compares cosemicomputable many-sorted algebras with a notion of finality to model minimal-state realizations of abstract (software) machines. Given a finite many-sorted signature Σ and a set of V of visible sorts, for every Σ-algebra A with co-r.e. behavior and nontrivial, computable V-behavior, there is a finite signature extension Σ' of Σ (without new sorts) and a finite set E of Σ'-equations such that A is isomorphic to a reduct of the final (Σ', E)-algebra relative to V. This uses a theorem due to Bergstra and Tucker [3]. If A is computable, then A is also isomorphic to the reduct of the initial (Σ′, E)-algebra. We also prove some results on congruences of finitely generated free algebras. We show that for every finite signature Σ, there are either countably many Σ-congruences on the free Σ-algebra or else there is a continuum of such congruences. There are several necessary and sufficient conditions which separate these two cases. We introduce the notion of the Turing degree of a minimal algebra. Using the results above, we prove that there is a fixed one-sorted signature such that for every r.e. degree d, there is a finite set E of Σ-equations such the initial (Σ, E)-algebra has degree d. There is a two-sorted signature Σ0 and a single visible sort such that for every r.e. degree d there is a finite set E of Σ-equations such that the initial (Σ, E, V)-algebra is computable and the final (Σ, E, V)-algebra is cosemicomputable and has degree d.
Conference Paper
A new specification method for data types is presented, which is distinguished by the semantic objects it specifies. In particular, only final data types [GGM,W] are specifiable. A final data type is one in which no two elements are "input-output equivalent". It is argued that the mathematical properties of final data types characterize abstractness on the semantic level.Examples are given to show that final data type specifications are easy to construct and use.
Conference Paper
In a strongly typed system supporting user defined data abstractions, the designer of a data abstraction ought to be careful in choosing the operations for the abstraction. If the operation set chosen is not expressive enough, it might be impossible or inconvenient to implement certain useful functions on the values of the data abstraction. In this paper, we characterize the expressive power of the operation set by defining two properties for data abstractions - expressive completeness and expressive richness. The operation set of an expressively complete data abstraction is adequate enough to implement all computable functions on its values. An expressively rich data abstraction is expressively complete with an operation set that is rich enough to conveniently extract from a value, all relevant information required to reconstruct the value from scratch. Practical applications of the properties of expressiveness introduced are also discussed.
Conference Paper
Very often, the terminal algebra semantics of an algebraic specification of an abstract data type is more important than the initial algebra semantics. This paper develops a theory of terminal algebra semantics. The notion of terminal (t-) abstract data type is introduced, and it is shown that a t-abstract data type is a terminal object in the categories of terminal models and implementations of an abstract data type specification. Many, but not all notions and properties of initial algebra semantics have their dual analogue in terminal algebra semantics. The connection between t-abstract data types and Scott's notation of a data type being a retract on a universal domain is explored. The main result is that for the class of recognizable t-specifications retracts constituting terminal models of respective t-specifications can be explicitly constructed.
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
  • J A J V Bergstra
  • Tucker
Algebraic specifications of computable and semicomputable data structures Mathematical Centre Department of Computer Science Research Report IW 115 Amsterdam 1979
  • J A J V Bergstra
  • Tucker