Typing Context-Dependent Behavioural Variation

Pierpaolo Degano
(Dipartimento di Informatica - Università di Pisa)
Gian-Luigi Ferrari
(Dipartimento di Informatica - Università di Pisa)
Letterio Galletta
(Dipartimento di Informatica - Università di Pisa)
Gianluca Mezzetti
(Dipartimento di Informatica - Università di Pisa)

Context Oriented Programming (COP) concerns the ability of programs to adapt to changes in their running environment. A number of programming languages endowed with COP constructs and features have been developed. However, some foundational issues remain unclear. This paper proposes adopting static analysis techniques to reason on and predict how programs adapt their behaviour. We introduce a core functional language, ContextML, equipped with COP primitives for manipulating contexts and for programming behavioural variations. In particular, we specify the dispatching mechanism, used to select the program fragments to be executed in the current active context. Besides the dynamic semantics we present an annotated type system. It guarantees that the well-typed programs adapt to any context, i.e. the dispatching mechanism always succeeds at run-time.

In Simon Gay and Paul Kelly: Proceedings Fifth Workshop on Programming Language Approaches to Concurrency- and Communication-cEntric Software (PLACES 2012), Tallinn, Estonia, 31 March 2012, Electronic Proceedings in Theoretical Computer Science 109, pp. 28–33.
Published: 23rd February 2013.

ArXived at: https://dx.doi.org/10.4204/EPTCS.109.5 bibtex PDF
References in reconstructed bibtex, XML and HTML format (approximated).
Comments and questions to: eptcs@eptcs.org
For website issues: webmaster@eptcs.org