11 research outputs found
Capable : a mechanised imperative language with native multiparty session types
CAPABLE is lightweight mechanised imperative language that provides native support for Multiparty Session Types (MPSTs). Through mechanisation, we can explore and catalogue the changes required to extend similar languages with native support for MPSTs, as well as the interplay between the existing type-system and other novel extensions. Principally, our demo shows CAPABLE in action and what a language with native MPSTs can look like. We also look beneath the surface syntax and offer insight over how we created intrinsically typed sessions (and session types) within a dependently typed language. We show a compact well-scoped encoding of session types, mechanised proofs of soundness and completeness for projection, and how dependent types help with bidirectional type checking of typed sessions
Rast: A Language for Resource-Aware Session Types
Traditional session types prescribe bidirectional communication protocols for
concurrent computations, where well-typed programs are guaranteed to adhere to
the protocols. However, simple session types cannot capture properties beyond
the basic type of the exchanged messages. In response, recent work has extended
session types with refinements from linear arithmetic, capturing intrinsic
attributes of processes and data. These refinements then play a central role in
describing sequential and parallel complexity bounds on session-typed programs.
The Rast language provides an open-source implementation of session-typed
concurrent programs extended with arithmetic refinements as well as ergometric
and temporal types to capture work and span of program execution. To further
support generic programming, Rast also enhances arithmetically refined session
types with recently developed nested parametric polymorphism. Type checking
relies on Cooper's algorithm for quantifier elimination in Presburger
arithmetic with a few significant optimizations, and a heuristic extension to
nonlinear constraints. Rast furthermore includes a reconstruction engine so
that most program constructs pertaining the layers of refinements and resources
are inserted automatically. We provide a variety of examples to demonstrate the
expressivity of the language
Gradual session types
Session types are a rich type discipline, based on linear types, that lifts
the sort of safety claims that come with type systems to communications.
However, web-based applications and microservices are often written in a mix of
languages, with type disciplines in a spectrum between static and dynamic
typing. Gradual session types address this mixed setting by providing a
framework which grants seamless transition between statically typed handling of
sessions and any required degree of dynamic typing.
We propose Gradual GV as a gradually typed extension of the functional
session type system GV. Following a standard framework of gradual typing,
Gradual GV consists of an external language, which relaxes the type system of
GV using dynamic types, and an internal language with casts, for which
operational semantics is given, and a cast-insertion translation from the
former to the latter. We demonstrate type and communication safety as well as
blame safety, thus extending previous results to functional languages with
session-based communication. The interplay of linearity and dynamic types
requires a novel approach to specifying the dynamics of the language.Comment: Preprint of an article to appear in Journal of Functional Programmin
On polymorphic sessions and functions: a tale of two (fully abstract) encodings
This work exploits the logical foundation of session types to determine what kind of type discipline for the Λ-calculus can exactly capture, and is captured by, Λ-calculus behaviours. Leveraging the proof theoretic content of the soundness and completeness of sequent calculus and natural deduction presentations of linear logic, we develop the first mutually inverse and fully abstract processes-as-functions and functions-as-processes encodings between a polymorphic session π-calculus and a linear formulation of System F. We are then able to derive results of the session calculus from the theory of the Λ-calculus: (1) we obtain a characterisation of inductive and coinductive session types via their algebraic representations in System F; and (2) we extend our results to account for value and process passing, entailing strong normalisation
On polymorphic sessions and functions: A tale of two (fully abstract) encodings
This work exploits the logical foundation of session types to determine what kind of type discipline for the -calculus can exactly capture, and is captured by, -calculus behaviours. Leveraging the proof theoretic content of the soundness and completeness of sequent calculus and natural deduction presentations of linear logic, we develop the first mutually inverse and fully abstract processes-as-functions and functions-as-processes encodings between a polymorphic session -calculus and a linear formulation of System F. We are then able to derive results of the session calculus from the theory of the -calculus: (1) we obtain a characterisation of inductive and coinductive session types via their algebraic representations in System F; and (2) we extend our results to account for value and process passing, entailing strong normalisation
Session types in practical programming
Programs are more distributed and concurrent today than ever before, and structural communications are at the core. Constructing and debugging such programs are hard due to the lack of formal specifications and verifications of concurrency. Recent advances in type systems allow us to specify the structures of communications as session types, thus enabling static type checking of the usages of communication channels against protocols. The soundness of session type systems implies communication fidelity and absence of deadlock. This work proposes to formalize multiparty dependent session types as an expressive and practical type discipline for enforcing communication protocols. The type system is formulated in the setting of multi-threaded λ-calculus with inspirations from multirole logic. It is sound, and it provides linearity and coherence guarantees entirely statically. The type system supports recursion and polymorphism. The formulation is particularly suitable for practical implementation, and this work provides such a runtime implementation
A Higher-Order Logic for Concurrent Termination-Preserving Refinement
Compiler correctness proofs for higher-order concurrent languages are difficult: they involve establishing a termination-preserving refinement between a concurrent high-level source language and an implementation that uses low-level shared memory primitives. However, existing logics for proving concurrent refinement either neglect properties such as termination, or only handle first-order state. In this paper, we address these limitations by extending Iris, a recent higher-order concurrent separation logic, with support for reasoning about termination-preserving refinements. To demonstrate the power of these extensions, we prove the correctness of an efficient implementation of a higher-order, session-typed language. To our knowledge, this is the first program logic capable of giving a compiler correctness proof for such a language. The soundness of our extensions and our compiler correctness proof have been mechanized in Coq