A Calculus for Variational Programming

Variation is ubiquitous in software. Many applications can benefit from making this variation explicit, then manipulating and computing with it directly---a technique we call "variational programming". This idea has been independently discovered in several application domains, such as efficiently analyzing and verifying software product lines, combining bounded and symbolic model-checking, and computing with alternative privacy profiles. Although these domains share similar core problems, and there are also many similarities in the solutions, there is no dedicated programming language support for variational programming. This makes the various implementations tedious, prone to errors, hard to maintain and reuse, and difficult to compare. In this paper we present a calculus that forms the basis of a programming language with explicit support for representing, manipulating, and computing with variation in programs and data. We illustrate how such a language can simplify the implementation of variational programming tasks. We present the syntax and semantics of the core calculus, a sound type system, and a type inference algorithm that produces principal types.

[1]  Martin Erwig,et al.  Guided Type Debugging , 2014, FLOPS.

[2]  Gunter Saake,et al.  Type checking annotation-based product lines , 2012, TSEM.

[3]  Andrej Bauer,et al.  Programming with algebraic effects and handlers , 2012, J. Log. Algebraic Methods Program..

[4]  Krzysztof Czarnecki,et al.  Mining configuration constraints: static analyses and empirical results , 2014, ICSE.

[5]  David Brumley,et al.  Tachyon: Tandem Execution for Efficient Live Patch Testing , 2012, USENIX Security Symposium.

[6]  Martin Erwig,et al.  The Choice Calculus: A Representation for Software Variation , 2011, TSEM.

[7]  Gunter Saake,et al.  A Classification and Survey of Analysis Strategies for Software Product Lines , 2014, ACM Comput. Surv..

[8]  Mona Attariyan,et al.  AutoBash: improving configuration management with operating system causality analysis , 2007, SOSP.

[9]  Cristian Cadar,et al.  Safe software updates via multi-version execution , 2013, 2013 35th International Conference on Software Engineering (ICSE).

[10]  Martin Erwig,et al.  Adding configuration to the choice calculus , 2013, VaMoS.

[11]  Martin Erwig,et al.  An error-tolerant type system for variational lambda calculus , 2012, ICFP.

[12]  Mira Mezini,et al.  Variability management with feature-oriented programming and aspects , 2004, SIGSOFT '04/FSE-12.

[13]  Sven Apel,et al.  Variational Data Structures: Exploring Tradeoffs in Computing with Variability , 2014, Onward!.

[14]  Thomas H. Austin,et al.  Multiple facets for dynamic information flow , 2012, POPL '12.

[15]  Martin Erwig,et al.  Principal type inference for GADTs , 2016, POPL.

[16]  Martin Erwig,et al.  A calculus for modeling and implementing variation , 2012, GPCE '12.

[17]  Hung Viet Nguyen,et al.  Exploring variability-aware execution for testing plugin-based web applications , 2014, ICSE.

[18]  Don Batory,et al.  Scaling step-wise refinement , 2003, 25th International Conference on Software Engineering, 2003. Proceedings..

[19]  Martin Erwig,et al.  Let's hear both sides: On combining type-error reporting tools , 2014, 2014 IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC).

[20]  Mira Mezini,et al.  SPLLIFT: statically analyzing software product lines in minutes instead of years , 2013, Software Engineering.

[21]  Xiangyu Zhang,et al.  Coalescing executions for fast uncertainty analysis , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[22]  Martin Odersky,et al.  Type Inference with Constrained Types , 1999, Theory Pract. Object Syst..

[23]  Emina Torlak,et al.  A lightweight symbolic virtual machine for solver-aided host languages , 2014, PLDI.

[24]  Viviana Bono,et al.  Delta-Oriented Programming of Software Product Lines , 2010, SPLC.

[25]  Claus Brabrand,et al.  Intraprocedural dataflow analysis for software product lines , 2012, AOSD.

[26]  Marcelo d'Amorim,et al.  Delta Execution for Efficient State-Space Exploration of Object-Oriented Programs , 2007, IEEE Transactions on Software Engineering.

[27]  Martin Sulzmann A General Type Inference Framework for Hindley/Milner Style Systems , 2001, FLOPS.

[28]  Eric Walkingshaw,et al.  The choice calculus : a formal language of variation , 2013 .

[29]  Martin Erwig,et al.  Type-based parametric analysis of program families , 2014, ICFP.

[30]  Gordon D. Plotkin,et al.  Adequacy for Algebraic Effects , 2001, FoSSaCS.

[31]  Benjamin Livshits,et al.  Rozzle: De-cloaking Internet Malware , 2012, 2012 IEEE Symposium on Security and Privacy.

[32]  Robert Harper,et al.  Practical Foundations for Programming Languages (2nd. Ed.) , 2016 .

[33]  Ohad Kammar,et al.  Handlers in action , 2013, ICFP.

[34]  Sarfraz Khurshid,et al.  Shared Execution for Efficiently Testing Product Lines , 2012, 2012 IEEE 23rd International Symposium on Software Reliability Engineering.

[35]  Sven Apel,et al.  Type safety for feature-oriented product lines , 2010, Automated Software Engineering.

[36]  Sebastian Erdweg,et al.  Variability-aware parsing in the presence of lexical macros and conditional compilation , 2011, OOPSLA '11.

[37]  Martin Erwig,et al.  Early detection of type errors in C++ templates , 2014, PEPM '14.

[38]  A. Prasad Sistla,et al.  Preventing Information Leaks through Shadow Executions , 2008, 2008 Annual Computer Security Applications Conference (ACSAC).

[39]  Eric Walkingshaw,et al.  Projectional editing of variational software , 2015 .

[40]  William R. Cook,et al.  Safe composition of product lines , 2007, GPCE '07.

[41]  Sven Apel,et al.  Domain Types: Selecting Abstractions Based on Variable Usage , 2013, ArXiv.

[42]  Dominique Devriese,et al.  Noninterference through Secure Multi-execution , 2010, 2010 IEEE Symposium on Security and Privacy.

[43]  Dominique Devriese,et al.  FlowFox: a web browser with flexible and precise information flow control , 2012, CCS '12.

[44]  Martin Erwig,et al.  Counter-factual typing for debugging type errors , 2014, POPL.

[45]  Sven Apel,et al.  Toward variability-aware testing , 2012, FOSD '12.

[46]  Martin Erwig,et al.  Variation Programming with the Choice Calculus , 2011, GTTSE.

[47]  Martin Erwig,et al.  Extending Type Inference to Variational Programs , 2014, ACM Trans. Program. Lang. Syst..

[48]  Sven Apel,et al.  Scalable analysis of variable software , 2013, ESEC/FSE 2013.

[49]  Krzysztof Czarnecki,et al.  Where Do Configuration Constraints Stem From? An Extraction Approach and an Empirical Study , 2015, IEEE Transactions on Software Engineering.

[50]  Yuanyuan Zhou,et al.  Efficient online validation with delta execution , 2009, ASPLOS.

[51]  Sven Apel,et al.  Morpheus: Variability-Aware Refactoring in the Wild , 2015, 2015 IEEE/ACM 37th IEEE International Conference on Software Engineering.

[52]  Edwin Brady,et al.  Programming and reasoning with algebraic effects and dependent types , 2013, ICFP.