methods for the specification and verification of business processes mpb...
TRANSCRIPT
![Page 1: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/1.jpg)
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
![Page 2: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/2.jpg)
Object
2
Overview of the basic concepts of Petri nets
Free Choice Nets (book, optional reading) https://www7.in.tum.de/~esparza/bookfc.html
![Page 3: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/3.jpg)
Why Petri nets
3
Business process analysis: validation: testing correctness
verification: proving correctness performance: planning and optimization
Use of Petri nets (or alike) visual + formal tool supported
![Page 4: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/4.jpg)
Approaching Petri nets
4
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
![Page 5: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/5.jpg)
Approaching Petri nets
5
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
![Page 6: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/6.jpg)
Finite automata examples
6
![Page 7: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/7.jpg)
Applications
7
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 …
![Page 8: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/8.jpg)
How to
8
Identify the admissible states of the system Optional: Mark some states as error states
Add transitions to move from one state to another
(no transition to recover from error states)
Set the starting state
Optional: Mark some states as final
![Page 9: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/9.jpg)
Example: Turnstile
9
locked
unlocked
card
push
card
push
![Page 10: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/10.jpg)
Example: Vending Machine
10($1.25 per soda)
$0.00
$0.25
$0.25
$0.25 $0.25
$0.25
$0.25, $1.00 $0.25, $1.00 $0.25, $1.00
$0.25, $1.00
$0.25
$1.00 $1.00 $1.00 $1.00
$1.00
$1.00 $1.25 $1.50
$0.50
$1.75
$2.00
start
select select select
select
select
select select select
select
$0.75
![Page 11: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/11.jpg)
Computer controlled characters for games
11
States = characters behaviours
Transitions = labelled by 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
4 AI in Video Games: Pac-Man’s Ghosts
Figure 2: Screenshot of a Pacman Clone
Finite state machines lend themselves to representing the behavior of computer-controller characters in video games. The states of the machine correspond to thecharacter’s behaviors, which change according to various events. These changes aremodeled by transitions in the state diagram. State machines are certainly not themost sophisticated means of implementing artificially intelligent agents in games, butmany games include characters with simple, state-based behaviors that are easily ande↵ectively modeled using state machines.
Here we consider the classic game, Pac-Man. For those unfamiliar with the game-play, Pac-Man requires the player to navigate through a maze, eating pellets andavoiding the ghosts who chase him through the maze. Occasionally, Pac-Man canturn the tables on his pursuers by eating a power pellet, which temporarily grantshim the power to eat the ghosts. When this occurs, the ghosts’ behavior changes,and instead of chasing Pac-Man they try to avoid him.
The ghosts in Pac-Man have four behaviors:
1. Randomly wander the maze
5
![Page 12: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/12.jpg)
Example: Pac-Man Ghosts
12
2. Chase Pac-Man, when he is within line of sight
3. Flee Pac-Man, after Pac-Man has consumed a power pellet
4. Return to the central base to regenerate
These four behaviors correspond directly to a four-state DFA. Transitions aredictated by the situation in the game. For instance, a ghost DFA in state 2 (ChasePac-Man) will transition to state 3 (Flee) when Pac-Man consumes a power pellet.
For a further discussion of state machines for game AI, see http://research.
ncl.ac.uk/game/mastersdegree/gametechnologies/aifinitestatemachines/.
Wander the Mazestart Chase Pac-Man
Return to Base Flee Pac-Man
SpotPac-Man
LosePac-Man
Pac-Man EatsPower Pellet
Power PelletExpires
Pac-Man EatsPower Pellet
Eaten byPac-Man
ReachCentral Base
Figure 3: Behavior of a Pac-Man Ghost
5 Internet Protocols: TCP as a DFA
Internet protocols also lend themselves to descriptions as DFAs. The state diagrambelow represents a simplified version of the Transmission Control Protocol (TCP).
6
![Page 13: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/13.jpg)
Example: Pac-Man Ghosts
13
2. Chase Pac-Man, when he is within line of sight
3. Flee Pac-Man, after Pac-Man has consumed a power pellet
4. Return to the central base to regenerate
These four behaviors correspond directly to a four-state DFA. Transitions aredictated by the situation in the game. For instance, a ghost DFA in state 2 (ChasePac-Man) will transition to state 3 (Flee) when Pac-Man consumes a power pellet.
For a further discussion of state machines for game AI, see http://research.
ncl.ac.uk/game/mastersdegree/gametechnologies/aifinitestatemachines/.
Wander the Mazestart Chase Pac-Man
Return to Base Flee Pac-Man
SpotPac-Man
LosePac-Man
Pac-Man EatsPower Pellet
Power PelletExpires
Pac-Man EatsPower Pellet
Eaten byPac-Man
ReachCentral Base
Figure 3: Behavior of a Pac-Man Ghost
5 Internet Protocols: TCP as a DFA
Internet protocols also lend themselves to descriptions as DFAs. The state diagrambelow represents a simplified version of the Transmission Control Protocol (TCP).
6
![Page 14: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/14.jpg)
Example: Pac-Man Ghosts
14
2. Chase Pac-Man, when he is within line of sight
3. Flee Pac-Man, after Pac-Man has consumed a power pellet
4. Return to the central base to regenerate
These four behaviors correspond directly to a four-state DFA. Transitions aredictated by the situation in the game. For instance, a ghost DFA in state 2 (ChasePac-Man) will transition to state 3 (Flee) when Pac-Man consumes a power pellet.
For a further discussion of state machines for game AI, see http://research.
ncl.ac.uk/game/mastersdegree/gametechnologies/aifinitestatemachines/.
Wander the Mazestart Chase Pac-Man
Return to Base Flee Pac-Man
SpotPac-Man
LosePac-Man
Pac-Man EatsPower Pellet
Power PelletExpires
Pac-Man EatsPower Pellet
Eaten byPac-Man
ReachCentral Base
Figure 3: Behavior of a Pac-Man Ghost
5 Internet Protocols: TCP as a DFA
Internet protocols also lend themselves to descriptions as DFAs. The state diagrambelow represents a simplified version of the Transmission Control Protocol (TCP).
6
![Page 15: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/15.jpg)
Example: Pac-Man Ghosts
15
2. Chase Pac-Man, when he is within line of sight
3. Flee Pac-Man, after Pac-Man has consumed a power pellet
4. Return to the central base to regenerate
These four behaviors correspond directly to a four-state DFA. Transitions aredictated by the situation in the game. For instance, a ghost DFA in state 2 (ChasePac-Man) will transition to state 3 (Flee) when Pac-Man consumes a power pellet.
For a further discussion of state machines for game AI, see http://research.
ncl.ac.uk/game/mastersdegree/gametechnologies/aifinitestatemachines/.
Wander the Mazestart Chase Pac-Man
Return to Base Flee Pac-Man
SpotPac-Man
LosePac-Man
Pac-Man EatsPower Pellet
Power PelletExpires
Pac-Man EatsPower Pellet
Eaten byPac-Man
ReachCentral Base
Figure 3: Behavior of a Pac-Man Ghost
5 Internet Protocols: TCP as a DFA
Internet protocols also lend themselves to descriptions as DFAs. The state diagrambelow represents a simplified version of the Transmission Control Protocol (TCP).
6
![Page 16: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/16.jpg)
Example: Pac-Man Ghosts
16
2. Chase Pac-Man, when he is within line of sight
3. Flee Pac-Man, after Pac-Man has consumed a power pellet
4. Return to the central base to regenerate
These four behaviors correspond directly to a four-state DFA. Transitions aredictated by the situation in the game. For instance, a ghost DFA in state 2 (ChasePac-Man) will transition to state 3 (Flee) when Pac-Man consumes a power pellet.
For a further discussion of state machines for game AI, see http://research.
ncl.ac.uk/game/mastersdegree/gametechnologies/aifinitestatemachines/.
Wander the Mazestart Chase Pac-Man
Return to Base Flee Pac-Man
SpotPac-Man
LosePac-Man
Pac-Man EatsPower Pellet
Power PelletExpires
Pac-Man EatsPower Pellet
Eaten byPac-Man
ReachCentral Base
Figure 3: Behavior of a Pac-Man Ghost
5 Internet Protocols: TCP as a DFA
Internet protocols also lend themselves to descriptions as DFAs. The state diagrambelow represents a simplified version of the Transmission Control Protocol (TCP).
6
![Page 17: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/17.jpg)
Example: Pac-Man Ghosts
17
2. Chase Pac-Man, when he is within line of sight
3. Flee Pac-Man, after Pac-Man has consumed a power pellet
4. Return to the central base to regenerate
These four behaviors correspond directly to a four-state DFA. Transitions aredictated by the situation in the game. For instance, a ghost DFA in state 2 (ChasePac-Man) will transition to state 3 (Flee) when Pac-Man consumes a power pellet.
For a further discussion of state machines for game AI, see http://research.
ncl.ac.uk/game/mastersdegree/gametechnologies/aifinitestatemachines/.
Wander the Mazestart Chase Pac-Man
Return to Base Flee Pac-Man
SpotPac-Man
LosePac-Man
Pac-Man EatsPower Pellet
Power PelletExpires
Pac-Man EatsPower Pellet
Eaten byPac-Man
ReachCentral Base
Figure 3: Behavior of a Pac-Man Ghost
5 Internet Protocols: TCP as a DFA
Internet protocols also lend themselves to descriptions as DFAs. The state diagrambelow represents a simplified version of the Transmission Control Protocol (TCP).
6
![Page 18: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/18.jpg)
Example: Pac-Man Ghosts
18
2. Chase Pac-Man, when he is within line of sight
3. Flee Pac-Man, after Pac-Man has consumed a power pellet
4. Return to the central base to regenerate
These four behaviors correspond directly to a four-state DFA. Transitions aredictated by the situation in the game. For instance, a ghost DFA in state 2 (ChasePac-Man) will transition to state 3 (Flee) when Pac-Man consumes a power pellet.
For a further discussion of state machines for game AI, see http://research.
ncl.ac.uk/game/mastersdegree/gametechnologies/aifinitestatemachines/.
Wander the Mazestart Chase Pac-Man
Return to Base Flee Pac-Man
SpotPac-Man
LosePac-Man
Pac-Man EatsPower Pellet
Power PelletExpires
Pac-Man EatsPower Pellet
Eaten byPac-Man
ReachCentral Base
Figure 3: Behavior of a Pac-Man Ghost
5 Internet Protocols: TCP as a DFA
Internet protocols also lend themselves to descriptions as DFAs. The state diagrambelow represents a simplified version of the Transmission Control Protocol (TCP).
6
![Page 19: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/19.jpg)
Exercises
19
Without adding states, draw the automata for a SuperGhost that can’t be eaten. It chases Pac-Man when the power pill is eaten, but 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.
![Page 20: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/20.jpg)
From automata to Petri nets
20
![Page 21: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/21.jpg)
DFA
21
A Deterministic Finite Automaton (DFA) is a tuple A = (Q,⌃, �, q0, F ),where
• Q is a finite set of states;
• ⌃ is a finite set of input symbols;
• � : Q⇥ ⌃ ! Q is the transition function;
• q0 2 Q is the initial state (also called start state);
• F ✓ Q is the set of final states (also accepting states)
![Page 22: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/22.jpg)
Kleene-star notation A*
22
Given a set A we denote by A⇤
the set of finite sequences of elements in A, i.e.:
A⇤= { a1 · · · an | n � 0 ^ a1, ..., an 2 A }
We denote the empty sequence by ✏ 2 A⇤
For example:
A = { a, b } A⇤= { ✏, a, b, aa, ab, ba, bb, aaa, aab, ... }
![Page 23: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/23.jpg)
Extended transit. func. (destination function)
23
Given A = (Q,⌃, �, q0, F ), we define
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)
![Page 24: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/24.jpg)
String processing
24
Given A = (Q,⌃, �, q0, F ) and w 2 ⌃⇤ we say that A accept w i↵
b�(q0, w) 2 F
The language of A = (Q,⌃, �, q0, F ) is
L(A) = { w | b�(q0, w) 2 F }
![Page 25: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/25.jpg)
Transition diagram
25
We represent A = (Q,⌃, �, q0, F ) as a graph s.t.
• Q is the set of nodes;
• { q a�! q0 | q0 = �(q, a) } is the set of arcs.
Plus some graphical conventions:
• there is one special arrow Start with
Start�! q0
• nodes in F are marked by double circles;
• nodes in Q \ F are marked by single circles.
![Page 26: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/26.jpg)
String processing as paths
26
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
![Page 27: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/27.jpg)
DFA: example
27
Start
q0
q1
q20 1
01 0 , 1
1 0 0 1 1 0
1 1 1 0 0 0q0 q0 q0 q0
q1
q1 q1 62 F
2 Fq1q0 q0 q1 q2 q2 q2
![Page 28: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/28.jpg)
DFA: question time
28
Start
q0 q1 q20 1
01 0 , 1
Does it accept 100 ? Does it accept 011 ? Does it accept 1010010 ? What is L(A) ?
![Page 29: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/29.jpg)
Transition table
30
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 *
![Page 30: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/30.jpg)
Transition table
31
�(q, a)q
a
!
⇤
⇤
![Page 31: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/31.jpg)
DFA: example
32
Start
q0 q1 q20 1
01 0 , 1
0 1
! q0 q1 q0q1 q1 q2
? q2 q2 q2
![Page 32: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/32.jpg)
DFA: exercise
33
Does it accept 100 ? Does it accept 1010 ? Write its transition table. What is L(A) ?
![Page 33: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/33.jpg)
NFA
34
ANon-deterministic Finite Automaton (NFA) is a tuple A = (Q,⌃, �, q0, F ),where
• Q is a finite set of states;
• ⌃ is a finite set of input symbols;
• � : Q⇥ ⌃ ! }(Q) is the transition function;
• q0 2 Q is the initial state (also called start state);
• F ✓ Q is the set of final states (also accepting states)
powerset of Q = set of sets over Q
![Page 34: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/34.jpg)
NFA: example
35
Start
q0 q1 q20 1
0 , 1
Can you explain why it is not a DFA?
![Page 35: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/35.jpg)
NFA: example
36
Start
q0 q1 q20 1
0 , 1
Can you explain why it is not a DFA?
0 , 10
![Page 36: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/36.jpg)
Reshaping
37
![Page 37: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/37.jpg)
Step 1: get a token
38
Start
q0 q1 q20 1
0 , 1
10 0 0 1
![Page 38: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/38.jpg)
Step 2: forget initial state decoration
39
q0 q1 q20 1
0 , 1
![Page 39: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/39.jpg)
Step 3: transitions as boxes
40
q0 q1 q200
0
1
1
![Page 40: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/40.jpg)
Step 4: forget final states
41
q0 q1 q200
0
1
1
![Page 41: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/41.jpg)
Step 5: allow for more tokens
42
q0 q1 q200
0
1
1
![Page 42: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/42.jpg)
Example: token game
43
q0 q1 q200
0
1
1
01 1 0 1
![Page 43: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/43.jpg)
Step 6: allow for more arcs
44
q0 q1 q200
0
1
1
![Page 44: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/44.jpg)
Terminology
45
0PlaceTransition
Arc Token
![Page 45: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/45.jpg)
Example: token game
46
q0 q1 q200
0
1
1
![Page 46: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/46.jpg)
Example: token game
47
q0 q1 q200
0
1
1
![Page 47: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/47.jpg)
Example: token game
48
q0 q1 q200
0
1
1
![Page 48: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/48.jpg)
Example: token game
49
q0 q1 q200
0
1
1
![Page 49: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/49.jpg)
Example: token game
50
q0 q1 q200
0
1
1
![Page 50: Methods for the specification and verification of business processes MPB …didawiki.di.unipi.it/.../mpb/07-nets-intro-2015.pdf · 2015-10-14 · Example: Pac-Man Ghosts 12 2. Chase](https://reader033.vdocument.in/reader033/viewer/2022041703/5e430fbe405f3a0bfe4e2eb0/html5/thumbnails/50.jpg)
Some hints
51
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)