Divide and recycle: types and compilation for a hybrid synchronous language

Hybrid modelers such as Simulink have become corner stones of embedded systems development. They allow both discrete controllers and their continuous environments to be expressed in a single language. Despite the availability of such tools, there remain a number of issues related to the lack of reproducibility of simulations and to the separation of the continuous part, which has to be exercised by a numerical solver, from the discrete part, which must be guaranteed not to evolve during a step. Starting from a minimal, yet full-featured, Lustre-like synchronous language, this paper presents a conservative extension where data-flow equations can be mixed with ordinary differential equations (ODEs) with possible reset. A type system is proposed to statically distinguish discrete computations from continuous ones and to ensure that signals are used in their proper domains. We propose a semantics based on non-standard analysis which gives a synchronous interpretation to the whole language, clarifies the discrete/continuous interaction and the treatment of zero-crossings, and also allows the correctness of the type system to be established. The extended data-flow language is realized through a source-to-source transformation into a synchronous subset, which can then be compiled using existing tools into routines that are both efficient and bounded in their use of memory. These routines are orchestrated with a single off-the-shelf numerical solver using a simple but precise algorithm which treats causally-related cascades of zero-crossings. We have validated the viability of the approach through experiments with the Sundials library.

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

[2]  Pascal Raymond,et al.  The synchronous data flow programming language LUSTRE , 1991, Proc. IEEE.

[3]  Timothy Bourke,et al.  Non-standard semantics of hybrid systems modelers , 2012, J. Comput. Syst. Sci..

[4]  Alberto L. Sangiovanni-Vincentelli,et al.  Languages and Tools for Hybrid Systems Design , 2006, Found. Trends Electron. Des. Autom..

[5]  Ramine Nikoukhah Hybrid Dynamics in Modelica: Should all Events be Considered Synchronous , 2007, EOOLT.

[6]  Marc Pouzet,et al.  Clock-directed modular code generation for synchronous data-flow languages , 2008, LCTES '08.

[7]  Albert Benveniste Compositional and Uniform Modelling of Hybrid Systems , 1995, Hybrid Systems.

[8]  Pieter J. Mosterman,et al.  Towards Computational Hybrid System Semantics for Time-Based Block Diagrams , 2009, ADHS.

[9]  Masoud Najafi,et al.  Implementation of Hybrid Automata in Scicos , 2007, 2007 IEEE International Conference on Control Applications.

[10]  Marc Pouzet,et al.  Lucid Synchrone - version 2.0: Tutorial and reference manual , 2001 .

[11]  Stavros Tripakis,et al.  Translating discrete-time simulink to lustre , 2003, TECS.

[12]  A. Benveniste Compositional and uniform modeling of hybrid systems , 1998 .

[13]  Jean-Philippe Chancelier,et al.  Modeling and Simulation in Scilab/Scicos with ScicosLab 4.4 , 2009 .

[14]  Edward A. Lee,et al.  Leveraging synchronous language principles for heterogeneous modeling and design of embedded systems , 2007, EMSOFT '07.

[15]  Pieter J. Mosterman,et al.  Stream and State-Based Semantics of Hierarchy in Block Diagrams , 2008 .

[16]  Edward A. Lee,et al.  A framework for comparing models of computation , 1998, IEEE Trans. Comput. Aided Des. Integr. Circuits Syst..

[17]  Jean-Philippe Chancelier,et al.  Modeling and Simulation in Scilab/Scicos , 2006 .

[18]  Simon Bliudze,et al.  Modelling of Complex Systems: Systems as Dataflow Machines , 2009, Fundam. Informaticae.

[19]  Albert Benveniste,et al.  programmi language and its , 2001 .

[20]  Marc Pouzet,et al.  The fundamentals of hybrid systems modelers , 2010, 49th IEEE Conference on Decision and Control (CDC).

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

[22]  Edward A. Lee,et al.  Operational Semantics of Hybrid Systems , 2005, HSCC.

[23]  Carol S. Woodward,et al.  Enabling New Flexibility in the SUNDIALS Suite of Nonlinear and Differential/Algebraic Equation Solvers , 2020, ACM Trans. Math. Softw..