Results 1  10
of
26
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 32 (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 28 (8 self)
 Add to MetaCart
(Show Context)
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
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 21 (5 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.
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 19 (1 self)
 Add to MetaCart
(Show Context)
This is a preprint of a paper that has been submitted to Information and Computation.
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 18 (2 self)
 Add to MetaCart
(Show Context)
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
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 14 (4 self)
 Add to MetaCart
(Show Context)
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.
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.
Proofs for free — parametricity for dependent types
 Journal of Functional Programming
, 2012
"... Reynolds ’ abstraction theorem (Reynolds, J. C. (1983) Types, abstraction and parametric polymorphism, Inf. Process. 83(1), 513–523) shows how a typing judgement in System F can be translated into a relational statement (in secondorder predicate logic) about inhabitants of the type. We obtain a sim ..."
Abstract

Cited by 10 (0 self)
 Add to MetaCart
(Show Context)
Reynolds ’ abstraction theorem (Reynolds, J. C. (1983) Types, abstraction and parametric polymorphism, Inf. Process. 83(1), 513–523) shows how a typing judgement in System F can be translated into a relational statement (in secondorder predicate logic) about inhabitants of the type. We obtain a similar result for pure type systems (PTSs): for any PTS used as a programming language, there is a PTS that can be used as a logic for parametricity. Types in the source PTS are translated to relations (expressed as types) in the target. Similarly, values of a given type are translated to proofs that the values satisfy the relational interpretation. We extend the result to inductive families. We also show that the assumption that every term satisfies the parametricity condition generated by its type is consistent with the generated logic. 1
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 (3 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
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 8 (2 self)
 Add to MetaCart
(Show Context)
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.