To save content items to your account,
please confirm that you agree to abide by our usage policies.
If this is the first time you use this feature, you will be asked to authorise Cambridge Core to connect with your account.
Find out more about saving content to .
To save content items to your Kindle, first ensure no-reply@cambridge.org
is added to your Approved Personal Document E-mail List under your Personal Document Settings
on the Manage Your Content and Devices page of your Amazon account. Then enter the ‘name’ part
of your Kindle email address below.
Find out more about saving to your Kindle.
Note you can select to save to either the @free.kindle.com or @kindle.com variations.
‘@free.kindle.com’ emails are free but can only be saved to your device when it is connected to wi-fi.
‘@kindle.com’ emails can be delivered even when you are not connected to wi-fi, but note that service fees apply.
The previous three chapters have introduced some basic elements of the theory of coalgebras, focusing on coalgebraic system descriptions, homomorphisms, behaviour, finality and bisimilarity. So far, only relatively simple coalgebras have been used, for inductively defined classes of polynomial functors, on the category Sets of sets and functions. This chapter will go beyond these polynomial functors and will consider other examples. But more important, it will follow a different, more systematic approach, relying not on the way functors are constructed but on the properties they satisfy – and work from there. Inevitably, this chapter will technically be more challenging, requiring more categorical maturity from the reader.
The chapter starts with a concrete description of two new functors, namely the multiset and distribution functors, written as M and D, respectively. As we shall see, on the one hand, from an abstract point of view, they are much like powerset P, but on the other hand they capture different kinds of computation: D is used for probabilistic computation and M for resourcesensitive computation.
Subsequently, Sections 4.2–4.5 will take a systematic look at relation lifting – used in the previous chapter to define bisimulation relations. Relation lifting will be described as a certain logical operation, which will be developed on the basis of a moderate amount of categorical logic, in terms of so-called factorisation systems. This will give rise to the notion of ‘logical bisimulation’ in Section 4.5. It is compared with several alternative formulations. For weak pullback-preserving functors on Sets these different formulations coincide. With this theory in place Section 4.6 concentrates on the existence of final coalgebras. Recall that earlier we skipped the proof of Theorem 2.3.9, claiming the existence of final coalgebras for finite Kripke polynomial functors. Here we present general existence results, for ‘bounded’ endofunctors on Sets. Finally, Section 4.7 contains another characterisation of simple polynomial functors in terms of size and preservation properties. It also contains a characterisation of more general ‘analytical’ functors, which includes for instance the multiset functor M.
Multiset and Distribution Functors
A set is a collection of elements. Such an element, if it occurs in the set, occurs only once. This sounds completely trivial. But one can imagine situations in which multiple occurrences of the same element can be relevant.
Mathematics is about the formal structures underlying counting, measuring, transforming etc. It has developed fundamental notions like number systems, groups, vector spaces (see e.g. [345]) and has studied their properties. In more recent decades also ‘dynamical’ features have become a subject of research. The emergence of computers has contributed to this development. Typically, dynamics involves a ‘state of affairs’, which can possibly be observed and modified. For instance, the contents of a tape of a Turing machine contribute to its state. Such a machine may thus have many possible states and can move from one state to another. Also, the combined contents of all memory cells of a computer can be understood as the computer's state. A user can observe part of this state via the screen (or via the printer) and modify this state by typing commands. In reaction, the computer can display certain behaviour. Describing the behaviour of such a computer system is a non-trivial matter. However, formal descriptions of such complicated systems are needed if we wish to reason formally about their behaviour. Such reasoning is required for the correctness or security of these systems. It involves a specification describing the required behaviour, together with a correctness proof demonstrating that a given implementation satisfies the specification.
Both mathematicians and computer scientists have introduced various formal structures to capture the essence of state-based dynamics, such as automata (in various forms), transition systems, Petri nets and event systems. The area of coalgebra has emerged within theoretical computer science with a unifying claim. It aims to be the mathematics of computational dynamics. It combines notions and ideas from the mathematical theory of dynamical systems and from the theory of state-based computation. The area of coalgebra is still in its infancy but promises a perspective on uniting, say, the theory of differential equations with automata and process theory and with biological and quantum computing, by providing an appropriate semantical basis with associated logic. The theory of coalgebras may be seen as one of the original contributions stemming from the area of theoretical computer science.
To begin the study of data structures, I demonstrate the usefulness of even quite simple structures by working through a detailed motivating example. We shall afterward come back to the basics and build up our body of knowledge incrementally.
The algorithm presented in this introduction is due to R. S. Boyer and J S. Moore and solves the string matching problem in a surprisingly efficient way. The techniques, although sophisticated, do not require any advanced mathematical tools for their understanding. It is precisely because of this simplicity that the algorithm is a good example of the usefulness of data structures, even the simplest ones. In fact, all that is needed to make the algorithm work are two small arrays storing integers.
There are two sorts of algorithms that, when first encountered, inspire both perplexity and admiration. The first is an algorithm so complicated that one can hardly imagine how its inventors came up with the idea, triggering a reaction of the kind, “How could they think of that?” The other possibility is just the opposite – some flash of ingeniousity that gives an utterly simple solution, leaving us with the question, “How didn't I think of that?” The Boyer–Moore algorithm is of this second kind.
We encounter on a daily basis instances of the string matching problem, defined generically as follows: given a text T = T[1]T[2] · · · T[n] of length n characters and a string S = S[1]S[2] · · · S[m] of length m, find the (first, or all) location(s) of S in T, if one appears there at all. In the example of Figure 1.1, the string S = TRYME is indeed found in T, starting at position 22.
To solve the problem, we imagine that the string is aligned underneath the text, starting with both text and string left justified. One can then compare corresponding characters, until a mismatch is found, which enables us to move the string forward to a new potential matching position. We call this the naive approach. It should be emphasized that our discourse of moving the pattern along an imaginary sliding path is just for facilitating understanding.
In this paper, we study the problem of adaptive position tracking for a multi-link robot driven by two opposing pneumatic muscle groups with additive disturbances. In contrast to widely used sliding mode control methods, the proposed controller is continuous and able to prevent chattering. All physical parameters of the robot and the pneumatic muscles, including pneumatic muscle coefficients, link lengths and moments of inertia are unknown and can be time-varying and the unknown additive disturbances can be discontinuous. Under these conditions, we prove that closed-loop trajectories of all of the joint positions can track any C1 joint reference signal. The joint errors will be within a prescribed error bound in a finite time. The adaptive controller only uses the reference signal, not its derivative. The continuous adaptive gain is one-dimensional. Simulations including a two-link robot arm with friction and realistic muscle models are presented to demonstrate the robustness of the adaptive control under severe changes of the system parameters. In all simulations, the joint positions can track C1 trajectories and all errors are within the prescribed error bound in the same time frame, even though the muscle parameters are vastly different.
A skeleton of the category with finite coproducts${\cal D}$ freely generated by a single object has a subcategory isomorphic to a skeleton of the category with finite products ${\cal C}$ freely generated by a countable set of objects. As a consequence, we obtain that ${\cal D}$ has a subcategory equivalent with ${\cal C}$. From a proof-theoretical point of view, this means that up to some identifications of formulae the deductions of pure conjunctive logic with a countable set of propositional letters can be represented by deductions in pure disjunctive logic with just one propositional letter. By taking opposite categories, one can replace coproduct by product, i.e., disjunction by conjunction, and the other way round, to obtain the dual results.
A huge discrepancy between theory and practice exists in one popular application area of functional programming – spreadsheets. Although spreadsheets are the most frequently used (functional) programs, they fall short of the quality level that is expected of functional programs, which is evidenced by the fact that existing spreadsheets contain many errors, some of which have serious impacts. We have developed a template specification language that allows the definition of spreadsheet templates that describe possible spreadsheet evolutions. This language is based on a table calculus that formally captures the process of creating and modifying spreadsheets. We have developed a type system for this calculus that can prevent type, reference, and omission errors from occurring in spreadsheets. On the basis of the table calculus we have developed Gencel, a system for generating reliable spreadsheets. We have implemented a prototype version of Gencel as an extension of Excel.
Lisp programmers have long used macros to extend their language. Indeed, their success has inspired macro notations for a variety of other languages, such as C and Java. There is, however, a paucity of effective pedagogic examples of macro use. This paper presents a short, non-trivial example that implements a construct not already found in mainstream languages. Furthermore, it motivates the need for tail-calls, as opposed to mere tail-recursion, and illustrates how support for tail-call optimization is crucial to support a natural style of macro-based language extension.
The Theory of Contexts is a type-theoretic axiomatization aiming to give a metalogical account of the fundamental notions of variable and context as they appear in Higher Order Abstract Syntax. In this paper, we prove that this theory is consistent by building a model based on functor categories. By means of a suitable notion of forcing, we prove that this model validates Classical Higher Order Logic, the Theory of Contexts, and also (parametrised) structural induction and recursion principles over contexts. Our approach, which we present in full detail, should also be useful for reasoning on other models based on functor categories. Moreover, the construction could also be adopted, and possibly generalized, for validating other theories of names and binders.