Embedded Systems 6 REVIEW. Place/transition nets. defaults: K = ω W = 1

Similar documents
fakultät für informatik informatik 12 technische universität dortmund Petri nets Peter Marwedel Informatik 12 TU Dortmund Germany

DES. 4. Petri Nets. Introduction. Different Classes of Petri Net. Petri net properties. Analysis of Petri net models

Petri nets. s 1 s 2. s 3 s 4. directed arcs.

Methods for the specification and verification of business processes MPB (6 cfu, 295AA)

Petri Nets and Model Checking. Natasa Gkolfi. University of Oslo. March 31, 2017

3 Net Models of Distributed Systems and Workflows

Methods for the specification and verification of business processes MPB (6 cfu, 295AA)

7. Queueing Systems. 8. Petri nets vs. State Automata

Petri Nets (for Planners)

Methods for the specification and verification of business processes MPB (6 cfu, 295AA)

Embedded Systems 5. Midterm, Thursday December 18, 2008, Final, Thursday February 12, 2009, 16-19

MPRI 1-22 Introduction to Verification January 4, TD 6: Petri Nets

Simulation of Spiking Neural P Systems using Pnet Lab

c 2011 Nisha Somnath

Analysing Signal-Net Systems

Linear Time Analysis of Properties of Conflict-Free and General Petri nets

Time(d) Petri Net. Serge Haddad. Petri Nets 2016, June 20th LSV ENS Cachan, Université Paris-Saclay & CNRS & INRIA

Analysis and Optimization of Discrete Event Systems using Petri Nets

NONBLOCKING CONTROL OF PETRI NETS USING UNFOLDING. Alessandro Giua Xiaolan Xie

On the modularity in Petri Nets of Active Resources

Efficient Symbolic Analysis of Bounded Petri Nets Using Interval Decision Diagrams

Composition of product-form Generalized Stochastic Petri Nets: a modular approach

A Structure Causality Relation for Liveness Characterisation in Petri Nets

The State Explosion Problem

Specification models and their analysis Petri Nets

Universiteit Leiden Opleiding Informatica

Sanjit A. Seshia EECS, UC Berkeley

1. sort of tokens (e.g. indistinguishable (black), coloured, structured,...),

Lecture 16: Computation Tree Logic (CTL)

Embedded Systems 5 BF - ES - 1 -

A REACHABLE THROUGHPUT UPPER BOUND FOR LIVE AND SAFE FREE CHOICE NETS VIA T-INVARIANTS

A Polynomial-Time Algorithm for Checking Consistency of Free-Choice Signal Transition Graphs

Communication in Petri nets

Complete Process Semantics for Inhibitor Nets Technical Report

Petri nets analysis using incidence matrix method inside ATOM 3

Markings in Perpetual Free-Choice Nets Are Fully Characterized by Their Enabled Transitions

Compositional Analysis of Timed-arc Resource Workflows with Communication

SPECIFICATION MODELS. Chapter 3. Overview. Introducing Hierarchy. StateCharts

Design of Distributed Systems Melinda Tóth, Zoltán Horváth

MODEL CHECKING - PART I - OF CONCURRENT SYSTEMS. Petrinetz model. system properties. Problem system. model properties

Time and Timed Petri Nets

Trace- and Failure-Based Semantics for Responsiveness

Georg Frey ANALYSIS OF PETRI NET BASED CONTROL ALGORITHMS

The Decent Philosophers: An exercise in concurrent behaviour

Timed Automata VINO 2011

Applications of Petri Nets

ADVANCED ROBOTICS. PLAN REPRESENTATION Generalized Stochastic Petri nets and Markov Decision Processes

Local state refinement on Elementary Net Systems: an approach based on morphisms

Introduction to Temporal Logic. The purpose of temporal logics is to specify properties of dynamic systems. These can be either

Distributed Deadlock-Avoidance. IMDEA Software Institute, Spain

Some techniques and results in deciding bisimilarity

Parameterized Reachability Trees for Algebraic Petri Nets

Embedded Systems 4. Petri nets. Introduced in 1962 by Carl Adam Petri in his PhD thesis. Different Types of Petri nets known

Complexity Analysis of Continuous Petri Nets

An Introduction to Temporal Logics

A Static Analysis Technique for Graph Transformation Systems

Design and Analysis of Distributed Interacting Systems

Dense-Timed Pushdown Automata

AGREEMENT PROBLEMS (1) Agreement problems arise in many practical applications:

Compact Regions for Place/Transition Nets

fakultät für informatik informatik 12 technische universität dortmund Petri Nets Peter Marwedel TU Dortmund, Informatik /10/10

Free-Choice Petri Nets without Frozen Tokens, and Bipolar Synchronization Systems. Joachim Wehler

A Review of Petri Net Modeling of Dynamical Systems

Chapter 6: NFA Applications

Coloured Petri Nets Based Diagnosis on Causal Models

Information System Design IT60105

Petri Nets (for Planners) ICAPS Petri Nets (for Planners) Outline of the Tutorial. Introduction & Motivation

Petri Net Modeling of Irrigation Canal Networks

Discrete Parameters in Petri Nets

Overview. Discrete Event Systems Verification of Finite Automata. What can finite automata be used for? What can finite automata be used for?

Can I Find a Partner?

Snapshots. Chandy-Lamport Algorithm for the determination of consistent global states <$1000, 0> <$50, 2000> mark. (order 10, $100) mark

Time Petri Nets. Miriam Zia School of Computer Science McGill University

Bounded LTL Model Checking with Stable Models

Modeling and Stability Analysis of a Communication Network System

Automata-based Verification - III

Synchronizing sequences. on a class of unbounded systems using synchronized Petri nets

Synthesis of bounded Petri Nets from Prime Event Structures with Cutting Context

Discrete Event Systems Exam

Flat counter automata almost everywhere!

Soundness of Workflow Nets with an Unbounded Resource is Decidable

Outline. Time Petri Net State Space Reduction Using Dynamic Programming and Time Paths. Petri Net. Petri Net. Time Petri Net.

Elementary Siphons of Petri Nets and Deadlock Control in FMS

A subtle problem. An obvious problem. An obvious problem. An obvious problem. No!

Recent results on Timed Systems

Introduction to Stochastic Petri Nets

Structural Analysis of Resource Allocation Systems with Synchronization Constraints

Verification of Probabilistic Systems with Faulty Communication

Liveness in L/U-Parametric Timed Automata

An Holistic State Equation for Timed Petri Nets

Efficient Computation of Causal Behavioural Profiles using Structural Decomposition

CS 301. Lecture 18 Decidable languages. Stephen Checkoway. April 2, 2018

TUM{INFO{10-I /1.{FI Alle Rechte vorbehalten Nachdruck auch auszugsweise verboten c1998 SFB 342 Methoden und Werkzeuge fur die Nutzung parallele

Timo Latvala. March 7, 2004

Priority Scheduling of Distributed Systems Based on Model Checking

Causal Dataflow Analysis for Concurrent Programs

CONTROL AND DEADLOCK RECOVERY OF TIMED PETRI NETS USING OBSERVERS

Improper Nesting Example

Logic Model Checking

Automata-based Verification - III

Transcription:

Embedded Systems 6-1 - Place/transition nets REVIEW Def.: (P, T, F, K, W, M 0 ) is called a place/transition net (P/T net) iff 1. N=(P,T,F) is a net with places p P and transitions t T 2. K: P (N 0 {ω}) \{0} denotes the capacity of places (ω symbolizes infinite capacity) 3. W: F (N 0 \{0}) denotes the weight of graph edges 4. M 0 : P N 0 {ω} represents the initial marking of places W (Segment of some net) M 0 defaults: K = ω W = 1 In the following: assume initial marking is finite, capacity ω. - 2-1

Unbounded Petri net REVIEW p 1 2 t 1 t 2 p 3 2 p 2 2-3 - Boundedness REVIEW Theorem 1: A P/T net (with finite initial marking) is bounded iff its reachability set is finite. Theorem 2: A P/T net is unbounded iff there exist two reachable markings M, M, such that M[*>M and M > M. - 4-2

Algorithm for deciding boundedness REVIEW Explore RG(M 0 ) depth-first: If there exists a marking M on the stack such that M <M, stop with result UNBOUNDED; If entire graph explored, return BOUNDED. - 5 - Weak Petri net computers REVIEW A P/T net with r distinguished input places (in i ), a finite number of internal places s i, one extra output place (out), one extra start place (on), and one extra stop place (off) is called a weak Petri net computer for the function f: N r N iff there exists for each x N r an initial marking M x such that M x (on)=1 and M x (in i )=x i for 1 x i r; M x (out)=m x (off)=0; M x (s i )=0; For all reachable markings M M x, M(on)=0 and 1 M(off) 1 and M(out) f(x); For all reachable markings M M x, if M(off)=1 then M is dead; For all 0 k f(x), there exists a reachable marking M such that M(out)=k and M(off)=1. - 6-3

Multiplication REVIEW Source: Matthias Jantzen, Complexity of Place/Transition Nets (1986) - 7 - Computation of Invariants REVIEW We are interested in subsets R of places whose number of labels remain invariant under transitions, e.g. the number of trains commuting between Amsterdam and Paris (Cologne and Paris) remains constant Important for correctness proofs, e.g. the proof of liveness - 8-4

Example Thalys trains: more complex REVIEW Thalys trains between Cologne, Amsterdam, Brussels and Paris. Synchronization at at Brussels and Paris s - 9 - Application to Thalys example N T c R = 0, with N T = p p p p p p p p p p p p p c R, 1 = ( 111111 0 0 0 0 0 0 0) - 10-5

Interpretation of the 1 st invariant c R, 1 = ( 111111 0 0 0 0 0 0 0) Characteristic vector describes places for for Cologne train. We proved that: the number of of trains along the path remains constant. C R,1 s - 11 - Application to Thalys example N T c R = 0, with N T = p p p p p p p p p p p p p c R, 2 = (1,0,0,0,1,1,0,0,1,1,1,0,0) - 12-6

Interpretation of the 2 nd invariant c R, 2 = (1,0,0,0,1,1,0,0,1,1,1,0,0) We proved that: None of of the Amsterdam trains gets lost. C R,2 s - 13 - Application to Thalys example N T c R = 0, with N T = p p p p p p p p p p p p p c R, 2 = ( 0 0 0 0 0 0 11 0 0 0 1 0) - 14-7

Solution vectors for Thalys example c R, 1 = c R, 2 = c R, = 3 cr, 4 = ( 111111 0 0 0 0 0 0 0) ( 0 0 0 0 0 0 11 0 0 0 1 0) ( 0 0 0 0 0 0 0 0 11 0 0 1) ( 1 0 0 0 11 0 0 1 1 1 0 0) C R,4 C R,3 C R,1 s We proved that: the number of of trains serving Amsterdam, Cologne and Paris remains constant. the number of of train drivers remains constant. C R,2-15 - Solution vectors for Thalys example It Itfollows: each place invariant must have at at least one label at at the beginning, otherwise dead at at least three labels are necessary in in the example C R,4 C R,3 C R,1 s C R,2-16 - 8

Invariants & boundedness A net is covered by place invariants iff every place is contained in some invariant. Theorem 4: a) If R is a place invariant and p R, then p is bounded. b) If a net is covered by place invariants then it is bounded. - 17 - Deadlock REVIEW A dead marking (deadlock) is a marking where no transition can fire. A Petri net is deadlock-free if no dead marking is reachable. - 18-9

Liveness REVIEW A transition t is dead at M if no marking M is reachable from M such that t can fire in M. A transition t is live at M if there is no marking M reachable from M where t is dead. A marking is live if all transitions are live. A P/T net is live if the initial marking is live. Observations: A live net is deadlock-free. No transition is live if the net is not deadlock-free. - 19 - Structural properties: deadlock-traps A place set S is a (static) deadlock if every transition that adds token from S also removes token from S. A place set S is a trap if every transition that removes token from S also adds token to S. - 20-10

Empty structural deadlocks and marked traps Empty structural deadlocks are never re-marked; Marked traps are never emptied. - 21 - Sufficiently marked places A place is called sufficiently marked if there are enough token for one of the outgoing transitions: Define W - (p)= min { W(p,t) (p,t) F } if there exists a (p,t) F and 0 otherwise Place p is sufficiently marked in marking M, if M(p) W - (p) A set of places is sufficiently marked if it contains a sufficiently marked place. 2 2-22 - 11

Deadlock-Trap Property A P/T has the deadlock-trap property, if every (static) deadlock contains a trap that is sufficiently marked in M 0. - 23 - Deadlock-Trap Property Theorem 5: Every homogeneous P/T net with non-blocking weights that has the deadlock-trap property is deadlock-free. Homogeneous: For each place, all outgoing edges have the same weight. Non-blocking weights: W + (p) W - (p) W - (p)= min { W(p,t) (p,t) F } if there exists a (p,t) F and 0 otherwise W + (p)= min { W(t,p) (t,p) F } if there exists a (t,p) F and 0 otherwise - 24-12

Proof of Theorem 5 Theorem 5: Every homogeneous P/T net with nonblocking weights that has the deadlock-trap property is deadlock-free. - 25 - - 26-13

Fairness Dining philosophers problem n>1 philosophers sitting at a round table; n forks, n plates with spaghetti; philosophers either thinking or eating spaghetti (using left and right fork). 2 forks needed! - 27 - e 5 e 1 s 5 f 1 s 1 f 5 f 2 s 4 s 2 f4 f 3 e 4 e 2 s 3 e 3-28 - 14

e 5 e 1 s 5 f 1 s 1 f 5 f 2 s 4 s 2 f4 f 3 e 4 e 2 s 3 e 3-29 - Executions Let w = (t i ), i 0, an infinite sequence of transitions. We call w an execution of the Petri net if there exists an infinite sequence of markings (M i ), i 0, starting with the initial marking M 0, such that M 0 [t 0 > M 1 [t 1 > M 2 [t 2 > Set of all exections of N: L(N) - 30-15

Emptiness Theorem 6: Emptiness of L(N) is decidable. - 31 - Fairness Let N be a Petri net and w an execution of N. w is impartial with respect to a set of transitions T iff every transition in T occurs infinitely often in w. w is just with respect to a set of transitions T iff every transition in T that is enabled in all except finitely many markings occurs infinitely often in w. w is fair with respect to a set of transitions T iff every transition in T that is enabled in infinitely many markings occurs infinitely often in w. w is impartial w is fair w is fair w is just - 32-16

Persistent nets A pair of transitions t 1 and t 2 are in conflict at marking M iff t 1 and t 2 are enabled in M, but M is too small to satisfy both preconditions. A net is statically conflict-free if there is no marking where two transitions are in conflict; A net is dynamically conflict-free (persistent) if there is no reachable marking where two transitions are in conflict. - 33 - Persistent nets Theorem 7: If the net is persistent, then every just execution is fair. - 34-17

State Fairness b c a e d An execution w=(t i ) is state-fair if, for all markings M and all transitions t that are enabled in M, the following holds: If M is visited infinitely often, then t is taken infinitely often at M. - 35 - State Fairness Theorem 8: Let N be a bounded net, t a live transition, and w a state-fair execution of N. Then t occurs infinitely often in w. - 36-18

Proof of Theorem 8 Theorem 8: Let N be a bounded net, t a live transition, and w a state-fair execution of N. Then t occurs infinitely often in w. - 37 - - 38-19

Extensions: finite capacities K(p)=4 t 1 p 2 2 t 2 t 3-39 - Extensions: Petri nets with priorities t 1 t 2 : t 2 has higher priority than t 1. test t 2 t 1 p 1 p 0 Petri nets with priorities are Turing-complete. - 40-20

Extensions: Predicate/transition nets Goal: compact representation of complex systems. Key changes: Tokens are becoming individuals; Transitions enabled if functions at incoming edges true; Individuals generated by firing transitions defined through functions Changes can be explained by folding and unfolding C/E nets, semantics can be defined by C/E nets. - 41 - e 5 e 1 s 5 f 1 s 1 f 5 f 2 s 4 s 2 f4 f 3 e 4 e 2 s 3 e 3 Model quite clumsy. Difficult to to extend to to more philosophers. - 42-21

Predicate/transition model of the dining philosophers problem Let x be one of the philosophers, let l(x) be the left fork of x, let r(x) be the right fork of x. p2 p1 p3 f1 f2 f3 Token: individuals. Semantics can be be defined by by replacing net by by equivalent condition/event net. Model can be be extended to to arbitrary numbers. - 43-22