Semantics-Based Crossover for Program Synthesis in Genetic Programming

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


Semantic information has been used to create operators that improve performance in genetic programming. As different problem domains have different semantics, extracting semantics and calculating semantic similarity is of tantamount importance to use semantic operators for each domain. To date researchers have struggled to effectively do this beyond the boolean and regression problem domain. In this paper, a semantic similarity-based crossover is tested in the problem domain of program synthesis. For this purpose, a similarity measure based on the execution trace of a program is introduced. Subtree crossover as well as semantic similarity-based crossover are analysed on performance and semantic aspects. The goal is to introduce the Semantic Similarity-based Crossover in the program synthesis domain and to study the effects of using semantic locality. The results show that semantic crossover produces more semantically different children as well as more children that are better than their parents compared to subtree crossover.


Genetic programming Program synthesis Crossover 



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


  1. 1.
    Beadle, L., Johnson, C.: Semantically driven mutation in genetic programming. In: 2009 IEEE Congress on Evolutionary Computation, CEC 2009, pp. 1336–1342, May 2009Google Scholar
  2. 2.
    Beadle, L., Johnson, C.: Semantically driven crossover in genetic programming. In: Wang, J. (ed.) Proceedings of the IEEE World Congress on Computational Intelligence, pp. 111–116. IEEE Computational Intelligence Society, IEEE Press, Hong Kong, 1–6 Jun 2008.
  3. 3.
    Forstenlechner, S., Fagan, D., Nicolau, M., O’Neill, M.: A grammar design pattern for arbitrary program synthesis problems in genetic programming. In: McDermott, J., Castelli, M., Sekanina, L., Haasdijk, E., García-Sánchez, P. (eds.) EuroGP 2017. LNCS, vol. 10196, pp. 262–277. Springer, Cham (2017). CrossRefGoogle Scholar
  4. 4.
    Forstenlechner, S., Nicolau, M., Fagan, D., O’Neill, M.: Introducing semantic-clustering selection in grammatical evolution. In: Johnson, C., Krawiec, K., Moraglio, A., O’Neill, M. (eds.) GECCO 2015 Semantic Methods in Genetic Programming (SMGP 2015) Workshop, pp. 1277–1284. ACM, Madrid, Spain, 11–15 July 2015.
  5. 5.
    Galván-López, E., Cody-Kenny, B., Trujillo, L., Kattan, A.: Using semantics in the selection mechanism in genetic programming: a simple method for promoting semantic diversity. In: 2013 IEEE Congress on Evolutionary Computation (CEC), pp. 2972–2979, June 2013Google Scholar
  6. 6.
    Helmuth, T., Spector, L., Matheson, J.: Solving uncompromising problems with lexicase selection. IEEE Trans. Evol. Comput. 19(5), 630–643 (2015)CrossRefGoogle Scholar
  7. 7.
    Helmuth, T., Spector, L.: General program synthesis benchmark suite. In: Proceedings of the 2015 on Genetic and Evolutionary Computation Conference, GECCO 2015, pp. 1039–1046. ACM, Madrid, Spain, 11–15 July 2015.
  8. 8.
    McPhee, N.F., Ohs, B., Hutchison, T.: Semantic building blocks in genetic programming. In: O’Neill, M., Vanneschi, L., Gustafson, S., Esparcia Alcázar, A.I., De Falco, I., Della Cioppa, A., Tarantino, E. (eds.) EuroGP 2008. LNCS, vol. 4971, pp. 134–145. Springer, Heidelberg (2008). CrossRefGoogle Scholar
  9. 9.
    Montana, D.J.: Strongly typed genetic programming. Evol. Comput. 3(2), 199–230 (1995). CrossRefGoogle Scholar
  10. 10.
    Moraglio, A., Krawiec, K., Johnson, C.G.: Geometric semantic genetic programming. In: Coello, C.A.C., Cutello, V., Deb, K., Forrest, S., Nicosia, G., Pavone, M. (eds.) PPSN 2012. LNCS, vol. 7491, pp. 21–31. Springer, Heidelberg (2012). CrossRefGoogle Scholar
  11. 11.
    Nguyen, Q.U., Nguyen, X.H., O’Neill, M.: Semantic aware crossover for genetic programming: the case for real-valued function regression. In: Vanneschi, L., Gustafson, S., Moraglio, A., De Falco, I., Ebner, M. (eds.) EuroGP 2009. LNCS, vol. 5481, pp. 292–302. Springer, Heidelberg (2009). CrossRefGoogle Scholar
  12. 12.
    Nguyen, Q.U., Nguyen, X.H., O’Neill, M., McKay, R.I., Galvan-Lopez, E.: Semantically-based crossover in genetic programming: application to real-valued symbolic regression. Genet. Program. Evolvable Mach. 12(2), 91–119 (2011)CrossRefGoogle Scholar
  13. 13.
    Nguyen, Q.U., Nguyen, X.H., O’Neill, M., McKay, R.I., Phong, D.N.: On the roles of semantic locality of crossover in genetic programming. Inf. Sci. 235, 195–213 (2013). MathSciNetCrossRefzbMATHGoogle Scholar
  14. 14.
    Spector, L., Robinson, A.: Genetic programming and autoconstructive evolution with the push programming language. Genet. Program. Evolvable Mach. 3(1), 7–40 (2002). CrossRefzbMATHGoogle Scholar
  15. 15.
    Vanneschi, L., Castelli, M., Silva, S.: A survey of semantic methods in genetic programming. Genet. Program. Evolvable Mach. 15(2), 195–214 (2014). CrossRefGoogle Scholar
  16. 16.
    Wagner, S., Kronberger, G., Beham, A., Kommenda, M., Scheibenpflug, A., Pitzer, E., Vonolfen, S., Kofler, M., Winkler, S., Dorfer, V., Affenzeller, M.: 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. Topics in Intelligent Engineering and Informatics, vol. 6, pp. 197–261. Springer, Heidelberg (2014). CrossRefGoogle Scholar

Copyright information

© Springer International Publishing AG, part of Springer Nature 2018

Authors and Affiliations

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

Personalised recommendations