Grammar Design for Derivation Tree Based Genetic Programming Systems

  • Stefan ForstenlechnerEmail author
  • Miguel Nicolau
  • David Fagan
  • Michael O’Neill
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9594)


Grammar-based genetic programming systems have gained interest in recent decades and are widely used nowadays. Although researchers normally present the grammar used to solve a certain problem, they seldom write about processes used to construct the grammar. This paper sheds some light on how to design a grammar that not only covers the search space, but also supports the search process in finding good solutions. The focus lies on context free grammar guided systems using derivation tree crossover and mutation, in contrast to linearised grammar based systems. Several grammars are presented encompassing the search space of sorting networks and show concepts which apply to general grammar design. An analysis of the search operators on different grammar is undertaken and performance examined on the sorting network problem. The results show that the overall structure for derivation trees created by the grammar has little effect on the performance, but still affects the genetic material changed by search operators.


Grammar design Derivation trees Genetic programming 



This research is based upon works supported by the Science Foundation Ireland, under Grant No. 13/IA/1850.


  1. 1.
    Cleary, R., O’Neill, M.: An attribute grammar decoder for the 01 multiconstrained knapsack problem. In: Raidl, G.R., Gottlieb, J. (eds.) EvoCOP 2005. LNCS, vol. 3448, pp. 34–45. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  2. 2.
    Codish, M., Cruz-Filipe, L., Frank, M., Schneider-Kamp, P.: Twenty-five comparators is optimal when sorting nine inputs (and twenty-nine for ten). CoRR (2014)Google Scholar
  3. 3.
    Daida, J., Hilss, A.: Identifying structural mechanisms in standard genetic programming. In: Cantú-Paz, E., et al. (eds.) Genetic and Evolutionary Computation — GECCO 2003. LNCS, vol. 2724, pp. 1639–1651. Springer, Heidelberg (2003)CrossRefGoogle Scholar
  4. 4.
    Dempsey, I., O’Neill, M., Brabazon, A.: Constant creation in grammatical evolution. Int. J. Innovative Comput. Appl. 1, 23–38 (2007)CrossRefGoogle Scholar
  5. 5.
    Dempsey, I., O’Neill, M., Brabazon, A.: Grammatical evolution. In: Dempsey, I., O’Neill, M., Brabazon, A. (eds.) Foundations in Grammatical Evolution for Dynamic Environments. SCI, vol. 194, pp. 9–24. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  6. 6.
    Hemberg, E.: University College, D.S.o.C.S.I. An exploration of grammars in grammatical evolution. Ph.D. thesis, University College Dublin, Ireland (2010)Google Scholar
  7. 7.
    Hoai, N.X., McKay, R., Essam, D.: Representation and structural difficulty in genetic programming. IEEE Trans. Evol. Comput. 10(2), 157–166 (2006)CrossRefGoogle Scholar
  8. 8.
    Keijzer, M., Babovic, V., Ryan, C., O’Neill, M., Cattolico, M.: Adaptive logic programming. In: Proceedings of the Genetic and Evolutionary Computation Conference (GECCO-2001), California, USA, pp. 42–49, 7–11 July 2001Google Scholar
  9. 9.
    Knuth, D.E.: The Art of Computer Programming. Sorting and Searching, vol. 3, 2nd edn. Addison Wesley Longman Publishing Co. Inc, Redwood City (1998)zbMATHGoogle Scholar
  10. 10.
    Koza, J.R., Andre, D., Bennett, F.H., Keane, M.A.: Genetic Programming III: Darwinian Invention & Problem Solving, 1st edn. Morgan Kaufmann Publishers Inc., San Francisco (1999)zbMATHGoogle Scholar
  11. 11.
    Koza, J.R., Bennett I, F.H., Hutchings, J., Bade, S., Keane, M.A., Andre, D.: Evolving sorting networks using genetic programming and the rapidly reconfigurable xilinx 6216 field-programmable gate array. In: Conference Record of the Thirty-First Asilomar Conference on Signals, Systems amp; Computers, vol. 1, pp. 404–410, November 1997Google Scholar
  12. 12.
    Luke, S.: Two fast tree-creation algorithms for genetic programming. IEEE Trans. Evol. Comput. 4(3), 274–283 (2000)CrossRefGoogle Scholar
  13. 13.
    McDermott, J., Swafford, J.M., Hemberg, M., Byrne, J., Hemberg, E., Fenton, M., McNally, C., Shotton, E., O’Neill, M.: String-rewriting grammars for evolutionary architectural design. Environ. Plann. B Plann. Des. 39(4), 713–731 (2012)CrossRefGoogle Scholar
  14. 14.
    McKay, R., Hoai, N., Whigham, P., Shan, Y., ONeill, M.: Grammar-based genetic programming: a survey. Genet. Program. Evolvable Mach. 11(3–4), 365–396 (2010)CrossRefGoogle Scholar
  15. 15.
    Montana, D.J.: Strongly typed genetic programming. Evol. Comput. 3(2), 199–230 (1995)CrossRefGoogle Scholar
  16. 16.
    Murphy, E., O’Neill, M., Galvapez, E., Brabazon, A. : Tree-adjunct grammatical evolution. In: 2010 IEEE Congress on Evolutionary Computation (CEC), pp. 1–8 (2010)Google Scholar
  17. 17.
    Murphy, E.: An exploration of tree-adjoining grammars for grammatical evolution. Ph.D. thesis, University College Dublin, Ireland, 6 December 2014Google Scholar
  18. 18.
    Murphy, E., Hemberg, E., Nicolau, M., O’Neill, M., Brabazon, A.: Grammar bias and initialisation in grammar based genetic programming. In: Moraglio, A., Silva, S., Krawiec, K., Machado, P., Cotta, C. (eds.) EuroGP 2012. LNCS, vol. 7244, pp. 85–96. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  19. 19.
    Nicolau, M.: Automatic grammar complexity reduction in grammatical evolution. In: GECCO 2004 Workshop Proceedings, Seattle, Washington, USA (2004)Google Scholar
  20. 20.
    O’Neill, M., Nicolau, M., Agapitos, A.: Experiments in program synthesis with grammatical evolution: A focus on integer sorting. In: 2014 IEEE Congress on Evolutionary Computation (CEC), pp. 1504–1511, July 2014Google Scholar
  21. 21.
    O’Neill, M., McDermott, J., Swafford, J.M., Byrne, J., Hemberg, E., Brabazon, A., Shotton, E., McNally, C., Hemberg, M.: Evolutionary design using grammatical evolution and shape grammars: designing a shelter. Int. J. Des. Eng. 3(1), 4–24 (2010)Google Scholar
  22. 22.
    O’Neill, M., Ryan, C.: Grammatical Evolution: Evolutionary Automatic Programming in an Arbitrary Language. Kluwer Academic Publishers, Berlin (2003)CrossRefzbMATHGoogle Scholar
  23. 23.
    Ryan, C., Nicolau, M., O’Neill, M.: Genetic algorithms using grammatical evolution. In: Foster, J.A., Lutton, E., Miller, J., Ryan, C., Tettamanzi, A.G.B. (eds.) EuroGP 2002. LNCS, vol. 2278, pp. 278–287. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  24. 24.
    Sekanina, L., Bidlo, M.: Evolutionary design of arbitrarily large sorting networks using development. Genet. Program. Evolvable Mach. 6(3), 319–347 (2005)CrossRefGoogle Scholar
  25. 25.
    Tanev, I.: Incorporating learning probabilistic context-sensitive grammar in genetic programming for efficient evolution and adaptation of snakebot. In: Keijzer, M., Tettamanzi, A.G.B., Collet, P., van Hemert, J., Tomassini, M. (eds.) EuroGP 2005. LNCS, vol. 3447, pp. 155–166. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  26. 26.
    Wagner, S., et al.: Architecture and design of the heuristiclab optimization environment. In: Klempous, R., Nikodem, J., Jacak, W., Chaczko, Z. (eds.) Advanced Methods and Applications in Computational Intelligence. TIEI, vol. 6, pp. 193–258. Springer, Heidelberg (2013)Google Scholar
  27. 27.
    Whigham, P.A.: Grammatical bias for evolutionary learning. Ph.D. thesis, New South Wales, Australia, Australia (1996)Google Scholar
  28. 28.
    Wong, M.L., Leung, K.S.: Evolutionary program induction directed by logic grammars. Evol. Comput. 5(2), 143–180 (1997)MathSciNetCrossRefGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2016

Authors and Affiliations

  • Stefan Forstenlechner
    • 1
    Email author
  • Miguel Nicolau
    • 1
  • David Fagan
    • 1
  • Michael O’Neill
    • 1
  1. 1.Natural Computing Research and Applications Group, School of BusinessUniversity College DublinDublinIreland

Personalised recommendations