skip to main content
10.1145/1967677.1967687acmconferencesArticle/Chapter ViewAbstractPublication PagescpsweekConference Proceedingsconference-collections
research-article

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

Published:11 April 2011Publication History

ABSTRACT

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.

References

  1. A. Benveniste. Compositional and uniform modelling of hybrid systems. IEEE Trans. on Automatic Control, 43(4):579--584, April 1998.Google ScholarGoogle ScholarCross RefCross Ref
  2. A. Benveniste, B. Caillaud, and M. Pouzet. The fundamentals of hybrid systems modelers. In 49th IEEE Int. Conf. on Decision and Control (CDC), Atlanta, Georgia, USA, December 2010.Google ScholarGoogle ScholarCross RefCross Ref
  3. A. Benveniste, P. LeGuernic, and Ch. Jacquemot. Synchronous programming with events and relations: the SIGNAL language and its semantics. Science of Computer Programming, 16:103--149, 1991. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. D. Biernacki, J.-L. Cola\c co, G. Hamon, and M. Pouzet. Clock-directed modular code generation of synchronous data-flow languages. In ACM Int. Conf. on Languages, Compilers, and Tools for Embedded Systems (LCTES), Tucson, Arizona, June 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. S. Bliudze and D. Krob. Modelling of complex systems: Systems as dataflow machines. Fundamenta Informaticae, 91(2):251--274, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. S.L. Campbell, J.-Ph. Chancelier, and R. Nikoukhah. Modeling and Simulation in Scilab/Scicos. Springer, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. L.P. Carloni, R. Passerone, A. Pinto, and A.L. Sangiovanni-Vincentelli. Languages and tools for hybrid systems design. Foundations and Trends in Electronic Design Automation, 1(1/2), 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. B. Denckla and P.J. Mosterman. Stream- and state-based semantics of hierarchy in block diagrams. In 17th IFAC World Congress, pages 7955--7960, Seoul, Korea, 2008.Google ScholarGoogle ScholarCross RefCross Ref
  9. C. Elliott and P. Hudak. Functional reactive animation. In Proc. of the ACM SIGPLAN Int. Conf. on Functional Programming (ICFP'97), pages 263--273, Amsterdam, The Netherlands, August 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. N. Halbwachs, P. Caspi, P. Raymond, and D. Pilaud. The synchronous dataflow programming language lustre. Proc. of the IEEE, 79(9):1305--1320, September 1991.Google ScholarGoogle ScholarCross RefCross Ref
  11. A.C. Hindmarsh, P.N. Brown, K.E. Grant, S.L. Lee, R. Serban, D.E. Shumaker, and C.S. Woodward. SUNDIALS: Suite of nonlinear and differential/algebraic equation solvers. ACM Trans. on Mathematical Software, 31(3):363--396, September 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. E.A. Lee and A.L. Sangiovanni-Vincentelli. A framework for comparing models of computation. IEEE Trans. on CAD of Integrated Circuits and Systems, 17(12):1217--1229, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. E.A. Lee and H. Zheng. Operational semantics of hybrid systems. In Hybrid Systems: Computation and Control (HSCC), volume 3414 of LNCS, pages 25--53, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. E.A. Lee and H. Zheng. Leveraging synchronous language principles for heterogeneous modeling and design of embedded systems. In Proc. of the 7th ACM & IEEE Int. Conf. on Embedded software (EMSOFT), pages 114--123, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. P.J. Mosterman, J. Zander, G. Hamon, and B. Denckla. Towards computational hybrid system semantics for time-based block diagrams. In 3rd IFAC Conf. on Analysis and Design of Hybrid Systems (ADHS'09), pages 376--385, Zaragoza, Spain, September 2009.Google ScholarGoogle ScholarCross RefCross Ref
  16. M. Najafi and R. Nikoukhah. Implementation of hybrid automata in scicos. In IEEE Multi-conference on Systems and Control, 2007.Google ScholarGoogle Scholar
  17. R. Nikoukhah. Hybrid dynamics in modelica: Should all events be considered synchronous? In First Int. Workshop on Equation-Based Object Oriented Languages and Tools (EOOLT 2007), pages 37--48, Berlin, Germany, 2007.Google ScholarGoogle Scholar
  18. H. Nilsson, A. Courtney, and J. Peterson. Functional reactive programming, continued. In Haskell'02: Proc. of the 2002 ACM SIGPLAN workshop on Haskell, pages 51--64, Pittsburgh, Pennsylvania, January 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. M. Pouzet. Lucid Synchrone, version 3. Tutorial and reference manual. Université Paris-Sud, LRI, April 2006. Distribution available at: www.lri.fr/$\sim$pouzet/lucid-synchrone.Google ScholarGoogle Scholar
  20. S. Tripakis, C. Sofronis, P. Caspi, and A. Curic. Translating discrete-time simulink to lustre. ACM Trans. on Embedded Computing Systems, 4(4):779--818, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

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

                Recommendations

                Reviews

                Prahladavaradan Sampath

                Embedded systems have become pervasive. They are prevalent in many aspects of our everyday lives, from controlling cars using anti-lock braking systems (ABSs) to controlling the rhythm of hearts using a pacemaker. All of these systems are discrete computers embedded within a continuous environment. Hybrid modelers are an important tool for studying and analyzing the interaction between discrete computation and the control of a continuous environment. A number of tools exist for modeling, simulating, and analyzing hybrid systems, including Simulink/Stateflow, Modelica, and Ptolemy. This paper enriches the literature with a type system that enables a clean factorization of a hybrid model into its discrete and continuous parts. It presents the factorization in the form of a compilation scheme that transforms well-typed hybrid models into synchronous programs, and a set of open dynamics engines (ODEs). Traditional tools available for synchronous languages can then simulate the synchronous program, and well-known ODE solvers can solve the ODEs. The heart of the compilation scheme is the interface between the ODE solvers and the synchronous code that takes the form of additional parameters to the synchronous functions, capturing information about zero crossings and continuous state variables. This paper is interesting because it provides a declarative approach for structuring hybrid models, as compared to the operational concept of "directors" used in Ptolemy. The use of a type system to enable factorization of a hybrid model is also quite novel. The type system also opens up the possibility of developing more expressive proof systems for reasoning about hybrid models in the future. Online Computing Reviews Service

                Access critical reviews of Computing literature here

                Become a reviewer for Computing Reviews.

                Comments

                Login options

                Check if you have access through your login credentials or your institution to get full access on this article.

                Sign in
                • Published in

                  cover image ACM Conferences
                  LCTES '11: Proceedings of the 2011 SIGPLAN/SIGBED conference on Languages, compilers and tools for embedded systems
                  April 2011
                  182 pages
                  ISBN:9781450305556
                  DOI:10.1145/1967677
                  • cover image ACM SIGPLAN Notices
                    ACM SIGPLAN Notices  Volume 46, Issue 5
                    LCTES '10
                    May 2011
                    170 pages
                    ISSN:0362-1340
                    EISSN:1558-1160
                    DOI:10.1145/2016603
                    Issue’s Table of Contents

                  Copyright © 2011 ACM

                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                  Publisher

                  Association for Computing Machinery

                  New York, NY, United States

                  Publication History

                  • Published: 11 April 2011

                  Permissions

                  Request permissions about this article.

                  Request Permissions

                  Check for updates

                  Qualifiers

                  • research-article

                  Acceptance Rates

                  Overall Acceptance Rate116of438submissions,26%

                PDF Format

                View or Download as a PDF file.

                PDF

                eReader

                View online with eReader.

                eReader