Skip to main content

Exploiting Purely Functional Programming to Obtain Bounded Resource Behaviour: The Hume Approach

  • Conference paper

Part of the book series: Lecture Notes in Computer Science ((LNTCS,volume 4164))

Abstract

This chapter describes Hume: a functionally-based language for programming with bounded resource usage, including time and space properties. The purpose of the Hume language design is to explore the expressibility/costability spectrum in resource-constrained systems, such as real-time embedded or control systems. It is unusual in being based on a combination of λ-calculus and finite state machine notions, rather than the more usual propositional logic, or flat finite-state-machine models. The use of a strict, purely functional programming notation allows the construction of a strong cost model for expressions, which can then be embedded into a simple cost model for processes.

In this chapter, we introduce Hume, describe the Hume Abstract Machine implementation, and show how a high-level cost model can be constructed that relates costs from the abstract machine to Hume source programs. We illustrate our approach with an example adapted from the literature: a simple vending machine controller.

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   54.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. Amey, P.: Correctness by Construction: Better can also be Cheaper. CrossTalk: the Journal of Defense Software Engineering, 24–28 (March 2002)

    Google Scholar 

  2. Apt, K.R., Olderog, E.-R.: Verification of Sequential and Concurrent Programs, 2nd edn. Springer, Heidelberg (1997)

    MATH  Google Scholar 

  3. Armstrong, J.: Erlang — a Survey of the Language and its Industrial Applications. In: Proc. INAP 1996 — The 9th Exhibitions and Symposium on Industrial Applications of Prolog, Hino, Tokyo, Japan, pp. 16–18 (1996)

    Google Scholar 

  4. Armstrong, J.: The Development of Erlang. In: Proc. 1997 ACM Intl. Conf. on Functl. Prog (ICFP 1997), Amsterdam, The Netherlands, pp. 196–203 (1997)

    Google Scholar 

  5. Armstrong, J., Virding, S.R., Williams, M.C.: Concurrent Programming in Erlang. Prentice-Hall, Englewood Cliffs (1993)

    MATH  Google Scholar 

  6. Augustsson, L.: Compiling Lazy Functional Languages, Part II. PhD thesis, Dept. of Computer Science, Chalmers University of Technology, Göteborg, Sweden (1987)

    Google Scholar 

  7. Barnes, J.G.P.: High Integrity Ada: the Spark Approach. Addison-Wesley, Reading (1997)

    MATH  Google Scholar 

  8. Blau, S., Rooth, J.: AXD-301: a New Generation ATM Switching System. Ericsson Review 1 (1998)

    Google Scholar 

  9. Bollela, G., et al.: The Real-Time Specification for Java. Addison-Wesley, Reading (2000)

    Google Scholar 

  10. Boussinot, F., de Simone, R.: The Esterel Language. Proceedings of the IEEE 79(9), 1293–1304 (1991)

    Article  Google Scholar 

  11. Breitinger, S., Loogen, R., Ortega-Mallén, Y., Pena, R.: The Eden Coordination Model for Distributed Memory Systems. In: High-Level Parallel Programming Models and Supportive Environments (HIPS 1997), vol. 1123. IEEE Press, Los Alamitos (1997)

    Google Scholar 

  12. Burstall, R.: Inductively Defined Functions in Functional Programming Languages. Technical Report ECS-LFCS-87-25, Dept. of Comp. Sci., Univ. of Edinburgh (1987)

    Google Scholar 

  13. Caspi, P., Pilaud, D., Halbwachs, N., Place, J.: Lustre: a Declarative Language for Programming Synchronous Systems. In: Proc. POPL 1987 – 1987 Symposium on Principles of Programming Languages, München, Germany, pp. 178–188 (January 1987)

    Google Scholar 

  14. Claessen, K., Sheeran, M.: A Tutorial on Lava: a Hardware Description and Verification System, unpublished report, chalmers university of technology, sweden (August 2000)

    Google Scholar 

  15. Colaço, J.-L., Pagano, B., Pouzet, M.: A Conservative Extension of Synchronous Data-flow with State Machines. In: Proc. ACM International Conference on Embedded Software (EMSOFT 2005), Jersey City, New Jersey, USA (September 2005)

    Google Scholar 

  16. Fijma, D.H., Udink, R.T.: A Case Study in Functional Real-Time Programming. Technical report, Dept. of Computer Science, Univ. of Twente, The Netherlands, Memoranda Informatica, pp. 91–62 (1991)

    Google Scholar 

  17. Gautier, T., Le Guernic, P., Besnard, L.: Signal: A declarative language for synchronous programming of real-time systems. In: Kahn, G. (ed.) FPCA 1987. LNCS, vol. 274, pp. 257–277. Springer, Heidelberg (1987)

    Google Scholar 

  18. Hammond, K., Michaelson, G.J.: Hume: A Domain-Specific Language for Real-Time Embedded Systems. In: Pfenning, F., Smaragdakis, Y. (eds.) GPCE 2003. LNCS, vol. 2830, pp. 37–56. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  19. Hammond, K., Michaelson, G.J.: Predictable Space Behaviour in FSM-Hume. In: Peña, R., Arts, T. (eds.) IFL 2002. LNCS, vol. 2670. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  20. Hawkins, J., Abdallah, A.E.: Behavioural Synthesis of a Parallel Hardware JPEG Decoder from a Functional Specification. In: Monien, B., Feldmann, R.L. (eds.) Euro-Par 2002. LNCS, vol. 2400, pp. 615–619. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  21. Hofmann, M., Jost, S.: Static Prediction of Heap Space Usage for First-Order Functional Programs. In: POPL 2003 — Symposium on Principles of Programming Languages, New Orleans, LA, USA, pp. 185–197. ACM Press, New York (2003)

    Chapter  Google Scholar 

  22. Hughes, R.J.M.: The Design and Implementation of Programming Languages, DPhil Thesis, Programming Research Group, Oxford (July 1983)

    Google Scholar 

  23. Hughes, R.J.M., O’Donnell, J.T.: Expressing and reasoning about non-deterministic functional programs. In: Proceedings of the 1989 Glasgow Workshop on Functional Programming, London, UK, pp. 308–328. Springer, Heidelberg (1990)

    Google Scholar 

  24. Hughes, R.J.M., Pareto, L.: Recursion and Dynamic Data Structures in Bounded Space: towards Embedded ML Programming. In: ICFP 1999 — International Conference on Functional Programming, Paris, France, pp. 70–81. ACM Press, New York (1999)

    Chapter  Google Scholar 

  25. Hughes, R.J.M., Pareto, L., Sabry, A.: Proving the Correctness of Reactive Systems Using Sized Types. In: POPL 1996 — Symposium on Principles of Programming Languages, St.Petersburg Beach, Florida, pp. 410–423. ACM, New York (1996)

    Chapter  Google Scholar 

  26. Launchbury, J., Matthews, J., Cook, B.: Microprocessor Specification in Hawk. In: Proc. International Conference on Computer Languages, pp. 90–101 (1998)

    Google Scholar 

  27. Landin, P.: The Mechanical Evaluation of Expressions. The Computer Journal 6(4), 308–320 (1964)

    MATH  Google Scholar 

  28. Liang, S., Hudak, P., Jones, M.P.: Monad transformers and modular interpreters. In: Proc. POPL 1995 — 1995 Symposium on Principles of Programming Languages, San Francisco, California, pp. 333–343. ACM Press, New York (1995)

    Chapter  Google Scholar 

  29. Lindholm, T., Yellin, F.: The Java Virtual Machine Specification, 2nd edn. Addison-Wesley, Reading (1999)

    Google Scholar 

  30. McDermid, J.: Engineering Safety-Critical Systems, pp. 217–245. Cambridge University Press, Cambridge (1996)

    Google Scholar 

  31. Mycroft, A., Sharp, R.: Hardware/Software Co-Design Using Functional Languages. In: Margaria, T., Yi, W. (eds.) TACAS 2001. LNCS, vol. 2031, pp. 236–251. Springer, Heidelberg (2001)

    Chapter  Google Scholar 

  32. Nöcker, E.G.J.M.H., Smetsers, J.E.W., van Eekelen, M.C.J.D., Plasmeijer, M.J.: Concurrent Clean. In: Aarts, E.H.L., Rem, M., van Leeuwen, J. (eds.) PARLE 1991. LNCS, vol. 505, pp. 202–219. Springer, Heidelberg (1991)

    Google Scholar 

  33. Nordlander, J., Carlsson, M., Jones, M.: Programming with Time-Constrained Reactions (unpublished report) (2006), http://www.cse.ogi.edu/pacsoft/projects/Timber/publications.htm

  34. O’Donnell, J.T.: The Hydra Hardware Description Language. In: Lengauer, C., Batory, D., Consel, C., Odersky, M. (eds.) Domain-Specific Program Generation. LNCS, vol. 3016, pp. 143–164. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  35. Peña, R., Segura, C.: A Polynomial-Cost Non-determinism Analysis. In: Arts, T., Mohnen, M. (eds.) IFL 2002. LNCS, vol. 2312, pp. 121–137. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  36. Peña, R., Segura, C.: A First-Order Functl. Lang. for Reasoning about Heap Consumption. In: Grelck, C., Huch, F., Michaelson, G.J., Trinder, P. (eds.) IFL 2004. LNCS, vol. 3474, Springer, Heidelberg (2005)

    Google Scholar 

  37. Peterson, J., Hudak, P., Elliot, C.: Lambda in Motion: Controlling Robots with Haskell. In: Gupta, G. (ed.) PADL 1999. LNCS, vol. 1551, p. 91. Springer, Heidelberg (1999)

    Chapter  Google Scholar 

  38. Peyton Jones, S.L., Lester, D.: Implementing Functional Languages: a Tutorial. Prentice-Hall, Englewood Cliffs (1992)

    Google Scholar 

  39. Peyton Jones, S.L.: Implementing Lazy Functional Languages on Stock Hardware:the Spineless Tagless G-Machine. Journal of Functional Programming 2(2), 127–202 (1992)

    Article  MATH  Google Scholar 

  40. Peyton Jones, S.L., Gordon, A.D., Finne, S.O.: Concurrent Haskell. In: Proc. POPL 1996 — ACM Symp. on Principles of Programming Languages, pp. 295–308 (January 1996)

    Google Scholar 

  41. Rebón Portillo, A.J., Hammond, K., Loidl, H.-W., Vasconcelos, P.: A Sized Time System for a Parallel Functional Language (Revised). In: Peña, R., Arts, T. (eds.) IFL 2002. LNCS, vol. 2670, pp. 1–16. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  42. Reppy, J.H.: CML: a Higher-Order Concurrent Language. In: Proc. 1991 ACM Conf. on Prog. Lang. Design and Impl (PLDI 1991), pp. 293–305 (June 1991)

    Google Scholar 

  43. Schwarz, R.: Causality in distributed systems. In: Proc. EW 5: 5th ACM SIGOPS European workshop, pp. 1–5. ACM Press, New York (1992)

    Chapter  Google Scholar 

  44. Taha, W., Ellner, S., Xi, H.: Generating Heap-Bounded Programs in a Functional Setting. In: Alur, R., Lee, I. (eds.) EMSOFT 2003. LNCS, vol. 2855, pp. 340–355. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  45. Tofte, M., Talpin, J.-P.: Region-Based Memory Management. Information and Computation 132(2), 109–176 (1997)

    Article  MATH  MathSciNet  Google Scholar 

  46. Turner, D.A.: Elementary Strong Functional Programming. In: Hartel, P.H., Plasmeijer, R. (eds.) FPLE 1995. LNCS, vol. 1022. Springer, Heidelberg (1995)

    Google Scholar 

  47. Vasconcelos, P.B.: Cost Inference and Analysis for Recursive Functional Programs. PhD thesis, University of St Andrews (in preparation, 2006)

    Google Scholar 

  48. Wadge, W.W., Ashcroft, E.A.: LUCID, the dataflow programming language. Academic Press, London (1985)

    MATH  Google Scholar 

  49. Wallace, M., Runciman, C.: Extending a Functional Programming System for Embedded Applications. Software: Practice & Experience 25(1) (January 1995)

    Google Scholar 

  50. Wikström, C., Nilsson, H.: Mnesia — an Industrial Database with Transactions, Distribution and a Logical Query Language. In: Proc. 1996 International Symposium on Cooperative Database Systems for Advanced Applications (1996)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2006 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Hammond, K. (2006). Exploiting Purely Functional Programming to Obtain Bounded Resource Behaviour: The Hume Approach. In: Horváth, Z. (eds) Central European Functional Programming School. CEFP 2005. Lecture Notes in Computer Science, vol 4164. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11894100_4

Download citation

  • DOI: https://doi.org/10.1007/11894100_4

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-46843-1

  • Online ISBN: 978-3-540-46845-5

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics