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.
Access provided by Autonomous University of Puebla. Download to read the full chapter text
Chapter PDF
Similar content being viewed by others
Keywords
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.
References
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)
Broman, D.: Flow lambda calculus for declarative physical connection semantics. Technical Reports in Computer and Information Science No. 1. LIU Electronic Press (2007)
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)
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)
Cheong, M.H.: Functional programming and 3D games. BEng thesis, University of New South Wales, Sydney, Australia (November 2005)
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)
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
Elliott, C., Hudak, P.: Functional reactive animation. In: Proceedings of ICFP 1997: International Conference on Functional Programming, pp. 163–173 (June 1997)
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)
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)
Hudak, P.: Modular domain specific languages and tools. In: Proceedings of Fifth International Conference on Software Reuse, pp. 134–142 (June 1998)
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)
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)
Lindley, S., Wadler, P., Yallop, J.: The arrow calculus, functional pearl (2008), http://homepages.inf.ed.ac.uk/wadler/topics/links.html
Liu, H.: CS690 report of FHM. Available from Computer Science, Yale University (May 2005)
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)
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)
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
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)
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)
Nilsson, H., Peterson, J., Hudak, P.: Functional Hybrid Modeling. In: Dahl, V. (ed.) PADL 2003. LNCS, vol. 2562, pp. 376–390. Springer, Heidelberg (2002)
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)
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)
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)
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)
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)
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)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights 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)