An introduction to automated analysis of feature models through propositional logic
1. An introduction to automated analysis of feature
models through propositional logic
SSC5793 - Especificação Formal de Software
(Seminários)
Sidgley Camargo de Andrade
PhD student in computer science
Institute of Computer Science and Mathematics
University of São Paulo
December 2015
1 / 24
2. Agenda
Product line, feature model, and automated analysis
Operations with automated support
Background and propositional logic
Identification of core features (how it works 1)
Finding a valid product or configuration (how works 2)
FaMa Tool
Challenges
Ongoing researches
References
2 / 24
3. Product line, feature model, and automated
analysis
Feature-Oriented Domain Analysis was proposed by Kyo C. Kang
and extended and applied by other researchers
Kang Schobbens Batory Benavides Beek Janota Czarnecki Maßen Zhang Mendonca
Figure: A sample feature model (Benavides et al., 2010) 3 / 24
4. Extended feature model and cardinality
Figure: A sample extended feature model (Benavides et al., 2010)
Czarnecki proposed extending feature models with UML-like
multiplicities due to practical applications – cardinality [n, m].
4 / 24
5. Initial review
Benavides, D., Segura, S., Ruiz-Cortés, A. (2010). Automated
analysis of feature models 20 years later: A literature review.
Information Systems, 35(6), 615–636.
Batory, D. (2005). Feature Models, Grammars, and Propositional
Formulas. In Software Product Lines (pp. 7–20).
Perez-Morago, H., Heradio, R., Fernandez-Amoros, D., Bean, R.,
Cerrada, C. (2015). Efficient Identification of Core and Dead
Features in Variability Models. IEEE Access, 3, 2333–2340.
Mannion, M. (2002). Using First-Order Logic for Product Line
Model Validation. In Software Product Lines (pp. 176–187).
5 / 24
6. Some operations with automated support
void feature is related to wrong usage of cross-tree
constraints.
valid product or partial configuration verifies whether a
given product or partial configuration is valid.
all products returns all possible complete configurations and
it is helpful to identify new valid requirement combinations.
number of products provides information about the flexibility
and complexity of the product line.
filter returns the set of products given a initial configuration.
core features returns the set of features that are part of all
the products.
anomalies detection and explanations, . . . , and other.
6 / 24
7. Background – logic vs automatized analyse
Propositional logic and order logic1
SAT-solvers (e.g. SAT4J), Binary Decision Diagram
(BDD) solvers (e.g. JavaBDD), Alloy, Z
Constraint programming2– Constraint Satisfaction Problem
CSP/CSOP-solvers (e.g. JaCoP, Choco, OPL studio)
Description logic3– semantic and ontology
OWL-DL
Heuristics4– ad hoc solutions
1
(Mannion, 2002; Batory, 2005; Zhang et al., 2004; Janota and Kiniry, 2007; Mendonca et al.,
2009; Benavides et al., 2007; Gheyi et al., 2006; Sun et al., 2005) and other
2
(Benavides et al., 2006, 2007; White et al., 2009) and other
3
(Fan and Zhang, 2006; Zaid et al., 2009)
4
(von der Massen and Lichter, 2005; Hemakumar, 2008; Fernandez-Amoros et al., 2009) and other
7 / 24
8. Mapping to propositional logic
Figure: Mapping from feature model to propositional logic (Benavides
et al., 2010)
8 / 24
9. HOW IT WORKS – 1
Identification of core features through SAT-solvers
9 / 24
10. Step 1: label the features – (HW 1)
All features of feature model must be labelled. Usually, it is done
by means of modelling tools and automated tools.
10 / 24
11. Step 2: generate the directed graph – (HW 1)
Identify the dependencies and incompatibilities of feature model in
a directed graph. In this step, only the mandatory, alternative,
requires, and excludes relationship must be represented.
11 / 24
13. Step 4: identify core features – (HW 1)
It is an approach top-down (from f1 to f8). It is also applied
recursively the logical expression for all features to identify the core.
A feature f is core if φ → f is a tautology
or when ¬f ∧ φ is unsat. (Perez-Morago et al., 2015)
13 / 24
14. HOW WORKS – 2
Finding a valid product or configuration through BDD
14 / 24
15. Selected features and configuration – (HW 2)
For this example was selected a subset of the previous feature
model.
In general, a configuration is a 2-tuple (S, R) | S, R ⊆ F.
({f1, f4, f7}, {f3, f6}) ⊆ {f1, f3, f4, f6, f7}
15 / 24
16. Step 1: binary decision tree from the
φ subset – (HW 2)
The binary decision tree corresponds the output of the truth table.
Solid edge means that a feature appears in the configuration (value
1); otherwise is a dashed edge (value 0). The leaves show whether
product or partial configuration is valid or not.
16 / 24
17. Step 2: binary decision diagrams – (HW 2)
BDD according to the variable ordering f1 f4 f6 f7 f3
(subset φ). It is an optimized binary decision tree.
17 / 24
18. Step 3: identify a configuration valid – (HW 2)
P1 = {f1, f4, f6, f3} P2 = {f1, f4, f6, f7}
P1 is a valid configuration (1-leaf), but P2 is not (0-leaf).
18 / 24
20. Challenges
Formal definition of operations and minimize ambiguity
Propose new operations of analysis leveraging extended feature
models
Improving performance and scalability of the operations
Reasoning about variability at runtime
Benchmarks
20 / 24
21. Ongoing researches (some topics)
Composition and decomposition of feature models
(Dhungana et al., 2011)
Mapping among implementation artifacts and features
(Thum et al., 2011)
Improving the operations on features models (optimization)
(Perez-Morago et al., 2015; Heradio-Gil et al., 2011)
21 / 24
22. Further information – repositories on automated
analysis of feature models
Publications – since 1990
www.isa.us.es/featuremodelanalysis/repository
Tools – specific and related)
www.isa.us.es/tools
http://www.splot-research.org/
22 / 24
23. References I
Batory, D. (2005). Feature models, grammars, and propositional formulas. In Proceedings of the 9th
International Conference on Software Product Lines, SPLC’05, pages 7–20, Berlin, Heidelberg.
Springer-Verlag.
Benavides, D., Segura, S., and Ruiz-Cortés, A. (2010). Automated analysis of feature models 20 years
later: A literature review. Information Systems, 35(6):615 – 636.
Benavides, D., Segura, S., Trinidad, P., and Ruiz-Cortés, A. (2006). Using java csp solvers in the
automated analyses of feature models. In Lämmel, R., Saraiva, J., and Visser, J., editors, Generative
and Transformational Techniques in Software Engineering, volume 4143 of Lecture Notes in
Computer Science, pages 399–408. Springer Berlin Heidelberg.
Benavides, D., Segura, S., Trinidad, P., and Ruiz-cortés, A. (2007). Fama: Tooling a framework for the
automated analysis of feature models. In In Proceeding of the First International Workshop on
Variability Modelling of Softwareintensive Systems (VAMOS, pages 129–134.
Dhungana, D., Seichter, D., Botterweck, G., Rabiser, R., Grunbacher, P., Benavides, D., and Galindo, J.
(2011). Configuration of multi product lines by bridging heterogeneous variability modeling
approaches. In Software Product Line Conference (SPLC), 2011 15th International, pages 120–129.
Fan, S. and Zhang, N. (2006). Feature model based on description logics. In Gabrys, B., Howlett, R.,
and Jain, L., editors, Knowledge-Based Intelligent Information and Engineering Systems, volume
4252 of Lecture Notes in Computer Science, pages 1144–1151. Springer Berlin Heidelberg.
Fernandez-Amoros, D., Gil, R. H., and Somolinos, J. C. (2009). Inferring information from feature
diagrams to product line economic models. In Proceedings of the 13th International Software
Product Line Conference, SPLC ’09, pages 41–50, Pittsburgh, PA, USA. Carnegie Mellon University.
Gheyi, R., Massoni, T., and Borba, P. (2006). A theory for feature models in alloy. In Proceedings of
the ACM SIGSOFY First Alloy Workshop, page 71–80, Portland, United States.
Hemakumar, A. (2008). Finding contradictions in feature models. In First International Workshop on
Analyses of Software Product Lines (ASPL’08), pages 183–190.
Heradio-Gil, R., Fernandez-Amoros, D., Cerrada, J., and Cerrada, C. (2011). Supporting
commonality-based analysis of software product lines. Software, IET, 5(6):496–509.
23 / 24
24. References II
Janota, M. and Kiniry, J. (2007). Reasoning about feature models in higher-order logic. In Software
Product Line Conference, 2007. SPLC 2007. 11th International, pages 13–22.
Mannion, M. (2002). Using first-order logic for product line model validation. In Proceedings of the
Second International Conference on Software Product Lines, SPLC 2, pages 176–187, London, UK,
UK. Springer-Verlag.
Mendonca, M., Wąsowski, A., and Czarnecki, K. (2009). Sat-based analysis of feature models is easy. In
Proceedings of the 13th International Software Product Line Conference, SPLC ’09, pages 231–240,
Pittsburgh, PA, USA. Carnegie Mellon University.
Perez-Morago, H., Heradio, R., Fernandez-Amoros, D., Bean, R., and Cerrada, C. (2015). Efficient
identification of core and dead features in variability models. Access, IEEE, 3:2333–2340.
Sun, J., Zhang, H., and Wang, H. (2005). Formal semantics and verification for feature modeling. In
Proceedings of the 10th IEEE International Conference on Engineering of Complex Computer
Systems, ICECCS ’05, pages 303–312, Washington, DC, USA. IEEE Computer Society.
Thum, T., Kastner, C., Erdweg, S., and Siegmund, N. (2011). Abstract features in feature modeling. In
Software Product Line Conference (SPLC), 2011 15th International, pages 191–200.
von der Massen, T. and Lichter, H. (2005). Determining the variation degree of feature models. In
Obbink, H. and Pohl, K., editors, Software Product Lines, volume 3714 of Lecture Notes in
Computer Science, pages 82–88. Springer Berlin Heidelberg.
White, J., Dougherty, B., Schmidt, D. C., and Benavides, D. (2009). Automated reasoning for
multi-step feature model configuration problems. In Proceedings of the 13th International Software
Product Line Conference, SPLC ’09, pages 11–20, Pittsburgh, PA, USA. Carnegie Mellon University.
Zaid, L. A., Kleinermann, F., and De Troyer, O. (2009). Applying semantic web technology to feature
modeling. In Proceedings of the 2009 ACM Symposium on Applied Computing, SAC ’09, pages
1252–1256, New York, NY, USA. ACM.
Zhang, W., Zhao, H., and Mei, H. (2004). A propositional logic-based method for verification of feature
models. In Davies, J., Schulte, W., and Barnett, M., editors, Formal Methods and Software
Engineering, volume 3308 of Lecture Notes in Computer Science, pages 115–130. Springer Berlin
Heidelberg.
24 / 24