Abstract

We introduce the concept of behavioral separation as a general principle for disciplining interference in higher-order imperative concurrent programs, and present a type-based approach that systematically develops the concept in the context of an ML-like language extended with concurrency and synchronization primitives. Behavioral separation builds on notions originally introduced for behavioral type systems and separation logics, but shifts the focus from the separation of static program state properties towards the separation of dynamic usage behaviors of runtime values. Behavioral separation types specify how values may be safely used by client code, and can enforce fine-grained interference control disciplines while preserving compositionality, information hiding, and flexibility. We illustrate how our type system, even if based on a small set of general primitives, is already able to tackle fairly challenging program idioms, involving aliasing at various types, concurrency with first-class threads, manipulation of linked data structures, behavioral borrowing, and invariant-based separation.

Highlights

  • The purpose of this work is to introduce and develop the concept of behavioral separation as a general principle for disciplining interference in higher-order imperative concurrent programs.Statically verifying that higher-order imperative programs do not go wrong in the presence of possible interference has proven to be a challenging task, and a fertile ground for research since the seminal work of Reynolds [32]

  • Behavioral separation builds on notions originally introduced for behavioral type systems and separation logics, but shifts the focus from the separation of static program state properties towards the separation of dynamic usage behaviors of runtime values

  • Let let c = newColl [] in ((c.init “my”); var a in (a := fork(c.scan); c.scan; wait(a); (c.add 1))). This code is well-typed under the current typing assumptions for c, as enforced by the parallel and sequential frame conditions, since the footprints of the fork and wait expressions match the expectations of the global behavioral type

Read more

Summary

Introduction

The purpose of this work is to introduce and develop the concept of behavioral separation as a general principle for disciplining interference in higher-order imperative concurrent programs. Separation logic supports expressive forms of local reasoning, based on the use of the separating conjunction in combination with fractional permissions [9, 5] to characterize the fine structure of program states. Extending such state-based techniques to tackle the sophisticated program idioms arising in modern higher-order imperative concurrent programming is both promising and challenging [36]. As will be clear from our examples, behavioral separation types are expressive and flexible enough for proving safety of programs combining features still challenging for (and even out of reach of) existing proof methods, including general higher-order store, aliasing / sharing at all types, linked data structures, borrowing of local behavior, first-class threads, and even invariant-based separation, based on typed synchronization constructs

Overview
Programming Language
Type System
Subtyping
Typing
Structural Rules
Functional Type
Tuple Type
Behavioral-Separation Types
Isolated Type
Sum Type
Heap Variable Types
Typing the Collection Implementation
Type Preservation and Progress
Invariant-based Separation
Related Work
Conclusions
Recursion
Runtime Configuration Typing
Further Remarks on Type Safety
A double linked List with Concurrent Iterator
Proofs of Main Results
11. Induction on the derivation of A
Some Detailed Typing Derivations
Progress up to locking
Full Text
Published version (Free)

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call