Results 11  20
of
22
A Substructural Type System for Delimited Continuations ⋆
"... Abstract. We propose type systems that abstractly interpret smallstep rather than bigstep operational semantics. We treat an expression or evaluation context as a structure in a linear logic with hypothetical reasoning. Evaluation order is not only regulated by familiar focusing rules in the opera ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
Abstract. We propose type systems that abstractly interpret smallstep rather than bigstep operational semantics. We treat an expression or evaluation context as a structure in a linear logic with hypothetical reasoning. Evaluation order is not only regulated by familiar focusing rules in the operational semantics, but also expressed by structural rules in the type system, so the types track control flow more closely. Binding and evaluation contexts are related, but the latter are linear. We use these ideas to build a type system for delimited continuations. It lets control operators change the answer type or act beyond the nearest dynamicallyenclosing delimiter, yet needs no extra fields in judgments and arrow types to record answer types. The typing derivation of a directstyle program desugars it into continuationpassing style. 1
Extending type inference to variational programs
, 2012
"... Through the use of conditional compilation and related tools, many software projects can be used to generate a huge number of related programs. The problem of typing such variational software is difficult. The bruteforce strategy of generating all variants and typing each one individually is (1) us ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
Through the use of conditional compilation and related tools, many software projects can be used to generate a huge number of related programs. The problem of typing such variational software is difficult. The bruteforce strategy of generating all variants and typing each one individually is (1) usually infeasible for efficiency reasons and (2) produces results that do not map well to the underlying variational program. Recent research has focused mainly on efficiency and addressed only the problem of type checking. In this work we tackle the more general problem of variational type inference and introduce variational types to represent the result of typing a variational program. We introduce the variational lambda calculus (VLC) as a formal foundation for research on typing variational programs. We define a type system for VLC in which VLC expressions are mapped to correspondingly variational types. We show that the type system is correct by proving that the typing of expressions is preserved over the process of variation elimination, which eventually results in a plain lambda calculus expression and its corresponding type. We identify a set of equivalence rules for variational types and prove that the type unification problem modulo these equivalence rules is unitary and decidable; we also present a sound and complete unification algorithm. Based on the unification algorithm, the variational type inference algorithm is an extension of algorithm W. We show that it is sound and complete and computes principal types. We also consider the extension of VLC with sum types, a necessary feature for supporting variational data types, and demonstrate that the previous theoretical results also hold under this extension. Finally, we characterize the complexity of variational type inference and demonstrate the efficiency gains over the bruteforce strategy.
Accumulating bindings
"... We give a Haskell implementation of Filinski’s normalisation by evaluation algorithm for the computational lambdacalculus with sums. Taking advantage of extensions to the GHC compiler, our implementation represents object language types as Haskell types and ensures that type errors are detected sta ..."
Abstract

Cited by 2 (0 self)
 Add to MetaCart
We give a Haskell implementation of Filinski’s normalisation by evaluation algorithm for the computational lambdacalculus with sums. Taking advantage of extensions to the GHC compiler, our implementation represents object language types as Haskell types and ensures that type errors are detected statically. Following Filinski, the implementation is parameterised over a residualising monad. The standard residualising monad for sums is a continuation monad. Defunctionalising the uses of the continuation monad we present the binding tree monad as an alternative. 1
Exceptional NbE for Sums
"... We devise an algorithm using normalization by evaluation (NbE) for deciding equality between terms in a λcalculus equipped with strong sums. While proofs of correctness and completeness are still work in progress, the originality of this algorithm is its use of exceptions, which yields a particular ..."
Abstract

Cited by 1 (0 self)
 Add to MetaCart
We devise an algorithm using normalization by evaluation (NbE) for deciding equality between terms in a λcalculus equipped with strong sums. While proofs of correctness and completeness are still work in progress, the originality of this algorithm is its use of exceptions, which yields a particularly simple solution to this intricate problem. 1.
Keeping sums under control
, 2004
"... In a recent paper [31], I presented with Marcelo Fiore and Roberto Di Cosmo a new normalisation tool for the λcalculus with sum types, based on the technique of normalisation by evaluation, and more precisely on techniques developped by Olivier Danvy for partial evaluation, using control operators. ..."
Abstract
 Add to MetaCart
In a recent paper [31], I presented with Marcelo Fiore and Roberto Di Cosmo a new normalisation tool for the λcalculus with sum types, based on the technique of normalisation by evaluation, and more precisely on techniques developped by Olivier Danvy for partial evaluation, using control operators. The main characteristic of this tool is that it produces a result in a canonical form we introduced. That is to say: two βηequivalent terms will be normalised into (almost) identical terms. It was not the case with the traditional algorithm, which could even lead to an explosion of the size of code. This canonical form is an ηlong βnormal form with constraints, which capture the definition of ηlong normal form for the λcalculus without sums, and reduces drastically the ηconversion possibilities for sums. The present paper recall the definition of these normal forms and the normalisation algorithm, and shows how it is possible to use these tools to solve a problem of characterization of type isomorphisms. Indeed, the canonical form allowed to find the complicated counterexamples we exhibited in another work [6], that proves that type isomorphisms in the λcalculus with sums are not finitely axiomatisable. What’s more, when proving that these terms are isomorphisms, the new partial evaluation algorithm avoids an explosion of the size of the term that arises with the old one.
Type Structures and Normalization by Evaluation for System F ω
"... We present the first verified normalizationbyevaluation algorithm for System F ω, the simplest impredicative type theory with computation on the type level. Types appear in three shapes: As syntactical types, as type values which direct the reification process, and as semantical types, i.e., sets ..."
Abstract
 Add to MetaCart
We present the first verified normalizationbyevaluation algorithm for System F ω, the simplest impredicative type theory with computation on the type level. Types appear in three shapes: As syntactical types, as type values which direct the reification process, and as semantical types, i.e., sets of total values. The three shapes are captured by the new concept of a type structure, and the fundamental theorem now states that an induced structure is a type substructure. This work is an attempt at an algebraic treatment of type theory based on typed applicative structures rather than categories. 1
On Normalization by Evaluation for Object Calculi
"... We present a procedure for computing normal forms of terms in Abadi and Cardelli’s functional object calculus. Even when equipped with simple types, terms of this calculus are not terminating in general, and we draw on recent ideas about the normalization by evaluation paradigm for the untyped lambd ..."
Abstract
 Add to MetaCart
We present a procedure for computing normal forms of terms in Abadi and Cardelli’s functional object calculus. Even when equipped with simple types, terms of this calculus are not terminating in general, and we draw on recent ideas about the normalization by evaluation paradigm for the untyped lambda calculus. Technically, we work in the framework of Shinwell and Pitts ’ FMdomain theory, which leads to a normalization procedure for the object calculus that is directly implementable in a language like Fresh O’Caml.
Computational Effects across Generated Binders Maintaining futurestage lexical scope
"... Code generation is the leading approach to making highperformance software reusable. Effects are indispensable in code generators, whether to report failures or to insert letstatements and ifguards. Extensive painful experience shows that unrestricted effects interact with generated binders in und ..."
Abstract
 Add to MetaCart
Code generation is the leading approach to making highperformance software reusable. Effects are indispensable in code generators, whether to report failures or to insert letstatements and ifguards. Extensive painful experience shows that unrestricted effects interact with generated binders in undesirable ways to produce unexpectedly unbound variables, or worse, unexpectedly bound ones. These subtleties prevent experts in the application domain, not in programming languages, from using and extending the generator. A pressing problem is thus to express the desired effects while regulating them so that the generated code is correct, or at least correctly scoped, by construction. In an imminently practical codegeneration framework, we show how to express arbitrary effects, including mutable references and delimited control, that move open code across generated binders. The static types of our generator expressions not only ensure that a welltyped generator produces welltyped and wellscoped code, but also express the lexical scopes of generated binders and prevent mixing up variables with different scopes. This precise notion of lexical scope subsumes the complaints about intuitively wrong example generators in the literature. For the first time, we demonstrate statically safe letinsertion across an arbitrary number of binders. Our framework is implemented as a Haskell library that embeds an extensible typed higherorder domainspecific language. It may be regarded as ‘staged Haskell. ’ The library is convenient to use thanks to the maturity of Haskell, higherorder abstract syntax, and polymorphism over generated type environments.
Delimited Control in OCaml, Abstractly and Concretely Oleg Kiselyov
"... We describe the first implementation of multiprompt delimited control operators in OCaml that is direct in that it captures only the needed part of the control stack. The implementation is a library that requires no changes to the OCaml compiler or runtime, so it is perfectly compatible with exist ..."
Abstract
 Add to MetaCart
We describe the first implementation of multiprompt delimited control operators in OCaml that is direct in that it captures only the needed part of the control stack. The implementation is a library that requires no changes to the OCaml compiler or runtime, so it is perfectly compatible with existing OCaml source and binary code. The library has been in fruitful practical use since 2006. We present the library as an implementation of an abstract machine derived by elaborating the definitional machine. The abstract view lets us distill a minimalistic API, scAPI, sufficient for implementing multiprompt delimited control. We argue that a language system that supports exception and stackoverflow handling supports scAPI. With byte and nativecode OCaml systems as two examples, our library illustrates how to use scAPI to implement multiprompt delimited control in a typed language. The approach is general and has been used to add multiprompt delimited control to other existing language systems.