Results 1  10
of
22
Dealing with Large Bananas
 UNIVERSITEIT UTRECHT
, 2000
"... Many problems call for a mixture of generic and specific programming techniques. We propose a polytypic programming approach based on generalised (monadic) folds where a separation is made between basic fold algebras that model generic behaviour and updates on these algebras that model specific beh ..."
Abstract

Cited by 28 (11 self)
 Add to MetaCart
Many problems call for a mixture of generic and specific programming techniques. We propose a polytypic programming approach based on generalised (monadic) folds where a separation is made between basic fold algebras that model generic behaviour and updates on these algebras that model specific behaviour. We identify particular basic algebras as well as some algebra combinators, and we show how these facilitate structured programming with updatable fold algebras. This blend of genericity and specificity allows programming with folds to scale up to applications involving large systems of mutually recursive datatypes. Finally, we address the possibility of providing generic definitions for the functions, algebras, and combinators that we propose.
Induction and coinduction in sequent calculus
 Postproceedings of TYPES 2003, number 3085 in LNCS
, 2003
"... Abstract. Proof search has been used to specify a wide range of computation systems. In order to build a framework for reasoning about such specifications, we make use of a sequent calculus involving induction and coinduction. These proof principles are based on a proof theoretic (rather than sett ..."
Abstract

Cited by 23 (8 self)
 Add to MetaCart
Abstract. Proof search has been used to specify a wide range of computation systems. In order to build a framework for reasoning about such specifications, we make use of a sequent calculus involving induction and coinduction. These proof principles are based on a proof theoretic (rather than settheoretic) notion of definition [13, 20, 25, 51]. Definitions are akin to (stratified) logic programs, where the left and right rules for defined atoms allow one to view theories as “closed ” or defining fixed points. The use of definitions makes it possible to reason intensionally about syntax, in particular enforcing free equality via unification. We add in a consistent way rules for pre and post fixed points, thus allowing the user to reason inductively and coinductively about properties of computational system making full use of higherorder abstract syntax. Consistency is guaranteed via cutelimination, where we give the first, to our knowledge, cutelimination procedure in the presence of general inductive and coinductive definitions. 1
On functors expressible in the polymorphic typed lambda calculus
 Logical Foundations of Functional Programming
, 1990
"... This is a preprint of a paper that has been submitted to Information and Computation. ..."
Abstract

Cited by 16 (1 self)
 Add to MetaCart
This is a preprint of a paper that has been submitted to Information and Computation.
The visitor pattern as a reusable, generic, typesafe component
 Proceedings of the 23rd ACM SIGPLAN conference on Objectoriented
"... The VISITOR design pattern shows how to separate the structure of an object hierarchy from the behaviour of traversals over that hierarchy. The pattern is very flexible; this very flexibility makes it difficult to capture the pattern formally. We show how to capture the essence of the VISITOR patter ..."
Abstract

Cited by 15 (3 self)
 Add to MetaCart
The VISITOR design pattern shows how to separate the structure of an object hierarchy from the behaviour of traversals over that hierarchy. The pattern is very flexible; this very flexibility makes it difficult to capture the pattern formally. We show how to capture the essence of the VISITOR pattern as a reusable software library, by using advanced type system features appearing in modern objectoriented languages such as Scala. We preserve typesafety statically: no reflection or similar mechanisms are used. The library is generic, in two senses: by types (the traversal return type and the object hierarchy shape) and by strategy (internal versus external control, imperative versus functional behaviour, orthogonal aspects such as tracing and memoisation). Finally, we propose a generalised datatypelike notation, providing a convenient functional decomposition style in objectoriented languages. 1.
A Typetheoretic Reconstruction of the Visitor Pattern
, 2005
"... In objectoriented languages, the Visitor pattern can be used to traverse treelike data structures: a visitor object contains some operations, and the data structure objects allow themselves to be traversed by accepting visitors. In the polymorphic lambda calculus (System F), treelike data structu ..."
Abstract

Cited by 14 (0 self)
 Add to MetaCart
In objectoriented languages, the Visitor pattern can be used to traverse treelike data structures: a visitor object contains some operations, and the data structure objects allow themselves to be traversed by accepting visitors. In the polymorphic lambda calculus (System F), treelike data structures can be encoded as polymorphic higherorder functions. In this paper, we reconstruct the Visitor pattern from the polymorphic encoding by way of generics in Java. We sketch how the quantified types in the polymorphic encoding can guide reasoning about visitors in general.
Parametricity and dependent types
, 2010
"... Reynolds ’ abstraction theorem shows how a typing judgement in System F can be translated into a relational statement (in second order predicate logic) about inhabitants of the type. We obtain a similar result for a single lambda calculus (a pure type system), in which terms, types and their relatio ..."
Abstract

Cited by 13 (2 self)
 Add to MetaCart
Reynolds ’ abstraction theorem shows how a typing judgement in System F can be translated into a relational statement (in second order predicate logic) about inhabitants of the type. We obtain a similar result for a single lambda calculus (a pure type system), in which terms, types and their relations are expressed. Working within a single system dispenses with the need for an interpretation layer, allowing for an unusually simple presentation. While the unification puts some constraints on the type system (which we spell out), the result applies to many interesting cases, including dependentlytyped ones. Categories and Subject Descriptors F.3.3 [Logics and Meanings
Modular visitor components: A practical solution to the expression families problem
 In ECOOP ’09
, 2009
"... Abstract. The expression families problem can be defined as the problem of achieving reusability and composability across the components involved in a family of related datatypes and corresponding operations over those datatypes. Like the traditional expression problem, adding new components (either ..."
Abstract

Cited by 8 (2 self)
 Add to MetaCart
Abstract. The expression families problem can be defined as the problem of achieving reusability and composability across the components involved in a family of related datatypes and corresponding operations over those datatypes. Like the traditional expression problem, adding new components (either variants or operations) should be possible while preserving modular and static typesafety. Moreover, different combinations of components should have different type identities and the subtyping relationships between components should be preserved. By generalizing previous work exploring the connection between typetheoretic encodings of datatypes and visitors, we propose two solutions for this problem in Scala using modular visitor components. These components can be grouped into features that can be easily composed in a featureoriented programming style to obtain customized datatypes and operations. 1
Metatheory à la carte
 In POPL ’13
, 2013
"... Formalizing metatheory, or proofs about programming languages, in a proof assistant has many wellknown benefits. However, the considerable effort involved in mechanizing proofs has prevented it from becoming standard practice. This cost can be amortized by reusing as much of an existing formalizat ..."
Abstract

Cited by 7 (1 self)
 Add to MetaCart
Formalizing metatheory, or proofs about programming languages, in a proof assistant has many wellknown benefits. However, the considerable effort involved in mechanizing proofs has prevented it from becoming standard practice. This cost can be amortized by reusing as much of an existing formalization as possible when building a new language or extending an existing one. Unfortunately reuse of components is typically adhoc, with the language designer cutting and pasting existing definitions and proofs, and expending considerable effort to patch up the results. This paper presents a more structured approach to the reuse of formalizations of programming language semantics through the composition of modular definitions and proofs. The key contribution is the development of an approach to induction for extensible Church encodings which uses a novel reinterpretation of the universal property of folds. These encodings provide the foundation for a framework, formalized in Coq, which uses type classes to automate the composition of proofs from modular components. Several interesting language features, including binders and general recursion, 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. Bounded induction enables proofs of properties for noninductive semantic functions, and mediating type classes enable proof adaptation for more featurerich languages. 1.
Typed selfrepresentation
 IN PLDI
, 2009
"... Selfrepresentation – the ability to represent programs in their own language – has important applications in reflective languages and many other domains of programming language design. Although approaches to designing typed program representations for sublanguages of some base language have become ..."
Abstract

Cited by 6 (1 self)
 Add to MetaCart
Selfrepresentation – the ability to represent programs in their own language – has important applications in reflective languages and many other domains of programming language design. Although approaches to designing typed program representations for sublanguages of some base language have become quite popular recently, the question whether a fully metacircular typed selfrepresentation is possible is still open. This paper makes a big step towards this aim by defining the F ∗ ω calculus, an extension of the higherorder polymorphic lambda calculus Fω that allows typed selfrepresentations. While the usability of these representations for metaprogramming is still limited, we believe that our approach makes a significant step towards a new generation of reflective languages that are both safe and efficient.
Recursion Versus Iteration at HigherOrders
, 1997
"... . We extend the wellknown analysis of recursionremoval in firstorder program schemes to a higherorder language of finitely typed and polymorphically typed functional programs, the semantics of which is based on callbyname parameterpassing. We introduce methods for recursionremoval, i.e. for ..."
Abstract

Cited by 6 (0 self)
 Add to MetaCart
. We extend the wellknown analysis of recursionremoval in firstorder program schemes to a higherorder language of finitely typed and polymorphically typed functional programs, the semantics of which is based on callbyname parameterpassing. We introduce methods for recursionremoval, i.e. for translating higherorder recursive programs into higherorder iterative programs, and determine conditions under which this translation is possible. Just as finitely typed recursive programs are naturally classified by their orders, so are finitely typed iterative programs. This syntactic classification of recursive and iterative programs corresponds to a semantic (or computational) classification: the higher the order of programs, the more functions they can compute. 1 Background and Motivation Although our analysis is entirely theoretical, as it combines methods from typed calculi, from abstract recursion theory and from denotational semantics, the problems we consider have a strong pra...