Petri nets Chapter 1: systems 1. Compare continuous systems and discrete event systems. 2. Compare discrete systems and discrete event systems. 3. Give 5 examples of discrete event systems with, for each, the states and the events. see also Ch1exoSupp Chapter 2: Language and automata 1. Represent the following state-transition diagram as an automaton (E, X, f, x0, F): 0 a 1 c 2 b 2. Find the set of event sequences of length less than or equal to 5 of the automaton of exo 4. What do you conclude? 2.6 Construct an automaton that marks to the following language { s {a, b}* : each a in s is immediately preceded and followed by b} 1 2 3 4 Chapter 3: Petri nets 3.A: Basics 1. Consider the following PN with initial marking M0 = [1,1,2,1]. p1 p2 2 t1 t3 p3 t2 t4 p4 a) What is the marking after firing the sequence s = < t1, t2, t3, t4>? b) Let sn be the n-time repetition of the sequence s. Starting from M0, is it possible to fire sn for any n? If yes, what is the marking? If not, what is the maximal value of n for which the firing of sn is possible? c) Determine the incidence matrix and verify the above results with the state equation. d) Determine the marking obtained with sequence s=t1t2t4t1t3t1t3t1t4 if it is firable. What do you conclude? 2. Assume that, in a PN of a manufacturing system, a transition represents an operation and a place represents a stock keeping unit. What the following PNs represent? Give the signification of the tokens and the types of operations modeled. (assembly-disassembly-transformation). t t t 3. Are the following graphs Petri nets? If yes, which transitions are firable? What are the resulting markings? What are the transitions firable at the new markings? 5 4. Are above PN belong to some elementary PN? 5. Explain the process modeled by the following PNs. get 15¢ candy 5¢ put 5¢ 0¢ put 10¢ 15¢ k put 5¢ put 5¢ put 5¢ p1 k put 10¢ 10¢ 20¢ Writing put 10¢ k reading k get 20¢ candy PN model of a vending machine Readers-writers system for k processes a copy add a+b divide x = (a+b)/(a-b) a if a-b°0 copy a-b b x is undefined b substract if a-b=0 Dataflow computation for x = (a+b)/(a-b) 3.B. Dynamic behaviors and analysis 1. Prove the theorem of monotonicity of the sequence of transitions. The state equation might be used. 6 Theorem : Given a firable sequence s of transitions of a Petri net (P, T, A, W, M0), then s is firable in PN (P, T, A, W, M0') for all M0' ≥ M0. 2. Show the properties of the following PN. S1 S2 R1 n R3 R2 3. Give a PN with unavoidable deadlock, a PN with avoidable deadlocks, a PN without deadlock but non live, a quasi live but not live PN (quasi live = any transition can be fire at least once). 4. Consider the following PN. (i) Show that M = (0, 0), M0 and Y = (1, 2) satisfy the state equation but there is no firable sequence with counting vector Y. (ii) Show that M = (n, 0) with n > 0, M0 and Y = (n, 1) satisfy the state equation but M is not reachable. (iii) What do you conclude? t1 p1 p2 t2 5. Show that, if there exists a sequence s of transitions transforming M0 into M such that M ≥ M0 and M(p) > M0(p) for at least one place p, then s can be repeated any time and places p such that M(p) > M0(p) are not bounded. 6. Construct the coverability tree of the following Petri nets. Verify their liveness. What do you observe? 2 2 2 7 7. Are the following PNs bounded, live, deadlock-free and reversible? 2 3 2 3 8. Build the coverability tree of the following PN? What do you conclude? 9. Determine the properties of the following PN with M0 = (1, 0, 0, 0, 0, 0), (2, 0, 0, 0, 0, 0), (1, 1, 0, 0, 0, 0). p2 p1 10. Consider the following production system. (i) model its operation with a PN with the initial state corresponding to the figure. (ii) Does it belong to an elementary PN class? (ii) Determine a firable sequence that contains each transition once. Determine the resulting marking. What do you conclude? Is the sequence firable with an initial marking M0' ≥ M0? 8 stock cap. = 3 producer consomer 11. Problem of dining philosophers: four silent philosophers sit around a table with four chopsticks b1 to b4. Each philosopher has two states: think or eat. (i) model with PN the following protocol: when a philosopher wants to eat, he first takes the chopstick on his right, then that on his left and then eat. When he finishes, he puts back the right chopstick and then that of left and start thinking. Indicate the invariants of the PN. Is the PN live? If there is a deadlock, give a sequence of transitions leading to it and explain why the deadlock occurs. (ii) Define a protocol without deadlock. phil. 1 b1 b2 phil. 4 phil. 2 b4 b3 phil. 3 12. Consider the following protocol for management of cabins and baskets of a swimming pool. Upon his arrival, a customer enters any free cabin and changes and leaves his clothes in the cabin. He then asks for a basket to fill his clothes before release the cabin. After the swim, he enters a cabin with his basket, empty the basket and release the basket. He then dresses and releases the cabin. Let Nc be the number of cabins and Nb the number of baskets. i) Model the protocol with PN. Is the PN bounded and deadlock-free? (ii) Define a protocol that is deadlock-free for all Nc and Nb. Verify with its PN model. 9 13. Show with coverability tree the properties of the following PN: NonB, NonV, NonR NonB, NonV, R NonB, V, NonR B, NonV, NonR NonB, V, R B, NonV, R B, V, NonR B, V, R 10 3.C. Structural properties 1. Prove the following theorem : Theorem: Any p-invariant is a non negative linear combination of minimal pinvariants. 2. The following PN represents a machine subject to failures. t1 represents the loading of a product on the machine, t2 the end of production, t3 the downloading of the product. The machine can fail when it is producing. Your task: (i) give the incidence matrix, (ii) construct the coverability tree, (iii) determine the invariants and their interpretation. p1 t1 t2 p2 t3 p3 t5 t4 p4 3. Consider a connected event graph. Show that (i) each elementary circuit is a pinvariant, (ii) there exists a single minimal t-invariant Y with all entries equal to 1, (iii) the PN is conservative and consistent if it is strongly connected. 4. Consider a connected state machine. Show that (i) each elementary circuit is a tinvariant, (iii) there exists a single minimal p-invariant X with all entries equal to 1, (iii) the PN is conservative and consistent if it is strongly connected. 5. Consider the following PN. You are asked to: (i) determine the set of p-invariants, the set of t-invariants, and explain their signification; (ii) show their structural properties; (iii) interpret these properties. t1 t4 R1 p1 p3 t2 t5 p2 p4 t3 R2 R3 t6 6. Consider the following PNs. (i) Show their structural properties, (ii) prove the behavior properties that can be directly derived from (i). 2 2 2 7. Are PN of problem 7 of chapter 3.B conservative, repetitive, consistent, structurally bounded? 11 8. Is the following PN conservative? Is there a p-invariant? Prove your answers and give an intuitive explanation. 9. Determine intuitively the p- and t-invariants of the following PN and then prove your results. 2 2 12