skip to main content
research-article
Open Access

Automatic and efficient variability-aware lifting of functional programs

Published:13 November 2020Publication History
Skip Abstract Section

Abstract

A software analysis is a computer program that takes some representation of a software product as input and produces some useful information about that product as output. A software product line encompasses many software product variants, and thus existing analyses can be applied to each of the product variations individually, but not to the entire product line as a whole. Enumerating all product variants and analyzing them one by one is usually intractable due to the combinatorial explosion of the number of product variants with respect to product line features. Several software analyses (e.g., type checkers, model checkers, data flow analyses) have been redesigned/re-implemented to support variability. This usually requires a lot of time and effort, and the variability-aware version of the analysis might have new errors/bugs that do not exist in the original one.

Given an analysis program written in a functional language based on PCF, in this paper we present two approaches to transforming (lifting) it into a semantically equivalent variability-aware analysis. A light-weight approach (referred to as shallow lifting) wraps the analysis program into a variability-aware version, exploring all combinations of its input arguments. Deep lifting, on the other hand, is a program rewriting mechanism where the syntactic constructs of the input program are rewritten into their variability-aware counterparts. Compositionally this results in an efficient program semantically equivalent to the input program, modulo variability.

We present the correctness criteria for functional program lifting, together with correctness proof sketches of shallow lifting. We evaluate our approach on a set of program analyses applied to the BusyBox C-language product line.

Skip Supplemental Material Section

Supplemental Material

Auxiliary Presentation Video

Given an analysis program written in a functional language based on PCF, in this paper we present two approaches to transforming (lifting) it into a semantically equivalent variability-aware analysis. A light-weight approach (referred to as shallow lifting) wraps the analysis program into a variability-aware version, exploring all combinations of its input arguments. Deep lifting, on the other hand, is a program rewriting mechanism where the syntactic constructs of the input program are rewritten into their variability-aware counterparts.

References

  1. Alejandro Aguirre, Gilles Barthe, Marco Gaboardi, Deepak Garg, and Pierre-Yves Strub. 2017. A Relational Logic for HigherOrder Programs. Proc. ACM Program. Lang. 1, ICFP, Article 21 ( Aug. 2017 ), 29 pages. https://doi.org/10.1145/3110265 Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. Sven Apel, Alexander von Rhein, Philipp Wendler, Armin Größlinger, and Dirk Beyer. 2013. Strategies for Product-line Verification: Case Studies and Experiments. In Proc. of ICSE'13. IEEE Press, 482-491.Google ScholarGoogle ScholarCross RefCross Ref
  3. Michael Arntzenius and Neelakantan R. Krishnaswami. 2016. Datafun: A Functional Datalog. In Proceedings of the 21st ACM SIGPLAN International Conference on Functional Programming (Nara, Japan) (ICFP 2016 ). Association for Computing Machinery, New York, NY, USA, 214-227. https://doi.org/10.1145/2951913.2951948 Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Eric Bodden, Társis Tolêdo, Márcio Ribeiro, Claus Brabrand, Paulo Borba, and Mira Mezini. 2013. SPLLIFT: Statically Analyzing Software Product Lines in Minutes Instead of Years. In Proc. of PLDI'13. ACM, 355-364.Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. Sheng Chen and Martin Erwig. 2014. Type-based Parametric Analysis of Program Families. In Proc. of ICFP'14. ACM, 39-51.Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Andreas Classen, Maxime Cordy, Pierre-Yves Schobbens, Patrick Heymans, Axel Legay, and Jean-Francois Raskin. 2013. Featured Transition Systems: Foundations for Verifying Variability-Intensive Systems and Their Application to LTL Model Checking. IEEE Trans. Softw. Eng. 39, 8 (Aug. 2013 ), 1069-1089.Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Paul Clements and Linda Northrop. 2001. Software Product Lines: Practices and Patterns. Addison-Wesley Professional.Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Krzysztof Czarnecki and Michal Antkiewicz. 2005. Mapping Features to Models: A Template Approach Based on Superimposed Variants. In Proc. of GPCE'05. 422-437.Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Martin Erwig and Eric Walkingshaw. 2011. The Choice Calculus: A Representation for Software Variation. ACM Trans. Softw. Eng. Methodol. 21, 1 (Dec. 2011 ), 6 : 1-6 : 27.Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Paul Gazzillo and Robert Grimm. 2012. SuperC: Parsing All of C by Taming the Preprocessor. In Proc. of PLDI'12. ACM, 323-334.Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Christian Kästner and Sven Apel. 2008. Integrating Compositional and Annotative Approaches for Product Line Engineering.. In Proc. of GPCE'08. 35-40.Google ScholarGoogle Scholar
  12. Christian Kästner, Sven Apel, Thomas Thüm, and Gunter Saake. 2012. Type Checking Annotation-based Product Lines. ACM Trans. Softw. Eng. Methodol. 21, 3 ( July 2012 ), 14 : 1-14 : 39.Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. Christian Kästner, Paolo G. Giarrusso, Tillmann Rendel, Sebastian Erdweg, Klaus Ostermann, and Thorsten Berger. 2011. Variability-aware Parsing in the Presence of Lexical Macros and Conditional Compilation. In Proc. of OOPSLA'11. ACM, 805-824.Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. G. A. Kavvos, Edward Morehouse, Daniel R. Licata, and Norman Danner. 2019. Recurrence Extraction for Functional Programs through Call-by-Push-Value. Proc. ACM Program. Lang. 4, POPL, Article 15 ( Dec. 2019 ), 31 pages. https: //doi.org/10.1145/3371083 Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. Sven Keidel and Sebastian Erdweg. 2019. Sound and Reusable Components for Abstract Interpretation. Proc. ACM Program. Lang. 3, OOPSLA, Article 176 (Oct. 2019 ), 28 pages. https://doi.org/10.1145/3360602 Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Jörg Liebig, Sven Apel, Christian Lengauer, Christian Kästner, and Michael Schulze. 2010. An Analysis of the Variability in Forty Preprocessor-Based Software Product Lines. In Proceedings of the 32nd ACM/IEEE International Conference on Software Engineering-Volume 1 ( Cape Town, South Africa) (ICSE '10). Association for Computing Machinery, New York, NY, USA, 105-114. https://doi.org/10.1145/1806799.1806819 Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Jörg Liebig, Alexander von Rhein, Christian Kästner, Sven Apel, Jens Dörre, and Christian Lengauer. 2013. Scalable Analysis of Variable Software. In Proc. of ESEc/FSE'13. 81-91.Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Magnus Madsen, Ming-Ho Yee, and Ondvrej Lhoták. 2016. From Datalog to Flix: A Declarative Language for Fixed Points on Lattices. In Proceedings of the 37th ACM SIGPLAN Conference on Programming Language Design and Implementation (Santa Barbara, CA, USA) ( PLDI '16). ACM, New York, NY, USA, 194-208. https://doi.org/10.1145/2908080.2908096 Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Jan Midtgaard, Aleksandar S. Dimovski, Claus Brabrand, and Andrzej Wąsowski. 2015. Systematic Derivation of Correct Variability-aware Program Analyses. Sci. Comput. Program. 105, C ( July 2015 ), 145-170.Google ScholarGoogle Scholar
  20. John C. Mitchell. 1996. Foundations for Programming Languages. The MIT Press.Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. Sarah Nadi and Ric Holt. 2014. The Linux Kernel: A Case Study of Build System Variability. J. Softw. Evol. Process 26, 8 (Aug. 2014 ), 730-746. https://doi.org/10.1002/smr.1595 Google ScholarGoogle ScholarDigital LibraryDigital Library
  22. Benjamin C. Pierce. 2002. Types and Programming Languages (1st ed.). The MIT Press.Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. G.D. Plotkin. 1977. LCF considered as a programming language. Theoretical Computer Science 5, 3 ( 1977 ), 223-255. https://doi.org/10.1016/ 0304-3975 ( 77 ) 90044-5 Google ScholarGoogle ScholarCross RefCross Ref
  24. Klaus Pohl, Günter Böckle, and Frank J. van der Linden. 2005. Software Product Line Engineering: Foundations, Principles and Techniques. Springer-Verlag, Berlin, Heidelberg.Google ScholarGoogle ScholarDigital LibraryDigital Library
  25. Thomas Reps, Susan Horwitz, and Mooly Sagiv. 1995. Precise Interprocedural Dataflow Analysis via Graph Reachability. In Proc. of POPL'95. ACM, 49-61.Google ScholarGoogle ScholarDigital LibraryDigital Library
  26. Julia Rubin and Marsha Chechik. 2012. Combining Related Products into Product Lines. In Proc. of FASE'12. LNCS, Vol. 7212. 285-300.Google ScholarGoogle ScholarDigital LibraryDigital Library
  27. Ulrich Schöpp. 2017. Defunctionalisation as Modular Closure Conversion. In Proceedings of the 19th International Symposium on Principles and Practice of Declarative Programming (Namur, Belgium) (PPDP '17). Association for Computing Machinery, New York, NY, USA, 175-186. https://doi.org/10.1145/3131851.3131868 Google ScholarGoogle ScholarDigital LibraryDigital Library
  28. Ramy Shahin and Marsha Chechik. 2020. Variability-Aware Datalog. In Practical Aspects of Declarative Languages, Ekaterina Komendantskaya and Yanhong Annie Liu (Eds.). Springer International Publishing, 213-221.Google ScholarGoogle Scholar
  29. Ramy Shahin, Marsha Chechik, and Rick Salay. 2019. Lifting Datalog-based Analyses to Software Product Lines. In Proceedings of the 2019 27th ACM Joint Meeting on European Software Engineering Conference and Symposium on the Foundations of Software Engineering (Tallinn, Estonia) (ESEC/FSE 2019). ACM, New York, NY, USA, 39-49.Google ScholarGoogle ScholarDigital LibraryDigital Library
  30. Fabio Somenzi. 1998. CUDD: CU Decision Diagram Package Release 2.2.0. (06 1998 ).Google ScholarGoogle Scholar
  31. Thomas Thüm, Sven Apel, Christian Kästner, Ina Schaefer, and Gunter Saake. 2014. A Classification and Survey of Analysis Strategies for Software Product Lines. ACM Comput. Surv. 47, 1, Article 6 ( June 2014 ), 45 pages.Google ScholarGoogle Scholar
  32. Alexander Von Rhein, JöRG Liebig, Andreas Janker, Christian Kästner, and Sven Apel. 2018. Variability-Aware Static Analysis at Scale: An Empirical Study. ACM Trans. Softw. Eng. Methodol. 27, 4, Article 18 ( Nov. 2018 ), 33 pages. https: //doi.org/10.1145/3280986 Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Automatic and efficient variability-aware lifting of functional programs

      Recommendations

      Comments

      Login options

      Check if you have access through your login credentials or your institution to get full access on this article.

      Sign in

      Full Access

      PDF Format

      View or Download as a PDF file.

      PDF

      eReader

      View online with eReader.

      eReader
      About Cookies On This Site

      We use cookies to ensure that we give you the best experience on our website.

      Learn more

      Got it!