Bridging the Gap between Acumen and Modelica

From CERES
Jump to: navigation, search
Title Bridging the Gap between Acumen and Modelica
Summary Provide Modelica Syntax for Acumen
Keywords
TimeFrame
References
Prerequisites
Author
Supervisor Walid Taha, Adam Duracz, and Yingfu Zeng
Level Master
Status Open

Generate PDF template

Description:

Modelica is a highly popular language for modeling cyber-physical systems (CPS) as hybrid (continuous/discrete) models. It is widely used in several industries, especially in the automotive domain. Acumen is a hybrid-systems modeling language that has been used with notable success in teaching CPS.

Milestones and Schedule:

  • Developing and testing a translator from Acumen to Modelica syntax
    • This involves mainly developing a pretty-printer for Modelica, which takes Acumen abstract syntax tree and produces an ASCII file that used Modelica syntax.
    • Syntax-level tests at this stage will use a standard Modelica parser to check that the produced programs are valid. As part of this test, it is important to produce *both* programs that are syntactically correct and others that are incorrect to check the integrity of the system.
    • Syntax-level tests at this stage will use a standard Modelica parser to check that the produced programs are valid. As part of this test, it is important to produce *both* programs that are syntactically correct and others that are incorrect to check the integrity of the system.
    • Semantics-level tests will check that the simulation that runs in Acumen produces “essentially identical results” to those that result from running Modelica. This is a challenging step, because every comparison has to be done manually and carefully, and any differences explained in a case-by-case fashion.
    • This tasks requiring learning the Scala programming language, functional programming, and becoming familiar abstract syntax tree (AST) data type used in the Acumen implementation. The MOOC mentioned in the reference section is an excellent source for learning Scala and functional programming.
    • The result of this work should be integrated with the latest release of Acumen. It should be noted that Acumen is continually being developed, so, this will require becoming familiar and skilled in working with version control (The git system) and in coordinating your work with the Acumen team.
  • Develop and test a parser for the *subset* of Modelica that corresponds to Acumen.
    • This parser must reject any Modelica programs that are *not* valid Acumen programs, and produce informative error messages.
    • Testing should be done by showing that translation into Modelica followed by parsing as a Modelica Light program 1) always succeeds, and 2) produces exact the same parse tree you started with.
    • Integration into the latest Acumen release.
  • Translating, formatting, reviewing and testing all the current examples included in the Acumen distribution (under the “examples” directory) into Modelica syntax.
  • Developing an approach to compare the result of running the Acumen models using both the Acumen implementation and the Modelica implementation to make sure that the results are the same.
    • This is step involves open research questions and is a challenging step.
    • It will be very important in this stage of the work to check with Peter Fritzson about the status of the extension of PySimulator that is aimed at comparing implementations (and that is currently under development)

Deliverables:

  • Translator from Acumen to Modelica
  • Extensive test cases for this translator, including unit tests and working property-based tests.
  • Translator from “Modelica Light” to Acumen
  • A method for comparing the results of running a model in both Acumen and Modelica
  • A suite of test cases that illustrates the effectiveness and limitations of this method
  • An integration of all of these results into the latest version of Acumen

References:

  • The Acumen Implementation (www.acumen-language.org)
  • The OpenModelica Implementation (https://openmodelica.org)
  • Walid Taha, Verónica Gaspes, Rex Page: Accurate Programming: Thinking about programs in terms of properties. DSL 2011: 236-260. PDF.
  • Functional Programming Principles in Scala. Martin Odersky. MOOC Website