PEC1 - Chapter 1 Synchronous Models 1.1 Reactive Components...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Chapter 1 Synchronous Models 1.1 Reactive Components A reactive component interacts with other components via inputs and outputs, executing in a sequence of rounds. The component maintains an internal state. In each round, it reads its inputs, and based on its current state and the inputs, it computes to produce outputs and to update the internal state. As a first example, consider the Delay component shown in Figure 1.1. The component has a Boolean input variable in , a Boolean output variable out , and an internal state, modeled by a Boolean variable x . To explain the behavior of the component, we first need to specify the initial value for the state variables. For Delay , assume that the initial value of x is 0. In each round of execution, the component sets the output out to the value of the state x at the beginning of the round, and then updates the state to the current input in . Thus, in the first round, the output will be 0, and in each subsequent round, the output will be equal to the input in the previous round. To explain the various aspects of the definition of this component precisely, we need a bit of mathematical notation concerning variables, expressions over variables, and assignment of values to variables. 1.1.1 Variables, Valuations, and Expressions We use typed variables to describe components. The commonly used types are: nat denoting the set of natural numbers; int denoting the set of integers; real denoting the set of real numbers; bool denoting the Boolean valued type { , 1 } ; enumerated types such as { on , off } that contain a finite number of sym- bolic constants; 1 2 Principles of Embedded Computation c Rajeev Alur bool in out = x x = in bool x : x = 0 bool out Figure 1.1: Reactive component Delay event denoting the enumerated type {> , } , where > denotes that the event is present and denotes that the event is absent. More generally, we allow the event type to be parameterized by another type, and the event can be absent, or can be present with a value of the parameter type. For example, the type event ( bool ) has 3 values 0, 1, and . Given a set V of typed variables, a valuation over V is a type-consistent assign- ment to all the variables in V . That is, a valuation over V is a function q with domain V such that for each variable v V , q ( v ) is an element of the type of v . We will use Q V to denote the set of all valuations over V . Typed expressions are formed from variables using operators. An expression e over a set V of variables consists of variables in V , constants, and primitive operations in types corresponding to these variables. Given a valuation q over V and an expression e over V , q ( e ) denotes the value obtained by evaluating the expression according to the assignment of values to variables specified by q ....
View Full Document

This note was uploaded on 03/22/2010 for the course CIS 540 taught by Professor Alur during the Fall '09 term at UPenn.

Page1 / 34

PEC1 - Chapter 1 Synchronous Models 1.1 Reactive Components...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online