Many software systems today are highly configurable. They can produce a potentially large variety of related programs (variants) by selecting suitable configuration options (features) at compile time. Recently, specialized variability-aware (lifted, family-based) static analyses based on abstract interpretation have been developed. They allow analyzing all variants of a program family (or, any other configurable software system), simultaneously, in a single run without generating any of the variants explicitly. In effect, they produce precise analysis results for all individual variants. The elements of the underlying lifted analysis domain represent tuples (i.e. disjunction of properties), which maintain one property from an existing single-program analysis domain per variant. Nevertheless, explicit property enumeration in tuples, one by one for all variants, immediately yields to combinatorial explosion given that the number of variants can grow exponentially with the number of features. Therefore, such lifted analyses may be too costly or even infeasible for program families with a large number of variants. In this work, we propose a more efficient lifted static analysis of program families with Boolean features, where sharing is explicitly possible between analysis elements corresponding to different variants. This is achieved by giving a symbolic representation of the lifted analysis domain, which can efficiently handle disjunctive properties in program families. The elements of the new lifted domain are binary decision diagrams, where decision nodes are labeled with Boolean features and leaf nodes belong to an existing single-program analysis domain. The lifted domain is parametric in the choice of the abstract (property) domain for leaf nodes. To illustrate the potential of this representation, we have implemented a lifted static analyzer that uses a combination of forward and backward analyses for inferring numerical invariants and necessary preconditions of C program families. It uses APRON and BDDAPRON libraries for implementing the new lifted analysis domain. The APRON library, used for the leaves, is a widely accepted API for numerical abstract domains (e.g. polyhedra, octagons, intervals), while the BDDAPRON is an extension of APRON which adds the power domain of Boolean formulae and any APRON domain. An empirical evaluation on C benchmarks taken from SV-COMP and BusyBox indicates that our binary decision diagram-based approach is effective and outperforms the baseline tuple-based approach.
Read full abstract