794 research outputs found
A Logical Approach To Deciding Semantic Subtyping
International audienceWe consider a type algebra equipped with recursive, product, function, intersection, union, and complement types together with type variables and implicit universal quantification over them. We consider the subtyping relation recently defined by Castagna and Xu over such type expressions and show how this relation can be decided in EXPTIME, answering an open question. The novelty, originality and strength of our solution reside in introducing a logical modeling for the semantic subtyping framework. We model semantic subtyping in a tree logic and use a satisfiability-testing algorithm in order to decide subtyping. We report on practical experiments made with a full implementation of the system. This provides a powerful polymorphic type system aiming at maintaining full static type-safety of functional programs that manipulate trees, even with higher-order functions, which is particularly useful in the context of XML
Using Inhabitation in Bounded Combinatory Logic with Intersection Types for Composition Synthesis
We describe ongoing work on a framework for automatic composition synthesis
from a repository of software components. This work is based on combinatory
logic with intersection types. The idea is that components are modeled as typed
combinators, and an algorithm for inhabitation {\textemdash} is there a
combinatory term e with type tau relative to an environment Gamma?
{\textemdash} can be used to synthesize compositions. Here, Gamma represents
the repository in the form of typed combinators, tau specifies the synthesis
goal, and e is the synthesized program. We illustrate our approach by examples,
including an application to synthesis from GUI-components.Comment: In Proceedings ITRS 2012, arXiv:1307.784
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
The Algebraic Intersection Type Unification Problem
The algebraic intersection type unification problem is an important component
in proof search related to several natural decision problems in intersection
type systems. It is unknown and remains open whether the algebraic intersection
type unification problem is decidable. We give the first nontrivial lower bound
for the problem by showing (our main result) that it is exponential time hard.
Furthermore, we show that this holds even under rank 1 solutions (substitutions
whose codomains are restricted to contain rank 1 types). In addition, we
provide a fixed-parameter intractability result for intersection type matching
(one-sided unification), which is known to be NP-complete.
We place the algebraic intersection type unification problem in the context
of unification theory. The equational theory of intersection types can be
presented as an algebraic theory with an ACI (associative, commutative, and
idempotent) operator (intersection type) combined with distributivity
properties with respect to a second operator (function type). Although the
problem is algebraically natural and interesting, it appears to occupy a
hitherto unstudied place in the theory of unification, and our investigation of
the problem suggests that new methods are required to understand the problem.
Thus, for the lower bound proof, we were not able to reduce from known results
in ACI-unification theory and use game-theoretic methods for two-player tiling
games
Covariance and Controvariance: a fresh look at an old issue (a primer in advanced type systems for learning functional programmers)
Twenty years ago, in an article titled "Covariance and contravariance:
conflict without a cause", I argued that covariant and contravariant
specialization of method parameters in object-oriented programming had
different purposes and deduced that, not only they could, but actually they
should both coexist in the same language.
In this work I reexamine the result of that article in the light of recent
advances in (sub-)typing theory and programming languages, taking a fresh look
at this old issue.
Actually, the revamping of this problem is just an excuse for writing an
essay that aims at explaining sophisticated type-theoretic concepts, in simple
terms and by examples, to undergraduate computer science students and/or
willing functional programmers.
Finally, I took advantage of this opportunity to describe some undocumented
advanced techniques of type-systems implementation that are known only to few
insiders that dug in the code of some compilers: therefore, even expert
language designers and implementers may find this work worth of reading
Timed Session Types
Timed session types formalise timed communication protocols between two
participants at the endpoints of a session. They feature a decidable compliance
relation, which generalises to the timed setting the progress-based compliance
between untimed session types. We show a sound and complete technique to decide
when a timed session type admits a compliant one. Then, we show how to
construct the most precise session type compliant with a given one, according
to the subtyping preorder induced by compliance. Decidability of subtyping
follows from these results
Liquid Intersection Types
We present a new type system combining refinement types and the
expressiveness of intersection type discipline. The use of such features makes
it possible to derive more precise types than in the original refinement
system. We have been able to prove several interesting properties for our
system (including subject reduction) and developed an inference algorithm,
which we proved to be sound.Comment: In Proceedings ITRS 2014, arXiv:1503.0437
- …