A Constructive State-based Semantics and Interpreter for a Synchronous Data-flow Language with State Machines - Inria - Institut national de recherche en sciences et technologies du numérique Access content directly
Journal Articles ACM Transactions on Embedded Computing Systems (TECS) Year : 2023

A Constructive State-based Semantics and Interpreter for a Synchronous Data-flow Language with State Machines

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.
Fichier principal
Vignette du fichier
emsoft23b-extended.pdf (701.75 Ko) Télécharger le fichier
Origin Files produced by the author(s)

Dates and versions

hal-04491219 , version 1 (05-03-2024)

Identifiers

Cite

Jean-Louis Colaço, Michael Mendler, Baptiste Pauget, Marc Pouzet. A Constructive State-based Semantics and Interpreter for a Synchronous Data-flow Language with State Machines: Application to the Language Scade. ACM Transactions on Embedded Computing Systems (TECS), 2023, 22 (5s), pp.Article 152: 1-26. ⟨10.1145/3609131⟩. ⟨hal-04491219⟩
20 View
8 Download

Altmetric

Share

Gmail Mastodon Facebook X LinkedIn More