Self-adaptive software modifies its behavior at run time to satisfy changing requirements in a dynamic environment. Recently, context-oriented programming (COP) has been proposed as a specialized programming paradigm for context-aware and adaptive systems. COP mostly focuses on run time adaptation of the application behavior and modularization of behavioral variations. However, there are other requirements that are specific of adaptive applications. Most notably, distribution and concurrency, support for unforeseen changes and enforcement of correct behavior in presence of dynamic change. Addressing these issues at the language level requires a holistic design that covers all aspects and takes into account the possibly cumbersome interaction of those features, for example concurrency and dynamic change.
ContextErlang is a COP programming language in which adaptive abstractions are designed in synergy with distribution and concurrency. ContextErlang has a formal semantics, validated through an executable prototype, as a conceptual model.
ContextErlang, introduces context-oriented programming (COP) in Erlang through the integration of COP concepts with the effective Erlang concurrency model. ContextErlang is based on the concept of context-aware reactive agents. Context-adaptable agents have a basic behavior which can be altered by variations, i.e. behavioral units that can be activated on the agent. The composition of all the active variations with the basic behavior produce the actual behavior of the agent.
ContextErlStorage A simple application based on ContextErlang. An erlang app that implements an adaptable storage service. Items can be stored and retrieved from their assigned key. Items required most frequently are placed in memory, others on disk.
Each item is implemented as an independent ContextErlang adaptable agent. Adaptability is implemented through the ContextErlang disk and memory variations, dynamically activated when required. Additionally alog variation can be activated.
ContextChat The chat prototype implemented in ContextErlang. Users in the systems are represented as context-adaptable agents. User conditions (e.g. online/offline), logging, remote backup are represented as context and dynamically activated on each agent.
MAUDE Prototype The prototype for the executable semantics in Maude. We used it to develop the formal semantics of ContextErlang.