Typing Context-Dependent Behavioural Variation
Pierpaolo Degano (Dipartimento di Informatica - Universit\`a di Pisa),, Gian-Luigi Ferrari (Dipartimento di Informatica - Universit\`a di Pisa),, Letterio Galletta (Dipartimento di Informatica - Universit\`a di Pisa),

TL;DR
This paper introduces ContextML, a core language with static analysis and type system guarantees, enabling predictable context-dependent behavioral adaptation in programs.
Contribution
It presents a formal core language with COP primitives and a type system that ensures reliable context-based program dispatching.
Findings
Type system guarantees successful dispatch at runtime
Formal semantics for context-dependent behavior
Predictability in context-oriented programming
Abstract
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.
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
TopicsAdvanced Software Engineering Methodologies · Logic, programming, and type systems · Distributed systems and fault tolerance
