158 research outputs found
Denotational Aspects of Untyped Normalization by Evaluation
We show that the standard normalization-by-evaluation construction for the simply-typed lambda_{beta eta}-calculus has a natural counterpart for the untyped lambda_beta-calculus, with the central type-indexed logical relation replaced by a "recursively defined'' invariant relation, in the style of Pitts. In fact, the construction can be seen as generalizing a computational-adequacy argument for an untyped, call-by-name language to normalization instead of evaluation. In the untyped setting, not all terms have normal forms, so the normalization function is necessarily partial. We establish its correctness in the senses of soundness (the output term, if any, is in normal form and beta-equivalent to the input term); identification ( beta-equivalent terms are mapped to the same result); and completeness (the function is defined for all terms that do have normal forms). We also show how the semantic construction enables a simple yet formal correctness proof for the normalization algorithm, expressed as a functional program in an ML-like call-by-value language. Finally, we generalize the construction to produce an infinitary variant of normal forms, namely Böhm trees. We show that the three-part characterization of correctness, as well as the proofs, extend naturally to this generalization
Towards PCC for Concurrent and Distributed Systems (Work in Progress)
We outline some conceptual challenges in extending the PCC paradigm to a concurrent and distributed setting, and sketch a generalized notion of module correctness based on viewing communication contracts as economic games. The model supports compositional reasoning about modular systems and is meant to apply not only to certification of executable code, but also of organizational workflows
Normalization by evaluation for call-by-push-value and polarized lambda calculus
We observe that normalization by evaluation for simply-typed lambda-calculus with weak coproducts can be carried out in a weak bi-cartesian closed category of presheaves equipped with a monad that allows us to perform case distinction on neutral terms of sum type. The placement of the monad influences the normal forms we obtain: for instance, placing the monad on coproducts gives us eta-long beta-pi normal forms where pi refers to permutation of case distinctions out of elimination positions. We further observe that placing the monad on every coproduct is rather wasteful, and an optimal placement of the monad can be determined by considering polarized simple types inspired by focalization. Polarization classifies types into positive and negative, and it is sufficient to place the monad at the embedding of positive types into negative ones. We consider two calculi based on polarized types: pure call-by-push-value (CBPV) and polarized lambda-calculus, the natural deduction calculus corresponding to focalized sequent calculus. For these two calculi, we present algorithms for normalization by evaluation. We further discuss different implementations of the monad and their relation to existing normalization proofs for lambda-calculus with sums. Our developments have been partially formalized in the Agda proof assistant
Normalization by Evaluation for Call-by-Push-Value and Polarized Lambda-Calculus
We observe that normalization by evaluation for simply-typed lambda-calculus
with weak coproducts can be carried out in a weak bi-cartesian closed category
of presheaves equipped with a monad that allows us to perform case distinction
on neutral terms of sum type. The placement of the monad influences the normal
forms we obtain: for instance, placing the monad on coproducts gives us
eta-long beta-pi normal forms where pi refers to permutation of case
distinctions out of elimination positions. We further observe that placing the
monad on every coproduct is rather wasteful, and an optimal placement of the
monad can be determined by considering polarized simple types inspired by
focalization. Polarization classifies types into positive and negative, and it
is sufficient to place the monad at the embedding of positive types into
negative ones. We consider two calculi based on polarized types: pure
call-by-push-value (CBPV) and polarized lambda-calculus, the natural deduction
calculus corresponding to focalized sequent calculus. For these two calculi, we
present algorithms for normalization by evaluation. We further discuss
different implementations of the monad and their relation to existing
normalization proofs for lambda-calculus with sums. Our developments have been
partially formalized in the Agda proof assistant
Kripke Models for Classical Logic
We introduce a notion of Kripke model for classical logic for which we
constructively prove soundness and cut-free completeness. We discuss the
novelty of the notion and its potential applications
Automatic transformation of iterative loops into recursive methods
NOTICE: this is the author’s version of a work that was accepted for publication in Information and Software Technology. Changes resulting from the publishing process, such as peer review, editing, corrections, structural formatting, and other quality control mechanisms may not be reflected in this document. Changes may have been made to this work since it was submitted for publication. A definitive version was subsequently published in Information and Software Technology, [Volume 58, February 2015, Pages 95–109] DOI 10.1016/j.infsof.2014.10.001[EN] Context
In software engineering, taking a good election between recursion and iteration is essential because their efficiency and maintenance are different. In fact, developers often need to transform iteration into recursion (e.g., in debugging, to decompose the call graph into iterations); thus, it is quite surprising that there does not exist a public transformation from loops to recursion that can be used in industrial projects (i.e., it is automatic, it handles all kinds of loops, it considers exceptions, etc.).
Objective
This article describes an industrial algorithm implemented as a Java library able to automatically transform iterative loops into equivalent recursive methods. The transformation is described for the programming language Java, but it is general enough as to be adapted to many other languages that allow iteration and recursion.
Method
We describe the changes needed to transform loops of types while/do/for/foreach into recursion. We provide a transformation schema for each kind of loop.
Results
Our algorithm is the first public transformation that can be used in industrial projects and faces the whole Java language (i.e., it is fully automatic, it handles all kinds of loops, it considers exceptions, it treats the control statements break and continue, it handles loop labels, it is able to transform any number of nested loops, etc.). This is particularly interesting because some of these features are missing in all previous work, probably, due to the complexity that their mixture introduce in the transformation.
Conclusion
Developers should use a methodology when transforming code, specifically when transforming loops into recursion. This article provides guidelines and algorithms that allow them to face different problems such as exception handling. The implementation has been made publicly available as open source.This work has been partially supported by the EU (FEDER) and the Spanish Ministerio de Economia y Competitividad (Secretaria de Estado de Investigacion, Desarrollo e Innovacion) under Grant TIN2013-44742-C4-1-R and by the Generalitat Valenciana under Grant PROMETEO/2011/052. David Insa was partially supported by the Spanish Ministerio de Educacion under FPU Grant AP2010-4415.Insa Cabrera, D.; Silva, J. (2015). Automatic transformation of iterative loops into recursive methods. Information and Software Technology. 58:95-109. https://doi.org/10.1016/j.infsof.2014.10.001S951095
Semantics of a Typed Algebraic Lambda-Calculus
Algebraic lambda-calculi have been studied in various ways, but their
semantics remain mostly untouched. In this paper we propose a semantic analysis
of a general simply-typed lambda-calculus endowed with a structure of vector
space. We sketch the relation with two established vectorial lambda-calculi.
Then we study the problems arising from the addition of a fixed point
combinator and how to modify the equational theory to solve them. We sketch an
algebraic vectorial PCF and its possible denotational interpretations
Continuation-passing Style Models Complete for Intuitionistic Logic
A class of models is presented, in the form of continuation monads
polymorphic for first-order individuals, that is sound and complete for minimal
intuitionistic predicate logic. The proofs of soundness and completeness are
constructive and the computational content of their composition is, in
particular, a -normalisation-by-evaluation program for simply typed
lambda calculus with sum types. Although the inspiration comes from Danvy's
type-directed partial evaluator for the same lambda calculus, the there
essential use of delimited control operators (i.e. computational effects) is
avoided. The role of polymorphism is crucial -- dropping it allows one to
obtain a notion of model complete for classical predicate logic. The connection
between ours and Kripke models is made through a strengthening of the
Double-negation Shift schema
- …