{"title":"Modeling with monads: extensible modeling semantics as syntactic sugar","authors":"Christoph Höger","doi":"10.1145/2904081.2904084","DOIUrl":null,"url":null,"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.","PeriodicalId":344062,"journal":{"name":"Proceedings of the 7th International Workshop on Equation-Based Object-Oriented Modeling Languages and Tools","volume":"10 1","pages":"0"},"PeriodicalIF":0.0000,"publicationDate":"2016-04-18","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"2","resultStr":null,"platform":"Semanticscholar","paperid":null,"PeriodicalName":"Proceedings of the 7th International Workshop on Equation-Based Object-Oriented Modeling Languages and Tools","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.1145/2904081.2904084","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 2
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.