Results 1  10
of
20
Normalization by evaluation for typed lambda calculus with coproducts
 In LICS
, 2001
"... We solve the decision problem for simply typed lambda calculus with strong binary sums, equivalently the word problem for free cartesian closed categories with binary coproducts. Our method is based on the semantical technique known as “normalization by evaluation ” and involves inverting the interp ..."
Abstract

Cited by 46 (6 self)
 Add to MetaCart
(Show Context)
We solve the decision problem for simply typed lambda calculus with strong binary sums, equivalently the word problem for free cartesian closed categories with binary coproducts. Our method is based on the semantical technique known as “normalization by evaluation ” and involves inverting the interpretation of the syntax into a suitable sheaf model and from this extracting appropriate unique normal forms. There is no rewriting theory involved, and the proof is completely constructive, allowing program extraction from the proof. 1
Delimited Dynamic Binding
, 2006
"... Dynamic binding and delimited control are useful together in many settings, including Web applications, database cursors, and mobile code. We examine this pair of language features to show that the semantics of their interaction is illdefined yet not expressive enough for these uses. We solve this ..."
Abstract

Cited by 34 (14 self)
 Add to MetaCart
Dynamic binding and delimited control are useful together in many settings, including Web applications, database cursors, and mobile code. We examine this pair of language features to show that the semantics of their interaction is illdefined yet not expressive enough for these uses. We solve this open and subtle problem. We formalise a typed language DB+DC that combines a calculus DB of dynamic binding and a calculus DC of delimited control. We argue from theoretical and practical points of view that its semantics should be based on delimited dynamic binding: capturing a delimited continuation closes over part of the dynamic environment, rather than all or none of it; reinstating the captured continuation supplements the dynamic environment, rather than replacing or inheriting it. We introduce a type and reductionpreserving translation from DB + DC to DC, which proves that delimited control macroexpresses dynamic binding. We use this translation to implement DB + DC in Scheme, OCaml, and Haskell. We extend DB + DC with mutable dynamic variables and a facility to obtain not only the latest binding of a dynamic variable but also older bindings. This facility provides for stack inspection and (more generally) folding over the execution context as an inductive data structure.
A Monadic Multistage Metalanguage
, 2003
"... We describe a metalanguage MMML, which makes explicit the order of evaluation (in the spirit of monadic metalanguages) and the staging of computations (as in languages for multilevel bindingtime analysis). The main contribution of the paper is an operational semantics which is sufficiently detaile ..."
Abstract

Cited by 17 (7 self)
 Add to MetaCart
We describe a metalanguage MMML, which makes explicit the order of evaluation (in the spirit of monadic metalanguages) and the staging of computations (as in languages for multilevel bindingtime analysis). The main contribution of the paper is an operational semantics which is sufficiently detailed for analyzing subtle aspects of multistage programming, but also intuitive enough to serve as a reference semantics. For instance, the separation of computational types from code types, makes clear the distinction between a computation for generating code and the generated code, and provides a basis for multilingual extensions, where a variety of programming languages (aka monads) coexist. The operational semantics consists of two parts: local (semantics preserving) simplification rules, and computation steps executed in a deterministic order (because they may have sideeffects). We focus on the computational aspects, thus we adopt a simple type system, that can detect usual type errors, but not the unresolved link errors. Because of its explicit annotations, MMML is suitable as an intermediate language.
A Hybrid Approach to Online and Offline Partial Evaluation
 HigherOrder and Symbolic Computation
, 2002
"... This article presents a hybrid method of partial evaluation (PE), which is exactly as precise as naive online PE and nearly as efficient as stateoftheart offline PE, for a statically typed callbyvalue functional language. ..."
Abstract

Cited by 17 (0 self)
 Add to MetaCart
This article presents a hybrid method of partial evaluation (PE), which is exactly as precise as naive online PE and nearly as efficient as stateoftheart offline PE, for a statically typed callbyvalue functional language.
Memoization in typedirected partial evaluation
 PROCEEDINGS OF THE 2002 ACM SIGPLAN/SIGSOFT CONFERENCE ON GENERATIVE PROGRAMMING AND COMPONENT ENGINEERING, NUMBER 2487 IN LECTURE NOTES IN COMPUTER SCIENCE
, 2002
"... We use a code generator—typedirected partial evaluation— to verify conversions between isomorphic types, or more precisely to verify that a composite function is the identity function at some complicated type. A typed functional language such as ML provides a natural support to express the function ..."
Abstract

Cited by 14 (6 self)
 Add to MetaCart
(Show Context)
We use a code generator—typedirected partial evaluation— to verify conversions between isomorphic types, or more precisely to verify that a composite function is the identity function at some complicated type. A typed functional language such as ML provides a natural support to express the functions and typedirected partial evaluation provides a convenient setting to obtain the normal form of their composition. However, offtheshelf typedirected partial evaluation turns out to yield gigantic normal forms. We identify that this gigantism is due to redundancies, and that these redundancies originate in the handling of sums, which uses delimited continuations. We successfully eliminate these redundancies by extending typedirected partial evaluation with memoization capabilities. The result only works for pure functional programs, but it provides an unexpected use of code generation and it yields ordersofmagnitude improvements both in time and in space for type isomorphisms.
Staged Notational Definitions
 GENERATIVE PROGRAMMING AND COMPONENT ENGINEERING (GPCE), LECTURE NOTES IN COMPUTER SCIENCE
, 2003
"... Recent work proposed defining typesafe macros via interpretation into a multistage language. The utility of this approach was illustrated with a language called MacroML, in which all type checking is carried out before macro expansion. Building on this work, the goal of this paper is to develo ..."
Abstract

Cited by 7 (3 self)
 Add to MetaCart
Recent work proposed defining typesafe macros via interpretation into a multistage language. The utility of this approach was illustrated with a language called MacroML, in which all type checking is carried out before macro expansion. Building on this work, the goal of this paper is to develop a macro language that makes it easy for programmers to reason about terms locally. We show that defining the semantics of macros in this manner helps in developing and verifying not only type systems for macro languages but also equational reasoning principles. Because the MacroML calculus is sensetive to renaming of (what appear locally to be) bound variables, we present a calculus of staged notational definitions (SND) that eliminates the renaming problem but retains MacroML's phase distinction. Additionally, SND incorporates the generality of Griffin's account of notational definitions. We exhibit a formal equational theory for SND and prove its soundness.
A Monadic Approach for Avoiding Code Duplication when Staging Memoized Functions
, 2006
"... Building program generators that do not duplicate generated code can be challenging. At the same time, code duplication can easily increase both generation time and runtime of generated programs by an exponential factor. We identify an instance of this problem that can arise when memoized functions ..."
Abstract

Cited by 7 (2 self)
 Add to MetaCart
Building program generators that do not duplicate generated code can be challenging. At the same time, code duplication can easily increase both generation time and runtime of generated programs by an exponential factor. We identify an instance of this problem that can arise when memoized functions are staged. Without addressing this problem, it would be impossible to effectively stage dynamic programming algorithms. Intuitively, direct staging undoes the effect of memoization. To solve this problem once and for all, and for any function that uses memoization, we propose a staged monadic combinator library. Experimental results confirm that the library works as expected. Preliminary results also indicate that the library is useful even when memoization is not used.
A new onepass transformation into monadic normal form
 In CC, volume 2622 of LNCS
, 2003
"... Abstract. We present a translation from the callbyvalue λcalculus to monadic normal forms that includes shortcut boolean evaluation. The translation is higherorder, operates in one pass, duplicates no code, generates no chains of thunks, and is properly tail recursive. It makes a crucial use of ..."
Abstract

Cited by 5 (1 self)
 Add to MetaCart
(Show Context)
Abstract. We present a translation from the callbyvalue λcalculus to monadic normal forms that includes shortcut boolean evaluation. The translation is higherorder, operates in one pass, duplicates no code, generates no chains of thunks, and is properly tail recursive. It makes a crucial use of symbolic computation at translation time. 1
Logical Relations for Callbyvalue Delimited Continuations
 In Trends in Functional Programming
, 2007
"... Abstract: Logical relations, defined inductively on the structure of types, provide a powerful tool to characterize higherorder functions. They often enable us to prove correctness of a program transformer written with higherorder functions concisely. This paper demonstrates that the technique of ..."
Abstract

Cited by 4 (4 self)
 Add to MetaCart
(Show Context)
Abstract: Logical relations, defined inductively on the structure of types, provide a powerful tool to characterize higherorder functions. They often enable us to prove correctness of a program transformer written with higherorder functions concisely. This paper demonstrates that the technique of logical relations can be used to characterize callbyvalue functions as well as delimited continuations. Based on the traditional logical relations for callbyname functions, logical relations for callbyvalue functions are first defined, whose CPS variant is used to prove the correctness of an offline specializer for the callbyvalue λcalculus. They are then modified to cope with delimited continuations and are used to establish the correctness of an offline specializer for the callbyvalue λcalculus with delimited continuation constructs, shift and reset. This is the first correctness proof for such a specializer. Along the development, correctness of the continuationbased and shift/resetbased letinsertion and Anormalization is established.