Skip to main content
×
Home

MRI: Modular reasoning about interference in incremental programming

  • BRUNO C. D. S. OLIVEIRA (a1), TOM SCHRIJVERS (a2) and WILLIAM R. COOK (a3)
Abstract
Abstract

Incremental Programming (IP) is a programming style in which new program components are defined as increments of other components. Examples of IP mechanisms include Object-oriented programming inheritance, aspect-oriented programming advice, and feature-oriented programming. A characteristic of IP mechanisms is that, while individual components can be independently defined, the composition of components makes those components become tightly coupled, sharing both control and data flows. This makes reasoning about IP mechanisms a notoriously hard problem: modular reasoning about a component becomes very difficult; and it is very hard to tell if two tightly coupled components interfere with each other's control and data flows. This paper presents modular reasoning about interference (MRI), a purely functional model of IP embedded in Haskell. MRI models inheritance with mixins and side effects with monads. It comes with a range of powerful reasoning techniques: equational reasoning, parametricity, and reasoning with algebraic laws about effectful operations. These techniques enable MRI in the presence of side effects. MRI formally captures harmlessness, a hard-to-formalize notion in the interference literature, in two theorems. We prove these theorems with a non-trivial combination of all three reasoning techniques.

Copyright
References
Hide All
Aldrich J. (2005) Open modules: Modular reasoning about advice. In Proceedings of the 19th European Conference on Object-Oriented Programming (ECOOP'05), Berlin, Heidelberg: Springer-Verlag, pp. 144168.
Bagherzadeh M., Rajan H., Leavens G. T. & Mooney S. (2011) Translucid contracts: Expressive specification and modular verification for aspect-oriented interfaces. In Proceedings of the 10th International Conference on Aspect-Oriented Software Development (AOSD'11), New York, NY, USA: ACM, pp. 141152.
Bird R. S. & De Moor O. (1997) Algebra of Programming. International Series in Computing Science, vol. 100. Upper Saddle River, NJ: Prentice Hall.
Bracha G. & Cook W. (1990) Mixin-based inheritance. In Proceedings of the European Conference on Object-Oriented Programming on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA/ECOOP ‘90). New York, NY: ACM, pp. 303311.
Chen K., Weng S.-C., Lin J.-Y., Wang M. & Khoo S.-C. (2011) Side-effect localization for lazy, purely functional languages via aspects. Higher-Order Symb. Comput. 24 (1–2), 139.
Chen K., Weng S., Wang M., Khoo S. & Chen C. (2007) A compilation model for aspect-oriented polymorphically typed functional languages. In Proceedings of the 14th International Symposium on Static Analysis (SAS'07), Berlin, Heidelberg: Springer-Verlag, pp. 3451.
Clifton C. & Leavens G. T. (2002) Observers and assistants: A proposal for modular aspect-oriented reasoning. In Proceedings of the 1st Workshop on Foundations of Aspect-Oriented Languages (FOAL'02), pp. 33–44.
Clifton C., Leavens G. T. & Noble J. (2007) MAO: Ownership and effects for more effective reasoning about aspects. In Proceedings of the 21st European Conference on Object-Oriented Programming (ECOOP'07), Berlin: Springer-Verlag, pp. 451475.
Cook W. R. (1989) A Denotational Semantics of Inheritance. PhD thesis, Brown University, Providence, RI.
Cook W. & Palsberg J. (1989) A denotational semantics of inheritance and its correctness. In Conference Proceedings on Object-Oriented Programming Systems, Languages and Applications (OOPSLA ‘89), New York, NY, USA: ACM, pp. 433443.
Dahl O.-J. & Nygaard K. (1966) Simula: An ALGOL-based simulation language. Commun. AC. 9 (9), 671678.
Dantas D. S. & Walker D. (2006) Harmless advice. In Proceedings of the 33rd Symposium on Principles of Programming Languages (POPL'06), New York, NY, USA: ACM, pp. 383396.
Dantas D. S., Walker D., Washburn G. & Weirich S. (2008) AspectML: A polymorphic aspect-oriented functional programming language. ACM Trans. Program. Lang. Syst. 30 (3), 160.
De Fraine B. & Braem M. (2007) Requirements for reusable aspect deployment. In Software Composition, Lumpe M. & Vanderperren W. (eds), Lecture Notes in Computer Science, vol. 4829. Berlin, Germany: Springer, pp. 176183.
Douence R., Fradet P. & Südholt M. (2004) Composition, reuse and interaction analysis of stateful aspects. In Proceedings of the 3rd International Conference on Aspect-Oriented Software Development (AOSD'04), New York, NY, USA: ACM, pp. 141150.
Dutchyn C., Tucker D. B. & Krishnamurthi S. (2006) Semantics and scoping of aspects in higher-order languages. Sci. Comput. Program. 63 3, 207239.
Flatt M., Krishnamurthi S. & Felleisen M. (1998) Classes and mixins. In Proceedings of the 25th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages (Popl ‘98), San Diego, CA. New York, NY: ACM, pp. 171183.
Gibbons J. & Hinze R. (2011) Just do it: Simple monadic equational reasoning. In Proceedings of the 16th International Conference on Functional Programming (ICFP'11), New York, NY, USA: ACM, pp. 214.
Hughes J. (1998) Generalising monads to arrows. Sci. Comput. Program. 37, 67111.
Hutton G. & Fulger D. (2008) Reasoning about effects: Seeing the wood through the trees. Proceedings of the Symposium on Trends in Functional Programming, Nijmegen, The Netherlands, May 2628.
Jaskelioff M. (2008) Monatron: An extensible monad transformer library. Proceedings of the 20th International Conference on Implementation and Application of Functional Languages (IFL'08), pp. 233–248.
Jones Mark P. (2000) Type classes with functional dependencies. In Proceedings of the 2000 European Symposium on Programming (ESOP'00), Lecture Notes in Computer Science, vol. 1782, London, UK: Springer-Verlag, pp. 230244.
Katz S. (1993) A superimposition control construct for distributed systems. ACM Trans. Program. Lang. Syst. 15 2, 337356.
Katz S. (2006) Aspect categories and classes of temporal properties. Trans. Aspect-Oriented Softw. Dev. 3880, 106134.
Kiczales G. & Lamping J. (1992) Issues in the design and specification of class libraries. In Proceedings of the 7th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'92), New York, NY, USA: ACM, pp. 435451.
Kiczales G., Lamping J., Menhdhekar A., Maeda C., Lopes C., Loingtier J., & Irwin J. (1997) Aspect-oriented programming. In Proceedings of the 17th European Conference on Object-Oriented Programming (ECOOP'97), Berlin, Heidelberg: Springer-Verlag, pp. 220242.
Kiczales G. & Mezini M. (2005) Aspect-oriented programming and modular reasoning. Proceedings of the 27th International Conference on Software Engineering (ICSE'05), New York, NY, USA: ACM, St. Louis, MO, May 15–21, pp. 4958.
Lamping J. (1993) Typing the specialization interface. In Proceedings of the 8th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'93), New York, NY, USA: ACM, pp. 201214.
Leino K. & Rustan M. (1998) Data groups: Specifying the modification of extended state. In Proceedings of the 13th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'98), New York, NY, USA: ACM, pp. 144153.
Lewis J. R., Launchbury J., Meijer E. & Shields M. B. (2000) Implicit parameters: Dynamic scoping with static types. In Proceedings of the 27th Symposium on Principles of Programming Languages (POPL'00), New York, NY, USA: ACM, pp. 108118.
Liang S. & Hudak P. (1996) Modular denotational semantics for compiler construction. In Proceedings of the European Symposium on Programming (ESOP'96). Berlin, Germany: Springer-Verlag, pp. 219234.
Liang S., Hudak P. & Jones M. (1995) Monad transformers and modular interpreters. In Proceedings of the 22nd Symposium on Principles of Programming Languages (POPL'95), New York, NY, USA: ACM, pp. 333343.
Ligatti J., Walker D. & Zdancewic S. (2006) A type-theoretic interpretation of pointcuts and advice. Sci. Comput. Program. 63 3, 240266.
Lopez-Herrejon R., Batory D. & Lengauer C. (2006) A disciplined approach to aspect composition. In Proceedings of the Symposium on Partial Evaluation and Semantics-Based Program Manipulation (PEPM'06), New York, NY, USA: ACM, pp. 6877.
Masuhara H., Tatsuzawa H. & Yonezawa A. (2005) Aspectual Caml: An aspect-oriented functional language. In Proceedings of the 10th International Conference on Functional Programming (ICFP'05), New York, NY, USA: ACM, pp. 320330.
McBride C. & Paterson R. (2008) Applicative programming with effects. J. Funct. Program. 18 1, 113.
Müller P., Poetzsch-Heffter A. & Leavens G. T. (2003) Modular specification of frame properties in JML. Concurrency Comput. Pract. Exp. 15 2, 117154.
Oliveira Bruno C. d. S., Schrijvers T. & Cook W. R. (2010) EffectiveAdvice: Disciplined advice with explicit effects. In Proceedings of the 9th International Conference on Aspect-Oriented Software Development (AOSD'10). New York, NY: ACM, pp. 109120.
Peyton Jones S., Vytiniotis D., Weirich S. & Shields M. (2007) Practical type inference for arbitrary-rank types. J. Funct. Program. 17 01, 182.
Prehofer C. (1997) Feature-oriented programming: A fresh look at objects. In Proceedings of the 11th European Conference on Object-Oriented Programming (ECOOP'97), Berlin, Heidelberg: Springer-Verlag, pp. 419443.
Prehofer C. (1999) Flexible Construction of Software Components: A Feature Oriented Approach. Habilitation Thesis, Fakultät für Informatik der Technischen Universität München.
Prehofer C. (2006) Semantic reasoning about feature composition via multiple aspect-weavings. In Proceedings of the 5th International Conference on Generative Programming and Component Engineering (GPCE'06), New York, NY, USA: ACM, pp. 237242.
Reynolds J. C. (1974) Towards a theory of type structure. Proceedings of Programming Symposium, Lecture Notes in Computer Science, vol. 19. New York: Springer-Verlag, pp. 408423.
Reynolds John C. (1983) Types, abstraction and parametric polymorphism. In Proceedings of the IFIP Congress, pp. 513–523.
Rinard M., Salcianu A. & Bugrara S. (2004) A classification system and analysis for aspect-oriented programs. ACM SIGSOFT Softw. Eng. Notes. 29 6, 147158.
Ruby C. & Leavens G. T. (2000) Safely creating correct subclasses without seeing superclass code. In Proceedings of the 15th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'00), New York, NY, USA: ACM, pp. 208228.
Salcianu A. & Rinard M. C. (2005) Purity and side effect analysis for JAVA programs. In Proceedings of the 6th International Conference on Verification, Model Checking, and Abstract Interpretation (VMCAI'05), Berlin, Heidelberg: Springer-Verlag, Lecture Notes in Computer Science, vol. 3385, pp. 199215.
Schrijvers T. & Oliveira Bruno C. d. S. (2011) Monads, zippers and views: Virtualizing the monad stack. In Proceedings of the 16th International Conference on Functional Programming (ICFP'11), New York, NY, USA: ACM, pp. 3244.
Stata R. & Guttag J. V. (1995) Modular reasoning in the presence of subclassing. In Proceedings of the 10th Annual Conference on Object-Oriented Programming Systems, Languages, and Applications (OOPSLA'95), New York, NY, USA: ACM, pp. 200214.
Tanter É. (2008) Expressive scoping of dynamically deployed aspects. In Proceedings of the 7th International Conference on Aspect-Oriented Software Development (AOSD'08), New York, NY, USA: ACM, pp. 168179.
Voigtländer J. (2009) Free theorems involving type constructor classes. In Proceedings of the 14th International Conference on Functional Programming (ICFP'09), New York, NY, USA: ACM, pp. 173184.
Wadler P. (1989) Theorems for free! In Proceedings of the 4th International Conference on Functional Programming and Computer Architecture (FPLCA'89), New York, NY, USA: ACM, pp. 347359.
Wadler P. (1992a) The essence of functional programming. In Proceedings of the 19th Symposium on Principles of Programming Languages (POPL'92), New York, NY, USA: ACM, pp. 114.
Wadler P. (1992b) Monads for functional programming. Proceedings of the Marktoberdorf Summer Schoolon Program Design Calculi, NATO ASI Series F: Computer and Systems Sciences, vol. 118. New York: Springer-Verlag.
Wang M. & Oliveira Bruno C. d. S. (2009) What does aspect-oriented programming mean for functional programmers? In Proceedings of the 8th Workshop on Generic Programming (WGP'09), New York, NY, USA: ACM, pp. 3748.
Recommend this journal

Email your librarian or administrator to recommend adding this journal to your organisation's collection.

Journal of Functional Programming
  • ISSN: 0956-7968
  • EISSN: 1469-7653
  • URL: /core/journals/journal-of-functional-programming
Please enter your name
Please enter a valid email address
Who would you like to send this to? *
×

Metrics

Full text views

Total number of HTML views: 0
Total number of PDF views: 8 *
Loading metrics...

Abstract views

Total abstract views: 130 *
Loading metrics...

* Views captured on Cambridge Core between September 2016 - 11th December 2017. This data will be updated every 24 hours.