Skip to main content

Functional Semantics

  • Chapter
  • 1188 Accesses

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 8106))

Abstract

In ordinary interpreters and executable specifications of operational semantics the interpreted language is represented by an algebraic data type and the operations are functions having this data type as argument. In this essay we reverse the roles of functions and data structures. Here the language constructs are represented by state transforming functions belonging to some class. There are instances of this class for the operations on the specified language. Typical examples of operations are reduction, pretty printing, and transformations. The state is a data structure indicating the desired operation. The advantage of this approach is that it is easy to add language constructs and operations independently of each other.

This is a preview of subscription content, log in via an institution.

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   49.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Learn about institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Barendregt, H.: The lambda calculus, its syntax and semantics, revised edition. Studies in Logic, vol. 103. North-Holland (1984)

    Google Scholar 

  2. Carette, J., Kiselyov, O., Shan, C.-C.: Finally tagless, partially evaluated: Tagless staged interpreters for simpler typed languages. J. Funct. Program. 19(5), 509–543 (2009)

    Article  MathSciNet  MATH  Google Scholar 

  3. Curry, H., Feys, R.: Combinatory logic. Studies in Logic and the Foundations of Mathematics Series, vol. 2. North-Holland Publishing Company (1972)

    Google Scholar 

  4. Hinze, R.: Fun with phantom types. In: Gibbons, J., de Moor, O. (eds.) The Fun of Programming, pp. 245–262. Palgrave Macmillan (2003)

    Google Scholar 

  5. Jansen, J.: Functional Web Applications – Implementation and Use of Client Side Interpreters. PhD thesis, Radboud University Nijmegen, 8 (July 2010) ISBN 978-90-9025436-4

    Google Scholar 

  6. Jansen, J., Koopman, P., Plasmeijer, R.: Efficient interpretation by transforming data types and patterns to functions. In: Nilsson, H. (ed.) Proceedings of the 7th Symposium on Trends in Functional Programming, TFP 2006, Nottingham, UK, April 19-21, pp. 157–172 (2006) ISBN 978-1-84150-188-8

    Google Scholar 

  7. Johann, P., Ghani, N.: Foundations for structured programming with gadts. SIGPLAN Not. 43(1), 297–308 (2008)

    Article  MATH  Google Scholar 

  8. Koopman, P.: Functional Programs as Executable Specifications. PhD thesis, University of Nijmegen (1990)

    Google Scholar 

  9. Koopman, P., Plasmeijer, R., Achten, P.: An Effective Methodology for Defining Consistent Semantics of Complex Systems. In: Horváth, Z., Plasmeijer, R., Zsók, V. (eds.) CEFP 2009. LNCS, vol. 6299, pp. 224–267. Springer, Heidelberg (2010)

    Chapter  Google Scholar 

  10. Koopman, P.W.M., van Eekelen, M.C.J.D., Plasmeijer, M.J.: Operational machine specification in a functional programming language. Softw., Pract. Exper. 25(5), 463–499 (1995)

    Article  Google Scholar 

  11. Lämmel, R., Ostermann, K.: Software extension and integration with type classes. In: Proceedings of the 5th International Conference on Generative Programming and Component Engineering, GPCE 2006, pp. 161–170. ACM, New York (2006)

    Google Scholar 

  12. Landin, P.J.: The next 700 programming languages. Commun. ACM 9(3), 157–166 (1966)

    Article  MATH  Google Scholar 

  13. Löh, A., Hinze, R.: Open data types and open functions. In: Proceedings of the 8th ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, PPDP 2006, pp. 133–144. ACM, New York (2006)

    Google Scholar 

  14. Middelkoop, A., Dijkstra, A., Swierstra, D.: A leaner specification for GADTs. In: Achten, P., Koopman, P., Morazán, M. (eds.) Trends in Functional Programming, vol. 9, pp. 65–80. Intellect (2009) ISBN 978-1-84150-277-9

    Google Scholar 

  15. Nielson, H., Nielson, F.: Semantics with applications: a formal introduction. John Wiley & Sons, Inc. (1992)

    Google Scholar 

  16. Pil, M.: Dynamic types and type dependent functions. In: Hammond, K., Davie, T., Clack, C. (eds.) IFL 1998. LNCS, vol. 1595, pp. 169–185. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  17. Plasmeijer, R., Achten, P., Koopman, P.: iTasks: executable specifications of interactive work flow systems for the web. In: Hinze, R., Ramsey, N. (eds.) Proceedings of the International Conference on Functional Programming, ICFP 2007, Freiburg, Germany, pp. 141–152. ACM Press (2007)

    Google Scholar 

  18. Plasmeijer, R., Achten, P., Koopman, P.: Generic Functions Dynamically Applied. In: Porkoláb, Z., Pataki, N. (eds.) Proceedings of Workshop on Generative Technologies, WGT 2010, Paphos, Cyprus, March 27, pp. 1–2 (2010)

    Google Scholar 

  19. Plasmeijer, R., Lijnse, B., Michels, S., Achten, P., Koopman, P.: Task-Oriented Programming in a Pure Functional Language. In: Proceedings of the 2012 ACM SIGPLAN International Conference on Principles and Practice of Declarative Programming, PPDP 2012, Leuven, Belgium, pp. 195–206. ACM (September 2012)

    Google Scholar 

  20. Plasmeijer, R., van Eekelen, M.: Clean language report (version 2.1) (2002), http://clean.cs.ru.nl

  21. Reynolds, J.: Defunctional interpreters for higher-order programming languages. Higher-Order and Symbolic Computation 11(4), 363–397 (1998)

    Article  MATH  Google Scholar 

  22. Schönfinkel, M.: über die bausteine der mathematischen logik. Mathematische Annalen 92, 305–316 (1924)

    Article  MathSciNet  MATH  Google Scholar 

  23. Swierstra, W.: Data types à la carte. J. Funct. Program. 18(4), 423–436 (2008)

    Article  MathSciNet  MATH  Google Scholar 

  24. Syme, D., Neverov, G., Margetson, J.: Extensible pattern matching via a lightweight language extension. In: Proceedings of the 12th ACM SIGPLAN International Conference on Functional Programming, ICFP 2007, pp. 29–40. ACM, New York (2007)

    Chapter  Google Scholar 

  25. Turner, D.A.: A new implementation technique for applicative languages. Software: Practice and Experience 9(1), 31–49 (1979)

    MATH  Google Scholar 

  26. Turner, D.A.: Miranda: a non-strict functional language with polymorphic types. In: Jouannaud, J.-P. (ed.) FPCA 1985. LNCS, vol. 201, pp. 1–16. Springer, Heidelberg (1985)

    Chapter  Google Scholar 

  27. Wadler, P.: The expression problem. Message to Java-genericity Electronic Mailing List (November 1998)

    Google Scholar 

  28. Zenger, M., Odersky, M.: Extensible algebraic datatypes with defaults. SIGPLAN Not. 36(10), 241–252 (2001)

    Article  MATH  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2013 Springer-Verlag Berlin Heidelberg

About this chapter

Cite this chapter

Koopman, P. (2013). Functional Semantics. In: Achten, P., Koopman, P. (eds) The Beauty of Functional Code. Lecture Notes in Computer Science, vol 8106. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-40355-2_6

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-40355-2_6

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-40354-5

  • Online ISBN: 978-3-642-40355-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics