Towards Modular Reasoning for Context-Oriented Programs

Context-oriented programming (COP) is an approach to modularity for applications whose behavior may vary depending on the status of the environment in which they execute and the software's own state. Languages supporting COP provide partial methods to modularly define behavioral variations of methods specific to a context, layers to group the partial methods and layer activation mechanisms to dynamically compose layers. Because the behavior of these partial methods often differs from that of the base methods they override, reasoning about context-oriented programs seems to require a case analysis based on partial methods and context information from the entire program, which is not scalable. In this paper we explain a new language feature, layer interfaces, which allows modular specification and verification of context-oriented programs. We demonstrate these techniques by using examples.

[1]  Michael Haupt,et al.  Event-Specific Software Composition in Context-Oriented Programming , 2010, SC@TOOLS.

[2]  Oscar Nierstrasz,et al.  Context-oriented Programming , 2008, J. Object Technol..

[3]  Gregor Kiczales,et al.  Aspect-oriented programming , 2001, ESEC/FSE-9.

[4]  Gary T. Leavens,et al.  Behavioral Subtyping, Specification Inheritance, and Modular Reasoning , 2015, ACM Trans. Program. Lang. Syst..

[5]  Oscar Nierstrasz,et al.  Context-oriented programming: beyond layers , 2007, ICDL '07.

[6]  Hidehiko Masuhara,et al.  Modeling Crosscutting in Aspect-Oriented Mechanisms , 2003, ECOOP.

[7]  Mohamed A. El-Zawawy Testing Automation of Context-Oriented Programs Using Separation Logic , 2014, Appl. Comput. Intell. Soft Comput..

[8]  Jim Hugunin,et al.  Advice weaving in AspectJ , 2004, AOSD '04.

[9]  Kim Mens,et al.  Context-Oriented Programming with the Ambient Object System , 2008, J. Univers. Comput. Sci..

[10]  Gavin M. Bierman,et al.  Separation logic, abstraction and inheritance , 2008, POPL '08.

[11]  Coen De Roover,et al.  Interruptible context-dependent executions: a fresh look at programming context-aware applications , 2012, Onward! 2012.

[12]  Gary T. Leavens,et al.  Translucid contracts: expressive specification and modular verification for aspect-oriented interfaces , 2011, AOSD '11.

[13]  Gavin M. Bierman,et al.  Separation logic and abstraction , 2005, POPL '05.

[14]  Robert Hirschfeld,et al.  Declarative Layer Composition with The JCop Programming Language , 2013, J. Object Technol..

[15]  Matteo Pradella,et al.  Context-oriented programming: A software engineering perspective , 2012, J. Syst. Softw..