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

Similar documents
Business Processes Modelling MPB (6 cfu, 295AA)

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

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

Finite Automata. Finite Automata

Let us first give some intuitive idea about a state of a system and state transitions before describing finite automata.

Extended transition function of a DFA

Finite Automata. BİL405 - Automata Theory and Formal Languages 1

COM364 Automata Theory Lecture Note 2 - Nondeterminism

UNIT-I. Strings, Alphabets, Language and Operations

CISC 4090 Theory of Computation

Deterministic Finite Automaton (DFA)


UNIT-II. NONDETERMINISTIC FINITE AUTOMATA WITH ε TRANSITIONS: SIGNIFICANCE. Use of ε-transitions. s t a r t. ε r. e g u l a r

Finite Automata and Languages

Lecture 3: Nondeterministic Finite Automata

Sri vidya college of engineering and technology

Chapter Two: Finite Automata

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

Kleene Algebras and Algebraic Path Problems

CSE 311 Lecture 23: Finite State Machines. Emina Torlak and Kevin Zatloukal

CMPSCI 250: Introduction to Computation. Lecture #22: From λ-nfa s to NFA s to DFA s David Mix Barrington 22 April 2013

Uses of finite automata

Nondeterministic Finite Automata

Analysis and Optimization of Discrete Event Systems using Petri Nets

CS 208: Automata Theory and Logic

Finite-State Machines (Automata) lecture 12

Nondeterminism and Epsilon Transitions

CS 154, Lecture 2: Finite Automata, Closure Properties Nondeterminism,

Deterministic Finite Automata (DFAs)

Introduction to Computers & Programming

Theory of computation: initial remarks (Chapter 11)

Deterministic Finite Automata. Non deterministic finite automata. Non-Deterministic Finite Automata (NFA) Non-Deterministic Finite Automata (NFA)

Deterministic Finite Automata (DFAs)

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Chapter 5. Finite Automata

Decision, Computation and Language

Nondeterministic Finite Automata and Regular Expressions

Nondeterminism. September 7, Nondeterminism

Course 4 Finite Automata/Finite State Machines

CHAPTER 1 Regular Languages. Contents

CISC 4090: Theory of Computation Chapter 1 Regular Languages. Section 1.1: Finite Automata. What is a computer? Finite automata

1 More finite deterministic automata

Regular Expressions and Language Properties

Deterministic Finite Automata (DFAs)

UNIT-III REGULAR LANGUAGES

Finite-state machines (FSMs)

HKN CS/ECE 374 Midterm 1 Review. Nathan Bleier and Mahir Morshed

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

Nondeterministic Finite Automata. Nondeterminism Subset Construction

Lecture 17: Language Recognition

CS:4330 Theory of Computation Spring Regular Languages. Finite Automata and Regular Expressions. Haniel Barbosa

Lecture 2: Connecting the Three Models

CSC236 Week 10. Larry Zhang

Introduction to the Theory of Computation. Automata 1VO + 1PS. Lecturer: Dr. Ana Sokolova.

Automata Theory. Lecture on Discussion Course of CS120. Runzhe SJTU ACM CLASS

Automata and Languages

2. Elements of the Theory of Computation, Lewis and Papadimitrou,

September 11, Second Part of Regular Expressions Equivalence with Finite Aut

Automata and Formal Languages - CM0081 Determinist Finite Automata

CS 121, Section 2. Week of September 16, 2013

Clarifications from last time. This Lecture. Last Lecture. CMSC 330: Organization of Programming Languages. Finite Automata.

Automata Theory, Computability and Complexity

Languages. A language is a set of strings. String: A sequence of letters. Examples: cat, dog, house, Defined over an alphabet:

Finite Automata Part One

Deterministic Finite Automata

Closure under the Regular Operations

Theory of computation: initial remarks (Chapter 11)

INF Introduction and Regular Languages. Daniel Lupp. 18th January University of Oslo. Department of Informatics. Universitetet i Oslo

Theory of Computation

Tasks of lexer. CISC 5920: Compiler Construction Chapter 2 Lexical Analysis. Tokens and lexemes. Buffering

Introduction to Theoretical Computer Science. Motivation. Automata = abstract computing devices

Finite Automata. Dr. Neil T. Dantam. Fall CSCI-561, Colorado School of Mines. Dantam (Mines CSCI-561) Finite Automata Fall / 43

Chapter Five: Nondeterministic Finite Automata

Introduction to Finite Automaton

Finite Automata Part Two

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Nondeterministic finite automata

CSE 105 THEORY OF COMPUTATION

Automata & languages. A primer on the Theory of Computation. Laurent Vanbever. ETH Zürich (D-ITET) September,

What we have done so far

Where does it come from?

1. Draw a parse tree for the following derivation: S C A C C A b b b b A b b b b B b b b b a A a a b b b b a b a a b b 2. Show on your parse tree u,

CSE 211. Pushdown Automata. CSE 211 (Theory of Computation) Atif Hasan Rahman

Automata: a short introduction

10. Finite Automata and Turing Machines

CSE 311: Foundations of Computing. Lecture 23: Finite State Machine Minimization & NFAs

Recap DFA,NFA, DTM. Slides by Prof. Debasis Mitra, FIT.

Closure Properties of Regular Languages. Union, Intersection, Difference, Concatenation, Kleene Closure, Reversal, Homomorphism, Inverse Homomorphism

Regular Expressions. Definitions Equivalence to Finite Automata

CS 581: Introduction to the Theory of Computation! Lecture 1!

Outline. Nondetermistic Finite Automata. Transition diagrams. A finite automaton is a 5-tuple (Q, Σ,δ,q 0,F)

Computer Sciences Department

Automata and Formal Languages - CM0081 Non-Deterministic Finite Automata

Finite Automata. Dr. Neil T. Dantam. Fall CSCI-561, Colorado School of Mines. Dantam (Mines CSCI-561) Finite Automata Fall / 35

Deterministic Finite Automata (DFAs)

Finite Automata Part One

CMP 309: Automata Theory, Computability and Formal Languages. Adapted from the work of Andrej Bogdanov

CS 154, Lecture 3: DFA NFA, Regular Expressions

Some useful tasks involving language. Finite-State Machines and Regular Languages. More useful tasks involving language. Regular expressions

T (s, xa) = T (T (s, x), a). The language recognized by M, denoted L(M), is the set of strings accepted by M. That is,

Transcription:

Methods for the specification and verification of business processes MPB (6 cfu, 295AA) Roberto Bruni http://www.di.unipi.it/~bruni 07 - Introduction to nets 1

Object Overview of the basic concepts of Petri nets Free Choice Nets (book, optional reading) https://www7.in.tum.de/~esparza/bookfc.html 2

Why Petri nets? Business process analysis: validation: testing correctness verification: proving correctness performance: planning and optimization Use of Petri nets (or alike) visual + formal tool supported 3

Approaching Petri nets Are you familiar with automata / transition systems? They are fine for sequential protocols / systems but do not capture concurrent behaviour directly A Petri net is a mathematical model of a parallel and concurrent system in the same way that a finite automaton is a mathematical model of a sequential system 4

Approaching Petri nets Petri net theory can be studied at several level of details We study some basics aspects, relevant to the analysis of business processes Petri nets have a faithful and convenient graphical representation, that we introduce and motivate next 5

Finite automata examples 6

Applications Finite automata are widely used, e.g., in protocol analysis, text parsing, video game character behavior, security analysis, CPU control units, natural language processing, speech recognition, mechanical devices (like elevators, vending machines, traffic lights) and many more 7

How to 1. Identify the admissible states of the system (Optional: mark some states as error states) 2. Add transitions to move from one state to another (no transition to recover from error states) 3. Set the initial state 4. (Optional: mark some states as final states) 8

Example: Turnstile 9

Example: Turnstile locked 9

Example: Turnstile locked unlocked 9

Example: Turnstile push locked unlocked 9

Example: Turnstile push locked push unlocked 9

Example: Turnstile push locked card push unlocked 9

Example: Turnstile push locked card unlocked push card 9

Example: Turnstile push locked card unlocked push card 9

Example: Vending Machine start $0.00 10 ($1.25 per soda)

Example: Vending Machine $0.25 start $0.00 $0.25 10 ($1.25 per soda)

Example: Vending Machine $0.25 $0.25 start $0.00 $0.25 $0.50 10 ($1.25 per soda)

Example: Vending Machine $0.25 $0.25 $0.25 start $0.00 $0.25 $0.50 $0.75 10 ($1.25 per soda)

Example: Vending Machine $0.25 $0.25 $0.25 start $0.00 $0.25 $0.50 $0.75 $0.25 $1.00 10 ($1.25 per soda)

Example: Vending Machine $0.25 $0.25 $0.25 start $0.00 $0.25 $0.50 $0.75 $0.25 $0.25 $1.00 $1.25 10 ($1.25 per soda)

Example: Vending Machine $0.25 $0.25 $0.25 start $0.00 $0.25 $0.50 $0.75 $1.00 $1.00 $1.00 $1.00 $0.25 $0.25 $1.00 $1.25 $1.50 $1.75 $1.00 $2.00 10 ($1.25 per soda)

Example: Vending Machine $0.25 $0.25 $0.25 start $0.00 $0.25 $0.50 $0.75 $1.00 $1.00 $1.00 $1.00 $0.25 $0.25 $1.00 $1.25 $1.50 $1.75 $1.00 $0.25, $1.00 $0.25, $1.00 $0.25, $1.00 $2.00 $0.25, $1.00 10 ($1.25 per soda)

Example: Vending Machine $0.25 $0.25 $0.25 start $0.00 $0.25 $0.50 $0.75 $1.00 $1.00 $1.00 $1.00 $0.25 select select select $0.25 $1.00 $1.25 $1.50 $1.75 $1.00 select $0.25, $1.00 $0.25, $1.00 $0.25, $1.00 $2.00 $0.25, $1.00 10 ($1.25 per soda)

Example: Vending Machine select select select $0.25 $0.25 $0.25 select start $0.00 $0.25 $0.50 $0.75 $1.00 $1.00 $1.00 $1.00 $0.25 select select select select $0.25 $1.00 $1.25 $1.50 $1.75 $1.00 select $0.25, $1.00 $0.25, $1.00 $0.25, $1.00 $2.00 $0.25, $1.00 10 ($1.25 per soda)

Computer controlled characters for games States = characters behaviours Transitions = events that cause a change in behaviour Example: Pac-man moves in a maze wants to eat pills is chased by ghosts by eating power pills, pac-man can defeat ghosts 11

Example: Pac-Man Ghosts start Wander the Maze Reach Central Base Power Pellet Expires Spot Pac-Man Lose Pac-Man Pac-Man Eats Power Pellet Chase Pac-Man Pac-Man Eats Power Pellet Return to Base Eaten by Pac-Man Flee Pac-Man 12

Example: Pac-Man Ghosts start Wander the Maze Reach Central Base Power Pellet Expires Spot Pac-Man Lose Pac-Man Pac-Man Eats Power Pellet Chase Pac-Man Pac-Man Eats Power Pellet Return to Base Eaten by Pac-Man Flee Pac-Man 13

Example: Pac-Man Ghosts start Wander the Maze Reach Central Base Power Pellet Expires Spot Pac-Man Lose Pac-Man Pac-Man Eats Power Pellet Chase Pac-Man Pac-Man Eats Power Pellet Return to Base Eaten by Pac-Man Flee Pac-Man 14

Example: Pac-Man Ghosts start Wander the Maze Reach Central Base Power Pellet Expires Spot Pac-Man Lose Pac-Man Pac-Man Eats Power Pellet Chase Pac-Man Pac-Man Eats Power Pellet Return to Base Eaten by Pac-Man Flee Pac-Man 15

Example: Pac-Man Ghosts start Wander the Maze Reach Central Base Power Pellet Expires Spot Pac-Man Lose Pac-Man Pac-Man Eats Power Pellet Chase Pac-Man Pac-Man Eats Power Pellet Return to Base Eaten by Pac-Man Flee Pac-Man 16

Example: Pac-Man Ghosts start Wander the Maze Reach Central Base Power Pellet Expires Spot Pac-Man Lose Pac-Man Pac-Man Eats Power Pellet Chase Pac-Man Pac-Man Eats Power Pellet Return to Base Eaten by Pac-Man Flee Pac-Man 17

Example: Pac-Man Ghosts start Wander the Maze Reach Central Base Power Pellet Expires Spot Pac-Man Lose Pac-Man Pac-Man Eats Power Pellet Chase Pac-Man Pac-Man Eats Power Pellet Return to Base Eaten by Pac-Man Flee Pac-Man 18

Exercises Without adding states, draw the automata for a SuperGhost that can t be eaten. It chases Pac-Man when the power pill is eaten, and it returns to base if Pac-Man eats a piece of fruit. Choose a favourite (video) game, and try drawing the state automata for one of the computer controlled characters in that game. 19

From automata to Petri nets 20

Some basis Are you familiar with the following concepts? Set notation ; a 2 A A B A B }(A) Functions f : A! B Predicate logic tt P ^ Q P _ Q P P! Q 9x.P (x) 8x.P (x) Induction principle (base case + inductive case) ( P (0) ^ 8n.( P (n) ) P (succ(n)) ) ) ) 8n.P (n) 21

DFA A Deterministic Finite Automaton (DFA) isatuplea =(Q,,,q 0,F), where Q is a finite set of states; is a finite set of input symbols; : Q! Q is the transition function; q 0 2 Q is the initial state (also called start state); F Q is the set of final states (also accepting states) 22

Kleene-star notation A* Given a set A we denote by A the set of finite sequences of elements in A, i.e.: A = { a 1 a n n 0 ^ a 1,...,a n 2 A } We denote the empty sequence by 2 A For example: A = { a, b } A = {,a,b,aa,ab,ba,bb,aaa,aab,...} 23

Extended transition function (destination function) Given A =(Q,,,q 0,F), wedefine b : Q! Q by induction: base case: For any q 2 Q we let b (q, ) =q inductive case: For any q 2 Q, a 2,w 2 we let b (q, wa) = ( b (q, w),a) ( b (q, w) returns the state reached from q by observing w) 24

String processing Given A =(Q,,,q 0,F) and w 2 we say that A accept w i b (q0,w) 2 F The language of A =(Q,,,q 0,F) is L(A) ={ w b (q0,w) 2 F } 25

Transition diagram We represent A =(Q,,,q 0,F) as a graph s.t. Q is the set of nodes; { q a! q 0 q 0 = (q, a) } is the set of arcs. Plus some graphical conventions: there is one special arrow Start with Start! q 0 nodes in F are marked by double circles; nodes in Q \ F are marked by single circles. 26

String processing as paths A DFA accepts a string w, if there is a path in its transition diagram such that: it starts from the initial state it ends in one final state the sequence of labels in the path is exactly w 27

DFA: example Start 0 1 q 0 q 1 q 2 1 0 0, 1 1 1 1 0 0 0 1 0 0 1 1 0 28

DFA: example Start 0 1 q 0 q 1 q 2 1 0 0, 1 q 0 1 1 1 0 0 0 1 0 0 1 1 0 28

DFA: example Start 0 1 q 0 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 1 0 0 0 1 0 0 1 1 0 28

DFA: example Start 0 1 q 0 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 0 0 0 1 0 0 1 1 0 28

DFA: example Start 0 1 q 0 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 q 0 0 0 0 1 0 0 1 1 0 28

DFA: example Start q 0 0 1 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 q 0 0 q 1 0 0 1 0 0 1 1 0 28

DFA: example Start q 0 0 1 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 q 0 0 q 1 0 q 1 0 1 0 0 1 1 0 28

DFA: example Start q 0 0 1 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 q 0 0 q 1 0 q 1 0 q 1 1 0 0 1 1 0 28

DFA: example Start q 0 0 1 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 q 0 0 q 1 0 q 1 0 q 1 2 F 1 0 0 1 1 0 28

DFA: example Start q 0 0 1 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 q 0 0 q 1 0 q 1 0 q 1 2 F q 0 1 0 0 1 1 0 28

DFA: example Start q 0 0 1 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 q 0 0 q 1 0 q 1 0 q 1 2 F q 0 1 q 0 0 0 1 1 0 28

DFA: example Start q 0 0 1 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 q 0 0 q 1 0 q 1 0 q 1 2 F q 0 1 q 0 0 q 1 0 1 1 0 28

DFA: example Start q 0 0 1 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 q 0 0 q 1 0 q 1 0 q 1 2 F q 0 1 q 0 0 q 1 0 q 1 1 1 0 28

DFA: example Start q 0 0 1 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 q 0 0 q 1 0 q 1 0 q 1 2 F q 0 1 q 0 0 q 1 0 q 1 1 q 2 1 0 28

DFA: example Start q 0 0 1 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 q 0 0 q 1 0 q 1 0 q 1 2 F q 0 1 q 0 0 q 1 0 q 1 1 q 2 1 q 2 0 28

DFA: example Start q 0 0 1 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 q 0 0 q 1 0 q 1 0 q 1 2 F q 0 1 q 0 0 q 1 0 q 1 1 q 2 1 q 2 0 q 2 28

DFA: example Start q 0 0 1 q 1 q 2 1 0 0, 1 q 0 1 q 0 1 q 0 1 q 0 0 q 1 0 q 1 0 q 1 2 F q 0 1 q 0 0 q 1 0 q 1 1 q 2 1 q 2 0 q 2 2 F 28

DFA: question time Start 0 1 q 0 q 1 q 2 1 0 0, 1 Does it accept 100? Does it accept 011? Does it accept 1010010? What is L(A)? 29

Transition table Conventional tabular representation its rows are in correspondence with states its columns are in correspondence with input symbols its entries are the states reached after the transition Plus some decoration start state decorated with an arrow all final states decorated with * 34

Transition table a! q (q, a) 35

Start DFA: example 0 1 q 0 q 1 q 2 1 0 0, 1 0 1! q 0 q 1 q 0 q 1 q 1 q 2? q 2 q 2 q 2 36

DFA: exercise Does it accept 100? Does it accept 1010? Write its transition table. What is L(A)? 37

NFA A Non-deterministic Finite Automaton (NFA)isatupleA =(Q,,,q 0,F), where Q is a finite set of states; is a finite set of input symbols; powerset of Q = set of sets over Q : Q! }(Q) is the transition function; q 0 2 Q is the initial state (also called start state); F Q is the set of final states (also accepting states) 38

NFA: example Start 0 1 q 0 q 1 q 2 0, 1 Can you explain why it is not a DFA? 39

Reshaping 41

Step 1: get a token Start 0 1 q 0 q 1 q 2 0, 1 0 1 0 0 1 42

Step 1: get a token Start 0 1 q 0 q 1 q 2 0, 1 0 1 0 0 1 42

Step 1: get a token Start 0 1 q 0 q 1 q 2 0, 1 0 1 0 0 1 42

Step 1: get a token Start 0 1 q 0 q 1 q 2 0, 1 0 1 0 0 1 42

Step 1: get a token Start 0 1 q 0 q 1 q 2 0, 1 0 1 0 0 1 42

Step 1: get a token Start 0 1 q 0 q 1 q 2 0, 1 0 1 0 0 1 42

Step 1: get a token Start 0 1 q 0 q 1 q 2 0, 1 0 1 0 0 1 42

Step 2: forget initial state decoration 0 1 q 0 q 1 q 2 0, 1 43

Step 3: transitions as 1 boxes q 0 0 q 1 1 q 2 0 44

Step 4: forget final states 1 q 0 0 q 1 1 q 2 0 45

Step 5: allow for more 1 tokens q 0 0 q 1 1 q 2 0 46

Example: token game 1 q 0 0 q 1 1 q 2 0 47

Example: token game 1 q 0 0 q 1 1 q 2 0 1 47

Example: token game 1 q 0 0 q 1 1 q 2 0 1 0 47

Example: token game 1 q 0 0 q 1 1 q 2 0 1 0 1 47

Example: token game 1 q 0 0 q 1 1 q 2 0 1 0 1 0 47

Example: token game 1 q 0 0 q 1 1 q 2 0 1 0 1 0 1 47

Step 6: allow for more 1 arcs q 0 0 q 1 1 q 2 0 48

Terminology 0 Arc Token Transition Place 49

Example: token game 1 q 0 0 q 1 1 q 2 0 50

Example: token game 1 q 0 0 q 1 1 q 2 0 51

Example: token game 1 q 0 0 q 1 1 q 2 0 51

Example: token game 1 q 0 0 q 1 1 q 2 0 52

Example: token game 1 q 0 0 q 1 1 q 2 0 52

Example: token game 1 q 0 0 q 1 1 q 2 0 53

Example: token game 1 q 0 0 q 1 1 q 2 0 53

Example: token game 1 q 0 0 q 1 1 q 2 0 54

Some hints Nets are bipartite graphs: arcs never connect two places arcs never connect two transitions Static structure for dynamic systems: places, transitions, arcs do not change tokens move around places Places are passive components Transitions are active components: tokens do not flow! (they are removed or freshly created) 55