Combinatory Synthesis of Classes Using Feature Grammars

  • Jan BessaiEmail author
  • Boris Düdder
  • George T. Heineman
  • Jakob Rehof
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9539)


We describe a method for automatically transforming feature grammars into type-specifications which are subsequently used to synthesize a code-generator for a product of a given feature selection. Feature models are assumed to be given in the form of feature grammars with constraints, and we present a generic type-theoretic representation of such grammars. Our synthesis method is based on an extension of previous work in combinatory logic synthesis, where semantic types can be superimposed onto native APIs to specify a repository of components as well as synthesis goals. In our case, semantic types correspond to feature selections. We use an encoding of boolean logic in intersection types, which allows us to directly represent logical formulas expressing complex feature selection constraints. The novelty of our approach is the possibility to perform retrieval, selection and composition of products in a unified form, without sacrificing modularity. In contrast to constraint based methods, multiple selections of a single feature can coexist.


Feature models Program synthesis Type theory Combinatory logic Feature grammar 


  1. 1.
    Andersen, N., Czarnecki, K., She, S., Wasowski, A.: Efficient synthesis of feature models. In: SPLC 2012, pp. 106–115. ACM (2012)Google Scholar
  2. 2.
    Apel, S., Batory, D., Kästner, C., Saake, G.: Feature-Oriented Software Product Lines. Springer, Heidelberg (2013)CrossRefGoogle Scholar
  3. 3.
    Apel, S., Kästner, C.: An overview of feature-oriented software development. J. Object Technol. 8(5), 49–84 (2009)CrossRefGoogle Scholar
  4. 4.
    Barendregt, H., Coppo, M., Dezani-Ciancaglini, M.: A filter lambda model and the completeness of type assignment. J. Symbolic Logic 48(4), 931–940 (1983)zbMATHMathSciNetCrossRefGoogle Scholar
  5. 5.
    Batory, D.: Feature-oriented programming and the AHEAD tool suite. In: ICSE 2004, pp. 702–703. IEEE Computer Society (2004)Google Scholar
  6. 6.
    Batory, D.: Feature models, grammars, and propositional formulas. In: Obbink, H., Pohl, K. (eds.) SPLC 2005. LNCS, vol. 3714, pp. 7–20. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  7. 7.
    Batory, D., Geraci, B.J.: Composition validation and subjectivity in GenVoca generators. IEEE Trans. Softw. Eng. 23(2), 67–82 (1997)CrossRefGoogle Scholar
  8. 8.
    Batory, D., Singhal, V., Thomas, J., Dasari, S., Geraci, B., Sirkin, M.: The GenVoca model of software-system generators. IEEE Softw. 11(5), 89–94 (1994)CrossRefGoogle Scholar
  9. 9.
    Benavides, D., Segura, S., Ruiz-Cortés, A.: Automated analysis of feature models 20 years later: a literature review. Inf. Syst. 35(6), 615–636 (2010)CrossRefGoogle Scholar
  10. 10.
    Benavides, D., Trinidad, P., Ruiz-Cortés, A.: Automated reasoning on feature models. In: Pastor, Ó., Falcão e Cunha, J. (eds.) CAiSE 2005. LNCS, vol. 3520, pp. 491–503. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  11. 11.
    Bertot, Y., Castéran, P.: Interactive Theorem Proving and Program Development. Springer Science & Business Media, Heidelberg (2004)zbMATHCrossRefGoogle Scholar
  12. 12.
    Bessai, J., Rehof, J., Düdder, B., Martens, M., Dudenhefner, A.: Combinatory logic synthesizer. In: Margaria, T., Steffen, B. (eds.) ISoLA 2014, Part I. LNCS, vol. 8802, pp. 26–40. Springer, Heidelberg (2014)Google Scholar
  13. 13.
    Bessai, J., Dudenhefner, A., Duedder, B., De’Liguoro, U., Chen, T.C., Rehof, J.: Mixin Composition synthesis Based on Intersection Types. In: TLCA 2015 (2015), (to appear)Google Scholar
  14. 14.
    Beuche, D.: Composition and Construction of Embedded Software Families. Ph.D. thesis, Otto-von-Guericke-Universität Magdeburg, Universitätsbibliothek (2003)Google Scholar
  15. 15.
    Czarnecki, K., Eisenecker, U.W.: Generative Programming: Methods, Tools, and Applications. ACM Press/Addison-Wesley Publishing Co., New York (2000)Google Scholar
  16. 16.
    Czarnecki, K., Wasowski, A.: Feature diagrams and logics: there and back again. In: SPLC 2007, pp. 23–34. IEEE (2007)Google Scholar
  17. 17.
    Davies, R., Pfenning, F.: A modal analysis of staged computation. J. ACM 48(3), 555–604 (2001)MathSciNetCrossRefGoogle Scholar
  18. 18.
    de Moura, L., Bjørner, N.S.: Z3: an efficient SMT solver. In: Ramakrishnan, C.R., Rehof, J. (eds.) TACAS 2008. LNCS, vol. 4963, pp. 337–340. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  19. 19.
    Delaware, B., Cook, W., Batory, D.: A machine-checked model of safe composition. In: FOAL 2009, pp. 31–35. ACM (2009)Google Scholar
  20. 20.
    Düdder, B., Heineman, G.T., Hoxha, A., Rehof, J.: Towards migrating object-oriented frameworks to enable synthesis of product line members. In: Proceedings of SPLC 2015 (2015), (to appear)Google Scholar
  21. 21.
    Düdder, B., Martens, M., Rehof, J., Urzyczyn, P.: Bounded Combinatory Logic. In: CSL 2012. LIPIcs, vol. 16, pp. 243–258, Schloss Dagstuhl (2012)Google Scholar
  22. 22.
    Eichberg, M., Klose, K., Mitschke, R., Mezini, M.: Component composition using feature models. In: Grunske, L., Reussner, R., Plasil, L. (eds.) CBSE 2010. LNCS, vol. 6092, pp. 200–215. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  23. 23.
    Gvero, T., Kuncak, V., Kuraj, I., Piskac, R.: On Fast Code Completion using Type Inhabitation. Technical report, École polytechnique fédérale de Lausanne (2012)Google Scholar
  24. 24.
    de Jonge, M., Visser, J.: Grammars as feature diagrams. In: ICSR7 Workshop on Generative Programming, pp. 23–24 (2002)Google Scholar
  25. 25.
    Kang, K.C., Cohen, S.G., Hess, J.A., Novak, W.E., Peterson, A.S.: Feature-oriented domain analysis (FODA) feasibility study. Technical report, DTIC Document (1990)Google Scholar
  26. 26.
    Mannion, M.: Using first-order logic for product line model validation. In: Chastek, G.J. (ed.) SPLC 2002. LNCS, vol. 2379, p. 176. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  27. 27.
    Neubauer, J., Steffen, B., Margaria, T.: Higher-order process modeling: product-lining, variability modeling and beyond. In: Semantics, Abstract Interpretation, and Reasoning about Programs: Essays Dedicated to David A. Schmidt. EPTCS, vol. 129, pp. 259–283 (2013)Google Scholar
  28. 28.
    Nieuwenhuis, R., Oliveras, A., Tinelli, C.: Solving SAT and SAT modulo theories: from an abstract Davis-Putnam-Logemann-Loveland Procedure to DPLL(T). J. ACM 53(6), 937–977 (2006)MathSciNetCrossRefGoogle Scholar
  29. 29.
    Sewell, P., Nardelli, F.Z., Owens, S., Peskine, G., Ridge, T., Sarkar, S., Strniša, R.: Ott: Effective tool support for the working semanticist. J. Funct. Program. 20(01), 71–122 (2010)zbMATHCrossRefGoogle Scholar
  30. 30.
    Thaker, S., Batory, D., Kitchin, D., Cook, W.: Safe composition of product lines. In: GPCE 2007, pp. 95–104. ACM (2007)Google Scholar
  31. 31.
    Venneri, B.: Intersection types as logical formulae. J. Logic Comput. 4(2), 109–124 (1994)zbMATHMathSciNetCrossRefGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  • Jan Bessai
    • 1
    Email author
  • Boris Düdder
    • 1
  • George T. Heineman
    • 2
  • Jakob Rehof
    • 1
  1. 1.Technical University of DortmundDortmundGermany
  2. 2.Worcester Polytechnic InstituteWorcesterUSA

Personalised recommendations