Article

Final algebra semantics and data type extensions

Authors:
To read the full-text of this research, you can request a copy directly from the author.

Abstract

We consider the problem of data type extensions. Guttag, Horowitz, and Musser have pointed out that in this situation the naive initial algebra approach requires the data type to save too much information. We formulate a category of implementations of such an extension, and we show that such a category has a final object. The resulting semantics is closer to that of Hoare, since it can be argued that an abstract data type in the sense of Hoare is a final object in the category of representations of that type. We consider as an example the specification of integer arrays, and we show that our specification yields arrays as its abstract data type. The connection with initial algebra semantics is discussed.

No full-text available

Request Full-text Paper PDF

To read the full-text of this research,
you can request a copy directly from the author.

... Any algebra which satisfies the axioms of a specification and is finitely generated (every carrier element is the value of some term) with true9false is acceptable as a model, although they seem to favour the 'final algebra' view that two terms should have the same value unless they are demonstrably different (see the notes on [Wand 1979] below). ...
... The language also includes a construct for specifying that one theory is an implementation of another (see chapter VII). Wand [1979] presents an alternative to ADJ's initial algebra approach, using the framework of Lawvere theories [Lawvere 1963]. ...
... In contrast to this 'initial algebra approach' is the final algebra approach of Wand (see [Wand 1979], also [Guttag, Horowitz and Musser 1978]). This seems to offer a viable alternative (which is even better in some respects) by considering a different class of distinguished models. ...
Thesis
Full-text available
Specifications are necessary for communicating decisions and intentions and for documenting results at many stages of the program development process. Informal specifications are typically used today, but they are imprecise and often ambiguous. Formal specifications are precise and exact but are more difficult to write and understand. We present work aimed toward enabling the practical use of formal specifications in program development, concentrating on the Clear language for structured algebraic specification. Two different but equivalent denotational semantics for Clear are given. One is a version of a semantics due to Burstall and Goguen with a few corrections, in which the category-theoretic notion of a colimit is used to define Clear's structuring operations independently of the underlying 'institution' (logical formalism). The other semantics defines the same operations by means of straightforward set-theoretic constructions; it is not institutionindependent but it can be modified to handle all institutions of apparent interest. Both versions of the semantics have been implemented. The settheoretic implementation is by far the more useful of the two, and includes a parser and typechecker. An implementation is useful for detecting syntax and type errors in specifications, and can be used as a front end for systems which manipulate specifications. Several large specifications which have been processed by the set-theoretic implementation are presented. A semi-automatic theorem prover for Clear built on top of the Edinburgh LCF system is described. It takes advantage of the structure of Clear specifications to restrict the available information to that which seems relevant to proving the theorem at hand. If the system is unable to prove a theorem automatically the user can attempt the proof interactively using the high-level primitives and inference rules provided. We lay a theoretical foundation for the use of Clear in systematic program development by investigating a new notion of the implementation of a specification by a lower-level specification. This notion extends to handle parameterised specifications. We show that this implementation relation is transitive and commutes with Clear's structuring operations under certain conditions. This means that a large specification can be refined to a program in a gradual and modular fashion, where the correctness of the individual refinements guarantees the correctness of the resulting program.
... Much less attention was given in the first years to the problem of implementation of abstract data types, although an algebraic version of the implementation of symbol tables by stacks was given already by Guttag in [28]. Later on algebraic implementation concepts were given by ADJ [1], Goguen-Nourani [27,39], Ehrich [11,12], Wand [41], Lehmann-Smyth [35], and most recently Hupbach [32,33] and Ganzinger [23]. In Section 8 all these concepts are compared with our new approach which was first announced in [16] and later presented as conference versions in [18] and [14]. ...
... The semantics of the specification is given by the corresponding quotient term algebra (or any isomorphic algebra) which is the initial algebra in the category of all algebras satisfying the given specification. This is the reason for referring the ADJ-approach as "initial algebra approach", while the approach of some other authors, initiated by [41], is called "final algebra approach". We will follow the ADJ-approach as given in [1] and continued in [15]. ...
... The most simplest case seems to be renaming of sorts by copy operations as defined above. Most of the known implementation concepts [28,1,27,11,12,41,35] belong to this type. More complex than copy are constructions like tuples and tables defined above or union, given by IN k : sk~s for k = 1, ... , n, and binary trees, given by EMPTY :~s and BIN: s s s 1 ... sn~s. ...
Article
Starting with a review of the theory of algebraic specifications in the sense of the ADJ-group a new theory for algebraic implementations of abstract data types is presented.While main concepts of this new theory were given already at several conferences this paper provides the full theory of algebraic implementations developed in Berlin except of complexity considerations which are given in a separate paper. The new concept of algebraic implementations includes implementations for algorithms in specific programming languages and on the other hand it meets also the requirements for stepwise refinement of structured programs and software systems as introduced by Dijkstra and Wirth. On the syntactical level an algebraic implementation corresponds to a system of recursive programs while the semantical level is defined by algebaic constructions, called synthesis, restriction and identification. Moreover the concept allows composition of implementations and a rigorous study of correctness. The main results of the paper are different kinds of correctness criteria which are applied to a number of illustrating examples including the implementation of sets by hash-tables. Algebraic implementations of larger systems like a histogram or a parts system are given in separate case studies which, however, are not included in this paper.
... The approach was first presented in [Ol87] and further developed in [Ol88a]. Both these references resort to basic category theory [Ma71] following [MA86] and [Wa79], which should be read as contextual research. To improve readability in this paper, the categorytheoretical notions are replaced by set-theoretical ones. ...
... The algebraic semantics underlying the formalisms below is the so-called final semantics [Wa79] 1 : a specification is given by a model, ie. a many-sorted Σalgebra A which is the final object (up to isomorphism) in the class of all its implementations (= "more redundant" models). This approach to abstract data type semantics is detailed below by presenting some standard definitions from the literature, cf. ...
... eg. [G*78, Wa79,BW82]. ...
Article
Full-text available
This paper presents a transformational approach to the derivation of implementations from model-oriented specifications of abstract data types. The purpose of this research is to reduce the number of formal proofs required in model refinement, which hinder software development. It is shown to be applicable to the transformation of models written in META-IV (the specification language of VDM) towards their refinement into, for example, Pascal or relational DBMSs. The approach includes the automatic synthesis of retrieve functions between models, and data-type invariants. The underlying algebraic semantics is the so-calledfinal semantics “à la Wand”: a specification “is” amodel (heterogeneous algebra) which is the final object (up to isomorphism) in the category of all its implementations. The transformational calculus approached in this paper follows from exploring the properties of finite, recursively defined sets. This work extends the well-known strategy of program transformation to model transformation, adding to previous work on a transformational style for operation-decomposition in META-IV. The model-calculus is also useful for improving model-oriented specifications.
... If T S (X) is restricted to either products or sums, T Σ is an algebraic theory in the sense of [64,109,23,107]. ...
... hidden abstraction ***** final algebra semantics [109,57,78] Labelled transition systems may be integrated into swinging types by declaring them as ternary relations. Although Def. 5.1 excludes the specification of alternating fixpoints [84], it is sufficient for axiomatizing all common modal-or temporal-logic operators in terms of swinging types (see also [89], Example 2.7). ...
Article
Dialgebraic specifications combine algebraic with coalgebraic ones. We present a uniform syntax, se-mantics and proof system for chains of signatures and axioms such that presentations of visible data types may alternate with those of hidden state types. Each element in the chain matches a design pattern that reflects some least/initial or greatest/final model construction over the respective predecessor in the chain. We sort out twelve such design patterns. Six of them lead to least models, the other six to greatest models. Each construction of the first group has its dual in the second group. All categories used in this approach are classes of structures with many-sorted carrier sets. The model constructions could be generalized to other categories, but this is not a goal of our approach. On the contrary, we aim at applications in software (and, maybe, also hardware) design and will show that for describing and solving problems in this area one need not go beyond categories of sets. Consequently, a fairly simple, though sufficiently powerful, syntax of dialgebraic specifications that builds upon classical algebraic notations as much as possible is crucial here. It captures the main constructions of both universal (co)algebra and relational fixpoint semantics and thereby extends "Lawvere-style" algebraic theories from product to arbitrary polynomial types and modal logics from one-to many-sorted Kripke frames.
... Abstract data type and its algebraic specifications are pointed out to be useful for the design and validation of large software systems [1]. Recently, the final (or terminal) algebra semantics of algebraic specifications has received much attention because of the advantage that it gives a natural semantics, and for a specification a variety of the implementations are allowed1236789. Our investigation stands on this approach. In the case where some new abstract data type is specified using old ones, it is often required that a specification of the new type is a data type extension, that is, it does not alter the semantics of the old types [3, 6, 7, 9]. ...
... Our investigation stands on this approach. In the case where some new abstract data type is specified using old ones, it is often required that a specification of the new type is a data type extension, that is, it does not alter the semantics of the old types [3, 6, 7, 9]. So, this paper considers the problem of deciding, for a given specification of a data type, whether it is a data type extension. ...
Article
From the standpoint of the final (or terminal) algebra semantics of algebraic specifications, this paper considers the problem of deciding, for a given specification of an abstract data type, whether it is a data type extension. It is shown that the problem is undecidable, but there exists a large class of specifications which are data type extensions.
... Definition 61 (Final algebra [179] • plus : point2D×vector2D → point2D, ...
Thesis
Full-text available
In this thesis, we present a formalization of geometric modeling operations as rules from the theory of graph transformation.First, we investigate the construction of a dedicated rule-based language. We describe the combinatorial models of generalized and oriented maps as labeled graphs, subject to consistency conditions. This topological representation is coupled with a description of the geometry using attributes. This formalization allows the study of modeling operations such as graph rewriting rules. The rules analysis covers two aspects: the preservation of the model consistency and the genericity of the described operations. Consistency preservation is the primary incentive for using graph transformations. Indeed, modifications of a well-formed object should result in a well-formed object. We ensure the preservation of topological and geometric consistency through syntactic conditions statically checked on the rules. In addition, we ensure that rewriting rules meet the requirements to describe the usual operations used in geometric modeling. In particular, since a rule fully describes a transformation, we extend the rules into rule schemes in order to abstract over the underlying topology. We present a semi-global extension of the usual DPO rewriting by incorporating a graph product simulating the application of a relabeling function.Secondly, we present a mechanism for the inference of operations. Given that an operation can be simply described from a sketch or an example, we propose to reconstruct operations from a representative example made of an initial and a target object. The inference mechanism exploits the regularity of generalized maps and the dedicated language previously. More precisely, we consider the process of inferring topological operations as the inverse construction of the specialization of a rule scheme into an operation. The inference of geometric modifications could admit multiple solutions, given the type of data and the nature of the modifications applied. Here, we propose to consider affine transformations of values from a vector space, which we solve as a constraint satisfaction problem. We have implemented the inference mechanism in Jerboa, a platform for the design of geometric modelers. The first part of this thesis, therefore, allows building a formal framework that is de facto hidden from the user but is still necessary for the conception of geometric modeling operations via our inference mechanism.
... By contrast to Natural, which eagerly validates immutable data structures, Co-Natural waits until the data structure is accessed to perform a check. The choice is analogous to the question of initial algebra vs. final algebra semantics for such datatypes [7,13,90], hence the prefix "Co" is a reminder that some checks now happen at an opposite time. Findler et al. [28] implement exactly the Co-Natural strategy for Racket struct contracts. ...
Article
Full-text available
The literature presents many strategies for enforcing the integrity of types when typed code interacts with untyped code. This paper presents a uniform evaluation framework that characterizes the differences among some major existing semantics for typed–untyped interaction. Type system designers can use this framework to analyze the guarantees of their own dynamic semantics.
... For that, Wand [38] proposed in 1977 the "final" or "terminal" algebra semantics. Even earlier (1976), Giarratana, Gimona and Montanari [21] did not consider an isomorphism class but the class of all finitely generated models having the same input/output behavior. ...
Article
Full-text available
Data structures, algorithms and programming languages can be described in a uniform implementation-independent way by axiomatic abstract data types i.e. by algebraic specifications defining abstractly the properties of objects and functions. Different semantic models such as initial and terminal algebras have been proposed in order to specify the meaning of such specifications -often involving a considerable amount of category theory. A more concrete semantics encompassing these different approaches is presented: Abstract data types are specified in hierarchies, employing “primitive” types on which other types are based. The semantics is defined to be the class of all partial heterogeneous algebras satisfying the axioms and respecting the hierarchy. The interpretation of a specification as its initial or terminal algebra is just a constraint on the underlying data. These constraints can be modified according to the specification goals. E.g. the data can be specified using total functions; for algorithms partial functions with syntactically checkable domains seem appropriate whereas for programming languages the general notion of partiality is needed, Model-theoretic and deduction-oriented conditions are developed which ensure properties leading to criteria for the soundness and complexity of specifications. These conditions are generalized to parameterized types, i.e. type procedures mapping types into types. Syntax and different semantics of parameter are defined and discussed. Criteria for proper parameterized specifications are developed. It is shown that the properties of proper specifications viz. of snowballing and impeccable types are preserved under application of parameterized types — finally guaranteeing that the composition of proper small specifications always leads to a proper large specification.
... It should be mentioned that the initial algebra approach is not the only way to attach formal semantics to algebraic specifications. Several authors have criticised this theory, and suggested other approaches, such as final algebra semantics [35]. Some types of specifications, such as parameterised specifications [34] cannot be handled by the initial algebra approach. ...
Article
Abstract We compare two methods for software specication: algebraic specic ations and automata. While algebraic specications have been around since the 1970s and have been studied extensively, specication by automata is relatively new. Its origins are in another veteran method called trace assertions, which considers a software module as a set of traces, that is, a sequences of function executions. A module is specied by a set of canonical traces and an equivalence relation matching one of the canonical traces to each non-canonical trace. It has been recently shown that trace assertions is an equivalent method to specication by automata. In continuation of this work on trace assertions and automata, we study how automata compare with algebraic specications. We prove that every specication using an automaton can be converted into an algebraic specication describing the same abstract data type. This conversion utilises a set of canonical words, representing states in the automaton. We next consider varieties of monoids as a heuristic for obtaining more concise algebraic specications from automata. Finally, we discuss the opposite conversion of algebraic specications into automata. We show that, while an automaton always exists for every abstract data type described by an algebraic specication, this automaton may not be nitely describable and therefore may not be considered as a viable method for software specication.
... Computations in certain specialist fields such as numerical analysis, hardware design, neural networks and dynamical systems, control systems theory and mathematical logic make use of uncountable algebras as idealised specifications. Such Clearly, by cardinality constraints, such algebras cannot be given a countable algebraic specification using any of the familiar term model constructions such as first-order initial semantics [6], first-order final semantics [18] or higher-order initial semantics [10,12]. However, given an appropriate separable topological space, (i.e. a space with a countable dense subspace) we may be able to give a recursive (or even finite!) ...
Chapter
We introduce an algebraic construction for the Hausdorff extension H(A) of a many-sorted universal algebra A with respect to a family T of Hausdorff topologies on the carrier sets of A. This construction can be combined with other algebraic constructions, such as the initial model construction, to provide methods for the algebraic specification of uncountable algebras, e.g. algebras of reals, function spaces and streams.
Chapter
Developing and maintaining software commonly requires (1) adding new data type constructors to existing applications, but also (2) adding new functions that work on existing data. Most programming languages have native support for defining data types and functions in a way that supports either (1) or (2), but not both. This lack of native support makes it difficult to use and extend libraries. A theoretically well-studied solution is to define data types and functions using initial algebra semantics. While it is possible to encode this solution in existing programming languages, such encodings add syntactic and interpretive overhead, and commonly fail to take advantage of the map and fold fusion laws of initial algebras which compilers could exploit to generate more efficient code. A solution to these is to provide native support for initial algebra semantics. In this paper, we develop such a solution and present a type discipline and core calculus for a language with native support for initial algebra semantics.
Chapter
Although they are widely cited as one of those techniques that can result in high-integrity systems [31], and are being mandated more and more in certain applications (see Part 6), formal methods remain one of the most controversial areas of current software engineering practice [119].
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
This paper presents an alternative approach to loose specifications of parameterized data types. The specification language is full first-order logic, and the semantics is a particular class of functions, mapping parameter algebras to (parameter generated) target algebras. We investigate monomorphicity and correctness of parameterized first-order specifications, and present simple syntactic criteria for these notions. Furthermore, correctness of standard parameter passing is studied. We give a characterization as well as a simple sufficient criterion for specifications with correct parameter passing. Finally, the interaction between parameter passing and correctness of specifications is investigated: We present conditions under which actualization of parameterized specifications preserves the correctness of the constituent specifications.
Chapter
We recall the kernel algebraic specification language ASL and outline its main features in the context of the state of research on algebraic specification at the time it was conceived in the early 1980s. We discuss the most significant new ideas in ASL and the influence they had on subsequent developments in the field and on our own work in particular.
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.
Chapter
Domain-specific languages are a popular application area for functional programming; and conversely, functional programming is a popular implementation vehicle for domain-specific languages—at least, for embedded ones. Why is this? The appeal of embedded domain-specific languages is greatly enhanced by the presence of convenient lightweight tools for defining, implementing, and optimising new languages; such tools represent one of functional programming’s strengths. In these lectures we discuss functional programming techniques for embedded domain-specific languages; we focus especially on algebraic datatypes and higher-order functions, and their influence on deep and shallow embeddings.
Thesis
Category theory is proving a useful tool in programming and program specification - not only as a descriptive language but as directly applicable to programming and specification tasks. Category theory achieves a level of generality of description at which computation is still possible. We show that theorems from category theory often have constructive proofs in the sense that they may be encoded as programs. In particular we look at the computation of colimits in categories showing that general theorems give rise to routines which considerably simplify the rather awkward computation of colimits. The general routines arising from categorical constructions can be used to build programs in the 'combinatorial' style of programming. We show this with an example - a program to implement the semantics of a specification language. More importantly, the intimate relationship between these routines and algebraic specifications allows us to develop programs from certain forms of specifications. Later we turn to algebraic specifications themselves and look at properties of "monadic theories". We establish that, under suitable conditions: 1. Signatures and presentations may be defined for monadic theories and free theories on a signature may be constructed. 2. Theory morphisms give rise to ad junctions between categories of algebras and moreover a collection of algebras of a theory give rise to a new theory with certain properties. 3. Finite colimits and certain factorisations exist in categories of monadic theories. 4. Many-sorted, order-sorted and even category-sorted theories may be handled by somewhat extending the notion of monadic theories. These results show that monadic theories are sufficiently well-behaved to be used in the semantics of algebraic specification languages. Some of the constructions can be encoded as programs by the techniques mentioned above.
Article
Full-text available
The so-called ‘typed tagless final’ approach of [6] has collected and polished a number of techniques for representing typed higher-order languages in a typed metalanguage, along with type-preserving interpretation, compilation and partial evaluation. The approach is an alternative to the traditional, or ‘initial’ encoding of an object language as a (generalized) algebraic data type. Both approaches permit multiple interpretations of an expression, to evaluate it, pretty-print, etc. The final encoding represents all and only typed object terms without resorting to generalized algebraic data types, dependent or other fancy types. The final encoding lets us add new language forms and interpretations without breaking the existing terms and interpreters. These lecture notes introduce the final approach slowly and in detail, highlighting extensibility, the solution to the expression problem, and the seemingly impossible pattern-matching. We develop the approach further, to type-safe cast, run-time-type representation, Dynamics, and type reconstruction. We finish with telling examples of type-directed partial evaluation and encodings of type-and-effect systems and linear lambda-calculus.
Article
A specification method for abstract data types based on many-sorted second order logic is presented. In our approach the specification is composed of two parts: the first part specifies a set of objects and a set of fundamental operations; the other part specifies an arbitrary number of augmenting operations. The fundamental operations are called constructors. On the basis of constructors the axioms can be put into schematic forms and the resulting theory is categorical.
Conference Paper
An algebraic specification is a description of one or more abstract data types. There are three main semantic approaches to algebraic specifications: (1) the initial algebra approach, (2) the terminal algebra approach, and (3) the loose approach. A fourth approach that is mainly of theoretical interest uses iso-initial algebras. This chapter reviews the basic concepts for the theory of algebraic specifications. It also describes the notion of an abstract data type and discusses its basic properties. The chapter also describes four other semantic concepts and algebras for specifying nondeterminism and concurrency. The chapter discusses the existence of initial and terminal algebras, the lattice structure of the models, and the expressive power of initial and terminal algebra specifications. The chapter also presents two additional concepts for algebraic specifications, which are both practically and theoretically essential: (1) hidden symbols and (2) constructors. The chapter also presents a general approach to structured specifications.
Conference Paper
Article
This paper focuses on observability issues in the framework of loose algebraic specifications. The main purpose of observability is to extend the model class of some given algebraic specification in order to consider not only the algebras that satisfy the axioms of the specification in order to consider not only the algebras that satisfy the axioms of the specification, but as well other ones, provided that the differences between the properties satisfied by these algebras and the properties required by the specification (i.e., the axioms) are not "observable". We compare various behavioural approaches developed so far. We point out their respective advantages and limitations. Expressive power is our main criterion for the discussion.
Article
Tese de doutoramento em Informática, área de Fundamentos da Computação, aprovada por unanimidade em provas públicas realizadas na Universidade do Minho This thesis has been partially supported by the LOGCOMP and KARMA projects, under, respectively
Article
Danvy’s functional unparsing problem (Danvy in J. Funct. Program. 8(6), 621–625, 1998) is to implement a type-safe ‘printf’ function, which converts a sequence of heterogeneous arguments to a string according to a given format. The dual problem is to implement a type-safe ‘scanf’ function, which extracts a sequence of heterogeneous arguments from a string by interpreting (Friedman and Wand in LFP, pp. 348–355, 1984 and in Essentials of Programming Languages, MIT Press, 2008) the same format as an equally heterogeneous sequence of patterns that binds zero or more variables. We derive multiple solutions to both problems (Wand in J. ACM 27(1), 164–180, 1980) from their formal specifications (Wand in Theor. Comput. Sci. 20(1), 3–32, 1982). On one hand, our solutions show how the Hindley-Milner type system, unextended, permits accessing heterogeneous sequences with the static assurance of type safety. On the other hand, our solutions demonstrate the use of control operators (Felleisen et al. in Proceedings of the 1988 ACM Conference on Lisp and Functional Programming, pp. 52–62, ACM Press, New York, 1988; Wand in POPL 85: Conference Record of the Annual ACM Symposium on Principles of Programming Languages, vol. 16, ACM Press, New York, 1985; Meyer and Wand in Logics of Programs, Lecture Notes in Computer Science, vol. 193, pp. 219–224, Springer, Berlin, 1985) to communicate with formats as coroutines (Wand in Proceedings of the 1980 ACM Conference on Lisp and Functional Programming, vol. 12, pp. 285–299, ACM Press, New York, 1980 and Haynes et al. in LFP, pp. 293–298, 1984).
Article
The term-generated models of an abstract data type can be represented by congruence relations on the term algebra. Total and partial heterogeneous algebras are considered as models of hierarchical abstract data types.Particular classes of models are studied and it is investigated under which conditions they form a complete lattice. This theory allows also to describe programming languages (and their semantic models) by abstract types. As example we present a simple deterministic stream processing language.
Article
Without Abstract
Article
This is a survey of methods of formalizing semantics of programming languages (algorithmic languages and specification languages). Principal attention is devoted to the logical approach.
Article
The aim of this work is to extend a standard treatment of data types to a foundation for hardware synthesis. Hardware synthesis exposes several problems not typically considered in software oriented theories. These include architectural constraints in the use of type instances, parallelism in the use of multiple instances, and consolidation of distinct types in a common process. Since we are concerned with the question of incorporating (more) concrete implementations of (more) abstract types found in higher levels of specification, our foundation must address these aspects of description. The paper begins with a condensed example of a stack based processor operating on a standard memory. This specification is compared to a target description in which both the stack and the memory are implemented by a single memory process. The remainder of the paper formalizes issues raised in the example.
Article
SETS is an emerging reification calculus for the derivation of implementations of model-oriented specifications of abstract data types. This paper shows how abstraction invariants can be synthesized by calculation in SETS, and the potential of this calculus for assessing, comparing or classifying specifications. The main results of the paper are concerned with a functorial approach to reification, particularly wrt. the systematic implementation of recursive data domains on non-recursive run-time environments. A final example of this class of implementations is provided.
Article
The theory of algebraic module specifications and modular systems was developed initially mainly on the basis of equational algebraic specifications. We show that it is in fact almost independent of what kind of underlying specification framework is chosen. More specifically, we present a formulation where this framework appears as an indexed category or, equivalently, specification frame. The ensuing theory is called the theory of abstract module specifications. We are able to prove main results concerning the correctness and compositionality of abstract module specifications in a purely categorical way, assuming the existence of pushouts of morphisms between abstract specifications that allow model amalgamation, functor extension and/or suitable free constructions. Then, by instantiating the theory of abstract module specifications to the behaviour specification frame in the sense of Nivela and Orejas, we obtain a theory of behaviour module specifications.
Article
Equations occur frequently in mathematics, logic and computer science. In this paper, we survey the main results concerning equations, and the methods available for reasoning about them and computing with them. The survey is self-contained and unified, using traditional abstract algebra. Reasoning about equations may involve deciding if an equation follows from a given set of equations (axioms), or if an equation is true in a given theory. When used in this manner, equations state properties that hold between objects. Equations may also be used as definitions; this use is well known in computer science: programs written in applicative languages, abstract interpreter definitions, and algebraic data type definitions are clearly of this nature. When these equations are regarded as oriented "rewrite rules," we may actually use them to compute. In addition to covering these topics, we discuss the problem of "solving" equations (the "unification" problem), the problem of proving termination of sets of rewrite rules, and the decidability and complexity of word problems and of combinations of equational theories. We restrict ourselves to first-order equations, and do not treat equations which define non-terminating computations or recent work on rewrite rules applied to equational congruence classes.
Article
Full-text available
In the framework of a category spec of equational specifications of abstract data types, implementations are defined to be certain pairs of morphisms with a common target. This concept covers, among others, arbitrary recursion schemes for defining the derived operations. It is shown that for given single steps of a multilevel implementation, there is always a multilevel implementation composed of these steps, but there is no effective construction of this overall implementation. Some suggestions are given for practical composition of implementations utilizing pushouts. Parametric specifications and parameter assignments are defined to be special morphisms in spec, and parameter substitution is made precise by means of pushouts.
Chapter
Full-text available
The paper proposes a unified approach to study and compare specification techniques and languages. It is devided into two parts: (1) A general notion of specification language is given which provides an axiomatic framework for the various known specification techniques. (2) Algebraic specification languages which admit initial semantics are characterized up to equivalence. They are shown to be exactly the implicational languages.
Chapter
Recently there has been a great deal of theoretical interest in formal specifications. However, there has not been a corresponding increase in their use for software development. Meanwhile, there has been significant convergence among formal specification methods intended for practical use. The Larch Project is developing tools and techniques intended to aid in the productive use of formal specifications. This talk presents the combination of ideas, both old and new, that we are currently exploring. One reason why our previous specification methods were not very successful was that we tried to make a single language serve too many purposes. To focus the Larch Project, we made some fairly strong assumptions about the problem we were addressing. Each Larch specification has two parts, written in different languages. Larch interface languages are used to specify program units (e.g., procedures, modules, types). Their semantics is given by translation to predicate calculus. Abstractions appearing in interface specifications are themselves specified algebraically, using the Larch Shared Language. A series of examples will be used to illustrate the use of the Larch Shared Language and the Larch/CLU interface language. The talk will conclude with notes on the key design choices for each of the languages, and for the method of combining the two parts of a specification.
Conference Paper
A machine-implemented system to support the reasoning about algebraic specifications is presented. The PAT-system is an attempt to ease design, analysis, and implementation of partial abstract data types. More precisely, the PAT-system allows to write "axiomatic abstract types", i.e. parameterised hierarchical algebraic specifications, as well as "domain types", i.e. abstract types defined by domain equations, introduces automatically the semantic conventions for the theory of partial abstract types including axioms for strictness (of partial functions) and for the validity of data type induction, facilitates proofs of derived properties: PAT provides (semiautomatic) strategies for using derived rules of inference as well as for simplifying conditional equations. It allows to use a metalanguage — Edinburgh-ML /LCF 79/ — for generating and performing proofs interactively; makes first attempts for analysing algebraic specifications by checking sufficient conditions for the existence of initial algebras (of hierachical specifications and/or parameterised specifications — for nonhierarchical and nonparameterised specifications initial algebras always exist) and for the existence of weakly terminal algebras, supports development and proof of correctness of implementations; in particular it is possible to verify implementations of "axiomatic types" by "domain types". The PAT-system is implemented in Edinburgh-ML being part of an interactive verification system, Edinburgh-LCF, which seems particularly appropriate to support proofs with algebraic specifications. The system PAT tries to use as much as possible the facilities and properties of the underlying Edinburgh-LCF system. Only necessary changes — such as "smash" product instead of "cartesian" product — and extensions — such as the introduction of certain induction schemata — are made. A short characterisation of LCF and a description of the PAT-system is given. The PAT-system is shortly compared with other systems manipulating algebraic specifications. Finally, as an example for the reasoning with and about algebraic specifications priority queues over linearly ordered data types are described as a parameterised abstract type, PQ.
Chapter
Without Abstract
Conference Paper
The algebraic specification of abstract data types provides a number of features for structuring specifications in order to make them easier to write, to read, to understand, and to maintain. Among the most important such features are different kinds of extensions, based on initial, final, or behavioural semantics. This paper studies a new kind of extension called key extension, and its final algebra semantics. Key extensions model one of the essential steps in database specification where abstract object types are to be specified on the basis of given abstract data types. The intended standard semantics is a universe of "possible objects" that provides the basis for further database concepts like situations, states, etc. It is shown under which conditions final algebras exist that can serve as a natural standard semantics for key extensions. We also characterize rather a large class of constraints that can be used for keys in accordance with our semantics.
Conference Paper
This paper aims to show that, in order to capture a quite relevant feature such as the recursiveness of abstract data types, Model Theory works better than Category Theory. First, various categorial notions such as "initiality", "finality", "monoinitiality", "epifinality", "weak monoinitiality" and "weak epifinality" are analyzed, from a model theoretic point of view, as regards the "abstractness" and the "cardinality" of the models they determine. In particular, countability is seen as a necessary condition to get recursive data types, and it is shown that only "initiality", "monoinitiality", "epifinality" and "weak epifinality" allow to select countable models. An extensive analysis is then devoted to the problem of the recursiveness of abstract data types: we provide a formal definition of recursiveness and show that it neither collapses, nor it is incompatible with the "abstractness" requirement. We also show that none of the above quoted categorial notions captures recursiveness. Finally, we consider our own definition of abstract data type, based on model-theoretic notions; we analyze this definition in the frame of the proposed formalization of recursiveness, and illustrate the sense according to which it captures recursiveness.
Conference Paper
A new concept for the implementation of abstract data types is proposed: Given algebraic specifications SPECO and SPEC1 of abstract data types ADTO and ADT1 an implementation of ADTO by ADT1 is defined separately on the syntactical level of specifications and on the semantical level of algebras. This concept is shown to satisfy a number of conceptual requirements for the implementation of abstract data types. Several correctness criteria are given and illustrating examples are provided.
Chapter
Term algebras have been widely used in the theory of abstract data types. Here, the concept of canonical term algebra is generalized to the notion of canonical term functor, which is useful for various aspects of abstract data type specifications. In particular, we show how canonical term functors provide a constraint mechanism in loose specifications and how they constitute a junction between axiomatic and constructive approaches. These concepts are the semantic base for the specification development language ASPIK which has been implemented as a core component of an integrated software development and verification system.
Chapter
The paper proposes an axiomatic approach to semantics of specification languages. It introduces the notion of a semantical system as a framework to discuss and compare various approaches to specification of (algebraic) data types and to spell out their underlying assumptions. For various of those assumptions we present complete specification languages or show that existing specification languages are complete. Initial and final semantics are characterized as special cases of our unifying concept of semantical systems which admit D-free structures.
Chapter
An induction principle, called context induction, is presented which is appropriate for the verification of behavioural properties of abstract data types. The usefulness of the proof principle is documented by several applications: the verification of behavioural theorems over a behavioural specification, the verification of behavioural implementations and the verification of "forget-restrict-identify" implementations. In particular it is shown that behavioural implementations and "forget-restrict-identify" implementations (under certain assumptions) can be characterized by the same context condition, i.e. (under the given assumptions) both concepts are equivalent. This leads to the suggestion to use context induction as a uniform proof method for correctness proofs of formal implementations.
Chapter
Data reification normally involves the explicit positing of an abstraction function with certain properties. However, the condition for one definition to reify another only requires that a function with such properties should exist. This suggests that it may be possible to carry through a data reification without giving an explicit definition of the abstraction function at all. This paper explores this possibility and compares it with the more conventional approach.
Article
A formal technique for incorporating two specification paradigms is presented in which an algebraic specification is implemented by a set of abstract procedures specified in pre- and post-condition style. The link between the two level specifications is provided via a translation from terms of algebraic specifications into temporal logic formulae representing abstract programs. In terms of translation, a criterion for an abstract implementation satisfying its specification is given, which allows one to check the consistency between the two levels of specifications. The abstract implementations can be refined into executable code by refining each abstract procedure in it. It is proved that the satisfication relation between a specification and its implementations is preserved by such refinement steps.
Article
Full-text available
A system of rules for transforming programs is described, with the programs in the form of recursion equations. An initially very simple, lucid, and hopefully correct program is transformed into a more efficient one by altering the recursion structure. Illustrative examples of program transformations are given, and a tentative implementation is described. Alternative structures for programs are shown, and a possible initial phase for an automatic or semiautomatic program-manipulation system is indicated.
Article
One reason for the recent interest in ″abstract″ data types is their extensions of structured programming ideas for control to data, by permitting the user to define new data types and then use them as part of the language. From a top-down structured development point of view, one can write a high-level program assuming whatever data types (and operations upon them) are convenient, and then provide them later using other data types, which are provided still later, etc. (For a simple example, provide push-down-of-sets-of-lists assuming sets-of-lists, etc. ). Moreover, with abstract data types one can provide either (1) quick to program but inefficient implementations or (2) more complex but efficient implementations, depending on the situation; one is not limited to an implementation provided by the compiler. ″Abstract″ means that the details of the implementation are truly internal to the data type: one is not allowed to use anything except the explicit operations provided for the type; thus one can later improve an implementation without having to change any code using it. It is shown that the algebraic approach is more powerful than the logical and that equations and initiality can do what formula cannot.
Article
In this paper, the term “data type” is intended to include both the items of data (of that type) and the permissible operations upon them (such as selectors, boolean tests for non-triviality and the like); this idea is developed (informally) in Knuth (1968), Dahl and Nygard (1966), and Liskow and Zilles (1974) among other places. The starting point for the algebraic approach is to realize that the data representations together with the operations on them constitute an algebra. But the really interesting point is that this algebra is in some sense free, that is, it is determined (up to isomorphism) by the operations, plus some equations; Zilles (1975) seems to have been the first to use this observation. Goguen, Thatcher, Wagner and Wright† (1975) gave a particularly clean formulation using their (1973) notion of many-sorted algebra and their machinery of initial algebra semantics (1974), with applications to proving correctness of both implementations and abstract types. Zilles (1975A) has developed a notion of “data algebra” along similar lines. This paper is intended to argue that many problems can be handled in a still more satisfactory way with algebraic theories, than with just algebras.
Article
Many of the basic theorems about general “algebras” derived in [1, Ch. 6] are extended to a class of heterogeneous algebras which includes automata, state machines, and monoids acting on sets. It is shown that some algebras can be fruitfully studied, using different interpretations, both as (homogeneous) algebras and as heterogeneous algebras, and a non-trivial “free machine” is constructed as an application. The extent of the overlap with previous work of Higgins [9] is specified.
Article
The notion algebraic theory was introduced by Lawvere in 1963 (cf. S. Eilenberg and J. B. Wright, Automata in general algebras, Information and Control 11 (1967) 4) to study equationally definable classes of algebras from a more intrinsic point of view. We make use of it to study Turing machines and machines with a similar kind of control at a level of abstraction which disregards the nature of ‘storage’ or ‘external memory’.
Article
Many apparently divergent approaches to specifying formal semantics of programming languages are applications of initial algebra semantics. In this paper an overview of initial algebra semantics is provided. The major technical feature is an initial continuous algebra which permits unified algebraic treatment of iterative and recursive semantic features in the same framework as more basic operations.
Article
Behavior is left adjoint to minimal realization, as functors between certain categories of machines and behaviors. This gives a succinct characterization of minimal realization valid for discrete as well as linear machines, with or without finiteness condition. Realization theory is therefore expressed in contemporary algebra in a way which reveals its inner structure and suggests generalizations. An adjunction between regular sets and finite state acceptors follows as a corollary.
Article
Meaning may be assigned to a string in a context-free language by defining attributes of the symbols in a derivation tree for that string. The attributes can be defined by functions associated with each production in the grammar. This paper examines the implications of this process when some of the attributes are synthesized, i.e., defined solely in terms of attributes of thedescendants of the corresponding nonterminal symbol, while other attributes are inherited, i.e., defined in terms of attributes of theancestors of the nonterminal symbol. An algorithm is given which detects when such semantic rules could possibly lead to circular definition of some attributes. An example is given of a simple programming language defined with both inherited and synthesized attributes, and the method of definition is compared to other techniques for formal specification of semantics which have appeared in the literature.
Conference Paper
Subtree replacement systems form a broad class of tree-manipulating systems. Systems with the “Church-Rosser property” are appropriate for evaluation or translation processes: the end result of a complete sequence of applications of the rules does not depend on the order in which the rules were applied. Theoretical and practical advantages of such flexibility are sketched. Values or meanings for trees can be defined by simple mathematical systems and then computed by the cheapest available algorithm, however intricate that algorithm may be. We derive sufficient conditions for the Church-Rosser property and discuss their applications to recursive definitions, to the lambda calculus, and to parallel programming. Only the first application is treated in detail. We extend McCarthy's recursive calculus by allowing a choice between call-by-value and call-by-name. We show that recursively defined functions are single-valued despite the nondeterminism of the evaluation algorithm. We also show that these functions solve their defining equations in a “canonical” manner.
Article
Program transformations often involve the generalization of a function to take additional arguments. It is shown that in many cases such an additional variable arises as a representation of the continuation or global context in which the function is evaluated. By considering continuations, local transformation strategies can take advantage of global knowledge. The general results are followed by two examples: the alpha - beta tree pruning algorithm and an algorithm for the conversion of a propositional formula to conjunctive normal form.
Article
We define a general class of tree-manipulating systems that includes many of the special cases from logic, linguistics, and automata theory. Systems possessing what we call the “Church-Rosser property” are appropriate for evaluation or translation processes: the end result of a complete sequence of applications of the rules does not depend on the order in which the rules were applied. We sketch the theoretical and practical advantages of such flexibility. We derive general sufficient conditions for the Church-Rosser property and apply them to some important tree-manipulating systems. Applications include tree transducers, the McCarthy formalism for recursive computation, and the classical Church-Rosser Theorem for the full lambda-calculus.
Article
A method for describing and structuring programs that simplifies proofs of their correctness is presented. The method formally represents a program in terms of levels of abstraction, each level of which can be described by a self-contained nonprocedural specification. The proofs, like the programs, are structured by levels. Although only manual proofs are described in the paper, the method is also applicable to semi-automatic and automatic proofs. Preliminary results are encouraging, indicating that the method can be applied to large programs, such as operating systems.
Article
A data abstraction can be naturally specified using algebraic axioms. The virtue of these axioms is that they permit a representation-independent formal specification of a data type. An example is given which shows how to employ algebraic axioms at successive levels of implementation. The major thrust of the paper is twofold. First, it is shown how the use of algebraic axiomatizations can simplify the process of proving the correctness of an implementation of an abstract data type. Second, semi-automatic tools are described which can be used both to automate such proofs of correctness and to derive an immediate implementation from the axioms. This implementation allows for limited testing of programs at design time, before a conventional implementation is accomplished.
Article
A powerful method of simplifying the proofs of program correctness is suggested; and some new light is shed on the problem of functions with side-effects.
Article
Vita. Thesis (Ph. D.)--University of Toronto, 1975. Includes bibliographical references (leaves 144-149). Microfiche of typescript.
Conference Paper
This paper presents a formulation, within the framework of initial algebra semantics, of Knuthian semantic systems (K-systems) which contain both synthesized and inherited attributes. This formulation permits a precise definition of K-systems, and combines their intuitive appeal with the theoretical power of algebraic methods. The basic approach consists of algebraically specifying the semantic portion of a given K-system, converting this K-system into another equivalent one which contains only synthesized attributes, and then defining the new equivalent K-system by means of an algebraic formulation. The practical implications of the algebraic definition of K-systems are discussed, and the combined use of Knuth's original formulation and the algebraic approach for the development of semantic definitions is advocated.
Conference Paper
In a wide variety of situations, computer science has found it convenient to define complex object as (fixed-point) solutions of certain equations. This has been done in both algebraic and order-theoretic settings, and has often been contrasted with other approaches. This paper shows how to formulate such solutions in a setting which encompasses both algebraic and order-theoretic aspects, so that the advantages of both worlds are available. Moreover, we try to show how this is consistent with other approaches to defining complex objects, through a number of applications, including: languages defined by context-free grammars; flow charts and their interpretations; and monadic recursive program schemes. The main mathematical results concern free rational theories and quotients of rational theories. However, the main goal has been to open up what we believe to be a beautiful and powerful new approach to the syntax and semantics of complex recursive specifications.
A transformation programs
  • R M Burstall
R. M. BURSTALL AND J. DARLINGTON, A transformation programs, J. Assoc. Comput. Mach. 24 (1977), 4467.
An Introduction to Categories, Algebraic Theories, and Algebras
  • J.A. Goguen
  • J.W. Thatcher
  • E.G. Wagner
  • J.B. Wright
  • J.A. Goguen
  • J.W. Thatcher
  • E.G. Wagner
  • J.B. Wright
By Lemma 2, to get a morphism 5: A -+ W, we must show that rlu$ ry factors through 7 wA. Since the 7's are in the category of sets, we need only
  • Now
Now, let A be any object of Ki. By Lemma 2, to get a morphism 5: A -+ W, we must show that rlu$ ry factors through 7 wA. Since the 7's are in the category of sets, we need only
Furthermore, if f E TAR&l, a), it is easy to show from the axioms for TARR that the partial function W(f) is defined at just those integers j such that in TARR , val[f, nj] = n, for some k, and that for any other j
  • First
First, it is straightforward to check that W is an object of KC. Furthermore, if f E TAR&l, a), it is easy to show from the axioms for TARR that the partial function W(f) is defined at just those integers j such that in TARR, val[f, nj] = n, for some k, and that for any other j, val[f, nj] = undefined.
An initial algebra approach to the specifica-tion, correctness, and implementation of abstract data types, in " Current Trends in Pro-gramming Methodology, IV, Data Structuring A Junction between Computer Science and Category Theory: I, Basic Definitions and Examples
  • J Goguen
  • J W Thatcher
  • E G And
  • Wagnerr
  • J A Yeh Il
  • J W Goguen
  • E G Thatcher
  • And J B Wagner
  • Wright
J..4. GOGUEN, J. W. THATCHER, AND E. G. WAGNER, An initial algebra approach to the specifica-tion, correctness, and implementation of abstract data types, in " Current Trends in Pro-gramming Methodology, IV, Data Structuring " (R. Yeh, Ed.), pp. 80-149, Prentice-Hall, Englewood Cliffs, N. J., 1978. Il. J. A. GOGUEN, J. W. THATCHER, E. G. WAGNER, AND J. B. WRIGHT, " A Junction between Computer Science and Category Theory: I, Basic Definitions and Examples, " Part I, IBM Research Report RC 4526, 1973; Part 2, IBM Research Report RC 5908, 1976.
An Introduction to Categories, Algebraic Theories, and Algebras
  • Goguen