Top Banner
MODELING TIMING CONSTRAINTS IN REALTIME SYSTEMS DIFFERENT TYPES OF TIMING CONSTRAINTS StimulusStimulus (SS): the deadline is defined between two stimuli ‐‐ this is a behavioural constraint, since the constraint is imposed on the second event which is a stimulus; a. StimulusResponse (SR): the deadline is defined on the response event, measured from the occurrence of the corresponding stimulus event ‐‐ this is a performance constraint, since the constraint is imposed on the response event; b. ResponseStimulus (RS): the deadline is on the production of the response counted from the corresponding stimulus ‐‐ this is a behavioural constraint; c. ResponseResponse (RR): is defined on two response events ‐‐ once the first response occurs, the second event must occur before a certain deadline ‐‐ this is a performance constraint. d. Deadline constraints. There are 4 types of deadline constraints that may be identified in a realtime system depending on whether the two events involved in the deadline constraint are stimulus type or response type: 1. ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 November2309 6:17 PM CHAPTER 6 By Radu Muresan University of Guelph Page 1
37

ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

Sep 28, 2020

Download

Documents

dariahiddleston
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

MODELING TIMING CONSTRAINTS IN REAL‐TIME SYSTEMS

DIFFERENT TYPES OF TIMING CONSTRAINTS

Stimulus‐Stimulus (SS): the deadline is defined between two stimuli ‐‐ this is a behavioural constraint, since the constraint is imposed on the second event which is a stimulus;

a.

Stimulus‐Response (SR): the deadline is defined on the response event, measured from the occurrence of the corresponding stimulus event ‐‐ this is a performance constraint, since the constraint is imposed on the response event;

b.

Response‐Stimulus (RS): the deadline is on the production of the response counted from the corresponding stimulus ‐‐ this is a behavioural constraint;

c.

Response‐Response (RR): is defined on two response events ‐‐ once the first response occurs, the second event must occur before a certain deadline ‐‐ this is a performance constraint.

d.

Deadline constraints. There are 4 types of deadline constraints that may be identified in a real‐time system depending on whether the two events involved in the deadline constraint are stimulus type or response type:

1.

ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 ‐ 3November‐23‐096:17 PM

CHAPTER 6 By Radu Muresan University of Guelph Page 1

Page 2: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

Delay Constraint: in general, defines a minimum delay between two events (SS, SR, RS, RR).

2.

Duration: a duration constraint on an event specifies the time interval over which the event acts.

3.

CLASSIFICATION OF TIMING CONSTRAINTS

CHAPTER 6 By Radu Muresan University of Guelph Page 2

Page 3: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

MODELING TIMING CONSTRAINTS USING EFSM

Modeling timing constraints is very important since once a model of the time constraints in a system is constructed, it can serve as a formal specification of the system ‐‐ besides serving as a specification, modelling time constraints can help to verify and understand a real‐time system.Finite State Machines (FSM) is modeling tool that is used to model transitional systems ‐‐ in an FSM, a state is defined in terms of the values assumed by some attributes. Example: the states of an elevator may be denoted in terms of its direction of motion ‐‐ here the direction is an attribute, based on which states up, down, and stationary are defined.

In an FSM model, at any point of time a system can be in any one of a (possibly infinite) number of states

A state is represented by a circle•The system changes state due to events that change the values of, or relation among the state variables

A state change is also called a state transition•A transition causing event may either be an interface event that are transmitted between the environment and the computer system or it could also be an internal event that is generated and consumed solely within the system

The event causing a transition is annotated on the arc that is directed between the states that transition

CHAPTER 6 By Radu Muresan University of Guelph Page 3

Page 4: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

EXTENDED FINITE STATE MACHINE (EFSM) is used to model time constraints ‐‐ EFSM extends the traditional FSM by incorporating the action of setting a timer and the expiry event of a timer.The notations used for construction of EFSMs are simple ‐‐ shown through examples.

In figure below, a) event e1 occurs when the current state of the system is s1, b) then an action will be taken by setting a timer to expire in the next 20 ms and c) the system transits to state s2. 

CHAPTER 6 By Radu Muresan University of Guelph Page 4

Page 5: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

EXAMPLES of modeling an SS type of deadline constraint for a telephone handset using the public switched telephone network (PSTN). Stimulus‐Stimulus (SS) Constraint on the telephone system ‐‐once the first digit has been dialled on the telephone handset, the next digit must be dialled within the next 5 ms.

Response‐Response (RR) model of deadline constraint ‐‐ once the ring tone is given to the callee, the corresponding ring back tone must be given to the caller within 2 s, otherwise the call is terminated.

CHAPTER 6 By Radu Muresan University of Guelph Page 5

Page 6: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

Those involving concurrency, synchronization and non‐determinism;

Those based on different architectures such as multi‐processor systems and distributed systems; and

Those characterized by deterministic, stochastic and other underlying mathematical models

Petri nets provide for a mathematical approach to modelling and analysis of systems, with a convenient, effective and highly intuitive graphical language for their visualization. Petri nets are applicable to a wide class of systems, among them:

Petri Nets cover a range of diverse applications, including communication protocols, computer networks, manufacturing systems, industrial process control and data flow computing. They have also been widely used in the study of behavioural properties as well as in areas such as simulations, performance evaluation and fault tolerance

PETRI NETS AN INTRODUCTIONNovember‐24‐099:05 AM

CHAPTER 6 By Radu Muresan University of Guelph Page 6

Page 7: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

PETRI NETS AS GRAPHS

A Petri net is a bipatite graph, which is a graph consisting of two distinct sets of nodes or verticesand a set of arcs between pairs of nodes. The nodes in each arc are drawn one each from the two sets ‐‐ the two sets of nodes are called places and transitions and are denoted conventionally by P and T, respectively.

The two sets are non‐empty, finite and are of distinct kinds and, thus, are also disjoint.

The elements of P and T are denoted by pi and tj, i and j being appropriate indices. 

In graphical presentation of Petri nets, places are shown by "circles"             and transitions by "bars"

There are two kinds of arcs in Petri nets, namely input and output arcs. As sets they are denoted by i and o, respectively.

The directions of arcs in graphical displays of nets are shown by arrows.

CHAPTER 6 By Radu Muresan University of Guelph Page 7

Page 8: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

The elements in i correspond to arcs from place to transitions; these places are referred to as inputs of the transition concerned.The elements in o correspond to arcs from transitions to places; these places are referred to as outputs of the transition concerned.

Note that other kinds of arcs, such as arcs from places to places, are not permitted.

Also, note that arcs between pairs of vertices are directed ‐‐ thus an arc corresponding to a pair (pi, tk) is different from that corresponding to (tk, pi).

Petri nets differ from conventional graphs by having, in general, multiple arcs (or bags of arcs) between some pairs of places and transitions ‐‐multiplicity of arcs may be seen alternatively as a weight attached to a single arc and, therefore, arc weights can be represented as a function

Petri nets occasionally use special kinds of arcs known as inhibitor arcs ‐‐ inhibitor arcs are permitted from (input) places to transitions only and, thus, do not point to output places ‐‐ the inhibitor arcs are distinguished in the graphical notation by a small circle in place of the arrow.

CHAPTER 6 By Radu Muresan University of Guelph Page 8

Page 9: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

MARKING FUNCTION

A 'time invariant' part of the Petri net with 5 components ‐‐ these components are time invariant in the sense that they remain fixed in the evolution of a Petri net. 

1.

A 'time variant' marking function, M, which captures the evolution of the net in time ‐‐marking is a mapping (a function)                                 and effectively associates a number of tokens with each place.

2.

Being models of some real‐life systems, Petri nets are supposed to evolve over time, and this evolution may be captured by means of the following:

It is important that the marking has a specified initial value, denoted conventionally by M0 ‐‐ in general, Mi refers to a specific value of the marking function, i being an appropriate numerical index.

Thus, Petri nets consist of both a time invariant static component and a time varying component ‐‐ each Petri net as a whole consist of six distinct components:

CHAPTER 6 By Radu Muresan University of Guelph Page 9

Page 10: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

REPRESENTATION OF SYSTEMS IN PETRI NETS

The components of Petri nets represent different aspects of the system ‐‐ let's examine the correspondence between Petri nets and systems.

The model The system

Potential conditions of the system. Mathematically, these conditions may be stated as predicates.Potential events in the system. These are elementary events in the sense that their internal composition is to be ignored at the level of abstraction of the given net.Input arcs to transitions, relating events with the pre conditions (prerequisites) for their occurrence.Output arcs from transitions, relating events with their post‐conditions ‐ conditions brought about by their occurrence.Presence of an appropriate number of tokens in an input place signifies 'fulfillment' (or readiness) of the condition attached to the place necessary for the occurrence of the event associated with the place.

Firing (or execution) of a transition signifies the occurrence of its associated event.

Currently prevailing system state.

The initial system state

A transformation of the system state

CHAPTER 6 By Radu Muresan University of Guelph Page 10

Page 11: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

MODEL OF EXECUTION

The evolution of Petri nets is captured by an ordering of the net states as represented by the marking function ‐‐each change of the net state is brought about by the firing or execution of a transition.Transition firing is based on the notion of enabledness of transitions ‐‐ a transition t is said to be enabled if and only if both conditions below are true:Every input place p, other than those in inhibitor arcs incident on t, has at least W((p, t)) tokens, that is, the weight of the arc from p to t.

1.

Every input place p, from where there is an inhibitor arc incident on t, has no tokens ‐‐ an inhibitor arc treats the negation of the condition attached to its input place as the enabling condition of the relevant transition.

2.

A transition is said to be disabled if it is not enabled.Firing of transitions alters the value of the marking function and obey the following rules:Only enabled transitions may fire.1.As transition t fires, W((pi, t)) tokens are removed from each input pi of the transition t, and W(po, t)) tokens are deposited at each output po of the transition t ‐‐ the value of the marking function elsewhere is unaltered.

2.

Firing is instantaneous and complete with respect to rule 2 above. Firing is also non‐deterministic in the case of a choice with more than one concurrently enabled transition ‐‐ any of the enabled transitions may fire and the transition which is to be fired is chosen arbitrarily. 

3.

CHAPTER 6 By Radu Muresan University of Guelph Page 11

Page 12: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 27

Modeling of Concurrency and Decision Points in Petri Nets

Concurrency: definition …

P2

P1

t1

P3

P4

P5t2

2

Petri nets allow the modeling of complex architectural behavioral features such as concurrency and decision points.Concurrency: two transitions are said to be concurrent if and only if they are both enabled and, further, each may be executed in any order without disabling the other by its execution.

CHAPTER 6 By Radu Muresan University of Guelph Page 12

Page 13: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 28

Conflict: definition … …Q?

P3

P2

P1

P4

P5

t1

t2

Conflict: two transitions are said to be in conflict if they are both enabled, but firing of any one of them immediately disables the other by its execution.The place causing the conflict is said to be a decision point.Q: Which place is the decision point?A: P2.Note: enabled transitions can fire in any order. In the analysis of Petri Nets we need to consider all possible solutions.

CHAPTER 6 By Radu Muresan University of Guelph Page 13

Page 14: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 29

Symmetric confusion: definition ...

P2

P1

t3

t2

t1

Symmetric confusion: a special form of conflict, where the concurrency of transitions is affected by the firing of a third transition. In this example, concurrency of t1 and t3 is affected by the firing of t2.Firing of t2 => t3 and t1 are not enabled anymore => no concurrency.

CHAPTER 6 By Radu Muresan University of Guelph Page 14

Page 15: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 30

Asymmetric confusion: definition …

P2

P1 t2

t1

t3

P3

P4

Asymmetric confusion: another special form of conflict, where a conflict between two transitions t2 and t3 is brought about by firing of a concurrent partner t1.Firing t1 puts a token in P2 and enables t2. Enabling t2 creates a conflict between t2 and t3. (Firing any of t2 or t3 disables the other).

CHAPTER 6 By Radu Muresan University of Guelph Page 15

Page 16: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

The nature of marking function enables the identification of the following classes of PN:Condition‐event Nets: each place contains at most one token and the presence of the token corresponds to a condition. The condition may be seen as propositions which may take one of the truth values: true or false.Place‐transition Nets: Places may contain multiple tokens, the presence of tokens corresponding to a condition and the number of tokens to some capacity or a counterPredicate‐event Nets: Generalize the above two classes by allowing particular objects or individuals as tokens. The so‐called colored nets form a special case of these nets. In this case, each condition may be seen as a predicate written with respect to these objects and taking a truth value.

Q: What is the marking function?A: A set showing the value of tokens for each place.

TYPES OF PETRI NETS

CHAPTER 6 By Radu Muresan University of Guelph Page 16

Page 17: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 32

Illustrative Example

A net with potential concurrency and conflicts

P4

t2

P2 P3

t3

P5

t4

t1

P1

t5

The diagrams shown in the following slides illustrate some applications of Petri nets especially in relation to certain characteristics features shared by many diverse systems.

This figure shows a net, the design of which includes features such as concurrency and conflict outlined in the previous slides. The next slides show how the behaviors intended by these features come about in the evolution of the net.

CHAPTER 6 By Radu Muresan University of Guelph Page 17

Page 18: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 33

Illustrative Example

t4

P4

t2

P2 P3

t3

P5

t1

P1

t5

concurrency

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 34

Illustrative Example

t2

A state showing concurrency and asymmetrical confusion

P4

P2 P3

t3

P5

t4

t1

P1

t5

Asymmetrical confusion

concurrency

Here transition t3 causes asymmetrical confusion with respect to transitions t4 and t5. Also, t4 and t3 are concurrent. Firing t3 first brings a conflict between t4 and t5. On the other hand t4 is concurrent transition with t3 and causes no asymmetrical confusion with respect to t3 if t4 chooses to fire first. However, if t3 chooses to fire in this state we will have the situation presented in the next slide.

Here we have 2 concurrent transitions subsequent to firing of the transition t1. From this point on the net can take different routes. If t2 (one of these concurrent transitions) fires the resulting state is presented below.

CHAPTER 6 By Radu Muresan University of Guelph Page 18

Page 19: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 35

Illustrative Example

P4

t2

P2 P3

t3

P5

t4

t1

P1

t5

A state showing a conflict

conflict

Decision point

Here t3 fired first and as a result t4 and t5 are in conflict.

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 50

*Example: Four Readers and a Writer

Depending on the type of job we can have a reader job orwriting job arriving.

(reading)

Four readers and a writer

(job arrives) (waiting)

(start writing) (writing) (finish writing)

(finish reading)(start reading)

P1t1

t3

t2 P2

P4

44

P3

t4

t5

(fileaccessible)

Example above models a file access control protocol allowing up to four concurrent readers in read‐only mode or a single writer accessing the file in exclusive read and write mode. Example: J1: read, J2: read, J3: read, and J4: write, arrive in this sequence in at various times. If jobs J1, J2, J3 are all in the reading state p2, job J4 has to wait in state p1 until all reading jobs had finished the reading operations and released their tokens back.

CHAPTER 6 By Radu Muresan University of Guelph Page 19

Page 20: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 52

*A Communication Protocol Between 2 Processors

(produce)

(ack.received)

(receive ack.)

t4P6

t5

P1

(ready to send)

(waiting for ack.)

(buffer in use)

(ack. sent)

(consume)

(ready toreceive)

P3

P2

P4

P7

Process A Process B

t1

t2

P5

t3

t6

P8

(buffer in use

Asynchronous communication through two independent buffers modeled by places p2 and p7.Communications take place between the two processors asynchronously through 2 independent buffers modeled by places p2 and p7. Any new data may be written to either buffer, but only when its previously held data has been read. t1 cannot send new data until p2 is empty. When t1 fires => p2 = 1 and p4 =1. Initially: process B has no transitions enabled; process A has one transition enable (that is t1).If t1 fires the system moves in the next stage where process A waits in state p4 until process B is placing a token in place p7 indicating that the acknowledge signal is generated and a new data can be produced. This is an example of handshake (asynchronous) based communication. 

CHAPTER 6 By Radu Muresan University of Guelph Page 20

Page 21: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

PROPERTIES OF PETRI NETS

The properties of interest in Petri nets belong to two categories: 1) those which depend on the structure of the net and 2) those which depend on the initial marking and on the net evolution.Here we discuss only the second category.

REACHABILITY. A marking Mn is said to be reachable from an initial marking M0 if and only if either n = 0 or there exists a sequence of firing s = <t1, t2, ..,tn> altering the value of the marking function respectively from M0 to M1, from M1 to M2, ..., and finally from Mn‐1 to Mn.

1.

The state corresponding to the marking addressed by reachability may be on the states not permitted or undesirable for safety reasons ‐‐ the set of all possible markings reachable from M0 in a given Petri net N is denoted by R(N, M0).If places represent data storage facilities such as buffers and the tokens represent the relevant items then we have two classes of nets: bounded nets and safe nets.

CHAPTER 6 By Radu Muresan University of Guelph Page 21

Page 22: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

k‐Boundedness: a PN is said to be k‐bounded for some given                                            for every marking                                and for every 

a.

Boundedness: a PN is said to be bounded if there exists a                   such that the net is k‐bounded.

b.

Safe Petri Net: a PN is said to be safe if the net is 1‐ bounded.

c.

BOUNDEDNESS AND SAFE NETS2.

As described above, the number of tokens in each and every place in a k‐bounded net never exceeds k for any marking reachable from the initial marking M0, k being a finite number ‐‐ by contrast, boundedness is a general notion which relies on some unspecified but a finite number.

LIVENESS. A PN is said to be live if for every marking M reachable from the initial marking M0 it is possible eventually to fire every transition in the net in some marking M' which is reachable from M ‐‐establishing whether a given system possesses liveness is not always feasible ‐‐ in such situations, a notion of limited liveness may be acceptable or the only possibility. 

3.

CHAPTER 6 By Radu Muresan University of Guelph Page 22

Page 23: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

PERSISTENCE. A PN is said to be persistent if for every pair of enabled transitions firing of one does not disable the other ‐‐ persistence is closely related to conflict free nets.

4.

Mutual fairness between transitions: a pair of transitions is said to be bounded‐fair if there is an upper bound on the number of executions of either transition while the other is not being executed. 

a.

Global fairness in firing sequences: a firing sequence s is globally fair if every transition appears in s infinitely often.

b.

Global fairness in nets: a net is said to be globally fair if every firing sequence starting from M0 is globally fair.

c.

FAIRNESS is a notion which quantitatively characterizes the extent of potential activity in a net. The following are some of the notions related to fairness:

5.

CHAPTER 6 By Radu Muresan University of Guelph Page 23

Page 24: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 113

Time Basic Nets (TBN)

General approach: can associate time with transitions, places and more

TBN involves the following elements: (a) Time offsets: associated with transitions …

(b) Time-stamping: associated with tokens for determining the enabling times of transitions

(c) Clock time interval: associated with transition give permitted or mandatory firing times of transition

This interval is defined as a function of time stamps on tokens

at input places and time offsets mentioned in (a)

In the TBN approach, tokens are time‐stamped; a time stamp being a record carried by each token of the firing time of the transition which created it. Associated with time stamps is a function time. Given a place p, time(p) gives the value of the time stamp of the token at place p, assuming that there is only one time stamp of the tokens at p. Time is a partial function:       time: P       T;  and is defined only at places where there are tokens. Therefore,        dom time = dom(M > 1 ...).

It is possible to define a function time so that it gives the time stamp of a given token at a given place, thus enabling a proper treatment of multiple tokens at any place with different time stamps. Unless otherwise stated we assume that time is a function from places to clock time. Because of its link with tokens, the value of the function time is updated, analogous to the marking function, each time a transition fires. 

CHAPTER 6 By Radu Muresan University of Guelph Page 24

Page 25: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 114

Tokens are Time-Stamped:

time(p) gives the value of time stamp of the token at place p: time : P -> T, and is defined only at places where there are

tokens.

it is possible to define a function time for individual tokens

Assumption: time is a function from places to clock time

each time a transition fires the value of function time is updated

Here T represents a set of time values associated with a given representation of clock time. 

Given a place p, time(p) gives the value of time stamp of the token at place p: time : P ‐> T, and is defined only at places where there are tokens.

It is possible to define a function time for individual tokens at a given place unless otherwise stated, we assume that time is a function from places to clock time. Because its links with tokens, the value of function time is update, analogous to the marking function, each time a transition fires.

CHAPTER 6 By Radu Muresan University of Guelph Page 25

Page 26: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 115

The permitted firing times of transitions are given in terms of a Time Condition:

A time condition is a set of clock time values or absolute time values

The time condition of a transition t is defined in terms of the time stamps and offsets associated to transitions time offsets (temporal parameters) – specified as lengths

of time, that is, relative times;

time offsets are fixed parameters of transitions the time condition function has to be customized for the

individual transitions

the time condition = f(time(P), offsets)

Note that conventionally time offsets are not listed among the arguments of the function time. Thus, the time condition varies with changes to the state of the net. 

A time condition is a set of clock time values or absolute time values (in this part it is assumed that this set forms a continuous stretch of time). The time condition of a transition t is defined in terms of the time stamps of its input places and certain temporal parameters associated with t the temporal parameters are referred to as time offsets and – specified as lengths of time, that is, relative times; Time offsets are fixed parameters of transitions.

The function that determines the time condition has to be customized for the individual transitions. The time condition of a given transition is obtained by applying the function time to the time stamps of input places of the transition and its time offsets.

CHAPTER 6 By Radu Muresan University of Guelph Page 26

Page 27: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

CHAPTER 6 By Radu Muresan University of Guelph Page 27

Page 28: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 116

Enabling of Transitions

A transition is said to be enabled iff (i) each input place contains the necessary number of

tokens. If inhibitor arcs are being used, then the input places connected with them must be empty

(ii) there are time values in its time condition which are greater than, or equal to, the largest time stamp on the input tokens this condition requires all the tokens to arrive at the input places

before the ‘expiry time’ of the transition enabling, if the transition concerned is to fire within its time condition

CHAPTER 6 By Radu Muresan University of Guelph Page 28

Page 29: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 117

Firing Period

Enabling tuple of a transition: (time; stamped-tokens) at its input places

An enabling tuple of a transition t must contain W((p,t)) tokens at every input place p, that is, the weight of normal arcs from p to t

Enabling time is the latest time stamped on the tokens in the enabling tuple

The firing period of a transition t is defined as the clock time interval indicated by the time condition of t

Identified with each enabled t is an enabling tuple. An enabling tuple is a set of time‐stamped tokens at its respective input places. An enabling tuple of a transition t must contain W((p,t)) tokens at every input place p, that is, the weight of normal arcs from p to t. Given an enabling tuple, enabling time is the latest time stamped on the tokens in the enabling tuple. 

The firing period of a transition is defined as the clock time interval whose values are drawn from the time condition of the transition concerned, but are greater than or equal to its enabling time.

CHAPTER 6 By Radu Muresan University of Guelph Page 29

Page 30: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 118

Model of Execution

(i) Only enabled transitions may fire. The firing of a given transition must take place at some time in its firing period

(ii) As a transition t fires, the enabling tuple is removed from the input places of t

(iii) Firing of transitions delivers to its outputs the appropriate number of tokens, time-stamped with its firing time and according to the arc weight following the rules of untimed Petri nets

(iv) The other rules in untimed Petri nets remain applicable

CHAPTER 6 By Radu Muresan University of Guelph Page 30

Page 31: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 119

Illustrative Example: Auto-Pilot Subsystem

Informal description: The system is basically an automatic override for pilot action, which

is invoked in the event of undue delays on the part of the pilot in controlling the aircraft. The delays may be either due to:

(i) pilot failing to choose the manual control as the flight approaches the landing site, or

(ii) pilot failing to adjust the manual control subsequently at the required intervals.

The timing constraints are as follows: In the case of (i), the pilot has to execute his choice of manual control

within the tsel time units after entering the landing radius, and In the case (ii), the adjustment must be made after a minimum

separation time of tadj-min time units from the previous adjustment. The auto pilot takes over the control of the aircraft a maximum of tadj-

max time units after the latest adjustment, but only if the monitoring system observes any excessive deviation from the landing approach

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 120

Untimed Petri Net Model of the Auto-Pilot Example

(excessivedeviations)

Sensors

(override)t4 t3

P2

t1t5

P4

P1 (Within landing radius)

Auto subsystem

(selectauto)

(Selectmanual)

Manual subsystem

(adjust)

(underpilot

control)

Flight Controller

P1

t2

P3

P5

CHAPTER 6 By Radu Muresan University of Guelph Page 31

Page 32: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 121

TBN Timing Aspects Required for the Petri net Untimed Model Example

Places Description

Flight is within landingradius

Flight is under pilot controlFlight is under automatic

controlFlight deviates excessivelyfrom landing approach(Some output place withinmanual subsystem)

P1

1P2

P3

1P4

1P5

Select manual operation1

invoke automatic operationAdjust manual operation

1Invoke automatic override

1Process sensor data(timing not covered)

t11t2t31t41t5

Id.TransitionsDescriptionId.

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 122

IMPORTANT!!!The untimed Petri net model together with the abovetiming specifications is considered a TIMED MODELof the system.

Cont ...

t1t2t3t4

tmin ,tmax

tmax

tsel

tsel

tadj , tadj

tadj

P1

P1

P2

P2, P4

( ( ), ( ) ]( ( ) , )( ( ) , ( ) )[ ( ) , ),

min max

max

time p time p ttime p ttime p t time p ttime p t

ael

ael

adj adj

adj

1 1

1

2 2

2

if time(P4) > time(P2)otherwise

Time offsets

Transition Inputplaces

Time condition

CHAPTER 6 By Radu Muresan University of Guelph Page 32

Page 33: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 123

Illustrative Example: A Process Control System

Informal description: the production of a certain product requires from T1 to T2 time units of total processing time. The processing commences within T3 time units from the delivery of the raw material for the product. If the processing is not begun before this time limit, the site should discard the raw material and be ready to accept new deliveries. Because of the sensitivity of the ambient conditions, the processors involved in the production are vulnerable to failure and, therefore, an additional processor is kept as standby. If a processor fails in the middle of its operation, it is immediately replaced by the standby processor, but incurring an unspecified delay. On termination of processing, the processors become available for the next cycle in T4 time units.

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 124

The Untimed Petri Net Model of the System

It is assumed that only up to one processor failure is possible in any cycle of operation. Also, we will ignore the aspects related to supply of new standby processors.

Raw material has been deliveredProcessors are availableA processor is readyProcessing is taking placeProcessing has startedProcessing has started or processor has failedProcessor has failed

Start processingFinish processingDiscard new materialProcessor failsReplaces processorDeliver raw material

P1

P2

P3

P4

P5

P6

P7

t1t2t3t4t5t6

PlacesDescription

TransitionsDescriptionId. Id.

CHAPTER 6 By Radu Muresan University of Guelph Page 33

Page 34: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 125

The Petri Net Representation of the System

P2

P7 (processor has failed

t4 (processor fails)

(processing startedor processor failed)

t2(finish)

P5 (has started)

P3 (ready)

t3 discard)

t6(deliver)

(processoravailable)

(replace)

t5

t1(start)

(being processed)

P4

P6P1

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 126

Cont ...

NOTE: places p4, p5, and p6 are introduced specifically for capturingtiming requirements (places p5 and p6 are not required in an untimednet. The use of these 3 places is such that:• time(p4): denotes the time of processor replacement;• time(p5): denotes the start time of processing;• time(p6): denotes the time of processor failure.

t1t2tt3t4tt5

Transi-tion

Timeoffsets

Inputplaces

Time conditon

T3, T4

T1, T2

tT3

T1

t—

P1, P2, P3

P4, P5, P6

tP1

P4, P6

tP2, P7

[time(P3) + T4, time(P1) + T3)[T0 + T1, T0 + T2]

where T0 = time(P4) + time(P5) – time(P6)[time(P1) + T3, ][time(P4), time(P4) + T1), if time(P4) = time(P6)

, otherwise(time(P7), )

CHAPTER 6 By Radu Muresan University of Guelph Page 34

Page 35: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 127

Scenario:T1 = 8, T2 = 10T3 = 3, T4 = 3time units

Enabled transitions andtime conditions (clock time intervals):t1 [0+3,2+3) = [3,5)t3 [2+3, infinity) = [5, ∞)

State 1: After firing of t6 at clock time = 2 the net looks like:time(p1) = 2 (in clock time);time(p2) = 0 on one token and 1 on the other token;time(p3) = 0;

P3

t1

t3

t6

P5

t2P4

P6

t4

t5

P2

P1

P7

Cont …

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 128

State 2: t1 fires at clock time 4: time(p2) = 1, time (p4) = time(p5) = time (p6) = 4;

Enabled transitions andtime conditions (clock time intervals):t2 [4+8,4+10] = [12,14]t4 [4,4+8] = [4,12)

P3

t1

t3

t6

P5

t2P4

P6

t4

t5

P2

P1

P7

Cont …

CHAPTER 6 By Radu Muresan University of Guelph Page 35

Page 36: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 129

State 3: t4 fires at clock time 7:time (p2) = 1; time (p5) = 4; time (p6) = 7; time (p7) = 7;

Enabled transitions andtime conditions (clock time intervals):

t5 [7, infinity] = [7, ∞)

P3

t1

t3

t6

P5

t2P4

P6

t4

t5

P2

P1

P7

Cont …

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 130

Enabled transitions andtime conditions (clock time intervals):t2 [10+8, 10+10] = [18,20]t4 (null)

State 4: t5 fires at clock time 13:time (p4) = 13; time (p5) = 4; time (p6) = 7.Note: T0 = time(p5) + time(p4) – time(p6) = 4+13 -7 = 10.

P3

t1

t3

t6

P5

t2P4

P6

t4

t5

P2

P1

P7

Cont …

CHAPTER 6 By Radu Muresan University of Guelph Page 36

Page 37: ENGG4420 ‐‐ CHAPTER 6 ‐‐ LECTURE 1 3 6 By... · ENGG4420 ‐‐CHAPTER 6 ‐‐LECTURE 1 ‐3 November‐23‐09 ... disabling the other by its execution. CHAPTER 6 By Radu

ENGG4420. CHAPTER 4: Uniprocessor and Multiprocessor Scheduling. Developed by Radu Muresan, Univesity of Guelph 131

State 5: t2 fires at clock time 19:time(p2) = time(p3) = 19;Note: no transitions are enabled in this state => the plant is ready for the next cycle of operation

P3

t1

t3

t6

P5

t2P4

P6

t4

t5

P2

P1

P7

Cont …

END OF THE ENGG4420 COURSE!!!

PROBLEMS FOR FINAL EXAM WILL BE POSTED ON THE COURSE WEB PAGE!!!

CHAPTER 6 By Radu Muresan University of Guelph Page 37