Abstract
The choice calculus provides a language for representing and transforming variation in software and other structured documents. Variability is captured in localized choices between alternatives. The space of all variations is organized by dimensions, which provide scoping and structure to choices. The variation space can be reduced through a process of selection, which eliminates a dimension and resolves all of its associated choices by replacing each with one of their alternatives. The choice calculus also allows the definition of arbitrary functions for the flexible construction and transformation of all kinds of variation structures. In this tutorial we will first present the motivation, general ideas, and principles that underlie the choice calculus. This is followed by a closer look at the semantics. We will then present practical applications based on several small example scenarios and consider the concepts of ”variation programming” and ”variation querying”. The practical applications involve work with a Haskell library that supports variation programming and experimentation with the choice calculus.
This work is partially supported by the Air Force Office of Scientific Research under the grant FA9550-09-1-0229 and by the National Science Foundation under the grant CCF-0917092.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
References
Adams, M.D.: Scrap Your Zippers – A Generic Zipper for Heterogeneous Types. In: ACM SIGPLAN Workshop on Generic Programming, pp. 13–24 (2010)
Apel, S., Kästner, C.: An Overview of Feature-Oriented Software Development. Journal of Object Technology 8(5), 49–84 (2009)
Batory, D.: Feature Models, Grammars, and Propositional Formulas. In: Obbink, H., Pohl, K. (eds.) SPLC 2005. LNCS, vol. 3714, pp. 7–20. Springer, Heidelberg (2005)
Batory, D., Sarvela, J.N., Rauschmayer, A.: Scaling Step-Wise Refinement. IEEE Trans. on Software Engineering 30(6), 355–371 (2004)
Bernstein, P.A., Dayal, U.: An Overview of Repository Technology. In: Int. Conf. on Very Large Databses, pp. 705–712 (1994)
Boucher, Q., Classen, A., Heymans, P., Bourdoux, A., Demonceau, L.: Tag and Prune: A Pragmatic Approach to Software Product Line Implementation. In: IEEE Int. Conf. on Automated Software Engineering, pp. 333–336 (2010)
Bracha, G., Cook, W.: Mixin-Based Inheritance. In: ACM SIGPLAN Int. Conf. on Object-Oriented Programming, Systems, Languages, and Applications, pp. 303–311 (1990)
Darcs, darcs.net
Elrad, T., Filman, R.E., Bader, A.: Aspect-Oriented Programming: Introduction. Communications of the ACM 44(10), 28–32 (2001)
Erwig, M.: A Language for Software Variation. In: ACM SIGPLAN Conf. on Generative Programming and Component Engineering, pp. 3–12 (2010)
Erwig, M., Walkingshaw, E.: Program Fields for Continuous Software. In: ACM SIGSOFT Workshop on the Future of Software Engineering Research, pp. 105–108 (2010)
Erwig, M., Walkingshaw, E.: The Choice Calculus: A Representation for Software Variation. ACM Trans. on Software Engineering and Methodology 21(1), 6:1–6:27 (2011)
GNU Project. The C Preprocessor. Free Software Foundation (2009), gcc.gnu.org/onlinedocs/cpp/
Höfner, P., Khedri, R., Möller, B.: Feature Algebra. In: Misra, J., Nipkow, T., Sekerinski, E. (eds.) FM 2006. LNCS, vol. 4085, pp. 300–315. Springer, Heidelberg (2006)
Hoogle, http://haskell.org/hoogle/
Kang, K.C., Cohen, S.G., Hess, J.A., Novak, W.E., Peterson, A.S.: Feature-Oriented Domain Analysis (FODA) Feasibility Study. Technical Report CMU/SEI-90-TR-21, Software Engineering Institute, Carnegie Mellon University (November 1990)
Kästner, C., Apel, S., Kuhlemann, M.: Granularity in Software Product Lines. In: IEEE Int. Conf. on Software Engineering, pp. 311–320 (2008)
Kiczales, G., Hilsdale, E., Hugunin, J., Kersten, M., Palm, J., Griswold, W.G.: Getting Started with Aspect. J. Communications of the ACM 44(10), 59–65 (2001)
Lämmel, R., Peyton Jones, S.: Scrap Your Boilerplate: A Practical Design Pattern for Generic Programming. In: ACM SIGPLAN Workshop on Types in Language Design and Implementation, pp. 26–37 (2003)
Liebig, J., Kästner, C., Apel, S.: Analyzing the Discipline of Preprocessor Annotations in 30 Million Lines of C Code. In: Int. Conf. on Aspect-Oriented Software Development, pp. 191–202 (2011)
MacKay, S.A.: The State of the Art in Concurrent, Distributed Configuration Management. Software Configuration Management: Selected Papers SCM-4 and SCM 5, 180–194 (1995)
Mens, T.: A state-of-the-art survey on software merging. IEEE Trans. on Software Engineering 28(5), 449–462 (2002)
Mezini, M., Ostermann, K.: Conquering Aspects with Caesar. In: Int. Conf. on Aspect-Oriented Software Development, pp. 90–99 (2003)
Mezini, M., Ostermann, K.: Variability Management with Feature-Oriented Programming and Aspects. ACM SIGSOFT Software Engineering Notes 29(6), 127–136 (2004)
Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1998)
O’Sullivan, B.: Making Sense of Revision-Control Systems. Communication of the ACM 52, 56–62 (2009)
Parnas, D.L.: On the Design and Development of Program Families. IEEE Trans. on Software Engineering 2(1), 1–9 (1976)
PLT. Racket (2011), racket-lang.org/new-name.html
Pohl, K., Böckle, G., van der Linden, F.: Software Product Line Engineering: Foundations, Principles, and Techniques. Springer, Heidelberg (2005)
Roundy, D.: Darcs: Distributed Version Management in Haskell. In: ACM SIGPLAN Workshop on Haskell, pp. 1–4 (2005)
Sheard, T.: A Taxonomy of Meta-Programming Systems, web.cecs.pdx.edu/~sheard/staged.html
Sheard, T.: Accomplishments and Research Challenges in Meta-programming. In: Taha, W. (ed.) SAIG 2001. LNCS, vol. 2196, pp. 2–44. Springer, Heidelberg (2001)
Sheard, T., Peyton Jones, S.L.: Template Metaprogramming for Haskell. In: ACM SIGPLAN Workshop on Haskell, pp. 1–16 (2002)
Spencer, H., Collyer, G.: #ifdef Considered Harmful, or Portability Experience With C News. In: USENIX Summer Technical Conference, pp. 185–197 (1992)
Stallman, R.M.: The C Preprocessor. Technical report, GNU Project, Free Software Foundation (1992)
Taha, W., Sheard, T.: MetaML and Multi-Stage Programming with Explicit Annotations. Theoretical Computer Science 248(1-2), 211–242 (2000)
Tichy, W.F.: Design, Implementation, and Evaluation of a Revision Control System. In: IEEE Int. Conf. on Software Engineering, pp. 58–67 (1982)
Tichy, W.F.: Tools for Software Configuration Management. In: Int. Workshop on Software Version and Configuration Control, pp. 1–20 (1988)
Wadler, P.: Theorems for Free! In: Conf. on Functional Programming and Computer Architecture, pp. 347–359 (1989)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2013 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Erwig, M., Walkingshaw, E. (2013). Variation Programming with the Choice Calculus. In: Lämmel, R., Saraiva, J., Visser, J. (eds) Generative and Transformational Techniques in Software Engineering IV. GTTSE 2011. Lecture Notes in Computer Science, vol 7680. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-35992-7_2
Download citation
DOI: https://doi.org/10.1007/978-3-642-35992-7_2
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-642-35991-0
Online ISBN: 978-3-642-35992-7
eBook Packages: Computer ScienceComputer Science (R0)