Embedding a Functional Hybrid Modelling Language in Haskell

  • George Giorgidze
  • Henrik Nilsson
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5836)

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.

Keywords

Signal Relation Modelling Language Signal Function Abstract Syntax Functional Programming 
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.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 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. 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. 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. 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. 5.
    Cheong, M.H.: Functional programming and 3D games. BEng thesis, University of New South Wales, Sydney, Australia (November 2005)Google Scholar
  6. 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. 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 proceedingsGoogle Scholar
  8. 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. 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. 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. 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. 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)CrossRefGoogle Scholar
  13. 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)CrossRefGoogle Scholar
  14. 14.
    Lindley, S., Wadler, P., Yallop, J.: The arrow calculus, functional pearl (2008), http://homepages.inf.ed.ac.uk/wadler/topics/links.html
  15. 15.
    Liu, H.: CS690 report of FHM. Available from Computer Science, Yale University (May 2005)Google Scholar
  16. 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. 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. 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. 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. 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. 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)CrossRefGoogle Scholar
  22. 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. 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. 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. 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. 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. 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

Copyright information

© Springer-Verlag Berlin Heidelberg 2011

Authors and Affiliations

  • George Giorgidze
    • 1
  • Henrik Nilsson
    • 1
  1. 1.Functional Programming Laboratory, School of Computer ScienceUniversity of NottinghamUnited Kingdom

Personalised recommendations