Results 1  10
of
18
Modular Tree Automata
"... Abstract. Tree automata are traditionally used to study properties of tree languages and tree transformations. In this paper, we consider tree automata as the basis for modular and extensible recursion schemes. We show, using wellknown techniques, how to derive from standard tree automata highly mo ..."
Abstract

Cited by 7 (6 self)
 Add to MetaCart
(Show Context)
Abstract. Tree automata are traditionally used to study properties of tree languages and tree transformations. In this paper, we consider tree automata as the basis for modular and extensible recursion schemes. We show, using wellknown techniques, how to derive from standard tree automata highly modular recursion schemes. Functions that are defined in terms of these recursion schemes can be combined, reused and transformed in many ways. This flexibility facilitates the specification of complex transformations in a concise manner, which is illustrated with a number of examples. 1
Modular monadic metatheory
"... This paper presents 3MT, a framework for developing modular mechanized metatheory of languages with effects. Using 3MT, individual language features and their corresponding definitions – semantic functions, theorem statements and proofs – can be built separately and then reused to create different ..."
Abstract

Cited by 5 (0 self)
 Add to MetaCart
This paper presents 3MT, a framework for developing modular mechanized metatheory of languages with effects. Using 3MT, individual language features and their corresponding definitions – semantic functions, theorem statements and proofs – can be built separately and then reused to create different languages with fully mechanized metatheory. 3MT tackles the multifaceted problem of modularity in this setting by combining modular datatypes and monads to define effectful semantic functions on a perfeature basis, without fixing a particular set of effects or language constructs. The main challenge that 3MT addresses is how to modularize the theorems and proofs for these modular monadic definitions. Theorem statements like type soundness depend intimately on the effects used in a language, making modularity particularly challenging to achieve. 3MT overcomes this problem by splitting theorems into two parts: a reusable theorem that captures type soundness of a feature in a languageindependent way, and a languagespecific type soundness theorem. Proofs of the first only mention the effects of a specific feature, and proofs of the second need only to know that the first theorem holds for the features included in a language. To establish both theorems, 3MT uses two key reasoning techniques: modular induction and algebraic laws about effects. Several effectful language features, including references and errors, illustrate the capabilities of our framework. We reuse these features to build fully mechanized definitions and proofs for a number of languages, including a version of miniML with effects.
Programming macro tree transducers
 In WGP ’13
, 2013
"... A tree transducer is a set of mutually recursive functions transforming an input tree into an output tree. Macro tree transducers extend this recursion scheme by allowing each function to be defined in terms of an arbitrary number of accumulation parameters. In this paper, we show how macro tree tra ..."
Abstract

Cited by 5 (5 self)
 Add to MetaCart
(Show Context)
A tree transducer is a set of mutually recursive functions transforming an input tree into an output tree. Macro tree transducers extend this recursion scheme by allowing each function to be defined in terms of an arbitrary number of accumulation parameters. In this paper, we show how macro tree transducers can be concisely represented in Haskell, and demonstrate the benefits of utilising such an approach with a number of examples. In particular, tree transducers afford a modular programming style as they can be easily composed and manipulated. Our Haskell representation generalises the original definition of (macro) tree transducers, abolishing a restriction on finite state spaces. However, as we demonstrate, this generalisation does not affect compositionality.
Towards Modular Compilers for Effects
"... Compilers are traditionally factorised into a number of separate phases, such as parsing, type checking, code generation, etc. However, there is another potential factorisation that has received comparatively little attention: the treatment of separate language features, such as mutable state, inpu ..."
Abstract

Cited by 4 (2 self)
 Add to MetaCart
(Show Context)
Compilers are traditionally factorised into a number of separate phases, such as parsing, type checking, code generation, etc. However, there is another potential factorisation that has received comparatively little attention: the treatment of separate language features, such as mutable state, input/output, exceptions, concurrency and so forth. In this article we focus on the problem of modular compilation, in which the aim is to develop compilers for separate language features independently, which can then be combined as required. We summarise our progress to date, issues that have arisen, and further work.
Composing and Decomposing Data Types A Closed Type Families Implementation of Data Types a ̀ la Carte
"... Wouter Swierstra’s data types a ̀ la carte is a technique to modularise data type definitions in Haskell. We give an alternative implementation of data types a ̀ la carte that offers more flexibility in composing and decomposing data types. To achieve this, we refine the subtyping constraint, whi ..."
Abstract

Cited by 4 (1 self)
 Add to MetaCart
(Show Context)
Wouter Swierstra’s data types a ̀ la carte is a technique to modularise data type definitions in Haskell. We give an alternative implementation of data types a ̀ la carte that offers more flexibility in composing and decomposing data types. To achieve this, we refine the subtyping constraint, which is at the centre of data types a ̀ la carte. On the one hand this refinement is more general, allowing subtypings that intuitively should hold but were not derivable beforehand. This aspect of our implementation removes previous restrictions on how data types can be combined. On the other hand our refinement is more restrictive, disallowing subtypings that lead to more than one possible injection and should therefore be considered programming errors. Furthermore, from this refined subtyping constraint we derive a new constraint to express type isomorphism. We show how this isomorphism constraint allows us to decompose data types and to define extensible functions on data types in an ad hoc manner. The implementation makes essential use of closed type families in Haskell. The use of closed type families instead of type classes comes with a set of tradeoffs, which we review in detail. Finally, we show that our technique can be used for other similar problem domains.
Compilation à la Carte
"... In previous work, we proposed a new approach to the problem of implementing compilers in a modular manner, by combining earlier work on the development of modular interpreters using monad transformers with the à la carte approach to modular syntax. In this article, we refine and extend our existing ..."
Abstract

Cited by 3 (3 self)
 Add to MetaCart
(Show Context)
In previous work, we proposed a new approach to the problem of implementing compilers in a modular manner, by combining earlier work on the development of modular interpreters using monad transformers with the à la carte approach to modular syntax. In this article, we refine and extend our existing framework in a number of directions. In particular, we show how generalised algebraic datatypes can be used to support a more modular approach to typing individual language features, we increase the expressive power of the framework by considering mutable state, variable binding, and the issue of noncommutative effects, and we show how the Zinc Abstract Machine can be adapted to provide a modular universal target machine for our modular compilers.
Simple and Compositional Reification of Monadic Embedded Languages Functional Pearl
"... When writing embedded domain specific languages in Haskell, it is often convenient to be able to make an instance of the Monad class to take advantage of the donotation and the extensive monad libraries. Commonly it is desirable to compile such languages rather than just interpret them. This intro ..."
Abstract

Cited by 3 (1 self)
 Add to MetaCart
(Show Context)
When writing embedded domain specific languages in Haskell, it is often convenient to be able to make an instance of the Monad class to take advantage of the donotation and the extensive monad libraries. Commonly it is desirable to compile such languages rather than just interpret them. This introduces the problem of monad reification, i.e. observing the structure of the monadic computation. We present a solution to the monad reification problem and illustrate it with a small robot control language. Monad reification is not new but the novelty of our approach is in its directness, simplicity and compositionality.
Evaluation à la Carte NonStrict Evaluation via Compositional Data Types
"... We describe how to perform monadic computations over recursive data structures with fine grained control over the evaluation strategy. This solves the issue that the definition of a recursive monadic function already determines the evaluation strategy due to the necessary sequencing of the monadic o ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
(Show Context)
We describe how to perform monadic computations over recursive data structures with fine grained control over the evaluation strategy. This solves the issue that the definition of a recursive monadic function already determines the evaluation strategy due to the necessary sequencing of the monadic operations. We show that compositional data types already provide the structure needed in order to delay monadic computations at any point of the computation. 1
Pick’n’Fix Capturing Control Flow in Modular Compilers
"... Abstract. We present a modular framework for implementing languages with effects and control structures such as loops and conditionals. This framework enables modular definitions of both syntax and semantics as well as modular implementations of compilers and virtual machines. In order to compile co ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
(Show Context)
Abstract. We present a modular framework for implementing languages with effects and control structures such as loops and conditionals. This framework enables modular definitions of both syntax and semantics as well as modular implementations of compilers and virtual machines. In order to compile control structures, in particular cyclic ones, we employ Oliveira and Cook’s purely functional representation of graphs. Moreover, to separate control flow features semantically from other language features, we represent source languages using Johann and Ghani’s encoding of generalised algebraic datatypes as fixpoints of higherorder functors. We demonstrate the usage of our modular compiler framework with an extended running example and highlight the extensibility of our modular compiler implementations. 1
Pick’n’Fix Modular Control Structures
"... We present a modular framework for implementing languages with effects and control structures such as loops and conditionals. This framework enables modular definitions of both syntax and semantics as well as modular implementations of compilers and virtual machines. In order to compile control stru ..."
Abstract

Cited by 1 (1 self)
 Add to MetaCart
(Show Context)
We present a modular framework for implementing languages with effects and control structures such as loops and conditionals. This framework enables modular definitions of both syntax and semantics as well as modular implementations of compilers and virtual machines. In order to compile control structures, in particular cyclic ones, we employ Oliveira and Cook’s purely functional representation of graphs. Moreover, to separate control flow features semantically from other language features, we represent source languages using Johann and Ghani’s encoding of generalised algebraic datatypes as fixpoints of higherorder functors. We demonstrate the usage modular compiler framework with two running examples and highlight the extensibility of our modular semantic definitions and compiler implementations.