Results

**11 - 19**of**19**### Abstract Composing Monads Using Coproducts

"... Monads are a useful abstraction of computation, as they model diverse computational effects such as stateful computations, exceptions and I/O in a uniform manner. Their potential to provide both a modular semantics and a modular programming style was soon recognised. However, in general, monads prov ..."

Abstract
- Add to MetaCart

(Show Context)
Monads are a useful abstraction of computation, as they model diverse computational effects such as stateful computations, exceptions and I/O in a uniform manner. Their potential to provide both a modular semantics and a modular programming style was soon recognised. However, in general, monads proved difficult to compose and so research focused on special mechanisms for their composition such as distributive monads and monad transformers. We present a new approach to this problem which is general in that nearly all monads compose, mathematically elegant in using the standard categorical tools underpinning monads and computationally expressive in supporting a canonical recursion operator. In a nutshell, we propose that two monads should be composed by taking their coproduct. Although abstractly this is a simple idea, the actual construction of the coproduct of two monads is non-trivial. We outline this construction, show how to implement the coproduct within Haskell and demonstrate its usage with a few examples. We also discuss its relationship with other ways of combining monads, in particular distributive laws for monads and monad transformers.

### Algebraic Operations and Generic Effects

"... Set, the corresponding monads being given by finite non-empty subsets, finite distributions, and the monads (- + ..."

Abstract
- Add to MetaCart

Set, the corresponding monads being given by finite non-empty subsets, finite distributions, and the monads (- +

### Nordic Journal of Computing 13(2006), 1–20. STRUCTURED FORMAL DEVELOPMENT IN ISABELLE

"... Abstract. General purpose theorem provers provide advanced facilities for proving properties about specifications, and may therefore be a valuable tool in formal program development. However, these provers generally lack many of the useful structuring mechanisms found in functional programming or sp ..."

Abstract
- Add to MetaCart

(Show Context)
Abstract. General purpose theorem provers provide advanced facilities for proving properties about specifications, and may therefore be a valuable tool in formal program development. However, these provers generally lack many of the useful structuring mechanisms found in functional programming or specification languages. This paper presents a constructive approach to adding theory morphisms and parametrisation to theorem provers, while preserving the proof support and consistency of the prover. The approach is implemented in Isabelle and illustrated by examples of an algorithm design rule and of the modular development of computational effects for imperative language features based on monads.

### Modular Modelling with Monads

, 2005

"... monads, which are used to model diverse computational effects (such as stateful computations, exceptional behaviour or non-determinism). This goes back to Moggi [6], and is for example used to great effect in the pure functional language Haskell [8, 11]. In this talk, we use the same technique to mo ..."

Abstract
- Add to MetaCart

(Show Context)
monads, which are used to model diverse computational effects (such as stateful computations, exceptional behaviour or non-determinism). This goes back to Moggi [6], and is for example used to great effect in the pure functional language Haskell [8, 11]. In this talk, we use the same technique to model computational effects in higher-order logic, and in particular the theorem prover Isabelle [7], thus shallowly embedding a small imperative language embedded shallow into Isabelle. The talk consists of three parts: we first recall the basic notions of monads, then show how the imperative language is built from three basic ingredients, and finally discuss the implementation. Monads A monad is the categorical modelling of an algebraic theory (that is, a set of operations and equations on them). One attraction of monads is that they come with a rich categorical model theory, giving a uniform treatment of both algebras and terms. The latter are given by the Kleisi category of a monad; this is where the computations modelled by the monad live. An adjunction

### Formal Software Development: From Foundations to Tools

"... This exposé gives an overview of the author’s contributions to the area of formal software development. These range from foundational issues dealing with abstract models of computation to practical engineering issues concerned with tool integration and user interface design. We can distinguish three ..."

Abstract
- Add to MetaCart

(Show Context)
This exposé gives an overview of the author’s contributions to the area of formal software development. These range from foundational issues dealing with abstract models of computation to practical engineering issues concerned with tool integration and user interface design. We can distinguish three lines of work: Firstly, there is foundational work, centred around categorical models of rewriting. A new semantics for rewriting is developed, which abstracts over the concrete term structure while still being able to express key concepts such as variable, layer and substitution. It is based on the concept of a monad, which is well-known in category theory to model algebraic theories. We generalise this treatment to term rewriting systems, infinitary terms, term graphs, and other forms of rewriting. The semantics finds applications in functional programming, where monads are used to model computational features such as state, exceptions and I/O, and modularity proofs, where

### Presheaf models for the π-calculus

- In Proc. CTCS’97, volume 1290 of LNCS
, 1997

"... Abstract. The finite π-calculus has an explicit set-theoretic functor-category model that is known to be fully abstract for strong late bisimulation congruence. We characterize this as the initial free algebra for an appropriate set of operations and equations in the enriched Lawvere theories of Plo ..."

Abstract
- Add to MetaCart

(Show Context)
Abstract. The finite π-calculus has an explicit set-theoretic functor-category model that is known to be fully abstract for strong late bisimulation congruence. We characterize this as the initial free algebra for an appropriate set of operations and equations in the enriched Lawvere theories of Plotkin and Power. Thus we obtain a novel algebraic description for models of the π-calculus, and validate an existing construction as the universal such model. The algebraic operations are intuitive, covering name creation, communication of names over channels, and nondeterminism; the equations then combine these features in a modular fashion. We work in an enriched setting, over a “possible worlds ” category of sets indexed by available names. This expands significantly on the classical notion of algebraic theories, and in particular allows us to use nonstandard arities that vary as processes evolve. Based on our algebraic theory we describe a category of models for the π-calculus, and show that they all preserve bisimulation congruence. We develop a direct construction of free models in this category; and generalise previous results to prove that all free-algebra models are fully abstract. 1

### Monad Combinators, Non-Determinism and Probabilistic Choice [Extended abstract]

"... We test Lüth and Ghani’s proposal [11, 12, 13] to use coproducts of monads as a basis for modularity by applying their ideas to Varacca’s work [20] on combining non-determinism and probabilistic choice. In particular, we discuss i) the coproduct of non-determinism and probabilistic choice; ii) how m ..."

Abstract
- Add to MetaCart

(Show Context)
We test Lüth and Ghani’s proposal [11, 12, 13] to use coproducts of monads as a basis for modularity by applying their ideas to Varacca’s work [20] on combining non-determinism and probabilistic choice. In particular, we discuss i) the coproduct of non-determinism and probabilistic choice; ii) how monad compositions based upon distributivity possess a universal property; and iii) Capretta’s [4] treatment of looping as an effect. We take advantage of the fact that all three effects are usefully modelled by ideal monads. 1

### Languages, Theory

"... Recently there has been a great deal of interest in higherorder syntax which seeks to extend standard initial algebra semantics to cover languages with variable binding by using functor categories. The canonical example studied in the literature is that of the untyped λ-calculus which is handled as ..."

Abstract
- Add to MetaCart

(Show Context)
Recently there has been a great deal of interest in higherorder syntax which seeks to extend standard initial algebra semantics to cover languages with variable binding by using functor categories. The canonical example studied in the literature is that of the untyped λ-calculus which is handled as an instance of the general theory of binding algebras, cf. Fiore, Plotkin, Turi [8]. Another important syntactic construction is that of explicit substitutions. The syntax of a language with explicit substitutions does not form a binding algebra as an explicit substitution may bind an arbitrary number of variables. Nevertheless we show that the language given by a standard signature Σ and explicit substitutions is naturally modelled as the initial algebra of the endofunctor Id + FΣ ◦ + ◦ on a functor category. We also comment on the apparent lack of modularity in syntax with variable binding as compared to first-order languages. Categories and Subject Descriptors