Affiliation:
1. Ansys, France
2. The University of Bamberg, Germany
3. Ansys, France and Inria, France
4. ENS, France and PSL University, France and Inria, France
Abstract
Scade is a domain-specific synchronous functional language used to implement safety-critical real-time software for more than twenty years. Two main approaches have been considered for its semantics: (i) an
indirect collapsing semantics
based on a source-to-source translation of high-level constructs into a data-flow core language whose semantics is precisely specified and is the entry for code generation; a
relational synchronous semantics
, akin to Esterel, that applies
directly
to the source. It defines what is a valid synchronous reaction but hides, on purpose, if a semantics exists, is unique and can be computed; hence, it is not executable.
This paper presents, for the first time, an
executable
, state-based semantics for a language that has the key constructs of Scade all together, in particular the arbitrary combination of data-flow equations and hierarchical state machines. It can apply
directly
to the source language before static checks and compilation steps. It is
constructive
in the sense that the language in which the semantics is defined is a statically typed functional language with call-by-value and strong normalization, e.g., it is expressible in a proof-assistant where all functions terminate. It leads to a reference, purely functional, interpreter. This semantics is modular and can account for possible errors, allowing to establish what property is ensured by each static verification performed by the compiler. It also clarifies how causality is treated in Scade compared with Esterel.
This semantics can serve as an oracle for compiler testing and validation; to prototype novel language constructs before they are implemented, to execute possibly unfinished models or that are correct but rejected by the compiler; to prove the correctness of compilation steps.
The semantics given in the paper is implemented as an interpreter in a purely functional style, in OCaml.
Publisher
Association for Computing Machinery (ACM)
Subject
Hardware and Architecture,Software
Reference51 articles.
1. Joaquín Aguado, Michael Mendler, Marc Pouzet, Partha S. Roop, and Reinhard von Hanxleden. 2018. Deterministic concurrency: A clock-synchronised shared memory approach. In ESOP. Thessaloniki, Greece, 86–113.
2. Denotational fixed-point semantics for constructive scheduling of synchronous concurrency;Aguado J.;Acta Informatica,2015
3. Ch. André. 1996. Representation and analysis of reactive behaviors: A synchronous approach. In CESA. IEEE-SMC, Lille.
4. A. Benveniste, T. Bourke, B. Caillaud, B. Pagano, and M. Pouzet. 2014. A type-based analysis of causality loops in hybrid systems modelers. In HSCC. ACM, Berlin, Germany.
5. The synchronous languages 12 years later