An expanding field with new questions

Recent progress in the field of NLP impacts all of its subfields and extends its domain of applications. Central to these developments is automated dialogue, either with chatbots (scripted, conversational, cognitive) or personal assistants, ubiquitous and widely distributed as services via smartphones or commercial websites.

At the same time, new written media continue to grow and most of them involve some sort of interaction: chats, forums, emails, microblogging, or collaborative instant messaging services. This progress and the generalization of natural language for interaction also make way for novel approaches taking into account multiple modalities (images, video) and the situation in which dialogues take place. In this context, all aspects of conversation analysis and dialogue system development are concerned, whether communication is oral or written, task-oriented or open.

The prevalence of neural network based approaches in NLP further influences approaches to dialogue, bringing into focus different matters, such as automatic generation of diverse and natural responses, although these approaches sometimes minimize the role of comprehension, and make it quite challenging to integrate linguistic and extra-linguistic context. New approaches also bring new problems that pervade machine-learning in general: black box models are not easy to explain, and blurring the lines between humans and machines may generate ethical quandaries-such as when conversational agents reproduce the biases and prejudices present in their training data-issues that generate a lot of concern and dedicated workshops. 1 Paucity 1. Such as the Safety for Conversational AI Workshop, safetyforconvai.splashthat.com.

Introduction to the Special Issue on Dialogue and Dialogue Systems

Liesbeth Degand * -Philippe Muller ** of annotated data for supervised methods is another issue for machine learning approaches which motivates the collection of auxiliary data, semi-automatically annotated data, or artificial data far removed from real-world use cases. This can generate a gap between theory and practice that needs to be addressed.

For this special issue, the TAL journal invited contributions on all aspects of research related to the analysis of written or transcribed conversations, to the development and evaluation of dialogue systems, to data collection for all interaction modalities, and to ethical and social issues pertaining to dialogue and its applications. While not all of these aspects have been addressed in the contributions to this special issue, we will quickly review in this introduction the more important lines of research in Natural Language Processing and Computational Linguistics, both from the point of view of natural language conversation and dialogue analysis, and from that of the perspective of dialogue systems that interact with users. We then present this issue's accepted papers.

Analysis of dialogues

Computational analysis of linguistic interaction is not a new topic, as it went hand in hand with progress in speech recognition, which gave rise to interactive applications, and a demand for a more complex understanding of conversations. Another shift has taken place with the increase of written interactions that came with the widespread use of the internet: forums, chat rooms, microblogging, and emails are all manifestations of more or less synchronous dialogues involving two or more participants. This has provided a boost in available data as the volume of written conversations largely surpasses available speech data, and they are also much easier to process. This is then reflected in the growth of annotated corpora, for instance the Ubuntu IRC corpus [START_REF] Kummerfeld | A Large-Scale Corpus for Conversation Disentanglement[END_REF] which includes relations between utterances in a multiparty technical chat discussion, or the STAC corpus [START_REF] Asher | Discourse Structure and Dialogue Acts in Multiparty Dialogue: the STAC Corpus[END_REF], consisting of chat negotiation dialogues with annotated discourse and conversation structures. In parallel, a rising number of (corpus) linguistic studies have engaged in trying to uncover the linguistic specificities of "online discourse". Thus, according to [START_REF] Baron | Discourse structures in Instant Messaging: The case of utterance breaks[END_REF], a "persistent question intriguing Internet researchers has been whether the stylistic features of CMC [computer-mediated communication] are more like those of informal speech or paradigmatic writing". In this strand of research, interactive text-based computer-mediated conversations have been shown to share many characteristics with informal spoken conversations, especially in terms of conversational and discourse mechanisms such as turn-taking, grounding, and coherence marking.

While the bridge between linguistic descriptive (corpus-based) research and computational work is not yet fully crossed, some of these linguistic findings have found their way to NLP research applications: identifying speech acts [START_REF] Mohiuddin | Adaptation of Hierarchical Structured Models for Speech Act Recognition in Asynchronous Conversation[END_REF], analyzing the structure of interactions [START_REF] Shi | Unsupervised Dialog Structure Learning[END_REF][START_REF] Badene | Weak Supervision for Learning Discourse Structure[END_REF], understanding the flow of information in context, among others. Other questions might be more relevant for oral data (speaker recognition for instance), or show up in different ways in various types of interactions (disfluencies, monitoring, feedback). Written-text oriented models or annotation standards tend now to be more concerned with integrating oral phenomena, as is shown by the new Universal dependencies model for syntax [START_REF] Sanguinetti | Treebanking User-Generated Content: A Proposal for a Unified Representation in Universal Dependencies[END_REF]. New interesting problems also appear: with more speakers/writers involved, overlapping threads of conversation complicate understanding [START_REF] Kummerfeld | A Large-Scale Corpus for Conversation Disentanglement[END_REF].

The current (industrial) applications are numerous: for instance, a lot of companies provide chat interaction for Customer Relationship Management instead of telephone services, and are interested in the information they can thus gain about their customers in order to improve their interaction with them. Another example is the analysis of meetings and producing the minutes, which was first undertaken with the AMI corpus [START_REF]Unleashing the killer corpus: experiences in creating the multi-everything AMI Meeting Corpus[END_REF] and the ICSI corpus [START_REF] Janin | The ICSI Meeting Corpus[END_REF], and is now being revisited, also with progress made in automated summarization [START_REF] Li | Keep Meeting Summaries on Topic: Abstractive Multi-Modal Meeting Summarization[END_REF].

On a technical level, neural networks have enabled powerful intermediate, learnable representations at each level of a conversation: tokens, utterances and speech acts, and sequences of such, which pervade the predictive models applied to conversation aspects [START_REF] Kumar | Dialogue Act Sequence Labeling Using Hierarchical Encoder With CRF[END_REF].

Dialogue systems

Of course, theoretical advances in dialogue models impact dialogue systems, but interactive dialogue systems include more than just the modelling of interactions. They generally consist of three main components: (1) understanding user input (either from speech or written text); (2) managing the interaction: keeping track of the dialogue state and planning actions; and (3) generating a linguistic output form such as text or speech to interact with the user.

The natural language understanding component is more directly tied to progress in dialogue modelling, but within dialogue systems it is usually tailored to a specific application, focusing on a particular part of the input or a classification of the goal of a speech act (sometimes called intents), with the goal of extracting predefined pieces of information relevant to the intent (slot filling), a task akin to semantic parsing in more general NLP, cf. the survey of recent work on these aspects by [START_REF] Louvan | Recent Neural Methods on Slot Filling and Intent Classification for Task-Oriented Dialogue Systems: A Survey[END_REF]. There is also a lot of interest in so-called open-domain systems, which would have the ability to naturally interact with human participants and converse on any subject, but they raise a lot more issues that only partly concern applied systems: background knowledge, and emotional engagement [START_REF] Huang | Challenges in Building Intelligent Open-domain Dialog Systems[END_REF].

At the level of dialogue management, one can distinguish two tasks that together define the behaviour of the system and the way it responds to users: (a) dialog state tracking (DST), and (b) determining an optimal dialog policy (what is the best move in a given context). DST covers all models and representations of speaker and agent beliefs, goals, and the state of conversation (questions under discussion, common ground, commitments), see a survey by [START_REF] Williams | The Dialog State Tracking Challenge Series: A Review[END_REF]. It is the subject of an ongoing series of annual challenges 2 , with varying subtasks. Recent approaches involve neural networks for their flexibility with respect to integrating different levels of representations [START_REF] Mrkšić | Neural Belief Tracker: Data-Driven Dialogue State Tracking[END_REF]. Dialog policy optimization is the planning and/or selection of dialogue actions, and their types and content, before generation of the linguistic output. Technical approaches have been based on reinforcement learning, first with partially observable Markov decision problems [START_REF] Young | POMDP-Based Statistical Spoken Dialog Systems: A Review[END_REF], superseded now by deep RL approaches, for instance [START_REF] Li | End-to-End Task-Completion Neural Dialogue Systems[END_REF].

These components can also be integrated into a single architecture, especially in neural models that try to enforce an end-to-end architecture, from user language input to system output, with intermediate latent representations for dialogue states and for the policy to follow, all supervised by the end result of the interaction with respect to the task. In this case the tasks are simple and focused, for example in the case of interactive question answering [START_REF] Dhingra | Towards End-to-End Reinforcement Learning of Dialogue Agents for Information Access[END_REF][START_REF] Vandyke | A Network-based End-to-End Trainable Task-oriented Dialogue System[END_REF]. Answering a user is then either based on dedicated Natural Language Generation (NLG) approaches, which in general is the problem of taking a formal representation to produce a wellformed linguistic output. As mentioned above, this can also be integrated in a general architecture in which it is the final output. In fact, recent work tends to develop endto-end architectures, where the only input is the user's last utterance(s), in so-called sequence-to-sequence neural models. These are often trained on existing dialogue corpora or social media exchanges, where there is no clear "task" or objective [START_REF] Zhao | Learning Discourse-level Diversity for Neural Dialog Models using Conditional Variational Autoencoders[END_REF][START_REF] Chan | Modeling Personalization in Continuous Space for Response Generation via Augmented Wasserstein Autoencoders[END_REF]. The recent survey by [START_REF] Dusek | Evaluating the state-of-the-art of End-to-End Natural Language Generation: The E2E NLG challenge[END_REF] underlines the difficulty of evaluating end-to-end NLG systems; and while seq2seq models give excellent results on some metrics (naturalness), they also can lack in semantic fidelity and diversity in their outputs.

Evaluation is an important issue in dialogue systems in general, and a complicated one, as systems involve different components and different objectives, as shown by [START_REF] Deriu | Survey on evaluation methods for dialogue systems[END_REF]. There is thus a variety of automatic metrics and human evaluation procedures specific to the different subtasks mentioned above.

The variety of approaches and applications can sometimes make generalization difficult from one domain to another, between tasks and contexts of use. This is also reflected in the richness and diversity of available data useful for designing systems, and a good view is given in [START_REF] Serban | A Survey of Available Corpora For Building Data-Driven Dialogue Systems: The Journal Version[END_REF]. The prevalence of data-driven models also means there is less a priori control on the behaviour of the systems, which can lead to undesirable outcomes and raise ethical questions [START_REF] Henderson | Ethical Challenges in Data-Driven Dialogue Systems[END_REF]. The paper by Maraev, Bernardy and Ginzburg focuses on the dialogue management component of dialogue systems: they are concerned by the modelling of dialogue states, consisting here in several elements: a set of questions under discussion, recording unresolved interactions (mostly questions waiting for an answer), the history of speech acts and their content, as interpreted by the system. The manager is also supposed to take care of an agenda of planned moves by the system. They focus on a type of interaction that is common in information-seeking conversations: question and answers, including embedded sequences of questions when clarification questions occur.

The model they present uses formal representations for these elements, and proposes to characterize updates of the dialogue state and its agenda as proof derivations in a linear logic, in which dialogue possible operations are linear logic formulas: processing a question, processing a potential answer, generating a clarification question when no unambiguous answer exists in the system database.

This gives an interesting formal framework to understand these dialogue moves, and gives a blueprint for a rule-based dialogue manager, as they implemented a prototype of the dialogue acts covered in the paper.

While rule-based formal approaches to dialog management were once very popular, they now tend to be in the shadow of probabilistic approaches, among them mostly neural approaches. There is nonetheless a growing awareness that the two kinds of approaches can benefit each other: empirical methods help achieving better coverage and robustness, while injecting knowledge in systems relying on supervised learning helps diminish the demands on huge amounts of data [START_REF] Lison | A hybrid approach to dialogue management based on probabilistic rules[END_REF][START_REF] Williams | Hybrid Code Networks: practical and efficient endto-end dialog control with supervised and reinforcement learning[END_REF].

Situated meaning in multimodal dialogue: human-robot and human-computer interactions

The paper by Pustejovsky & Krishnaswamy focuses on the important topic of "situated" conversation, where interaction between humans or between humans and a system takes into account the specific context of the interaction, including user location, and activities that connect users to each other and to their environment (e.g. a common task or a game), and non-linguistic interactions. A model of this kind of conversation must address different issues, most importantly linguistic references to the context (deixis), reasoning about the environment, tying the perceptions of agents and their actions to the conversation [START_REF] Hunter | A formal semantics for situated conversation[END_REF].

In order to study these sorts of interactions, the paper presents a system which provides a simulated physical environment for agent interactions and a few scripted tasks involving the manipulation of objects. The system demonstrates the kind of knowledge that is needed to explain conversation moves and references to the situation in which the conversation takes place. To this end, it proposes an ontology for physical objects that makes explicit how they might be manipulated and discussed.

An important topic of the paper is how to address paralinguistic conversation, with gestures associated with speech acts: interpreting the other speaker's gestures jointly with the linguistic message. They thus provide a formal representation for the semantics of speech acts and accompanying gestures.

The interest of such a platform and associated models is two-fold: it provides a simulation environment to record situated conversations with a trace of the situation: knowledge of the environment, the geometry of objects and agents, and their gestures superimposed on the conversation content. Such a platform could prove useful in collecting rich conversational data. Furthermore, depending on the ease with which it might be configured, the platform could provide an environment and testable model for situated conversational agents.

Comparaison linguistique et neuro-physiologique de conversations humain-humain et humain-robot

The paper by Hallart, Maes, Spatola, Prévot and Chaminade addresses questions about the behaviour of speakers in a conversation, comparing a context involving an automated dialog agent (or perceived as such, in a Wizard-of-Oz experimental setup) and a more natural context with two humans. By observing various parameters, linguistic and conversation patterns, but also cognitive aspects through fMRI scans, experiments show how human behave differently when facing a perceived robot with limited linguistic capabilities, and how they adapt their linguistic behaviour to the agent. For instance, humans facing robots show a stronger lexical alignment, i.e. their vocabulary converges more towards the other conversant's vocabulary. In general, language complexity decreases when talking to a perceived robot.

Conversational aspects that are observed include speech time, interaction with the other speaker with feedback moves, specific discourse markers. Linguistic aspects are mostly related to language complexity: lexical, syntactic, and also descriptive, related to the use of adjectives and adverbs. The paper proposes or refines quantitative measures of those complexity types. An original aspect of this study is to compare the linguistic observations with fMRI scans to see what regions of the brain are more or less active during a conversation, and if differences can be identified when talking to another human or to a robot. In particular, lexical complexity seems correlated negatively with the activation of certain regions that would indicate cognitive resources (i.e. memory) are less mobilized when talking to a simple robot agent.

While it is only a perspective of the present work, studying linguistic and cognitive patterns of interaction raises potentially interesting lines of research to improve dialog agents and anticipate unforeseen or undesirable human reactions to a system.

  2. https://dstc9.dstc.community/past-challenges.

  Dialogue management with linear logic: the role of metavariables in questions and clarifications

TAL. Volume 61 -n°3/2020

Acknowledgements

We wish to thanks the editors-in-chief for their unfailing support, especially Sophie Rosset, the scientific committee for this special issue for their constructive work and reactivity: Nicholas Asher (IRIT, CNRS), Fred Bechet (Aix Marseille University), Christophe Cerisara (LORIA, CNRS), Nancy Chen (A*STAR, Singapore), Laurence Devillers (Paris Sorbonne University, LIMSI), Yannick Esteve (LIUM, University of Le Mans), Raquel Fernández (ILLC, University of Amsterdam), Kerstin Fischer (Hamburg University), Jonathan Ginzburg (Paris University), Casey Kennington (Boise State University ), Nicolas Hernandez (LS2N, Nantes University), Julie Hunter (Linagora), Frédéric Landragin (CNRS, ENS), Pierre Lison (Norwegian Computing Center), Laurent Prévot (Aix Marseille University), Lina Maria Rojas Barahona (Orange Labs, Lannion), David Schlangen (Bielefeld University), Noël Nguyen Trong (Aix Marseille University), and finally Kate Thompson for proof-reading and suggestions.


Kai Hu
email: hukai@buaa.edu.cn

Teng Zhang

Zhibin Yang

Multi-threaded code generation from Signal program to OpenMP

Keywords: multi-thread, synchronous language, Signal, code generation, OpenMP

The use of multi-core processors will become a trend in safety c1itical systems. For safe execution of multithreaded code, automatic code generation from formal specification is a desirable method. Signal, a synchronous lan guage dedicated for the functional description of safety crit ical systems, provides soundness semantics for determinis tic concurrency. Although sequential code generation of Sig nal has been implemented in Polychrony compiler, deter ministic multi-threaded code generation strategy is still far from mature. Moreover, existing code generation methods use certain multi-thread library, which limits the cross plat form executions. OpenMP is an application program inter face (API) standard for parallel programming, supported by several mainstream compilers from different platforms. This paper presents a methodology translating Signal program to OpenMP-based multi-threaded C code. First, the intermedi ate representation of the core syntax of Signal using syn chronous guarded actions is defined. Then, according to the compositional semantics of Signal equations, the Signal pro gram is synthesized to dependency graph (DG). After par allel tasks are extracted from dependency graph, the Signal pro gram can be finally translated into OpenMP-based C code which can be executed on multiple platforms.

Multi-core processors have been widely used in high performance computing and universal computing. With the increase of functional and non-functional demands, multi core architecture will become indispensable in safety critical systems such as avionics, aerospace and automobile control.

Multi-threaded software is necessary to make full use of computing resources of multi-core processors. At present, two types of strategies have been developed to aid program ming multi-threaded software. One is application pro gram in terfaces (APls) and libra1ies provided by Unix-like OS [l] and Windows [START_REF]Microsoft windows threads[END_REF]; the other includes several parallel program ming technologies such as MPI [START_REF]MPI: A message-passing interface standard version 3.0[END_REF] for the multi-processor distributed system, and OpenMP [START_REF]The OpenMP API specification for parallel programrning[END_REF] and Intel TBB [START_REF]Intel thread building blocks[END_REF] for the shared memory architecture which provides mechanism to describe high level parallel algorithm.

However, these two strategies fail to satisfy the strict quan titative indicators of functional and non-functional properties demanded in safety critical systems. If the executions of the embedded software are non-deterministic, they may cause undesirable consequences such as delay of reactions and race conditions. ln addition, parallel programming is error-prone because programmers have to specify the synchronization and resources sharing among threads. This will bring the multi-threaded coding for safety-critical applications a high risk programming activity [START_REF] Lee | The problem with threads[END_REF].

To solve this problem, using model-based development and automatic code generation technology based on formal methods has become a trend in academics and industries. One of the available formal methods used in safety critical systems is the synchronous language [START_REF] Benveniste | The synchronous approach to reactive and real time systems[END_REF][START_REF] Benveniste | The synchronous languages 12 years later[END_REF], built on a math ematical model combining synchronous hypothesis and de terministic concurrency. In synchronous hypothesis, time is abstracted as partial discrete logical time series and actions executed by the system are abstracted as discrete steps of computing. The input, computation and the output take no time at each instant (the unit of discrete logical time). Due to the abstract time model, the inherent functional proper ties are preserved, which makes synchronous languages suit able for the functional design of systems. The mainstream synchronous languages include Esterel [START_REF] Berry | The esterel synchronous programrning language: design, semantics, implementation[END_REF], Lustre [10], and Signal [START_REF] Guernic | Programrning real time applications with signal[END_REF] among which Signal is a multi-clocked language that no global clock is pre-defined and every signal has its own clock. Compared to the mono-clocked synchronous lan guages, multi-clocked model is more sui table for the descrip tion of distributed systems and multi-core systems.

Endochrony [START_REF] Guernic | Polychrony for system design[END_REF] and weak endochrony [START_REF] Potop-Butucaru | Concurrency in syn chronous systems[END_REF] properties have been proposed to generate deterministic code from Sig nal. In the endochronous Signal program, the clock of each signal can be computed from a "root clock". The Polychrony compiler [START_REF] Besnard | Code generation strategies in the polychrony environment[END_REF][START_REF] Besnard | Compilation of poly chronous data flow equations[END_REF] not only supports the sequential code gen eration, but also provides the fonction of multi-threaded code generation from the endochronous program, based on the clustering method. According to the data dependency rela tions, the Signal program is divided into tasks which will be "forked" as threads at the runtime. These threads will com municate with each other by the "wait-notify" system call while in each thread the sequential code will be executed. However, there are still some implicit concurrencies in the program which may not be discovered and the use of "wait notify" takes time in the synchronization among threads.

Weak endochrony property, as its name implies, is less strict than endochrony. If the relation among signais meets the full-diamond condition [START_REF] Potop-Butucaru | Concurrency in syn chronous systems[END_REF], it is possible to generate de terministic multi-threaded code. [START_REF] Talpin | Compositional design of isochronous systems[END_REF] proposes a methodol ogy checking weak endochrony property based on bounded model-checking. Since the model-checking method is ex pensive for the code generation, the paper proposes another method based on the isochrony [START_REF] Benveniste | Compositionality in dataflow synchronous languages: specification and distributed code generation[END_REF] property which is suit able for the compositional design. This method, however, cannot fully caver all the weakly endochronous programs. [START_REF] Jose | On the deterministic multi threaded software synthesis from polychronous specifications[END_REF] proposes a methodology generating deterministic multi threaded code from weakly endochronous program based on synchronous flow dependence graphs [START_REF] Maffeïs 0 | Combining dependability with architectural adaptability by means of the signal language[END_REF]. Every statement in the program corresponds to a thread and the threads syn-chronize with each other based on "wait-notify" system call. On the basis of the atom theory proposed in [START_REF] Potop-Butucaru | Concurrency in syn chronous systems[END_REF][START_REF] Potop-Butucarn | From concurrent multi-clock programs to detenninistic asynchronous implementations[END_REF] presents a general method to check weak endochrony on multi-clocked synchronous programs. The corresponding strategy of multi threaded code generation is given in [START_REF] Papailiopoulou | From design-time concurrency to effective implementation parallelism: The multi-clock reactive case[END_REF]. However, some re strictions must be met. For instance, data types of the pro gram interface should be finite and delay equations should be replaced by the clock relation equations. Therefore, some weakly endochronous programs may be rejected.

Another strain of methodology is proposed in [START_REF] Baudisch | Multithreaded code from syn chronous programs: extracting independent threads for openmp[END_REF]. It translates synchronous guarded actions, an intermediate rep resentation for mono-clocked synchronous languages, into OpenMP-based multi-threaded program. The synchronous guarded actions are first translated into dependency graph (DG) and then, from the DG, tasks are divided for the parallel execution. Finally, OpenMP-based C code can be generated according to the task partition. Since OpenMP has been im plemented by several compilers from different OS, the gener ated code can be executed on multiple platforms.

As an API standard for parallel programming, OpenMP provides abundant mechanism for the description of high level parallel algorithms. The newest version of OpenMP supports fine-grained scheduling and task balancing which can increase the performance of the program. However, few studies of multi-threaded code generation for Signal have chosen OpenMP as the target language. Drawing on the idea presented in [START_REF] Baudisch | Multithreaded code from syn chronous programs: extracting independent threads for openmp[END_REF], this paper introduces a methodology dis covering the implicit parallelism from the Signal program and translating the endochronous Signal program to OpenMP based C code. However, some vital changes are made to fit the characteristics of Signal. Firstly, while [START_REF] Baudisch | Multithreaded code from syn chronous programs: extracting independent threads for openmp[END_REF] directly trans lates the program written by synchronous guarded actions, p1imitive constructs in Signal are needed to be first translated into representation of synchronous guarded actions. With re gard to this, some new f eatures are added to synchronous guarded actions. For instance, in order to represent implicit clock relations defined in each primitive construct, Boolean variables representing the clocks are introduced. Moreover, in [START_REF] Baudisch | Multithreaded code from syn chronous programs: extracting independent threads for openmp[END_REF], action dependency grpah (ADG) is a bipartite graph in which variables and guarded actions are vertices. This pa per proposes a DAG (directed acyclic graph)-like form of DG in which nodes are guarded actions and edges represent the dependency relations between nodes.

The paper is structured as follows. An informa! introduc tion to the Signal is provided in Section 2. In Section 3, the paper proposes an intermediate representation of the core syntax of Signal using synchronous guarded actions. Based on the compositional semantics and data dependency rela-tions, the formal defi nition of DG is given. In Section 4, methods of finding the implicit parallelism of the Signal pro gram and the task partition from DG are proposed. Finally, in Section 5, the translation from partitioned tasks to OpenMP based C code is defined and an example is analyzed to vali date the methodology proposed in this paper.

Introduction to Signal

Syntax and conesponding semantics

Apart from primitive constructs listed in Table 1, Signal also provides other extended constructs such as the dock operator "/\" and memory operator "cell". Moreover, nested process, module and other mechanisms are defined in Signal to specify the large system with components at various rates. The details of the syntax can be refened in [START_REF] Besnard | Signal v4-Inria version: reference manual[END_REF].

Relations among signals and their docks are defined as equations in Signal. The basic unit of a Signal program, called process, consists of a set of equations. Two basic oper ators, respectively called synchronous composition and local de.finition, are applied to the process. The syntax and cone-As mentioned in Section 1, time is abstracted and the behav-sponding semantics are shown in Table 2. iors of the system are divided into a discrete series of instants. Table 2 Piimitive operations on the process At each instant, the input, computing and output are executed instantaneously and simultaneously. The unbounded series of typed values are called signais. Signals in the program can be present or absent at each instant and the dock of a signal is defined as the series of subscripts at which instant the signal is present.

In Signal, primitive constructs (core syntax) are provided to express the relations between signals, defined in Table 1. Note that the dock of signal sis denoted as '"'s".

Operators in Signal not only depict the data dependency relations but also imply dock relations among signais. Ac cording to the dock relations, operators can be divided into two types, mono-docked operators and multi-docked opera tors. In equations of mono-docked operators, induding Re lation and Delay, operand signals are synchronous, that is, at any instant, all signais will be present or absent at the same time. In contrast, operand signals of multi-clocked operators, such as Sampling and Merge, may have different docks. For instance, in the Sampling equation, shown in Table 1, the left hand side value O will be present only when the right-hand side value sl and s2 are present and s2 evaluates to true. From the introduction given above, we can give the ab stract syntax process, shown as below:

P, Q ::= x := yfzlPIQIP/x
The process (P and Q) consists of the synchronous compo sition (PIQ) of dataflow equations. P/x is the local definition of signals. Dataflow equation "x := yfz" represents that the value of xis decided by the input signal y, z and the operation f on them.

To simplify the translation, this paper sets a few restric tions on the source Signal program: all equations are w1it ten in primitive constructs; every signal can only be defined once in the program [START_REF] Gamatie | Designing embedded systems with the signal programrning language[END_REF]; all equations are in the same pro cess, which means that there is no subprocess in the Signal program. Moreover, in Signal, a program is a process and shares the same syntax [START_REF] Gamatie | Designing embedded systems with the signal programrning language[END_REF]. In the remainder of the paper, the source program is a flattened process written in primitive constructs.

Two IDEs, RT-builder [START_REF]RT-builder[END_REF] and Polychrony [START_REF]Polychrony[END_REF] are based on Signal. The former one is commercial version and Poly chrony is open source for academic use. The code generated by Polychrony compiler takes the form of the infinite loop of elementary iterations. In each iteration, the program will read from the input, compute and write to the output. More details of this code generation principle can be found in [START_REF] Besnard | Code generation strategies in the polychrony environment[END_REF]. In this paper, we will use the iteration as the execution model of the generated code.

An example of Signal 3 Intermediate representation for primitive

A Signal program presented in [START_REF] Gamatie | Designing embedded systems with the signal programrning language[END_REF] called ABRO is used to constructs and the program synthesis method illustrate the code generation in the paper. Figure 1 is a finite state machine specification of the ABRO process.

Due to the declarative feature of Signal, one of the indispens- able steps when generating imperative code is to translate the source program into an intermediate form with the informa tion of clock hierarchy and data dependency relations. Sec tion 3.1 presents a method translating primitive constructs of Signal into the code block of synchronous guarded actions which is used to represent the clock and data dependencies among the operands of equations. To represent the data de pendency relations for the whole program, another interme diate form called DG is defined in Section 3.2. Implicit con currency of the program can be then detected by analyzing the DG, which will be proposed in Section 4. Note that the source program to be translated should be endochronous. Based on the definition given in [START_REF] Jose | On the deterministic multi threaded software synthesis from polychronous specifications[END_REF], the informal description of en dochrony is: a Signal program is endochronous if and only if the clock of all signals can be computed according to the intemal clock relations and no extemal environment runtime information is needed, which equivalently means that there will be a root dock in the program.

Synchronous guarded actions for primitive constructs

Based on the semantics of core syntax given in Section 2, the synchronous guarded actions is defined as below, which is different from [START_REF] Baudisch | Multithreaded code from syn chronous programs: extracting independent threads for openmp[END_REF]:

A synchronous guarded action is a four-tuple (R, L, B, 0). Ris the set of signals which represent the right-hand side val ues of the primitive constructs. L is the set of the left-hand side values. Bis the code block defined as (G, A), taking the form "if G thenA". Gis a Boolean expression and Ais the set of actions to be executed when G holds. 0 is the output set of the signals which can be used in other blocks' right-hand side values.

There are three kinds of signals: input, output and intenne diate signals. Although input signals cannot be the left-hand side value of the equation, the dock relations can be specified to decide at which instants the value can be read. Intermediate signals and output signals can be the left-hand and right-hand side value of the equation.

The synchronous guarded actions representations of the core syntax are defined below. We use syntax of C as the style of pseudo code in the block and the dock of signal "s" is denoted as "C_s". Note that before constructing blocks for each equation in the program, dock analysis needs to be com pleted to divide all signals into dock equivalence classes so that synchronous signais will have the same clock represen tation in each block. a) 0 := f(sl, s2, ... , sn)

Right-hand side signais: sl, s2, ... , sn, Co Left-hand side signal: 0 if(Co==true) 0 = j(sl, s2, ... , sn); Output of the block: 0 In the block above, "f" is an n-ary instant operator. The right-hand side operands of the block are the operands of op erator "f" and the left-hand side operand of the block is O.

The implicit clock relation is '"'

O = A s1 = • • • = A sn" while
C_O is defined as the common dock of these signals. Signals on the right-hand side are needed to compute the value of O. The Boolean expression in the block, "C_O= =true", means that the O can be computed only when O is present at this in stant. The Output of the block depicts that after the execution of the code block, 0 can be used as a right-hand side value and if Ois an output signal, the write action can be executed. b) 0 := s1 default s2 From the semantics of operator Merge, two corresponding code blocks are constructed. Signal s1 is prior to s2. If s1 is present, 0 is assigned to the value of sl. If sl is absent and s2 is present, 0 is assigned to the value of s2. Note that apart from the assignment to 0, the dock of 0, denoted by C_O should be assigned to trne if s1 or s2 is present. c) 0 := s1 when s2 For operator Delay, since Delay is a mono-docked opera tor, s1 and 0 have the same dock, which means that when sl is present at the instant, 0 is also present and can be used as right-hand side value. The dock of 0 and s1, denoted as C_O, is the single right-hand side signal. However, the corre sponding code block has no action since no data dependency is defined in the equation. How to assign value to the memory signal will be introduced in Section 3.2.

As for the input signals in the root dock set, at the begin ning of each iteration, read actions should be executed. The corresponding dock should also be set to true.

Right-hand side signais: Null Left-hand side signais: i { read(i); C _i=true;} Output of the block: i, C_i For the input signal not belonging to the root dock set, the dock can be extracted from the dock calculation, denoted as C_s. If C_s evaluates to true, the read actions can be executed so that the read will be nested in the same block assigning C_s to true.

Left-hand side signais: i, other signais if( ... ){ other assignments C_s=tme; read(i);

Output of the block: i, other signais

Two other primitive constructs indude the local definition (P/x) and synchronous composition (PIQ). They have no cor responding code blocks of synchronous guarded actions. The local definition operator enables one to restrict the scope of a signal to a process [START_REF] Gamatie | Designing embedded systems with the signal programrning language[END_REF]. Intermediate signais are defined in this part and they are invisible from the outside of the process. Synchronous composition is the union of equations defined in the program. Equations communicate with each other by common signal variables. The behavior of the program can be seen as the conjunction of mutual behaviors of all equa tions [START_REF] Gamatie | Designing embedded systems with the signal programrning language[END_REF]. Based on the semantics of synchronous composi-tion, code blocks of synchronous guarded actions generated for Delay equation has no left-hand side value. In this case, from the program will be composed into the DG according tests on whether docks of memory signais evaluate to true are to the data dependencies among code blocks of synchronous included in the guard condition of b 1 and no precedence re guarded actions, used to describe the behavior of the whole lation needs to be specified between nodes respectively conprogram and explore the implicit concurrencies. taining b 1 and b2.

Synthesis method based on DG

After generating the code block of synchronous guarded ac tions for each equation in the program, DG can be con structed. All signals belonging to the same class are syn chronous. The definition of DG is given below: DG is defined as (NS, � ). NS is the set of nodes which represents the code block of synchronous guarded actions. � is the precedence relation between nodes defined over NS as follow: s1 � s2 if and only if some signais exist both in right-hand side of s2 and left-hand side of sl, which indicates that to execute the code in s2, we first need to get the execution result of sl. Note that two code blocks for the operator Merge defined in Section 3.1 will be treated as one node in DG. A DG is correct if every cycle "sO � • • • � sn � sO" is a pseudo cy cle: the conjunction of all guard expression of synchronous guarded action sO, ... , sn involved in the cycle is false. From this, it is also easy to know that DG is not strictly a DAG because there may be pseudo cycle in the graph. Note that if dependencies from docks to their corresponding signais (in put signais) are added, dock constraints are set. In this case, values read from the environment must meet the constraints to guarantee the correct execution.

To generate a complete DG, some situations need to be considered. Sorne blocks are for the read of input signal with no right-hand side signal. These nodes will be composed into a single node called the initial node. Since there is no prece dence among these nodes, they can be arranged at any order when getting composed. Furthermore, the dock of the root clock class, denoted as C_l, has to be set to true in the front of the initial node. At the end of iteration, a terminal node is also needed in which every signal on the left-hand side of the Delay equation(denoted as memory signais) will be set to new value under the condition that it has been present at the last iteration. These blocks are then synthesized into the ter minal node in which all the docks of the clock equivalence classes are also needed to be set to false. Note that the initial assignments to memory signais needs to be executed before the iteration begins. Furthermore, according to the definition given in Section 3. 1, some blocks (denoted as bl) may have the right-hand side signals which are memory signals but the code block of synchronous guarded actions (denoted as b2)

Redundancies in the generated DG can be found as follows:

1) The Boolean sub expressions may be duplicated in the condition expression of the code blocks. For instance, ac cording to the algorithm given in Section 3.1, the corre sponding condition of the equation "c := b when not b" is "C_b==true&& C_b==true &&b==false".

2) If there are blocks with signais in the same clock equiva lence class as the left-hand side value, there will be duplicated assignments to the dock.

To eliminate these redundancies, the duplicated Boolean expressions are to be deleted first. Then traverse from the ini tial node, if there is a clock assignment in a node, the same assignment in its subsequent nodes will be deleted.

Task partition strategy

As defined in Section 3, DG is a kind of DAG on which prece dence relation is defined among nodes. Informally, the prece dence relation indicates the dependency between nodes. If no precedence relation exists between two nodes, they can run in parallel. In this section, we partition a set of nodes of DG into tasks. The precedence relation on tasks is compatible with the precedence relation on nodes.

Task is defined as a set of nodes belonging to NS of DG. TS is a two-tuple (T, �),in which Tisa partition of NS and � is the precedence relation among tasks on T. A task t of T is an anti-chain in the reflexive transitive closure -v0 of � (i.e., nodes in a task cannot be compared:

(Vt E T)(Vnl E t)(Vn2 E NS)(nl � n2) ⇒ ((nl = n2) V (n2 (J. t)).
Among tasks belonging to T, tl � t2 if and only if there exists at least one node in t2 which is preceded by nodes in tl. Note that although cycle checking has been done after the con struction of DG, there may be pseudo cycles of tasks since pseudo cycles are allowed in DG. To deal with this problem, the guard of a task t is defined as the disjunction of the guards of nodes belonging to t. If the conjunction of ail these guards of tasks involved in the cycle is false, the cycle is a pseudo cycle. Because of pseudo cycles, the result of some nodes in t2 may be required by some nodes in t1 (when some condi tion C is true) and conversely (when the condition C is false). In this paper we only consider DAG of nodes: the processing of programs with cycles and pseudo cycles is not described here. One can then use a topological sorting to partition nodes into tasks so that the result of the partition is a total order of tasks: for all tasks t1, t2, ... , tn belonging to T, a series of them, t 1 -» • • • -» tm n -i -» lm11 exists. As a result, no task pair will be allowed to execute in parallel. Here we illustrate the task partition with the example in Section 2.

Part of the code is shown in Fig. The result of the task partition is shown in Fig. 5. Nodes of DG are divided into four tasks. Arrows in the figure illustrate the total order among four tasks: taskl will be executed first and task4 will be the last one to be executed. Nodes in the same task can be executed in parallel. For instance, in task2 there are three nodes preceded by the node in taskl. How ever, there is no precedence relations among these nodes so that they can be executed in parallel.

After the task partition, the generated tasks will be used for the OpenMP code generation which will be presented in Section 5.

OpenMP based C code generation and case study

OpenMP, an API for shared-memory parallel programming in C/C++ and FORTRAN, provides users with several mecha nisms such as compiler directive, programming interface and environment variables for the high level description of paral lel algorithms. This section will introduce the method map ping tasks partitioned in Section 4 to the OpenMP-based C code.

The basic syntax of directives in OpenMP is shown in Fig. 6. There are several directives in OpenMP. For instance, directive "parallel for" is used for the parallelization of "for" loop; directive "parallel sections" is used to specify the code blocks which can be executed in parallel. ln OpenMP 3.0, directive "task" is added to support the parallelization of ir regular data, iteration and recursive call. Since actions of code blocks are simple computations, we choose the directive "parallel sections" for the parallelization, shown in Fig. 7. The code blocks executed in parallel are encircled in direc tive "#pragma omp section" respectively. Moreover, race condition will occur when multiple threads can access shared variables at the same time, which will make the result of the execution non-deterministic. Clauses, such as p1ivate, shared and reduction, are provided to specify the variable scope and sharing property to handle this problem. Clause private (list) is used to declare that each thread has its own duplicate of the variables in the list. Clause shared (list) declares the list of shared variables among threads. Clause re duction (operator:list) specifies an operation on one or a list of variables. Each thread has duplicates of variables in the list and when all threads finish their executions, initial variables will be updated according to the calculation among its dupli cates. However, every signal will be defined only once in the source program so that parallel nodes in the same task share We take the form of the infinite loop of elementary itera tions from [START_REF] Besnard | Code generation strategies in the polychrony environment[END_REF] as the structure of the generated code. Tasks will be generated into the OpenMP structure as the core of the iteration. Here we only give the method translating tasks. Firstly, every node are translated into C code block. Secondly, each translated code block is encircled in the directive "#pragma omp section". Tuen, all blocks belonging to the same task will be encircled by directive "#pragma omp paral lel sections". Finally, the sequential order of these blocks will be determined according to the total order specified among tasks. Note that the initial and tenninal node of DG are re spectivel y put in the front and the rear of the iteration and initial assignments to the memory signais should be put be fore the iteration part. According to the method given above, fragment of the pro gram in Fig. 3 can be translated to the OpenMP structure, shown in Fig. 8. We can see that sequential code is generated according to the order of the tasks. Since task2, task3, and task4 hare multiple code blocks, the corresponding OpenMP directives "#pragma omp parallel sections" are respectively generated. Code blocks which can be executed in parallel are encircled in the directive "#pragma omp section". Note that although assignments to the memory signal Adelay and Bdelay are not shown in Fig. 8, the value of these two signais can be determined when they are on the right-hand side of the assignment statement, as Section 3.2 has indicated.

Conclusion and future works

Tiùs paper presented a methodology transforming en dochronous Signal program (using core syntax) to OpenMP based C code. First, the translation of Signal core primitives to code blocks of synchronous guarded action was described. Tuen, the formai definition of DG was presented, used to ex plore the implicit concurrency. From DG, the definition of task was given. Nodes of DG can be partitioned into tasks. Tasks will be executed in sequence while in each task, nodes can be executed in parallel. Finally, the method translating tasks into OpenMP-based C code was introduced. Using the approach, the generated program can run on multi-core pro cessors, increasing the utilization of computation resources. Moreover, since the generation target OpenMP is a multi platform standard, few modifications are needed for multi platform execution.

However, several improvements can be accomplished from the current study. For instance, the method proposed in this paper does not allow the parallel execution among tasks, which may restrict the possibility of generating more effi cient code. Another problem is that the methodology does not support the transformation of weakly endochronous Sig nal program, which limits the practicality of the study. In the future work, we will study how to check weak endochrony and generate deterministic code from weakly endochronous programs. Moreover, Signal provides arrays of processes to handle data arrays which is suitable for parallel execution. To generate better OpenMP code for these features is also one of our objectives.

Fig. 1 Fig. 2

 12 Fig. 1 A finite state machine specification of the ABRO process ABRO emits signal O when input signals A and B have been received. When input signal Ris received, ABRO cornes back to the initial state and begins to wait the inputs. Once 0 has been emitted, it will not be emitted again until R has ar rived to reset the state. The original version of the Signal pro gram of ABRO can be found in [24]. Here we give a modified version, shown in Fig. 2. 1 : process ABRO= 2: ( ? boolean A, B, R; ! event O ; ) 3: ( 1A _received " = B _received "=after _fi_ until_ 0 4: A received " = A "= B " = R 5: RT : = not R when R 6: A received : = RTdefaultAR 7: AT: = A whenA 8: AR : = ATdefault Adelay 9: Adelay: = A_received $ init false 10: IBT: = BwhenB 11: 1 B _received : = RT default BR 12: I BR : = BT default Bdelay 13: 1 Bdelay : = B _received $ init false 14: from R before O : = not O default RR 15: RR : ,;-Re defauît after R until 0 16: Re : = Rwhen R ---17: after R until O : = from R before O $ init true 18: 0 : = true when ABR ---19: ABR : = A received whenArr 20: Arr: = B _received when after_R_until_OI) 21: where 22: boolean A received, B received, from R before 0 23: ,Adelay, Bdelay, AR, BR, RR, ABR, Arr, after_R_until_O 24: ,AT, BT, RT, Re; end; Fig. 2 Signal program of ABRO process In the process ABRO, A, B, Rare Boolean typed input sig nals and O is event typed output signal, as shown in Line 2. Line 3 to Line 20 are dataflow equations specifying the dock and value relations among signals. Lines 3 and 4 synchro nize the input signals A, B, R with the intermediate signals A_received, B_received and after_R_until_O. By analyzing the dock relations among signals, it can be deduced that the dock of input signals is the only root dock of this program, so the pro gram is endochronous.

3 .Fig. 3 FragmentFig. 4

 334 Fig. 3 Fragment of ABRO process

Fig. 5 4 #Fig. 6

 546 Fig. 5 Task partitions of DG in Fig. 4

#Fig. 7

 7 Fig. 7 Syntax of directive parallel sections

Fig. 8

 8 Fig.8OpenMP-based C code corresponding to the Signal program frag ment in Fig.3

Kai

  Hu is an associate professor at Bei hang University, China. He received his PhD degree from Beihang University in 2001. From 2001 to 2004, he did the post-doctoral research at Nanyang Technological University, Singapore. Since 2004, he is the leader of the team of LDMC in the lnstitute of Computer Architecture(ICA), Beihang university. His research interests concem embedded real time systems and high performance computing. He has good cooperation with IRIT and INRIA Institute of France on study of AADL and synchronous lan guages. Teng Zhang received his BE in com puter science and engineering from Beihang University in 2011. He is now the master's degree student at the same university. His research interests in clude synchronous languages, model ing of embedded system and fo1mal methods. Zhibin Yang received his PhD degree from Beihang University, China, in February 2012. Since April 2012, he has been a Postdoc in IRIT research laboratory of University of Toulouse, France. His research interests include safety-critical real-time system, formal verifi cation, AADL, and synchronous languages.

Table 1

 1 P1imitive constrncts of Signal When sl, s2, ... , sn are present, 0 is .

	Name	Syntax	Informa! semantics
	Relation O := /(sl, s2, of 0
			is C
	Sampling O := sl when s2 0 will be present and evaluated to sl only
			when s l and s2 are present and s2 evaluates
			to true
	Merge

.. , sn) present and the value is /(sl, s2, ... , sn); otherwise signal Ois absent Delay O := sl $ init r. The docks of O and sl are equal; when sl is present, the value of O is the previous present value of sl; the initial value O := sl default When sl is present, 0 is present and evalu-s2 ated to sl; other\vise when s2 is present, 0 is present and evaluated to s2; if neither sl nor s2 is present, signal O is absent Name Syntax Synchronous Pl Q composition Local defini-P where t_l sl tion ... t_n sn; end lnfo1mal semantics P and Q are processes. The behavior of PI Q is the conjunction of the mutual be haviors of P and Q [24] Pis a process and sl ... sn are signais. The scope of s 1, ... , sn is restricted to P which means they are not visible outside P[24]

Acknowledgements

This work was supported by the National Natural Sci ence Foundation of China (Grant Nos. 61073013 and 61003017) and the Aviation Science Foundation of China (2 012ZC51025). Grateful acknowl edgement is made to Mr. Mamoun FILALI-AMINE, Prof. Jean-Pau! BODE-VEIX from IRIT-CNRS and Prof. Paul Le Guernic from INRIA. They have given a lot of instructive advice to this paper.


Nadia Rosero

John J Martinez

Maxime Chorin

Samuel Vergès

Estimation of carbon-dioxide production during cycling by using a set-membership observer

This paper presents a set-membership observer for the estimation of carbon dioxide production during cycling. The observer uses measurements of oxygen consumption and power at pedal level together with a discrete-time linear model of gas exchange dynamics. The real process is assumed to be disturbed by unknown but bounded disturbances. The proposed observer provides a deterministic interval which contains the real state. Since the excess of carbon dioxide production is linked to the overtake of the anaerobic threshold, the observer can be applied to predict the physiological state of the cyclist by using a reduced number of gas exchange sensors. The methodology is illustrated and validated using experimental data.

I. INTRODUCTION

Riding a bike is a worldwide usual activity not only as a sport, but also as a mean of transportation. During cycling, the human and the bicycle can be considered as a whole system composed by two main subsystems, which is susceptible to be improved in many ways. The first step for enhancing this system is to be able to measure and to understand the dynamical relationship between the variables of each part, in this case the link between physiological and mechanical variables.

Nowadays, connected objects and commercial sensors make it possible to monitor the cyclist-bike system. However, what happens within the body of the cyclist, in particular the dynamics of fatigue is difficult to assess, because of the need of either invasive or complex measurement systems (using blood sampling, or spirometric masks). Therefore, the fatigue dynamics is a subject of study of many physiologists, trainers and recently engineers, who analyze the relationship between measured variables and physiological markers of fatigue to develop medical and commercial products.

Since the works of [START_REF] Wasserman | Anaerobic threshold and respiratory gas exchange during exercise[END_REF] and [START_REF] Beaver | A new method for detecting anaerobic threshold by gas exchange[END_REF] the gas exchange measures have been widely accepted for the determination of metabolic pathways (aerobic or anaerobic) used during physical activity. Also the identification of the anaerobic threshold, which is the point from which the production of mechanical power becomes less efficient, can be identified from gas exchange. Having a dynamical model of gas exchange during cycling constitutes an advantage in the study of physiological 1 Nadia Rosero is with Departamento de Electrónica, Universidad de Nariño, Pasto, Colombia. nprosero@udenar.edu.co 2 Nadia Rosero, John J. Martinez and Maxime Chorin are with Univ. Grenoble Alpes, CNRS, Grenoble INP, GIPSA-lab, 38000 Grenoble, France. john-jairo.martinez-molina@grenoble-inp.fr, maxime.chorin@grenoble-inp.fr 3 Maxime Chorin and Samuel Verges are with Univ. Grenoble Alpes, Inserm, CHU Grenoble Alpes, HP2, 38000 Grenoble, France.

SVerges@chu-grenoble.fr behavior and to develop futures tools for improving the cyclist-bike system, for example for its use in control design.

Control techniques to regulate physiological variables while cycling have been recently implemented, among them the most popular is the control of Heart Rate (HR), thanks to its ease of measurements. For example [START_REF] Leitner | Model based control of human heart rate on a bicycle ergometer[END_REF], [START_REF] Meyer | Sliding mode control for heart rate regulation of electric bicycle riders[END_REF], [START_REF] Corno | Human-in-theloop bicycle control via active heart rate regulation[END_REF] present techniques for controlling HR and the results show the difficulties to achieve an accurate control solution. On the other hand, the gas exchange variables are more strongly related to physical activity, although they are slightly harder to measure. In this regard, the work [START_REF] Rosero | Modeling of gas exchange dynamics using cycle-ergometer tests[END_REF] presents a gas exchange model during cycling identified and validated using experimental data.

The implementation of control laws often requires the availability of the system states to make decisions, and a proper estimation of those reduces the need for sensors. In this aspect, observers are a useful tool, but the associated uncertainties of the estimation is often not quantified. In [START_REF] Loukkas | Set-membership observer design based on ellipsoidal invariant sets[END_REF], [START_REF] Martinez | H-infinity set-membership observer design for discrete-time lpv systems[END_REF] it is presented a set-membership observer (SMO) which provides both state estimations and their corresponding estimation error bounds. To study gas exchange, this kind of observer is interesting because of the biological nature of the considered system, whose parameters cannot be known with absolute precision and potentially vary over time. In addition, automated gas exchange analyzers are known to provide an estimation of gas exchange with limited accuracy [START_REF] Macfarlane | Automated Metabolic Gas Analysis Systems: A Review[END_REF], [START_REF] Atkinson | Performance Characteristics of Gas Analysis Systems: What We Know and What We Need to Know[END_REF], [START_REF] Ramos-Álvarez | Disadvantages of Automated Respiratory Gas Exchange Analyzers[END_REF], [START_REF] Folke | Critical review of non-invasive respiratory monitoring in medical care[END_REF]. The SMO proposed in [START_REF] Loukkas | Set-membership observer design based on ellipsoidal invariant sets[END_REF], [START_REF] Martinez | H-infinity set-membership observer design for discrete-time lpv systems[END_REF] takes these phenomena into account under the form of bounded state and output disturbances, whose bounds are used in the design process to produce deterministic estimation error bounds. Estimation error bounds are useful in critical setups, such as supervised training, where the physiological limitations are strictly respected in order to guarantee the safety and the quality of training of the individual.

The main objective of this paper is to implement the SMO for the estimation of carbon dioxide (CO 2 ) production during cycling by using measures of oxygen (O 2 ) consumption and power at pedal level.

Firstly, the architecture of the observer is described in Section II. Secondly, the model of gas exchange dynamics while cycling is explained in Section III. Section IV explains the design of the SMO and its implementation in the cyclist-bike system. Finally, simulation results together with measured data from tests in cyclo-ergometer are presented to illustrate the contribution of the approach.

II. ARCHITECTURE FOR THE ESTIMATION OF CARBON DIOXIDE PRODUCTION

An architecture for the estimation of carbon dioxide production during cycling is proposed in this paper. This approach can be applied to quantify the current physiological state of the cyclist which is directly linked to the excess in carbon dioxide production.

The scheme for the implementation of the observer is depicted in Fig. 1. The complete cyclist-bike dynamics acts like a system of energy transformation where the power at pedal level can be seen as an image of internal chemical reactions involving oxygen consumption and carbon dioxide production.

The real system represented by the the block "Gas exchange dynamics", has a power input and two outputs, which can be all measured in practice, but here we assume available measurements of the input and the oxygen consumption. A validated model of gas exchange dynamics (see [START_REF] Rosero | Modeling of gas exchange dynamics using cycle-ergometer tests[END_REF]), is used for the implementation of the observer.

The state estimation is performed by using a SMO, which takes as inputs the power and oxygen consumption measurements and gives an estimation of the gas exchange variables. A non-linear output matrix, which depends on the estimated states is used to provide the estimation of the carbon dioxide production.

The components of the proposed architecture are discussed in more detail in the next sections.

III. MODEL OF GAS EXCHANGE DURING CYCLING

The gas exchange measurements during a physical activity are widely used by physiologists and trainers to assess the physiological state of an individual. Sensors used for oxygen consumption and carbon dioxide production measurements do not require invasive methods such as blood or muscle measurements and provide relevant information about chemical reactions in the body.

To perform an exercise, the synthesis of Adenosine Triphosphate (ATP), which is the energy source at cellular level, is required. It can be distinguished several pathways to obtain ATP, here, we will focus in the main two, they are: i) the aerobic pathway, when the chemical reactions include oxygen and ii) the lactic anaerobic pathway, which is mostly used in exhaustive exercise and is characterized by the over production of carbon dioxide and the increase in blood lactate. In the articles [START_REF] Wasserman | Anaerobic threshold and respiratory gas exchange during exercise[END_REF] and [START_REF] Beaver | A new method for detecting anaerobic threshold by gas exchange[END_REF] the concept of anaerobic threshold is introduced. Basically, when the anaerobic threshold is overcome, the anaerobic lactic pathway is activated, which produces ATP through anaerobic glycolysis, to supply the energy requirements of exercise with insufficient oxygen.

In the case of cycling, the power at pedal level gives us a measurement of the mechanical work performed by the cyclist. It is equal to the product of pedaling frequency and torque exerted on the pedal. On the other hand, oxygen consumption and carbon dioxide production provide information about chemical reactions within the body ensuring power production.

In the previous work [START_REF] Rosero | Modeling of gas exchange dynamics using cycle-ergometer tests[END_REF] a gas exchange dynamical model was presented. A version of this model with added state and output disturbances can be written as follows:

x k+1 =Ax k + Bu k + Bw 0 + Fd k (1) y k =Cx k + Gv k (2)
where x k ∈ R 3 is the state vector given by x k = [x 1 , x 2 , x 3 ] T with x 1 the consumed oxygen mass per unit time (in g/min), x 2 the mass of carbon dioxide produced aerobically per unit time (in g/min) and x 3 the mass of carbon dioxide produced anaerobically per unit time (in g/min) or excess of CO 2 . The input u k ∈ R stands for the mechanical power at pedal level (in Watts). The symbol w 0 models an additional power consumption required by other physiological tasks that require oxygen consumption and carbon dioxide production. Remark that, at rest u k = 0 and the input w 0 is the only responsible of O 2 consumption and CO 2 production. In this sense the input w 0 corresponds to a constant value, equivalent to the power (in Watts) that produces the basal values of O 2 and CO 2 during rest.

The output vector is defined as y k = [y 1 , y 2 ] T with y 1 the oxygen consumption O 2 and y 2 for the total carbon dioxide production, which is the sum of aerobically produced CO 2 and a fraction of the excess of CO 2 .

The signals d k and v k are unknown but bounded disturbances. The products Fd k and Gv k , with F ∈ R 3 and G ∈ R 2 , model respectively the state and output disturbances.

The system matrices are defined as follows:

A =   θ 1 θ 2 0 0 θ 3 0 0 θ 5 θ 6   B =   θ 4 θ 4 θ 7   (3)
The output matrix is defined as follows:

C(ρ k ) = 1 0 0 0 1 ρ k (4)
Remark that C depends on a time-varying parameter ρ k . This varying parameter changes according to the intensity of the exercise.

For the system identification process, two kinds of exercises were performed: i) a sub-maximal exercise or aerobic, where the value of ρ k is assumed as zero and therefore no overproduction of carbon dioxide is considered; ii) a supramaximal exercise or anaerobic, performed over the anaerobic threshold. In the second case, the value of ρ k is set to 1 and hence the third state x 3 , i.e. the excess of carbon dioxide is added to the output. The function hyperbolic tangent, allows us a smooth transition for intermediate values of ρ k between 0 and 1, which constitutes a third case. To sum up, the values of ρ k can be written:

ρ(z k ) =
   0 for case 1 : mostly aerobic 1 for case 2 : mostly anaerobic 0.5 + 0.5 tanh zt-z k h for case 3 : mixed

The index z k can be written in terms of the the volume per unit of time of oxygen V O 2 and the volume per unit of time of carbon dioxide V CO 2 , as follows :

z k = δ O2 VO 2(k) -δ CO2 VCO 2(k) (6)
where the constants δ O2 and δ CO2 correspond to the volumetric mass density in g/l (or equivalently kg/m 3 ) of O 2 and CO 2 , respectively. The values of z t and h are parameters calibrated during the identification process proposed in [START_REF] Rosero | Modeling of gas exchange dynamics using cycle-ergometer tests[END_REF].

The outputs of the gas exchange model and measured data of oxygen consumption and carbon dioxide production during an Incremental Cycling Test (ICT) are depicted in Fig. 2. The abrupt change in slope at t = 500s in the plot of CO 2 mass corresponds to a transition between mostly aerobic (case 1) and mostly anaerobic (case 2) in equation ( 5), i.e. a change in ρ from 0 to 1.

IV. DESIGN OF A SET-MEMBERSHIP OBSERVER

In order to estimate the quantity of carbon-dioxide production during cycling, the discrete-time system (1) is considered. However, it is assumed the availability of the oxygen consumption measurement only, i.e.:.

C(ρ k ) = 1 0 0 (7)
In this work, the design of the SMO is performed as proposed in [START_REF] Loukkas | Set-membership observer design based on ellipsoidal invariant sets[END_REF]:

xk+1 =(A -LC)x k + Bu k + Bw 0 + Ly k (8) µ k+1 =(1 -λ)µ k + λ (9)
x k =x k + e ∞ µ 1/2 k ( 10
)
x k =x k -e ∞ µ 1/2 k (11)
where ( 8) is a punctual observer with a matrix L computed by using a suitable observer design method based on Linear Matrix Inequalities (LMI). These LMI can be solved by using for instance the CVX solver [START_REF] Grant | CVX: Matlab software for disciplined convex programming, version 2.1[END_REF], [START_REF] Grant | Graph implementations for nonsmooth convex programs[END_REF] Here, the observer gain L is computed using an H ∞ observer design approach in order to minimize the norm-2 of the estimation error with respect to the norm-2 of the disturbance. Equations ( 9)-( 11) concern the bounds of the state estimation error. These bounds depend on the a priori known bounds of the system disturbances. In particular, as it is proposed in [START_REF] Martinez | H-infinity set-membership observer design for discrete-time lpv systems[END_REF], the term e ∞ , in (10)- [START_REF] Ramos-Álvarez | Disadvantages of Automated Respiratory Gas Exchange Analyzers[END_REF], stands for a constant column vector defined as follows:

e ∞ = diag   P 1 λ γ 2 w T w -1/2   ( 12
)
where P is a positive definite matrix, γ and λ ≤ 1 are positive scalars. Here, the system disturbances w k ∈ R m are defined as follows:

w k := d k v k T (13)
The symbol w stands for a vector with positive elements bounding the system disturbances. That is, at every timeinstant k, the disturbance satisfies :

w T k w k ≤ wT w (14)
For a given observer gain matrix L, the matrix P and the positive scalars γ and λ are obtained by considering the estimation error dynamics:

e k+1 = A o e k + Ew k (15)
with A o := (A -LC) and E := [F -LG]. Then, a suitable gain L stabilizing the dynamics ( 15) is computed using the Bounded Real Lemma [START_REF] Loukkas | Set-membership observer design based on ellipsoidal invariant sets[END_REF]:

Proposition 4.1: (Bounded-real lemma) System ( 15) is stable if there exist a symmetric positive definite matrix P 0 and a positive scalar γ > 0 such that,

A T o PA o -P + Q A T o PE E T PA o E T PE -γ 2 I m 0 (16)
where Q ∈ R n×n is a given (arbitrary) symmetric positive definite matrix and I m ∈ R m×m is an identity matrix. In addition, system [START_REF] Kofman | Probabilistic set invariance and ultimate boundedness[END_REF], with output ζ k := Q 1/2 e k and input w k , has a Quadratic H ∞ performance equal to γ.

Here, the matrix Q in ( 16) is computed as Q = V -1 , where the matrix V denotes the steady-state estimation error covariance matrix, that can be obtained by solving the following Lyapunov equation, see for instance [START_REF] Kofman | Probabilistic set invariance and ultimate boundedness[END_REF]:

A o VA T o -V = -EWE T ( 17
)
where W ∈ R m×m concerns the covariance matrix of disturbances w k .

Once the matrix P is obtained for a given matrix Q, the scalar λ (used in ( 9) and ( 12)) is obtained as the minimum generalized eigenvalue of the pair (Q, P).

Finally, in order to initialize the SMO ( 8)-( 11), we suppose that the initial estimation error e 0 is known and belongs, for instance, to a known ball, that is, e T 0 e 0 ≤ δ 2 , for a given constant positive scalar δ. Then, as stated in [START_REF] Loukkas | Set-membership observer design based on ellipsoidal invariant sets[END_REF], the initial value of the scalar µ in ( 9) has to verify:

µ 0 ≥ λ max (P)δ 2 /c ( 18
)
with c = 1 λ γ 2 w T w. The complete observer design process is summarizing in Algorithm 1.

Algorithm 1 Set-membership observer design. Require: Matrices A, B, C, F and G describing system (1), the observer gain L obtained by performing and H ∞ observer synthesis and the covariance matrix of disturbances W.

1: Compute A o = A -LC. 2: Compute E = [F -LG] 3: Compute the covariance matrix V using (17). 4: Do Q = V -1 .
5: Find a matrix P and the minimum γ who satisfy the LMI (16). 6: Compute λ as the minimum generalized eigenvalue of the pair (Q,P). 7: return The observer parameters L, P, γ and λ.

V. EXPERIMENTAL VALIDATION

A. System identification

Experimental data was obtained using a Hammer Trainer for measurements of power and cadence, a Metalyzer 3B Cortex for measurements of the oxygen consumption and carbon dioxide production and a bluetooth sensor Polar H10 for measurements of the heart rate. Gas exchange data was collected breath-by-breath and then resampled by interpolation with a constant sampling period of 1 second. The Fig. 3 shows the subject of study performing one the cycling tests.

The methodology described in [START_REF] Rosero | Modeling of gas exchange dynamics using cycle-ergometer tests[END_REF] is followed to compute the matrices of the system :

A =   0.
and the parameters w 0 = 18.288, z t = -0.507 and h = 0.0452. The parameters of the system are chosen to fit the behaviour of a single individual, however the model structure does not change for different individuals.

B. Estimation of the disturbances bounds

Section IV describes that the system is affected by unknown and bounded state and output disturbances. This section describes a method for estimating the bounds of the disturbances.

The output error or measurement error in (2), denoted now as Gv k , can be estimated thanks to the availability of measured data. This error is used for the identification and further validation of the model.

The output error ỹ, called also the residual, is defined as the difference between the model output y I k and the measured data. Since the measurements correspond to O 2 and CO 2 flows and the model outputs are in mass units, it is necessary to calculate the equivalent masses using the density of the gases. With the equivalent of the measurements in mass, y D k , the residual equation is : The model identification was performed using measurements of the mass of oxygen consumption (y 1 ) and of the mass of total carbon dioxide production (y 2 ), i.e. the vector

ỹk = y I k -y D k (20)
y = [y 1 , y 2 ] T .
The values of the obtained residuals can be depicted in an output error space (ỹ 1 , ỹ2 ) as it is shown in Fig. 4.

From this figure, a polyhedron which contains all the output error points can be calculated. After that, a ball which contains the furthest vertex of the polyhedron can be also calculated, and then, the radius of that ball is considered to be a bound of the output disturbances. Here we have a radius equal to 1.478.

As it can be seen in Fig. 4, the ball is a conservative estimation of the error, but ensures the inclusion of all possible measurement errors. Thus for the output given by (2) which is considered as the only output for the SMO, we set G 1 = 1.478 and |v k |≤ 1.

Concerning process disturbances and/or model errors, we assume the existence of additive disturbances with maximum amplitudes corresponding to 30% of the constant input Bw 0 . That is, the bounds of those disturbances will be equal to 1.993 × 10 -3 affecting every system state. In particular, it is chosen process disturbances modeled by a column vector F = 1.993×10 -3 [1, 1, 1] T and an input |d k |≤ 1. In this way all the disturbances (process and measurement disturbances) have been normalized by suitable scaling their input matrices.

C. Computation of observer gain matrix

A SMO is designed by using Algorithm 1. The obtained observer gain is L = 0.157 0.064 0.012 T × 10 -3 .

The disturbance covariance matrix is chosen to be W = diag([0.33, 0.33]), which suppose that the normalized disturbances v k and d k are bounded disturbances with uniform probability distribution. Thus, the obtained matrix Q is :

Q =   6
After solving the LMI given by ( 16) using (21), the matrix P and the minimum value of γ are : Finally, the scalar λ was 2.612 × 10 -3 , computed as the minimum generalized eigenvalue of the pair (Q, P).

P =   2.
Using all the previous observer parameters and equation ( 12), the following element-wise steady-state estimationerror bounds was computed e ∞ = 0.222 0.262 0.063 T .

The observer validation is performed with an initial value of µ 0 (used in (9)) equal to 2, which means that the initial value of the estimation error vector is twice the amplitude of the estimation error vector at steady-state value. This assumption ensures the inclusion of initial conditions and therefore verifies (18).

D. Simulation results of state estimation

The results of the estimation of carbon dioxide production are shown in Fig. 5. In addition, the measured data is included for comparison. This scenario contains two different intensities of exercise: a high intensity exercise followed by a moderate intensity exercise. The dotted lines correspond to the state bounds obtained from the set-membership state observer. Remark that carbon dioxide production (CO 2 mass) concerns the sum of two system states, then its error bounds will result from the operation of the bounds of both states. Some trajectories in Fig. 6 are measurements outside of the predetermined bounds, for instance between t = 400s and 500s, when movements of the cyclist and gas exchange variables are not related with pedal power. A similar situation occurs during high levels of exercise (between t=700s and 800s), where hyperventilation occurs. These phenomena are related to state trajectories that are not depending on the pedal power, and it is thus normal that the proposed observer bounds do not include those trajectories. In addition, by assumption we consider bounded disturbances who values of the bounds are obtained from the identification process. Even if this assumption is not realistic for unbounded stochastic disturbances, the proposed approach could be useful for determining a level of the estimation uncertainty for a given possible amplitude of disturbances.

VI. CONCLUSIONS AND PERSPECTIVES

In this paper, we presented a design method to compute the gain of a robust set-membership state observer as well as deterministic bounds for the estimation error for a disturbed linear system.

The methodology is applied to a model of gas exchange dynamics in order to estimate gas exchange during cycling, based on a measure of power at the pedal and oxygen consumption. To do so, the disturbances affecting the gas exchange system are quantified by analyzing the distribution of the output error of the model in the residual space. The performances of the aforementioned state observer are assessed in simulation using experimental data. The gas exchange variables are successfully estimated along the cycling test and the bounds for the estimation error properly framed the experimental signals.

The obtained results motivate its use for gas exchange estimation for which the number of sensors has to be reduced, especially for embedded applications.

Fig. 1 .

 1 Fig. 1. Gas exchange dynamics and a set-membership observer architecture for CO 2 production estimation.

Fig. 3 .

 3 Fig. 3. Experimental setup for cycling tests: system identification and state observer validation.

Fig. 4 .

 4 Fig.[START_REF] Meyer | Sliding mode control for heart rate regulation of electric bicycle riders[END_REF]. Ball containing all the output errors from the identified system.

Fig. 5 .

 5 Fig. 5. Results of the set-membership observer Grey signals are measured, blue signals are the estimated signals and red dotted signals are the estimation error bounds.

Fig. 6 .

 6 Fig. 6. Zoom of the outputs of Fig.5 between t=300 s and 1000 s. Data outside the bounds are noise with respect the dynamical model.