Chaperone Contracts for Higher-Order Sessions

Abstract : Contracts have proved to be an effective mechanism that helps developers in identifying those modules of a program that violate the contracts of the functions and objects they use. In recent years, sessions have been established as a key mechanism for realizing inter-module communications in concurrent programs. Just like values flow into or out of a function or object, messages are sent on, and received from, a session endpoint. Unlike conventional functions and objects, however, the kind, direction, and properties of messages exchanged in a session may vary over time, as the session progresses. This feature of sessions calls for contracts that evolve along with the session they describe. In this work, we extend to sessions the notion of chaperone contract (roughly, a contract that applies to a mutable object) and investigate the ramifications of contract monitoring in a higher-order language that features sessions. We give a characterization of a correct module, one that honors the contracts of the sessions it uses, and prove a blame theorem. Guided by the calculus, we describe a lightweight implementation of monitored sessions as an OCaml module with which programmers can benefit from static session type checking and dynamic contract monitoring using an off-the-shelf version of OCaml.
Type de document :
Pré-publication, Document de travail
2017
Liste complète des métadonnées

Littérature citée [88 références]  Voir  Masquer  Télécharger

https://hal.archives-ouvertes.fr/hal-01545695
Contributeur : Luca Padovani <>
Soumis le : vendredi 23 juin 2017 - 08:47:25
Dernière modification le : lundi 3 juillet 2017 - 18:29:35

Fichier

techreport.pdf
Fichiers produits par l'(les) auteur(s)

Licence


Distributed under a Creative Commons Paternité 4.0 International License

Identifiants

  • HAL Id : hal-01545695, version 1

Citation

Hernán Melgratti, Luca Padovani. Chaperone Contracts for Higher-Order Sessions. 2017. 〈hal-01545695〉

Partager

Métriques

Consultations de la notice

34

Téléchargements de fichiers

25