2,570 research outputs found
A deep quantitative type system
We investigate intersection types and resource lambda-calculus in deep-inference proof theory. We give a unified type system that is parametric in various aspects: it encompasses resource calculi, intersection-typed lambda-calculus, and simply-typed lambda-calculus; it accommodates both idempotence and non-idempotence; it characterizes strong and weak normalization; and it does so while allowing a range of algebraic laws to determine reduction behaviour, for various quantitative effects. We give a parametric resource calculus with explicit sharing, the "collection calculus", as a Curry-Howard interpretation of the type system, that embodies these computational properties
A Typed Lambda Calculus with Intersection Types
AbstractIntersection types are well known to type theorists mainly for two reasons. Firstly, they type all and only the strongly normalizable lambda terms. Secondly, the intersection type operator is a meta-level operator, that is, there is no direct logical counterpart in the Curry–Howard isomorphism sense. In particular, its meta-level nature implies that it does not correspond to the intuitionistic conjunction.The intersection type system is naturally a type inference system (system à la Curry), but the meta-level nature of the intersection operator does not allow to easily design an equivalent typed system (system à la Church). There are many proposals in the literature to design such systems, but none of them gives an entirely satisfactory answer to the problem. In this paper, we will review the main results in the literature both on the logical interpretation of intersection types and on proposed typed lambda calculi.The core of this paper is a new proposal for a true intersection typed lambda calculus, without any meta-level notion. Namely, any typable term (in the intersection type inference) has a corresponding typed term (which is the same as the untyped term by erasing the type decorations and the typed term constructors) with the same type, and vice versa.The main idea is to introduce a relevant parallel term constructor which corresponds to the intersection type constructor, in such a way that terms in parallel share the same resources, that is, the same context of free typed variables. Three rules allow us to generate all typed terms. The first two rules, Application and Lambda-abstraction, are performed on all the components of a parallel term in a synchronized way. Finally, via the third rule of Local Renaming, once a free typed variable is bounded by lambda-abstraction, each of the terms in parallel can do its local renaming, with type refinement, of that particular resource
Java & Lambda: a Featherweight Story
We present FJ&, a new core calculus that extends Featherweight Java
(FJ) with interfaces, supporting multiple inheritance in a restricted form,
-expressions, and intersection types. Our main goal is to formalise
how lambdas and intersection types are grafted on Java 8, by studying their
properties in a formal setting. We show how intersection types play a
significant role in several cases, in particular in the typecast of a
-expression and in the typing of conditional expressions. We also
embody interface \emph{default methods} in FJ&, since they increase
the dynamism of -expressions, by allowing these methods to be called
on -expressions.
The crucial point in Java 8 and in our calculus is that -expressions
can have various types according to the context requirements (target types):
indeed, Java code does not compile when -expressions come without
target types. In particular, in the operational semantics we must record target
types by decorating -expressions, otherwise they would be lost in the
runtime expressions.
We prove the subject reduction property and progress for the resulting
calculus, and we give a type inference algorithm that returns the type of a
given program if it is well typed. The design of FJ& has been driven
by the aim of making it a subset of Java 8, while preserving the elegance and
compactness of FJ. Indeed, FJ& programs are typed and behave the same
as Java programs
Mixin Composition Synthesis based on Intersection Types
We present a method for synthesizing compositions of mixins using type
inhabitation in intersection types. First, recursively defined classes and
mixins, which are functions over classes, are expressed as terms in a lambda
calculus with records. Intersection types with records and record-merge are
used to assign meaningful types to these terms without resorting to recursive
types. Second, typed terms are translated to a repository of typed combinators.
We show a relation between record types with record-merge and intersection
types with constructors. This relation is used to prove soundness and partial
completeness of the translation with respect to mixin composition synthesis.
Furthermore, we demonstrate how a translated repository and goal type can be
used as input to an existing framework for composition synthesis in bounded
combinatory logic via type inhabitation. The computed result is a class typed
by the goal type and generated by a mixin composition applied to an existing
class
Non-Deterministic Functions as Non-Deterministic Processes (Extended Version)
We study encodings of the lambda-calculus into the pi-calculus in the unexplored case of calculi with non-determinism and failures. On the sequential side, we consider lambdafail, a new non-deterministic calculus in which intersection types control resources (terms); on the concurrent side, we consider spi, a pi-calculus in which non-determinism and failure rest upon a Curry-Howard correspondence between linear logic and session types. We present a typed encoding of lambdafail into spi and establish its correctness. Our encoding precisely explains the interplay of non-deterministic and fail-prone evaluation in lambdafail via typed processes in spi. In particular, it shows how failures in sequential evaluation (absence/excess of resources) can be neatly codified as interaction protocols
Intersection types for unbind and rebind
We define a type system with intersection types for an extension of
lambda-calculus with unbind and rebind operators. In this calculus, a term with
free variables, representing open code, can be packed into an "unbound" term,
and passed around as a value. In order to execute inside code, an unbound term
should be explicitly rebound at the point where it is used. Unbinding and
rebinding are hierarchical, that is, the term can contain arbitrarily nested
unbound terms, whose inside code can only be executed after a sequence of
rebinds has been applied. Correspondingly, types are decorated with levels, and
a term has type decorated with k if it needs k rebinds in order to reduce to a
value. With intersection types we model the fact that a term can be used
differently in contexts providing different numbers of unbinds. In particular,
top-level terms, that is, terms not requiring unbinds to reduce to values,
should have a value type, that is, an intersection type where at least one
element has level 0. With the proposed intersection type system we get
soundness under the call-by-value strategy, an issue which was not resolved by
previous type systems.Comment: In Proceedings ITRS 2010, arXiv:1101.410
Reconciling positional and nominal binding
We define an extension of the simply-typed lambda calculus where two
different binding mechanisms, by position and by name, nicely coexist. In the
former, as in standard lambda calculus, the matching between parameter and
argument is done on a positional basis, hence alpha-equivalence holds, whereas
in the latter it is done on a nominal basis. The two mechanisms also
respectively correspond to static binding, where the existence and type
compatibility of the argument are checked at compile-time, and dynamic binding,
where they are checked at run-time.Comment: In Proceedings ITRS 2012, arXiv:1307.784
A Theory of Explicit Substitutions with Safe and Full Composition
Many different systems with explicit substitutions have been proposed to
implement a large class of higher-order languages. Motivations and challenges
that guided the development of such calculi in functional frameworks are
surveyed in the first part of this paper. Then, very simple technology in named
variable-style notation is used to establish a theory of explicit substitutions
for the lambda-calculus which enjoys a whole set of useful properties such as
full composition, simulation of one-step beta-reduction, preservation of
beta-strong normalisation, strong normalisation of typed terms and confluence
on metaterms. Normalisation of related calculi is also discussed.Comment: 29 pages Special Issue: Selected Papers of the Conference
"International Colloquium on Automata, Languages and Programming 2008" edited
by Giuseppe Castagna and Igor Walukiewic
- …