Business Processes Modelling MPB (6 cfu, 295AA)

Similar documents
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. BİL405 - Automata Theory and Formal Languages 1

Finite Automata. Finite Automata

Extended transition function of a DFA

COM364 Automata Theory Lecture Note 2 - Nondeterminism

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

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

Deterministic Finite Automaton (DFA)

CISC 4090 Theory of Computation

Finite Automata and Languages

Sri vidya college of engineering and technology

UNIT-I. Strings, Alphabets, Language and Operations

CS 208: Automata Theory and Logic

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

Nondeterministic Finite Automata

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


Nondeterministic Finite Automata and Regular Expressions

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

Theory of computation: initial remarks (Chapter 11)

Chapter Two: Finite Automata

Kleene Algebras and Algebraic Path Problems

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

Lecture 3: Nondeterministic Finite Automata

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

Nondeterministic Finite Automata. Nondeterminism Subset Construction

Finite-State Machines (Automata) lecture 12

Nondeterminism and Epsilon Transitions

Automata and Languages

Chapter 5. Finite Automata

Introduction to Computers & Programming

Decision, Computation and Language

Regular Expressions and Language Properties

Uses of finite automata

UNIT-III REGULAR LANGUAGES

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

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

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

Course 4 Finite Automata/Finite State Machines

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

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

Regular Expressions. Definitions Equivalence to Finite Automata

Automata and Formal Languages - CM0081 Determinist Finite Automata

Automata and Formal Languages - CM0081 Non-Deterministic Finite Automata

CHAPTER 1 Regular Languages. Contents

Chapter Five: Nondeterministic Finite Automata

Nondeterministic finite automata

Deterministic Finite Automata (DFAs)

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

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

Lecture 17: Language Recognition

Analysis and Optimization of Discrete Event Systems using Petri Nets

Deterministic Finite Automata (DFAs)

cse303 ELEMENTS OF THE THEORY OF COMPUTATION Professor Anita Wasilewska

Nondeterminism. September 7, Nondeterminism

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

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

CSC236 Week 10. Larry Zhang

1 More finite deterministic automata

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

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

CSC173 Workshop: 13 Sept. Notes

ECS 120 Lesson 15 Turing Machines, Pt. 1

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

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

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,

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Automata: a short introduction

CSE 105 THEORY OF COMPUTATION

Theory of computation: initial remarks (Chapter 11)

Finite-state machines (FSMs)

CMSC 330: Organization of Programming Languages. Theory of Regular Expressions Finite Automata

What we have done so far

Deterministic Finite Automata (DFAs)

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

Theory of Computation

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

Automata Theory, Computability and Complexity

Finite Automata Part Two

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,

Embedded Systems Development

10. Finite Automata and Turing Machines

Finite Automata Part One

Deterministic Finite Automata

Computational Models Lecture 2 1

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

Before we show how languages can be proven not regular, first, how would we show a language is regular?

Lecture 2: Connecting the Three Models

CS 154, Lecture 3: DFA NFA, Regular Expressions

Concatenation. The concatenation of two languages L 1 and L 2

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

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

FORMAL LANGUAGES, AUTOMATA AND COMPUTABILITY

Theory Bridge Exam Example Questions

Finite Automata. Seungjin Choi

Closure under the Regular Operations

Regular languages, regular expressions, & finite automata (intro) CS 350 Fall 2018 gilray.org/classes/fall2018/cs350/

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

Transcription:

Business Processes Modelling 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 define an automaton 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 cases + inductive cases) ( P (0) ^ 8n.( P (n) ) P (succ(n)) ) ) ) 8n.P (n) 24

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,...} 25

Inductive definitions A natural number is either: - 0 - or the successor n+1 of a natural number n A sequence over the alphabet A is either: - the empty sequence ε - or the juxtaposition wa of a sequence w with an element a of A 26

Recursively defined functions Let us define the exponential function base case: for any k>0 we set exp(k,0) = 1 inductive case: for any k>0, n 0 we set exp(k,n+1) = exp(k,n) x k 27

Recursively defined functions Let us define the exponential function base case: for any k>0 we set exp(k,0) = 1 inductive case: for any k>0, n 0 we set exp(k,n+1) = exp(k,n) x k 28

Recursively defined functions Let us define the exponential function base case: for any k>0 we set exp(k,0) = 1 inductive case: for any k>0, n 0 we set exp(k,n+1) = exp(k,n) x k 29

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) 30

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) 31

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) 32

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) 33

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 } 34

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. 35

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 36

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 37

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 37

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 37

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 37

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 37

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 37

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 37

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 37

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 37

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 37

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 37

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 37

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 37

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 37

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 37

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 37

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 37

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)? 38

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 * 43

Transition table a! q (q, a) 44

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 45

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 45

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

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) 47

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

Reshaping 50

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Terminology 0 Arc Token Transition Place 58

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

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

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

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

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

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

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

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

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) 64