Hostname: page-component-7c8c6479df-p566r Total loading time: 0 Render date: 2024-03-27T23:08:12.631Z Has data issue: false hasContentIssue false

MRI: Modular reasoning about interference in incremental programming

Published online by Cambridge University Press:  11 October 2012

BRUNO C. D. S. OLIVEIRA
Affiliation:
School of Computing, National University of Singapore, Singapore (e-mail: oliveira@comp.nus.edu.sg)
TOM SCHRIJVERS
Affiliation:
Department of Applied Mathematics and Computer ScienceGhent University, Ghent, Belgium (e-mail: tom.schrijvers@ugent.be)
WILLIAM R. COOK
Affiliation:
Department of Computer Science, University of Texas at Austin, University Station, Austin, TX, USA (e-mail: wcook@cs.utexas.edu)
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

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.

Type
Articles
Copyright
Copyright © Cambridge University Press 2012

References

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.Google Scholar
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.CrossRefGoogle Scholar
Bird, R. S. & De Moor, O. (1997) Algebra of Programming. International Series in Computing Science, vol. 100. Upper Saddle River, NJ: Prentice Hall.Google Scholar
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.Google Scholar
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.CrossRefGoogle Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Cook, W. R. (1989) A Denotational Semantics of Inheritance. PhD thesis, Brown University, Providence, RI.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Dahl, O.-J. & Nygaard, K. (1966) Simula: An ALGOL-based simulation language. Commun. AC. 9 (9), 671678.CrossRefGoogle Scholar
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.Google Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Dutchyn, C., Tucker, D. B. & Krishnamurthi, S. (2006) Semantics and scoping of aspects in higher-order languages. Sci. Comput. Program. 63 3, 207239.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.Google Scholar
Hughes, J. (1998) Generalising monads to arrows. Sci. Comput. Program. 37, 67111.CrossRefGoogle Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Katz, S. (1993) A superimposition control construct for distributed systems. ACM Trans. Program. Lang. Syst. 15 2, 337356.CrossRefGoogle Scholar
Katz, S. (2006) Aspect categories and classes of temporal properties. Trans. Aspect-Oriented Softw. Dev. 3880, 106134.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Ligatti, J., Walker, D. & Zdancewic, S. (2006) A type-theoretic interpretation of pointcuts and advice. Sci. Comput. Program. 63 3, 240266.CrossRefGoogle Scholar
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.Google Scholar
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.Google Scholar
McBride, C. & Paterson, R. (2008) Applicative programming with effects. J. Funct. Program. 18 1, 113.CrossRefGoogle Scholar
Müller, P., Poetzsch-Heffter, A. & Leavens, G. T. (2003) Modular specification of frame properties in JML. Concurrency Comput. Pract. Exp. 15 2, 117154.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Peyton Jones, S., Vytiniotis, D., Weirich, S. & Shields, M. (2007) Practical type inference for arbitrary-rank types. J. Funct. Program. 17 01, 182.Google Scholar
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.CrossRefGoogle Scholar
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.Google Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
Reynolds, John C. (1983) Types, abstraction and parametric polymorphism. In Proceedings of the IFIP Congress, pp. 513–523.Google Scholar
Rinard, M., Salcianu, A. & Bugrara, S. (2004) A classification system and analysis for aspect-oriented programs. ACM SIGSOFT Softw. Eng. Notes. 29 6, 147158.CrossRefGoogle Scholar
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.Google Scholar
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.CrossRefGoogle Scholar
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.Google Scholar
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.CrossRefGoogle Scholar
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.CrossRefGoogle Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.