Abstract
Program synthesis via heuristic search often requires a great deal of ‘boilerplate’ code to adapt program APIs to the search mechanism. In addition, the majority of existing approaches are not type-safe: i.e. they can fail at runtime because the search mechanisms lack the strict type information often available to the compiler. In this article, we describe Polytope, a Scala framework that uses polytypic programming, a relatively recent advance in program abstraction. Polytope requires a minimum of boilerplate code and supports a form of strong-typing in which type rules are automatically enforced by the compiler, even for search operations such as mutation which are applied at runtime. By operating directly on language-native expressions, it provides an embeddable optimization procedure for existing code. We give a tutorial example of the specific polytypic approach we adopt and compare both runtime efficiency and required lines of code against the well-known EpochX GP framework, showing comparable performance in the former and the complete elimination of boilerplate for the latter.
Similar content being viewed by others
Notes
- 1.
Not to be confused with the weaker notion of abstract data types.
- 2.
We focus on tree-based GP in this paper.
- 3.
The term ‘coproduct’ represents a generalized notion of ‘sum’ inherited from Category Theory.
- 4.
Type constructors in Scala can be infix and composed of non-alphabetic characters.
- 5.
- 6.
as determined by the nonparametric Wilcoxon Signed Rank test.
References
Kannappan, K., Spector, L., Sipper, M., Helmuth, T., La Cava, W., Wisdom, J., Bernstein, O.: Analyzing a decade of human-competitive (“HUMIE”) winners: what can we learn? In: Riolo, R., Worzel, W.P., Kotanchek, M. (eds.) Genetic Programming Theory and Practice XII. Genetic and Evolutionary Computation, pp. 149–166. Springer, Heidelberg (2015)
Luke, S.: The ECJ owner’s manual (2010). http://www.cs.gmu.edu/~eclab/projects/ecj
Dawson-Howe, K.: A Practical Introduction to Computer Vision with OpenCV, 1st edn. Wiley Publishing, Chichester (2014)
Langdon, W.B., White, D.R., Harman, M., Jia, Y., Petke, J.: API-constrained genetic improvement. In: Sarro, F., Deb, K. (eds.) SSBSE 2016. LNCS, vol. 9962, pp. 224–230. Springer, Cham (2016). doi:10.1007/978-3-319-47106-8_16
Krawiec, K., Bhanu, B.: Visual learning by coevolutionary feature synthesis. IEEE Trans. Syst. Man and Cybern. Part B 35(3), 409–425 (2005)
Harding, S., Leitner, J., Schmidhuber, J.: Cartesian genetic programming for image processing. In: Riolo, R., Vladislavleva, E., Ritchie, M.D., Moore, J.H. (eds.) Genetic Programming Theory and Practice X. Genetic and Evolutionary Computation. Springer, New York (2012)
Otero, F., Castle, T., Johnson, C.: EpochX: genetic programming in java with statistics and event monitoring. In: Proceedings of the 14th Annual Conference Companion on Genetic and Evolutionary Computation (GECCO 2012), pp. 93–100, New York, NY, USA. ACM (2012)
Fortin, F.-A., De Rainville, F.-M., Gardner, M.-A., Parizeau, M., Christian Gagné, D.: Evolutionary algorithms made easy. J. Mach. Learn. Res. 13, 2171–2175 (2012)
Harman, M., Jia, Y., Langdon, W.B., Petke, J., Moghadam, I.H., Yoo, S., Fan, W.: Genetic improvement for adaptive software engineering (keynote). In: Proceedings of the 9th International Symposium on Software Engineering for Adaptive and Self-Managing Systems (SEAMS 2014), pp. 1–4, New York, NY, USA. ACM (2014)
Swan, J., Burles, N.: Templar – a framework for template-method hyper-heuristics. In: Machado, P., Heywood, M.I., McDermott, J., Castelli, M., García-Sánchez, P., Burelli, P., Risi, S., Sim, K. (eds.) EuroGP 2015. LNCS, vol. 9025, pp. 205–216. Springer, Cham (2015). doi:10.1007/978-3-319-16501-1_17
Swan, J., Epitropakis, M.G., Woodward, J.R.: Gen-O-Fix: an embeddable framework for dynamic adaptive genetic improvement programming. Technical report CSM-195, Computing Science and Mathematics, University of Stirling, Stirling FK9 4LA, Scotland, January 2014
Yeboah-Antwi, K., Baudry, B.: Embedding adaptivity in software systems using the ECSELR framework. In: Proceedings of the Companion Publication of the 2015 on Genetic and Evolutionary Computation Conference, pp. 839–844. ACM (2015)
Woodward, J.R., Swan, J.: Template method hyper-heuristics. In: Proceedings of the Companion Publication of the 2014 Annual Conference on Genetic and Evolutionary Computation (GECCO Comp 2014), pp. 1437–1438, New York, NY, USA. ACM (2014)
Burles, N., Swan, J., Bowles, E., Brownlee, A.E.I., Kocsis, Z.A., Veerapen, N.: Embedded dynamic improvement. In: Genetic and Evolutionary Computation Conference (GECCO 2015), Companion Material Proceedings, Madrid, Spain, 11–15 July 2015, pp. 831–832 (2015)
Montana, D.J.: Strongly typed genetic programming. Evol. Comput. 3(2), 199–230 (1995)
Ryan, C., Collins, J.J., Neill, M.O.: Grammatical evolution: evolving programs for an arbitrary language. In: Banzhaf, W., Poli, R., Schoenauer, M., Fogarty, T.C. (eds.) EuroGP 1998. LNCS, vol. 1391, pp. 83–96. Springer, Heidelberg (1998). doi:10.1007/BFb0055930
Mitchell, J.C.: Concepts in Programming Languages. Cambridge University Press, Cambridge (2003)
Milner, R., Morris, L., Newey, M.: A logic for computable functions with reflexive and polymorphic types. In: Proceedings of the Conference on Proving and Improving Programs, Arc-et-Senans (1975)
Gibbons, J.: Datatype-generic programming. In: Backhouse, R., Gibbons, J., Hinze, R., Jeuring, J. (eds.) SSDGP 2006. LNCS, vol. 4719, pp. 1–71. Springer, Heidelberg (2007). doi:10.1007/978-3-540-76786-2_1
Lämmel, R., Jones, S.P.: Scrap your boilerplate: a practical design pattern for generic programming. In: Proceedings of the 2003 ACM SIGPLAN International Workshop on Types in Languages Design and Implementation (TLDI 2003), pp. 26–37, New York, NY, USA. ACM (2003)
Oliveira, B.C.d.S., Gibbons, J.: Scala for generic programmers: comparing haskell and scala support for generic programming. J. Funct. Program. 20(3–4), 303–352 (2010)
Gibbons, J.: Origami programming. In: Gibbons, J., de Moor, O. (eds.) The Fun of Programming, Cornerstones in Computing, pp. 41–60. Palgrave, New York (2003)
Moors, A., Piessens, F., Joosen, W.: An object-oriented approach to datatype-generic programming. In: Proceedings of the 2006 ACM SIGPLAN Workshop on Generic Programming (WGP 2006), pp. 96–106, New York, NY, USA. ACM (2006)
Hinze, R.: Generics for the masses. J. Funct. Program. 16(4–5), 451–483 (2006)
Sabin, M., et al.: Shapeless: generic programming for Scala, 2011–2016. http://github.com/milessabin/shapeless
Gurnell, D.: The type astronaut’s guide to shapeless. Underscore consulting LLP (2016). http://underscore.io/books/shapeless-guide. ISBN 978-1-365-61352-4
Koza, J.R.: Genetic Programming: On the Programming of Computers by Means of Natural Selection. MIT Press, Cambridge (1992)
Rechenberg, I.: Evolutionsstrategie: optimierung technischer Systeme nach Prinzipien der biologischen Evolution. Number 15 in Problemata. Frommann-Holzboog, Stuttgart-Bad Cannstatt (1973)
Luke, S.: Essentials of Metaheuristics, 2nd edn. Lulu, Raleigh (2013). http://cs.gmu.edu/~sean/book/metaheuristics/
Miller, J.F., Thomson, P.: Cartesian genetic programming. In: Poli, R., Banzhaf, W., Langdon, W.B., Miller, J., Nordin, P., Fogarty, T.C. (eds.) EuroGP 2000. LNCS, vol. 1802, pp. 121–132. Springer, Heidelberg (2000). doi:10.1007/978-3-540-46239-2_9
Langdon, W.B., Harman, M.: Optimising existing software with genetic programming. IEEE Trans. Evol. Comput. 19(1), 118–135 (2015)
Luke, S., Panait, L.: A comparison of bloat control methods for genetic programming. Evol. Comput. 14(3), 309–344 (2006)
Keijzer, M., O’Reilly, U.-M., Lucas, S., Costa, E., Soule, T. (eds.): EuroGP 2004. LNCS, vol. 3003. Springer, Heidelberg (2004)
Le Goues, C., Nguyen, T.V., Forrest, S., Weimer, W.: GenProg: a generic method for automatic software repair. IEEE Trans. Softw. Eng. 38(1), 54–72 (2012)
Swan, J., Kocsis, Z.A., Lisitsa, A.: The ‘representative’ metaheuristic design pattern. In: Proceedings of the Companion Publication of the 2014 Annual Conference on Genetic and Evolutionary Computation (GECCO Comp 2014), pp. 1435–1436, New York, NY, USA. ACM (2014)
Acknowledgements
J. Swan would like to thank Miles Sabin and the contributors to the Scala ‘shapeless’ library. His work on this paper is funded by EPSRC grant EP/J017515/1 (DAASE). K. Krawiec acknowledges support from National Science Centre, Poland, grant 2014/15/B/ST6/05205.
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2017 Springer International Publishing AG
About this paper
Cite this paper
Swan, J., Krawiec, K., Ghani, N. (2017). Polytypic Genetic Programming. In: Squillero, G., Sim, K. (eds) Applications of Evolutionary Computation. EvoApplications 2017. Lecture Notes in Computer Science(), vol 10200. Springer, Cham. https://doi.org/10.1007/978-3-319-55792-2_5
Download citation
DOI: https://doi.org/10.1007/978-3-319-55792-2_5
Published:
Publisher Name: Springer, Cham
Print ISBN: 978-3-319-55791-5
Online ISBN: 978-3-319-55792-2
eBook Packages: Computer ScienceComputer Science (R0)