[go: up one dir, main page]
More Web Proxy on the site http://driver.im/ skip to main content
research-article
Open access

Automatic and efficient variability-aware lifting of functional programs

Published: 13 November 2020 Publication History

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.

Supplementary Material

Auxiliary Presentation Video (oopsla20main-p113-p-video.mp4)
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
[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.
[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
[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.
[5]
Sheng Chen and Martin Erwig. 2014. Type-based Parametric Analysis of Program Families. In Proc. of ICFP'14. ACM, 39-51.
[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.
[7]
Paul Clements and Linda Northrop. 2001. Software Product Lines: Practices and Patterns. Addison-Wesley Professional.
[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.
[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.
[10]
Paul Gazzillo and Robert Grimm. 2012. SuperC: Parsing All of C by Taming the Preprocessor. In Proc. of PLDI'12. ACM, 323-334.
[11]
Christian Kästner and Sven Apel. 2008. Integrating Compositional and Annotative Approaches for Product Line Engineering. In Proc. of GPCE'08. 35-40.
[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.
[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.
[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
[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
[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
[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.
[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
[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.
[20]
John C. Mitchell. 1996. Foundations for Programming Languages. The MIT Press.
[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
[22]
Benjamin C. Pierce. 2002. Types and Programming Languages (1st ed.). The MIT Press.
[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
[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.
[25]
Thomas Reps, Susan Horwitz, and Mooly Sagiv. 1995. Precise Interprocedural Dataflow Analysis via Graph Reachability. In Proc. of POPL'95. ACM, 49-61.
[26]
Julia Rubin and Marsha Chechik. 2012. Combining Related Products into Product Lines. In Proc. of FASE'12. LNCS, Vol. 7212. 285-300.
[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
[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.
[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.
[30]
Fabio Somenzi. 1998. CUDD: CU Decision Diagram Package Release 2.2.0. (06 1998 ).
[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.
[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

Cited By

View all
  • (2025)A structural taxonomy for lifted software product line analysesJournal of Systems and Software10.1016/j.jss.2024.112280222(112280)Online publication date: Apr-2025
  • (2024)Score-based causal discovery of latent variable causal modelsProceedings of the 41st International Conference on Machine Learning10.5555/3692070.3693595(37531-37552)Online publication date: 21-Jul-2024
  • (2024)On the Expressive Power of Languages for Static VariabilityProceedings of the ACM on Programming Languages10.1145/36897478:OOPSLA2(1018-1050)Online publication date: 8-Oct-2024
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image Proceedings of the ACM on Programming Languages
Proceedings of the ACM on Programming Languages  Volume 4, Issue OOPSLA
November 2020
3108 pages
EISSN:2475-1421
DOI:10.1145/3436718
Issue’s Table of Contents
This work is licensed under a Creative Commons Attribution-NonCommercial-NoDerivatives International 4.0 License.

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 13 November 2020
Published in PACMPL Volume 4, Issue OOPSLA

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. Lifting
  2. PCF
  3. Program Rewriting
  4. Software Product Lines
  5. Variability-aware Programming

Qualifiers

  • Research-article

Funding Sources

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)174
  • Downloads (Last 6 weeks)20
Reflects downloads up to 15 Jan 2025

Other Metrics

Citations

Cited By

View all
  • (2025)A structural taxonomy for lifted software product line analysesJournal of Systems and Software10.1016/j.jss.2024.112280222(112280)Online publication date: Apr-2025
  • (2024)Score-based causal discovery of latent variable causal modelsProceedings of the 41st International Conference on Machine Learning10.5555/3692070.3693595(37531-37552)Online publication date: 21-Jul-2024
  • (2024)On the Expressive Power of Languages for Static VariabilityProceedings of the ACM on Programming Languages10.1145/36897478:OOPSLA2(1018-1050)Online publication date: 8-Oct-2024
  • (2024)Probabilistic Graph Queries for Design Space Exploration Under UncertaintyProceedings of the ACM/IEEE 27th International Conference on Model Driven Engineering Languages and Systems10.1145/3652620.3688199(142-148)Online publication date: 22-Sep-2024
  • (2024)(Neo4j)^ Browser: Visualizing Variable-Aware Analysis ResultsProceedings of the 2024 IEEE/ACM 46th International Conference on Software Engineering: Companion Proceedings10.1145/3639478.3640046(69-73)Online publication date: 14-Apr-2024
  • (2023)Reusing Your Favourite Analysis Framework to Handle Workflows of Product Line ModelsProceedings of the 27th ACM International Systems and Software Product Line Conference - Volume A10.1145/3579027.3608983(117-128)Online publication date: 28-Aug-2023
  • (2023)Code-Level Functional Equivalence Checking of Annotative Software Product LinesProceedings of the 27th ACM International Systems and Software Product Line Conference - Volume A10.1145/3579027.3608978(64-75)Online publication date: 28-Aug-2023
  • (2023)Adding Product-Line Capabilities to Your Favourite Modeling LanguageProceedings of the 17th International Working Conference on Variability Modelling of Software-Intensive Systems10.1145/3571788.3571791(3-12)Online publication date: 25-Jan-2023
  • (2023)Annotative Software Product Line Analysis Using Variability-Aware DatalogIEEE Transactions on Software Engineering10.1109/TSE.2022.317575249:3(1323-1341)Online publication date: 1-Mar-2023
  • (2023)Variability-aware Neo4j for Analyzing a Graphical Model of a Software Product Line2023 ACM/IEEE 26th International Conference on Model Driven Engineering Languages and Systems (MODELS)10.1109/MODELS58315.2023.00034(307-318)Online publication date: 1-Oct-2023
  • Show More Cited By

View Options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Login options

Full Access

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media