23 research outputs found
Applied type system
We present a type system that can effectively facilitate the use of types in capturing invariants in stateful programs that may involve (sophisticated) pointer manipulation. With its root in a recently developed framework Applied Type System (ATS), the type system imposes a level of abstraction on program states by introducing a novel notion of recursive stateful views and then relies on a form of linear logic to reason about such views. We consider the design and then the formalization of the type system to constitute the primary contribution of the paper. In addition, we mention a prototype implementation of the type system and then give a variety of examples that attests to the practicality of programming with recursive stateful views.National Science Foundation (CCR-0224244, CCR-0229480
Special Delivery: Programming with Mailbox Types (Extended Version)
The asynchronous and unidirectional communication model supported by
mailboxes is a key reason for the success of actor languages like Erlang and
Elixir for implementing reliable and scalable distributed systems. While many
actors may send messages to some actor, only the actor may (selectively)
receive from its mailbox. Although actors eliminate many of the issues stemming
from shared memory concurrency, they remain vulnerable to communication errors
such as protocol violations and deadlocks.
Mailbox types are a novel behavioural type system for mailboxes first
introduced for a process calculus by de'Liguoro and Padovani in 2018, which
capture the contents of a mailbox as a commutative regular expression. Due to
aliasing and nested evaluation contexts, moving from a process calculus to a
programming language is challenging.
This paper presents Pat, the first programming language design incorporating
mailbox types, and describes an algorithmic type system. We make essential use
of quasi-linear typing to tame some of the complexity introduced by aliasing.
Our algorithmic type system is necessarily co-contextual, achieved through a
novel use of backwards bidirectional typing, and we prove it sound and complete
with respect to our declarative type system. We implement a prototype type
checker, and use it to demonstrate the expressiveness of Pat on a factory
automation case study and a series of examples from the Savina actor benchmark
suite.Comment: Extended version of paper accepted to ICFP'2
A type system with usage aspects
Linear typing schemes can be used to guarantee non-interference and so the soundness of in-place update with respect to a functional semantics. But linear schemes are restrictive in practice, and more restrictive than necessary to guarantee soundness of in-place update. This limitation has prompted research into static analysis and more sophisticated typing disciplines to determine when in-place update may be safely used, or to combine linear and non-linear schemes. Here we contribute to this direction by defining a new typing scheme that better approximates the semantic property of soundness of in-place update for a functional semantics. We begin from the observation that some data are used only in a read-only context, after which it may be safely re-used before being destroyed. Formalising the in-place update interpretation in a machine model semantics allows us to refine this observation, motivating three usage aspects apparent from the semantics that are used to annotate function argument types. The aspects are (1) used destructively, (2), used read-only but shared with result, and (3) used read-only and not shared with the result. The main novelty is aspect (2), which allows a linear value to be safely read and even aliased with a result of a function without being consumed. This novelty makes our type system more expressive than previous systems for functional languages in the literature. The system remains simple and intuitive, but it enjoys a strong soundness property whose proof is non-trivial. Moreover, our analysis features principal types and feasible type reconstruction, as shown in M. Konen'y (In TYPES 2002 workshop, Nijmegen, Proceedings, Springer-Verlag, 2003)
Kinetic theory of jet dynamics in the stochastic barotropic and 2D Navier-Stokes equations
We discuss the dynamics of zonal (or unidirectional) jets for barotropic
flows forced by Gaussian stochastic fields with white in time correlation
functions. This problem contains the stochastic dynamics of 2D Navier-Stokes
equation as a special case. We consider the limit of weak forces and
dissipation, when there is a time scale separation between the inertial time
scale (fast) and the spin-up or spin-down time (large) needed to reach an
average energy balance. In this limit, we show that an adiabatic reduction (or
stochastic averaging) of the dynamics can be performed. We then obtain a
kinetic equation that describes the slow evolution of zonal jets over a very
long time scale, where the effect of non-zonal turbulence has been integrated
out. The main theoretical difficulty, achieved in this work, is to analyze the
stationary distribution of a Lyapunov equation that describes quasi-Gaussian
fluctuations around each zonal jet, in the inertial limit. This is necessary to
prove that there is no ultraviolet divergence at leading order in such a way
that the asymptotic expansion is self-consistent. We obtain at leading order a
Fokker--Planck equation, associated to a stochastic kinetic equation, that
describes the slow jet dynamics. Its deterministic part is related to well
known phenomenological theories (for instance Stochastic Structural Stability
Theory) and to quasi-linear approximations, whereas the stochastic part allows
to go beyond the computation of the most probable zonal jet. We argue that the
effect of the stochastic part may be of huge importance when, as for instance
in the proximity of phase transitions, more than one attractor of the dynamics
is present
Type Reconstruction for the Linear π-Calculus with Composite and Equi-Recursive Types
We extend the linear π-calculus with composite and equi-recursive types in a way that enables the sharing of data containing linear values, provided that there is no overlapping access on such values. We show that the extended type system admits a complete type reconstruction algorithm and, as a by-product, we solve the problem of reconstruction for equi-recursive session types
Introduction to the Literature On Programming Language Design
This is an introduction to the literature on programming language design and related topics. It is intended to cite the most important work, and to provide a place for students to start a literature search