Skip to main content

Embedding a Functional Hybrid Modelling Language in Haskell

  • Conference paper
Implementation and Application of Functional Languages (IFL 2008)

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

Included in the following conference series:

Abstract

In this paper we present the first investigation into the implementation of a Functional Hybrid Modelling language for non-causal modelling and simulation of physical systems. In particular, we present a simple way to handle connect constructs: a facility for composing model fragments present in some form in most non-causal modelling languages. Our implementation is realised as a domain-specific language embedded in Haskell. The method of embedding employs quasiquoting, thus demonstrating the effectiveness of this approach for languages that are not suitable for embedding in more traditional ways. Our implementation is available on-line, and thus the first publicly available prototype implementation of a Functional Hybrid Modelling language.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 54.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 69.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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Augustsson, L., Mansell, H., Sittampalam, G.: Paradise: a two-stage DSL embedded in Haskell. In: ICFP 2008: Proceeding of the 13th ACM SIGPLAN International Conference on Functional Programming, pp. 225–228. ACM, New York (2008)

    Google Scholar 

  2. Broman, D.: Flow lambda calculus for declarative physical connection semantics. Technical Reports in Computer and Information Science No. 1. LIU Electronic Press (2007)

    Google Scholar 

  3. Broman, D., Fritzson, P.: Higher-order acausal models. In: Proceedings of the 2nd International Workshop on Equation-Based Object-Oriented Languages and Tools, Paphos, Cyprus, pp. 59–69. LIU Electronic Press (2008)

    Google Scholar 

  4. Cellier, F.E.: Object-oriented modelling: Means for dealing with system complexity. In: Proceedings of the 15th Benelux Meeting on Systems and Control, Mierlo, The Netherlands, pp. 53–64 (1996)

    Google Scholar 

  5. Cheong, M.H.: Functional programming and 3D games. BEng thesis, University of New South Wales, Sydney, Australia (November 2005)

    Google Scholar 

  6. Courtney, A., Nilsson, H., Peterson, J.: The Yampa arcade. In: Proceedings of the 2003 ACM SIGPLAN Haskell Workshop (Haskell 2003), Uppsala, Sweden, pp. 7–18. ACM Press, New York (2003)

    Google Scholar 

  7. Elliott, C., Finne, S., de Moor, O.: Compiling embedded languages. Journal of Functional Programming 13(2) (2003); Updated version of paper by the same name that appeared in SAIG 2000 proceedings

    Google Scholar 

  8. Elliott, C., Hudak, P.: Functional reactive animation. In: Proceedings of ICFP 1997: International Conference on Functional Programming, pp. 163–173 (June 1997)

    Google Scholar 

  9. Fritzson, P., Aronsson, P., Pop, A., Lundvall, H., Nystrom, K., Saldamli, L., Broman, D., Sandholm, A.: OpenModelica - a free open-source environment for system modeling, simulation, and teaching. In: 2006 IEEE International Symposium on Computer-Aided Control Systems Design, pp. 1588–1595 (October 2006)

    Google Scholar 

  10. Giorgidze, G., Nilsson, H.: Switched-on Yampa. In: Hudak, P., Warren, D.S. (eds.) PADL 2008. LNCS, vol. 4902, pp. 282–298. Springer, Heidelberg (2008)

    Google Scholar 

  11. Hudak, P.: Modular domain specific languages and tools. In: Proceedings of Fifth International Conference on Software Reuse, pp. 134–142 (June 1998)

    Google Scholar 

  12. Hudak, P., Courtney, A., Nilsson, H., Peterson, J.: Arrows, robots, and functional reactive programming. In: Jeuring, J., Jones, S.L.P. (eds.) AFP 2002. LNCS, vol. 2638, pp. 159–187. Springer, Heidelberg (2003)

    Chapter  Google Scholar 

  13. Leijen, D., Meijer, E.: Domain specific embedded compilers. In: Proceedings of the 2nd Conference on Domain-Specific Languages, pp. 109–122. ACM Press, New York (1999)

    Chapter  Google Scholar 

  14. Lindley, S., Wadler, P., Yallop, J.: The arrow calculus, functional pearl (2008), http://homepages.inf.ed.ac.uk/wadler/topics/links.html

  15. Liu, H.: CS690 report of FHM. Available from Computer Science, Yale University (May 2005)

    Google Scholar 

  16. Mainland, G.: Why it’s nice to be quoted: Quasiquoting for Haskell. In: Haskell 2007: Proceedings of the ACM SIGPLAN Workshop on Haskell Workshop, pp. 73–82. ACM, New York (2007)

    Google Scholar 

  17. Mainland, G., Morrisett, G., Welsh, M.: Flask: Staged functional programming for sensor networks. In: Proceedings of the Thirteenth ACM SIGPLAN International Conference on Functional Programming (ICFP 2008), Victoria, British Columbia, Canada. ACM Press, New York (2008)

    Google Scholar 

  18. The Modelica Association. Modelica – A unified object-oriented language for physical systems modeling: Language Specification version 3.0 (September 2007), http://www.modelica.org/documents/ModelicaSpec30.pdf

  19. Nilsson, H.: Type-based structural analysis for modular systems of equations. In: Fritzson, P., Cellier, F., Broman, D. (eds.) Proceedings of the 2nd International Workshop on Equation-Based Object-Oriented Languages and Tools, Paphos, Cyprus. Linköping Electronic Conference Proceedings, vol. 29, pp. 71–81. Linköping University Electronic Press (July 2008)

    Google Scholar 

  20. Nilsson, H., Courtney, A., Peterson, J.: Functional reactive programming, continued. In: Proceedings of the 2002 ACM SIGPLAN Haskell Workshop (Haskell 2002), Pittsburgh, Pennsylvania, USA, pp. 51–64. ACM Press, New York (2002)

    Google Scholar 

  21. Nilsson, H., Peterson, J., Hudak, P.: Functional Hybrid Modeling. In: Dahl, V. (ed.) PADL 2003. LNCS, vol. 2562, pp. 376–390. Springer, Heidelberg (2002)

    Chapter  Google Scholar 

  22. Nilsson, H., Peterson, J., Hudak, P.: Functional hybrid modeling from an object-oriented perspective. In: Fritzson, P., Cellier, F., Nytsch-Geusen, C. (eds.) Proceedings of the 1st International Workshop on Equation-Based Object-Oriented Languages and Tools. Linköping Electronic Conference Proceedings, vol. 24, pp. 71–87. Linköping University Electronic Press (2007)

    Google Scholar 

  23. Nytsch-Geusen, C., Ernst, T., Nordwig, A., Schwarz, P., Schneider, P., Vetter, M., Wittwer, C., Nouidui, T., Holm, A., Leopold, J., Schmidt, G., Mattes, A., Doll, U.: MOSILAB: Development of a modelica based generic simulation tool supporting model structural dynamics. In: Proceedings of the 4th International Modelica Conference, Hamburg, Germany, pp. 527–535 (2005)

    Google Scholar 

  24. Paterson, R.: A new notation for arrows. In: Proceedings of the 2001 ACM SIGPLAN International Conference on Functional Programming, Firenze, Italy, pp. 229–240 (September 2001)

    Google Scholar 

  25. Pellauer, M., Forsberg, M., Ranta, A.: BNF Converter: Multilingual front-end generation from labelled BNF grammars. Technical report, Computing Science at Chalmers University of Technology and Gothenburg University (September 2004)

    Google Scholar 

  26. Wan, Z., Hudak, P.: Functional reactive programming from first principles. In: Proceedings of PLDI 2001: Symposium on Programming Language Design and Implementation, pp. 242–252 (June 2000)

    Google Scholar 

  27. Zimmer, D.: Introducing Sol: A general methodology for equation-based modeling of variable-structure systems. In: Proceedings of the 6th International Modelica Conference, Bielefeld, Germany, pp. 47–56 (2008)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2011 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Giorgidze, G., Nilsson, H. (2011). Embedding a Functional Hybrid Modelling Language in Haskell. In: Scholz, SB., Chitil, O. (eds) Implementation and Application of Functional Languages. IFL 2008. Lecture Notes in Computer Science, vol 5836. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-642-24452-0_8

Download citation

  • DOI: https://doi.org/10.1007/978-3-642-24452-0_8

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-642-24451-3

  • Online ISBN: 978-3-642-24452-0

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics