Skip to main content

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 7680))

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Adams, M.D.: Scrap Your Zippers – A Generic Zipper for Heterogeneous Types. In: ACM SIGPLAN Workshop on Generic Programming, pp. 13–24 (2010)

    Google Scholar 

  2. Apel, S., Kästner, C.: An Overview of Feature-Oriented Software Development. Journal of Object Technology 8(5), 49–84 (2009)

    Article  Google Scholar 

  3. 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)

    Chapter  Google Scholar 

  4. Batory, D., Sarvela, J.N., Rauschmayer, A.: Scaling Step-Wise Refinement. IEEE Trans. on Software Engineering 30(6), 355–371 (2004)

    Article  Google Scholar 

  5. Bernstein, P.A., Dayal, U.: An Overview of Repository Technology. In: Int. Conf. on Very Large Databses, pp. 705–712 (1994)

    Google Scholar 

  6. 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)

    Google Scholar 

  7. Bracha, G., Cook, W.: Mixin-Based Inheritance. In: ACM SIGPLAN Int. Conf. on Object-Oriented Programming, Systems, Languages, and Applications, pp. 303–311 (1990)

    Google Scholar 

  8. Darcs, darcs.net

  9. Elrad, T., Filman, R.E., Bader, A.: Aspect-Oriented Programming: Introduction. Communications of the ACM 44(10), 28–32 (2001)

    Google Scholar 

  10. Erwig, M.: A Language for Software Variation. In: ACM SIGPLAN Conf. on Generative Programming and Component Engineering, pp. 3–12 (2010)

    Google Scholar 

  11. Erwig, M., Walkingshaw, E.: Program Fields for Continuous Software. In: ACM SIGSOFT Workshop on the Future of Software Engineering Research, pp. 105–108 (2010)

    Google Scholar 

  12. 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)

    Article  Google Scholar 

  13. GNU Project. The C Preprocessor. Free Software Foundation (2009), gcc.gnu.org/onlinedocs/cpp/

  14. 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)

    Chapter  Google Scholar 

  15. Hoogle, http://haskell.org/hoogle/

  16. 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)

    Google Scholar 

  17. Kästner, C., Apel, S., Kuhlemann, M.: Granularity in Software Product Lines. In: IEEE Int. Conf. on Software Engineering, pp. 311–320 (2008)

    Google Scholar 

  18. 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)

    Article  Google Scholar 

  19. 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)

    Google Scholar 

  20. 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)

    Google Scholar 

  21. 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)

    Article  Google Scholar 

  22. Mens, T.: A state-of-the-art survey on software merging. IEEE Trans. on Software Engineering 28(5), 449–462 (2002)

    Article  Google Scholar 

  23. Mezini, M., Ostermann, K.: Conquering Aspects with Caesar. In: Int. Conf. on Aspect-Oriented Software Development, pp. 90–99 (2003)

    Google Scholar 

  24. Mezini, M., Ostermann, K.: Variability Management with Feature-Oriented Programming and Aspects. ACM SIGSOFT Software Engineering Notes 29(6), 127–136 (2004)

    Article  Google Scholar 

  25. Okasaki, C.: Purely Functional Data Structures. Cambridge University Press, Cambridge (1998)

    Book  MATH  Google Scholar 

  26. O’Sullivan, B.: Making Sense of Revision-Control Systems. Communication of the ACM 52, 56–62 (2009)

    Article  Google Scholar 

  27. Parnas, D.L.: On the Design and Development of Program Families. IEEE Trans. on Software Engineering 2(1), 1–9 (1976)

    Article  MATH  Google Scholar 

  28. PLT. Racket (2011), racket-lang.org/new-name.html

  29. Pohl, K., Böckle, G., van der Linden, F.: Software Product Line Engineering: Foundations, Principles, and Techniques. Springer, Heidelberg (2005)

    Book  MATH  Google Scholar 

  30. Roundy, D.: Darcs: Distributed Version Management in Haskell. In: ACM SIGPLAN Workshop on Haskell, pp. 1–4 (2005)

    Google Scholar 

  31. Sheard, T.: A Taxonomy of Meta-Programming Systems, web.cecs.pdx.edu/~sheard/staged.html

  32. Sheard, T.: Accomplishments and Research Challenges in Meta-programming. In: Taha, W. (ed.) SAIG 2001. LNCS, vol. 2196, pp. 2–44. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  33. Sheard, T., Peyton Jones, S.L.: Template Metaprogramming for Haskell. In: ACM SIGPLAN Workshop on Haskell, pp. 1–16 (2002)

    Google Scholar 

  34. Spencer, H., Collyer, G.: #ifdef Considered Harmful, or Portability Experience With C News. In: USENIX Summer Technical Conference, pp. 185–197 (1992)

    Google Scholar 

  35. Stallman, R.M.: The C Preprocessor. Technical report, GNU Project, Free Software Foundation (1992)

    Google Scholar 

  36. Taha, W., Sheard, T.: MetaML and Multi-Stage Programming with Explicit Annotations. Theoretical Computer Science 248(1-2), 211–242 (2000)

    Article  MATH  Google Scholar 

  37. Tichy, W.F.: Design, Implementation, and Evaluation of a Revision Control System. In: IEEE Int. Conf. on Software Engineering, pp. 58–67 (1982)

    Google Scholar 

  38. Tichy, W.F.: Tools for Software Configuration Management. In: Int. Workshop on Software Version and Configuration Control, pp. 1–20 (1988)

    Google Scholar 

  39. Wadler, P.: Theorems for Free! In: Conf. on Functional Programming and Computer Architecture, pp. 347–359 (1989)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics