## Semantic Lego (1995)

Citations: | 38 - 0 self |

### BibTeX

@TECHREPORT{Espinosa95semanticlego,

author = {David Espinosa},

title = {Semantic Lego},

institution = {},

year = {1995}

}

### Years of Citing Articles

### OpenURL

### Abstract

Denotational semantics [Sch86] is a powerful framework for describing programming languages; however, its descriptions lack modularity: conceptually independent language features influence each others' semantics. We address this problem by presenting a theory of modular denotational semantics. Following Mosses [Mos92], we divide a semantics into two parts, a computation ADT and a language ADT (abstract data type). The computation ADT represents the basic semantic structure of the language. The language ADT represents the actual language constructs, as described by a grammar. We define the language ADT using the computation ADT; in fact, language constructs are polymorphic over many different computation ADTs. Following Moggi [Mog89a], we build the computation ADT from composable parts, using monads and monad transformers. These techniques allow us to build many different computation ADTs, and, since our language constructs are polymorphic, many different language semantics. We autom...

### Citations

1353 | Introduction to Functional Programming
- Bird, Wadler
- 1988
(Show Context)
Citation Context ...e they do not have an obvious composition. Once viewed as objects, they transform via endofunctors on the category. So category theory leads, as is often the case, to a suitable design. 4.2 Wadler In =-=[Wad92a]-=-, Philip Wadler popularized Moggi's ideas by presenting monadic interpreters written in Haskell. Later, in [WPJ93, Wad92b], he demonstrated the utility of monads for structuring programs rather than s... |

773 |
Structure and Interpretation of Computer Programs
- Abelson, Sussman, et al.
- 1985
(Show Context)
Citation Context ...ng interpreters isn't modular, shows two 7 styles of writing modular interpreters, and exercises SL with a series of examples. 1.1 Languages as ADTs We begin with a simple interpreter in the style of =-=[ASS85] and reduc-=-e it to its essence, eliminating issues of syntax as much as possible. This approach shows that "metalinguistic abstraction" (in the sense of Abelson and Sussman) is no different from ordina... |

766 | Notions of computation and monads
- Moggi
- 1991
(Show Context)
Citation Context ...e show their equivalence, at least in the cases that lifting can handle? 92 Logics Can we develop modular calculi for reasoning about the languages we construct? Moggi's computational lambda calculus =-=[Mog91]-=- captures precisely the inferences valid for lambda calculus over an arbitrary monad. Moggi's syntactic approach [MC93] is relevant but does not seem to address the problem directly. Calculi can proba... |

467 | Comprehending monads
- Wadler
- 1990
(Show Context)
Citation Context ...terpreters written in Haskell. The interpreters' limitation to extension by a single monad motivated this thesis. Also, Wadler and King showed how to combine continuations and lists with other monads =-=[KW92]. Despite Moggi's ea-=-rlier formulation of monad transformers, they discussed "combining M and L" rather than "constructing ML from M ". SL treats monad constructors in general and exhibits a complete s... |

457 | Computational lambda-calculus and monads
- Moggi
- 1989
(Show Context)
Citation Context ...\Theta T (B) ! T (A \Theta B) we can write (define (list+ l1 l2) (map (product l1 l2) (lambda (n1*n2) (+ (left n1*n2) (right n1*n2))))) A purely categorical model of lambda calculus over a monad (see =-=[Mog89b]) actually-=- requires a "tensorial strength" similar to product, even when using bind. Thus, some of the power of bind (when compared to map) comes from Scheme, rather than from pure category theory. Mo... |

419 |
Category Theory for Computer Science
- Barr, Wells
- 1990
(Show Context)
Citation Context ...n publish these handwritten notes in electronic or book form. A muchabbreviated version appears as [Spi89]. 2.1.7 References General references on category theory for computer science are [Pie91] and =-=[BW90]-=-. The latter contains many examples and applications and is easy despite its length. Category theory is not terribly hard to learn, because its rich descriptive content encourages the reader to acquir... |

339 | Theorems for free - Wadler - 1989 |

248 | Monad transformers and modular interpreters
- Liang, Hudak, et al.
- 1995
(Show Context)
Citation Context ...ing We define a language of types t(S) parametrized by a functor S: t(S) = A (constants) j V (variables) j t \Theta t (pairs) j t ! t (functions) j S(t) (functors) The form of this definition is from =-=[LJH95]-=-; a slighty more complex version appears in [Mog89a]. It is also nearly identical to the fundamental definition in Reynolds' work on parametricity [Wadb]. For any particular S, t(S) is still polymorph... |

235 | Domain theory in logical form
- Abramsky
- 1991
(Show Context)
Citation Context ...derived via both lifting and stratification. Given a set of laws on T , can we lift them to F (T )? Or, can we use the stratified monad laws to derive laws for a completed semantics ? Abramsky's work =-=[Abr91]-=- on deriving program logics from domain equations is applicable to domains built using type constructors; however, his methods seem to derive calculi that are still very low-level. 5.5 Conclusion Four... |

194 |
Initial algebra semantics and continuous algebras
- Goguen, Thatcher, et al.
- 1977
(Show Context)
Citation Context ... we can define a map from expressions to denotations, that is, from syntax to semantics. For example, (* 2 3) goes to (%* (%num 2) (%num 3)). The denotational approach to interpreters originates with =-=[GTWW77]-=-. This paper shows that the expression implementation is initial in the category of implementions of an ADT interface (see section 2.1.4). A consequence is that all syntaxes are isomorphic, and hence,... |

185 |
Basic category theory for computer scientists, Foundations of Computing Series
- Pierce
- 1991
(Show Context)
Citation Context ...vey will soon publish these handwritten notes in electronic or book form. A muchabbreviated version appears as [Spi89]. 2.1.7 References General references on category theory for computer science are =-=[Pie91]-=- and [BW90]. The latter contains many examples and applications and is easy despite its length. Category theory is not terribly hard to learn, because its rich descriptive content encourages the reade... |

179 | General Logics - Meseguer - 1989 |

174 |
An abstract view of programming languages
- Moggi
- 1989
(Show Context)
Citation Context ...anguage constructs, as described by a grammar. We define the language ADT using the computation ADT; in fact, language constructs are polymorphic over many different computation ADTs. Following Moggi =-=[Mog89a]-=-, we build the computation ADT from composable parts, using monads and monad transformers. These techniques allow us to build many different computation ADTs, and, since our language constructs are po... |

150 |
Semantics of Programming Languages
- Gunter
- 1992
(Show Context)
Citation Context ...sistance. When I first met him at LFP in 1992, he was a soft-spoken man who, after a heated semantics argument died down, would say, "Actually, the real answer is : : : ". His explations and=-= his book [Gun92]-=- are crystal clear. Charles Leiserson provided convincing evidence to attend MIT as an undergrad by being the most interesting person at Brown when I visited there. He did a great job teaching me algo... |

142 | Typeful Programming
- Cardelli
- 1989
(Show Context)
Citation Context ...ensible in most languages. That is, stores map locations to values, and we can create new locations on demand. 5.4 Future work Implementation As mentioned in section A.1, we could rewrite SL in Quest =-=[Car89]-=- to verify proper use of higher-order types. By forming domains from expressions instead of functions, we could build abstract interpretations, translations (such as CPS), and simple compilers. We cou... |

132 | Representing monads
- Filinski
- 1994
(Show Context)
Citation Context ...n unnatural and non-modular way. With SL, we can build ADTs custom tailored to the languages we define. In essence, SL is the final step in Mosses's program, the ability to combine algebras. Filinski =-=[Fil94]-=- showed how to compute over an arbitrary monad in a language with composable continuations. His construction is a direct use of the continuation monad transformer F (T )(A) = (A ! T (Ans)) ! T (Ans) M... |

78 | Towards a new model of abstraction in software engineering - Kiczales - 1992 |

72 | Composing Monads
- Jones, Duponcheel
- 1993
(Show Context)
Citation Context .... Figure 2.3 shows join for the individual monads and for their composition. It is clear by inspection that the latter cannot be defined from the former, even using unit and map. Jones and Duponcheel =-=[JD93]-=- give a rigorous proof based on the propositions as types analogy, showing that the type of joinST is not provable in implicational logic from the types of the other operators. However, if we think of... |

69 |
Distributive laws
- Beck
- 1969
(Show Context)
Citation Context ...are just triangles and squares, which are sufficiently described by their types: (C1) : Id ! ST (C2) : STT ! ST (C3) : SST ! ST (C4) : SSTST ! ST (C5) : STSTT ! ST The second formulation, due to Beck =-=[Bec69]-=-, requires that the two maps unitS : T ! ST mapS(unitT) : S ! ST be monad morphisms (see section 2.3) and that the middle unitary law holds: joinST o mapS(unitT o unitS) = id : ST ! ST Distributive la... |

57 |
Computational Category Theory
- Rydeheard, Burstall
- 1988
(Show Context)
Citation Context ...s of programs. In this thesis, we embed category theory within functional programming in a particular way: objects are types, and arrows are functions. Other embeddings are possible; for example, see =-=[RB90]-=-, which represents objects as values. Their approach is less straightforward, but more flexible. Our choice of embedding has several problems: ffl Current languages have weak, non-existent, or implici... |

41 | A functional theory of exceptions - Spivey - 1990 |

34 | Extensible denotational language specifications
- Cartwright, Felleisen
- 1994
(Show Context)
Citation Context ...be primitive for efficiency. Extensibility through continuations costs nothing (beyond the continuations) if we don't use it. This point is not obvious; see Filinski's paper. Cartwright and Felleisen =-=[CF94]-=-, in a baroque attempt at extensibility, postulate that a computation is either a value or an effect (they include a resource administrator to manage effects). Their semantics already includes environ... |

31 | Declarative continuations and categorical duality
- Filinski
- 1989
(Show Context)
Citation Context ...ell-known dual concepts are products / sums and injective / surjective. In general, we can form the dual of any concept formulated solely in category-theoretic terms. In his brilliant master's thesis =-=[Fil89]-=-, Filinski shows that values and continuations are dual. Although it is difficult to develop an intuition for his language, his thesis contains many surprising insights. 44 2.1.6 Category theory and f... |

31 | Building interpreters by composing monads - Steele - 1994 |

30 |
Rivieres, The Art of the Meta-Object Protocol
- Kiczales, des
- 1993
(Show Context)
Citation Context ...s an example, suppose that s computes various vehicles' maximum speeds. Then s : Vehicle ! Number where Vehicle is an extensible sum. Extensible sums are simply generic functions in the sense of CLOS =-=[KBdR91]-=-, while extensible products are not commonly used. The types of s and p come directly from the categorytheoretic definitions of sum and product. For other theoretical treatments of object-oriented pro... |

24 | A syntactic approach to modularity in denotational semantics
- Cenciarelli, Moggi
- 1993
(Show Context)
Citation Context ...asoning about the languages we construct? Moggi's computational lambda calculus [Mog91] captures precisely the inferences valid for lambda calculus over an arbitrary monad. Moggi's syntactic approach =-=[MC93]-=- is relevant but does not seem to address the problem directly. Calculi can probably be derived via both lifting and stratification. Given a set of laws on T , can we lift them to F (T )? Or, can we u... |

20 |
Building interpreters by composing monads
- Jr
- 1994
(Show Context)
Citation Context ...structors, they described their work as "combining M and L" rather than "constructing ML from M", and even in discussing monad constructors did not realize the significance of the =-=idea. 4.3 Steele In [Ste94]-=-, Guy Steele shows how to compose pseudomonads, a new construction. Although they compose, pseudomonads are both more complex and less general than monad constructors. In fact, pseudomonads are essent... |

17 |
A categorical approach to the theory of lists
- Spivey
- 1989
(Show Context)
Citation Context ...f category theory and functional programming in this embedding is [Spi93]; hopefully, Spivey will soon publish these handwritten notes in electronic or book form. A muchabbreviated version appears as =-=[Spi89]-=-. 2.1.7 References General references on category theory for computer science are [Pie91] and [BW90]. The latter contains many examples and applications and is easy despite its length. Category theory... |

16 |
Denotational Semantics. Allyn and
- Schmidt
- 1986
(Show Context)
Citation Context ...ch to continue. The typical use of resumptions is to interleave several computations by executing one until it pauses, then executing the next, etcetera. The standard parallel semantics, described in =-=[Sch86]-=- has T (A) = Sto ! List(A \Theta Sto) so that computations accept and return stores and can fork into multiple computations. Thus the complete type of denotations is Den = fix (X) Sto ! List((Val +X) ... |

10 |
A modular approach to denotational semantics
- Moggi
- 1991
(Show Context)
Citation Context ... category theory and, on first reading, appear impractical and difficult. The notes are also not widely available, and the only published paper referring to monad constructors is the two-page summary =-=[Mog91a]. His more-=- recent paper [MC93] presents a syntactic treatment in hope of "hiding the category-theoretic concepts and sophistication of the original approach in suitable metalanguages". It describes wh... |

7 |
Category Theory for the Working Mathematician
- MACLANE
- 1971
(Show Context)
Citation Context ...properties (o join unit) = id : T (A) ! T (A) (o join (map unit)) = id : T (A) ! T (A) (o join (map join)) = (o join join) : T (T (T (A))) ! T (A) This formulation presents monads as modified monoids =-=[Mac71]-=- (whence the name), where unit is the identity and join is the monoid operator. The above laws are left and right identity and associativity. Table 2.1 shows the type constructors for some common mona... |

2 | Language Extensibility via First-class Interpreters and Constructive Modules - Espinosa - 1993 |

2 |
A unified system of parametrization for programming languages
- Lamping
- 1988
(Show Context)
Citation Context ... (%call (%var 'k) (%num 4)))))))) ) (5) Figure 1.24: %amb version 3 36 1.4.3 Unified system of parametrization In this section, we use SL to realize John Lamping's "Unified System of Parametrizat=-=ion" [Lam88]-=-. Lamping describes a semantics in which expressions are parametrized over variables that (recursively) denote expressions. This recursion models a substitution in which substituted terms can contain ... |

2 | Category theory and functional programming - Spivey - 1993 |

1 |
Language features for extensible programs. Available via http://www.cs.columbia.edu
- Espinosa
- 1993
(Show Context)
Citation Context ... are not the right tool for building extensible sums. 97 A.4 Extensible sums and products Although extensible sums and products play little part in this thesis, they can build extensible systems (see =-=[Esp93b]-=-), demonstrate how category theory can aids language design, and capture the esssentials of object-oriented programming. We consider types S = S 1 + S 2 + \Delta \Delta \Delta P = P 1 \Theta P 2 \Thet... |

1 |
Semantic Lego. Available via http://www.cs.columbia.edu
- Espinosa
- 1994
(Show Context)
Citation Context ... from parts [Mog89a]. This crucial facility was hitherto missing; however, his presentation is difficult, and few researchers realized that he had made substantial progress. Rewriting Moggi's methods =-=[Esp94]-=-, I saw that they did not easily handle constructs involving multiple semantic levels, such as %call/cc or even %+ (because it raises errors on non-numbers). Stratified monads solve this problem, incr... |

1 |
Action Semantics, volume 26
- Mosses
- 1992
(Show Context)
Citation Context ...ptions lack modularity: conceptually independent language features influence each others' semantics. We address this problem by presenting a theory of modular denotational semantics. Following Mosses =-=[Mos92]-=-, we divide a semantics into two parts, a computationsADT and a language ADT (abstract data type). The computation ADT represents the basic semantic structure of the language. The language ADT represe... |

1 | Language features for extensible programs. See http://www.cs.columbia.edu - Espinosa - 1993 |