skip to main content
10.1145/2904081.2904084acmotherconferencesArticle/Chapter ViewAbstractPublication PageseooltConference Proceedingsconference-collections
research-article

Modeling with monads: extensible modeling semantics as syntactic sugar

Published:18 April 2016Publication History

ABSTRACT

We present an extensible implementation of Modelica-style modeling semantics. Modeling features are implemented using an intuitive encoding as an extensible state monad. Monadic computation naturally yields model composition and interpretation. This in turn allows for a clear separation between the modular aspects of a modeling language (e.g. classes and inheritance) and the symbolical and numerical treatment of models: While the former can be implemented by a compiler or interpreter, the latter can be moved into a core-library to be maintained by domain-experts. In a second step, we show how the elaboration aspects of the language can be removed by a correct and complete desugaring procedure. The residual language is a simple extension of a call-by-value λ-calculus. Thus it becomes possible to implement a compiler for a modeling language using existing standard techniques.

References

  1. Modelica Association et al. Modelica: A unified object-oriented language for systems modeling-language specification version 3.3. URL="https://www.modelica.org/documents/ModelicaSpec33.pdf, 9, 2012.Google ScholarGoogle Scholar
  2. Andrej Bauer and Matija Pretnar. Programming with algebraic effects and handlers. Journal of Logical and Algebraic Methods in Programming, 84(1):108--123, 2015.Google ScholarGoogle ScholarCross RefCross Ref
  3. David Broman. Meta-Languages and Semantics for Equation-Based Modeling and Simulation. PhD thesis, Department of Computer and Information Science, Linköping University, Sweden, 2010.Google ScholarGoogle Scholar
  4. David Broman, Peter Fritzson, and Sébastien Furic. Types in the Modelica Language. In Proceedings of the Fifth International Modelica Conference, Vienna, Austria, 2006.Google ScholarGoogle Scholar
  5. David Broman and Jeremy G. Siek. Modelyze: a gradually typed host language for embedding equation-based modeling languages. Technical Report UCB/EECS-2012-173, EECS Department, University of California, Berkeley, Jun 2012.Google ScholarGoogle Scholar
  6. George Giorgidze and Henrik Nilsson. Embedding a functional hybrid modelling language in haskell. In Implementation and Application of Functional Languages, pages 138--155. Springer, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Christoph Höger, Florian Lorenzen, and Peter Pepper. Notes on the separate compilation of modelica. In Peter Fritzson, Edward Lee, François E. Cellier, and David Broman, editors, 3rd International Workshop on Equation-Based Object-Oriented Modeling Languages and Tools, pages 43--51. Linköping University Electronic Press, 2010.Google ScholarGoogle Scholar
  8. Peter J. Landin. The mechanical evaluation of expressions. Computer Journal, 6(4):308--320, 1964.Google ScholarGoogle ScholarCross RefCross Ref
  9. Sheng Liang, Paul Hudak, and Mark Jones. Monad transformers and modular interpreters. In Proceedings of the 22Nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, POPL '95, pages 333--343, New York, NY, USA, 1995. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. Sven Erik Mattsson and Gustaf Söderlind. Index reduction in differential-algebraic equations using dummy derivatives. SIAM Journal on Scientific Computing, 14(3):677--692, 1993. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Peter Pepper, Alexandra Mehlhase, Christoph Höger, and Lena Scholz. A compositional semantics for modelica-style variable-structuremodeling. In EOOLT, pages 45--54, 2011.Google ScholarGoogle Scholar
  12. John D Pryce. A simple structural analysis method for daes. BIT Numerical Mathematics, 41(2):364--394, 2001.Google ScholarGoogle ScholarCross RefCross Ref
  13. Philip Wadler. Comprehending monads. In LFP '90: Proceedings of the 1990 ACM conference on LISP and functional programming, pages 61--78, New York, NY, USA, 1990. ACM. Google ScholarGoogle ScholarDigital LibraryDigital Library

Recommendations

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 Other conferences
    EOOLT '16: Proceedings of the 7th International Workshop on Equation-Based Object-Oriented Modeling Languages and Tools
    April 2016
    75 pages
    ISBN:9781450342025
    DOI:10.1145/2904081

    Copyright © 2016 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: 18 April 2016

    Permissions

    Request permissions about this article.

    Request Permissions

    Check for updates

    Qualifiers

    • research-article

    Acceptance Rates

    EOOLT '16 Paper Acceptance Rate10of11submissions,91%Overall Acceptance Rate10of11submissions,91%

PDF Format

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader