Synthesis of Functions Using Generic Programming

  • Pieter Koopman
  • Rinus Plasmeijer
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5812)


This paper describes a very flexible way to synthesize functions matching a given predicate. This can be used to find general recursive functions or λ-terms obeying an input–output behavior specified by a number of examples. Generating complex algorithms from just a small number of simple input-output pairs is the goal of inductive programming. This paper illustrates that our approach works well in some challenging examples.


Data Type Test Suite Generic Programming Recursive Function Recursive Call 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
  2. 2.
    Alimarine, A., Smetsers, S.: Efficient generic functional programming. Technical report niii-r0425, Institute for Computing and Information Sciences, Radboud University Nijmegen, The Netherlands (2004)Google Scholar
  3. 3.
    Banerjee, D.: A methodology for synthesis of recursive functional programs. ACM Transactions on Programming Languages and Systems (TOPLAS) 9(3), 441–462 (1987)zbMATHCrossRefGoogle Scholar
  4. 4.
    Bird, R.: Introduction to functional programming using Haskell, 2nd edn. Prentice Hall, Englewood Cliffs (1998)Google Scholar
  5. 5.
    Claessen, K., Hughes, J.: QuickCheck: a lightweight tool for random testing of Haskell programs. In: Proceedings of the 5th ACM SIGPLAN International Conference on Functional Programming, Montreal, Canada, pp. 268–279. ACM Press, New York (2000)Google Scholar
  6. 6.
    Cypher, A.: Watch what I do: programming by demonstration. MIT Press, Cambridge (1993)Google Scholar
  7. 7.
    Henderson, R.: Incremental learning in inductive programming. In: Schmid, U., Kitzelmann, E., Plasmeijer, R. (eds.) AAIP 2009. LNCS, vol. 5812, pp. 74–92. Springer, Heidelberg (2010)Google Scholar
  8. 8.
    Katayama, S.: Systematic search for lambda expressions. In: Proceedings of the 6th Symposium on Trends in Functional Programming (TFP 2005), pp. 195–205 (2005)Google Scholar
  9. 9.
    Katayama, S.: Efficient exhaustive generation of functional programs using monte-carlo search with iterative deepening. In: Ho, T.-B., Zhou, Z.-H. (eds.) PRICAI 2008. LNCS (LNAI), vol. 5351, pp. 199–210. Springer, Heidelberg (2008)CrossRefGoogle Scholar
  10. 10.
    Koopman, P., Plasmeijer, R.: Fully automatic testing with functions as specifications. In: Horváth, Z. (ed.) CEFP 2005. LNCS, vol. 4164, pp. 35–61. Springer, Heidelberg (2006)CrossRefGoogle Scholar
  11. 11.
    Koopman, P., Plasmeijer, R.: Systematic synthesis of functions. In: Nilsson, H. (ed.) Selected Papers of the 7th Symposium on Trends in Functional Programming, TFP 2006, Nottingham, UK, April 19-21, pp. 68–83 (2006), Intellect Books, ISBN 978-1-84150-188-8Google Scholar
  12. 12.
    Koopman, P., Plasmeijer, R.: Systematic synthesis of λ-terms. In: Barendsen, E., Capretta, V., Geuvers, H., Niqui, M. (eds.) Reflections on Type Theory, λ-Calculus, and the Mind - Essays dedicated to Henk Barendregt on the Occasion of his 60th Birthday, December 17, pp. 211–222 (2007) ISBN 978-90-9022446-6Google Scholar
  13. 13.
    Plasmeijer, R., van Eekelen, M.: Concurrent Clean language report (version 2.0) (December 2001),
  14. 14.
    Schmid, U. (ed.): Inductive Synthesis of Functional Programs. LNCS (LNAI), vol. 2654. Springer, Heidelberg (2003)zbMATHGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2010

Authors and Affiliations

  • Pieter Koopman
    • 1
  • Rinus Plasmeijer
    • 1
  1. 1.Nijmegen Institute for Computing and Information SciencesRadboud University NijmegenThe Netherlands

Personalised recommendations