39 research outputs found
Recommended from our members
Category theory : definitions and examples
Category theory was invented as an abstract language for describing certain structures and constructions which repeatedly occur in many branches of mathematics, such as topology, algebra, and logic. In recent years, it has found several applications in computer science, e.g., algebraic specification, type theory, and programming language semantics. In this paper, we collect definitions and examples of the basic concepts in category theory: categories, functors, natural transformations, universal properties, limits, and adjoints
Some fundamental algebraic tools for the semantics of computation: Part 3. indexed categories
AbstractThis paper presents indexed categories which model uniformly defined families of categories, and suggests that they are a useful tool for the working computer scientist. An indexed category gives rise to a single flattened category as a disjoint union of its component categories plus some additional morphisms. Similarly, an indexed functor (which is a uniform family of functors between the components categories) induces a flattened functor between the corresponding flattened categories. Under certain assumptions, flattened categories are (co)complete if all their components are, and flattened functors have left adjoints if all their components do. Several examples are given. Although this paper is Part 3 of the series âSome fundamental algebraic tools for the semantics of computationâ, it is entirely independent of Parts 1 and 2
Applications of Category Theory to Programming and Program Specification
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
Specification, horizontal composition and parameterization of algebraic implementations
Loose specifications of abstract data types (ADTs) have many non-isomorphic algebras as models. An implementation between two loose Specifications should therefore consider many abstraction functions together with their source and target algebras. Just like specifications are stepwise refined to restrict their class of models, implementations should be stepwise refinable to restrict the class of abstraction functions. In this scenario specifications and implementations can be developed interwovenly.
We suggest to have implementation specifications analogously to loose ADT specifications: Implementations have signatures, models, axioms and sentences thus constituting an institution. Implementation specifications are the theories of this institution and refinements between implementation specifications are its theory morphisms.
In this framework, implementations between parameterized specifications and horizontal composition of implementations turn out to be special cases of the more powerful concept of parameterized implementations, which allow to instantiate an implementation by substituting a subimplementation by another implementation
Semantics, Implementation and Pragmatics of Clear, a Program Specification Language
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
Recommended from our members
Algebraic specification : syntax, semantics, structure
Algebraic specification is the technique of using algebras to model properties of a system and using axioms to characterize such algebras. Algebraic specification comprises two aspects: the underlying logic used in the axioms and algebras, and the use of a small, general set of operators to build specifications in a structured manner. We describe these two aspects using the unifying notion of institutions. An institution is an abstraction of a logical system, describing the vocabulary, the kinds of axioms, the kinds of algebras, and the relation between them. Using institutions, one can define general structuring operators which are independent of the underlying logic. In this paper, we survey the different kind of logics, syntax, semantics, and structuring operators that have been used in algebraic specification
Recommended from our members
Second-Order Algebraic Theories
Second-order universal algebra and second-order equational logic respectively provide a model theory
and a formal deductive system for languages with variable binding and parameterised metavariables.
This dissertation completes the algebraic foundations of second-order languages from the viewpoint of
categorical algebra.
In particular, the dissertation introduces the notion of second-order algebraic theory. A main role in
the definition is played by the second-order theory of equality M, representing the most elementary
operators and equations present in every second-order language. We show that M can be described
abstractly via the universal property of being the free cartesian category on an exponentiable object.
Thereby, in the tradition of categorical algebra, a second-order algebraic theory consists of a cartesian
category M and a strict cartesian identity-on-objects functor M: M âM that preserves the universal
exponentiable object of M.
At the syntactic level, we establish the correctness of our definition by showing a categorical equivalence
between second-order equational presentations and second-order algebraic theories. This equivalence,
referred to as the Second-Order Syntactic Categorical Type Theory Correspondence, involves distilling
a notion of syntactic translation between second-order equational presentations that corresponds to the canonical notion of morphism between second-order algebraic theories. Syntactic translations provide a mathematical formalisation of notions such as encodings and transforms for second-order languages.
On top of the aforementioned syntactic correspondence, we furthermore establish the Second-Order
Semantic Categorical Type Theory Correspondence. This involves generalising Lawvereâs notion of
functorial model of algebraic theories to the second-order setting. By this semantic correspondence,
second-order functorial semantics is shown to correspond to the model theory of second-order universal algebra.
We finally show that the core of the theory surrounding Lawvere theories generalises to the second order as well. Instances of this development are the existence of algebraic functors and monad morphisms in the second-order universe. Moreover, we define a notion of translation homomorphism that allows us to establish a 2-categorical type theory correspondence