Embedding a Functional Hybrid Modelling Language in Haskell

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.

[1]  Paul Hudak,et al.  Modular domain specific languages and tools , 1998, Proceedings. Fifth International Conference on Software Reuse (Cat. No.98TB100203).

[2]  Ross Paterson,et al.  A new notation for arrows , 2001, ICFP '01.

[3]  Oege de Moor,et al.  Compiling embedded languages , 2003, J. Funct. Program..

[4]  Geoffrey Mainland Why it's nice to be quoted: quasiquoting for haskell , 2007, Haskell '07.

[5]  Xiang Li Intelligent object-oriented modelling , 1996 .

[6]  Paul Hudak,et al.  Functional reactive programming from first principles , 2000, PLDI '00.

[7]  Paul Hudak,et al.  Arrows, Robots, and Functional Reactive Programming , 2002, Advanced Functional Programming.

[8]  Matt Welsh,et al.  Flask: staged functional programming for sensor networks , 2008, ICFP.

[9]  David Broman,et al.  Flow Lambda Calculus for Declarative Physical Connection Semantics , 2007 .

[10]  Paul Hudak,et al.  Functional reactive animation , 1997, ICFP '97.

[11]  Mun Hon Cheong,et al.  Functional Programming and 3D Games , 2005 .

[12]  COIS E. CELLIER Object{oriented Modeling: Means for Dealing with System Complexity , 1996 .

[13]  Philip Wadler,et al.  The arrow calculus , 2010, J. Funct. Program..

[14]  Henrik Nilsson,et al.  Switched-On Yampa , 2008, PADL.

[15]  David Broman,et al.  Higher-Order Acausal Models , 2009, EOOLT.

[16]  Dirk Zimmer Introducing Sol: A General Methodology for Equation-Based Modeling of Variable-Structure Systems , 2008 .

[17]  Henrik Nilsson,et al.  Type-Based Structural Analysis for Modular Systems of Equations , 2008, EOOLT.

[18]  Markus Forsberg,et al.  BNF converter , 2004, Haskell '04.

[19]  Philip Wadler,et al.  The Arrow Calculus (Functional Pearl) , 2008 .

[20]  Daan Leijen,et al.  Domain specific embedded compilers , 1999, DSL '99.

[21]  Paul Hudak,et al.  Functional Hybrid Modeling , 2003, PADL.

[22]  Ganesh Sittampalam,et al.  Paradise: a two-stage DSL embedded in Haskell , 2008, ICFP.

[23]  Henrik Nilsson,et al.  The Yampa arcade , 2003, Haskell '03.

[24]  Paul Hudak,et al.  Functional Hybrid Modeling from an Object-Oriented Perspective , 2007, EOOLT.

[25]  Adrian Pop,et al.  OpenModelica - A free open-source environment for system modeling, simulation, and teaching , 2006, 2006 IEEE Conference on Computer Aided Control System Design, 2006 IEEE International Conference on Control Applications, 2006 IEEE International Symposium on Intelligent Control.

[26]  Ganesh Sittampalam,et al.  Paradise: a two-stage DSL embedded in Haskell , 2008, ICFP 2008.

[27]  Henrik Nilsson,et al.  Functional reactive programming, continued , 2002, Haskell '02.

[28]  M. Otter,et al.  Modelica - A Unified Object-Oriented Language for Physical Systems Modeling - Language Specification , 2000 .

[29]  Markus Forsberg,et al.  BNF Converter: Multilingual front-end generation from labelled BNF , 2004 .

[30]  Fraunhofer Iis,et al.  MOSILAB: Development of a Modelica based generic simulation tool supporting model structural dynamics , 2005 .