Process Algebras and Petri Nets are Discrete Dynamical Systems

Post on 19-Jul-2015

140 views 1 download

transcript

Process Algebras and Petri Nets are DiscreteDynamical Systems

Fernando Lopez Pelayo

Real Time and Concurrent Systems Group

Computing Systems Department of University of Castilla-La Mancha

Facultad de Informatica

Universidad Complutense

December 4th, 2014 Madrid, SPAIN

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.1/55

Objectives

• To get a more usable Process Algebra

• To codify Petri Nets as Discrete DynamicalSystems

• To study the DDS

• To study the ODE

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.2/55

Outline

1. The Problem: LTS generation process• Roughly ROSA• Normal Formed ROSA• A Complete Metric Space• GENETIC ROSA

2. Petri Nets to Dynamical Systems• 1-safe PNs ⇒ Discrete Dynamical Systems I• PNs ⇒ DDSs II• TAPNs ∗ ⇒ DDSs III

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.3/55

Outline

1. The Problem: LTS generation process• Roughly ROSA• Normal Formed ROSA• A Complete Metric Space• GENETIC ROSA

2. Petri Nets to Dynamical Systems• 1-safe PNs ⇒ Discrete Dynamical Systems I• PNs ⇒ DDSs II• TAPNs ∗ ⇒ DDSs III

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.3/55

The Problem: LTS are unbroachable

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.4/55

Markovian Process Algebra ROSA

Three kinds of transitions:

• Non-Deterministic transitions: P −→ Q

Process P can evolve non-deterministically to proc. Q

• Probabilistic Transitions: P −→r Q

Process P can evolve, with probability r to process Q

• Action transitions: Pa,λ−→ Q

Process P can evolve by executing the action labelledby a, taking a time described by an Exponentialrandom distribution with parameter λ, to process Q

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.5/55

Markovian Process Algebra ROSA

Three kinds of transitions:

• Non-Deterministic transitions: P −→ Q

Process P can evolve non-deterministically to proc. Q

• Probabilistic Transitions: P −→r Q

Process P can evolve, with probability r to process Q

• Action transitions: Pa,λ−→ Q

Process P can evolve by executing the action labelledby a, taking a time described by an Exponentialrandom distribution with parameter λ, to process Q

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.5/55

Markovian Process Algebra ROSA

Three kinds of transitions:

• Non-Deterministic transitions: P −→ Q

Process P can evolve non-deterministically to proc. Q

• Probabilistic Transitions: P −→r Q

Process P can evolve, with probability r to process Q

• Action transitions: Pa,λ−→ Q

Process P can evolve by executing the action labelledby a, taking a time described by an Exponentialrandom distribution with parameter λ, to process Q

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.5/55

Markovian Process Algebra ROSA

Three kinds of transitions:

• Non-Deterministic transitions: P −→ Q

Process P can evolve non-deterministically to proc. Q

• Probabilistic Transitions: P −→r Q

Process P can evolve, with probability r to process Q

• Action transitions: Pa,λ−→ Q

Process P can evolve by executing the action labelledby a, taking a time described by an Exponentialrandom distribution with parameter λ, to process Q

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.5/55

Non-deterministic Transitions Rules

(ND-Def) P ⊕ Q −→ P (ND-Def) P ⊕ Q −→ Q

(ND-Ext) P −→ P ′

P + Q −→ P ′ + Q(ND-Ext) Q −→ Q′

P + Q −→ P + Q′

(ND-Pro) P −→ P ′

P ⊕r Q −→ P ′ ⊕r Q(ND-Pro) Q −→ Q′

P ⊕r Q −→ P ⊕r Q′

(ND-Par) P −→ P ′

P ||AQ −→ P ′||AQ(ND-Par) Q −→ Q′

P ||AQ −→ P ||AQ′

(ND-Rec)recX.P −→ P [recX.P/X]

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.6/55

Probabilistic Transition Rules

(P-Def) P ⊕r Q −→r P (P-Def) P ⊕r Q −→1−r Q

(P-Ext) P −→r P ′ ∧ Action[Q]P + Q −→r P ′ + Q

(P-Ext) Q −→t Q′ ∧ Action[P ]P + Q −→t P + Q′

(P-Par) P −→r P ′ ∧ Action[Q]P ||AQ −→r P ′||AQ

(P-Par) Q −→t Q′ ∧ Action[P ]P ||AQ −→t P ||AQ′

(P-BothExt) P −→r P ′ ∧Q −→t Q′

P + Q −→r·t P ′ + Q′ (P-BothPar) P −→r P ′ ∧Q −→t Q′

P ||AQ −→r·t P ′||AQ′

Provided that DS[P ] ∧DS[Q]

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.7/55

Action Transition Rules

(A-Def)a.P

a,∞−→ P

(A-Def)〈a, λ〉.P

a,λ−→ P

(A-Ext) Pa,λ−→ P ′ ∧ a /∈ Type[Available[Q]]

P + Qa,λ−→ P ′

(A-Ext) Qa,λ−→ Q′ ∧ a /∈ Type[Available[P ]]

P + Qa,λ−→ Q′

(A-Par) Pa,λ−→ P ′ ∧ a /∈ Type[Available[Q]] ∪A

P ||AQa,λ−→ P ′||AQ

(A-Par) Qa,λ−→ Q′ ∧ a /∈ Type[Available[P ]] ∪A

P ||AQa,λ−→ P ||AQ′

(A-RaceExt) Pa,∞−→ P ′ ∧Q

a,λ−→ Q′ ∧ λ 6= ∞

P + Qa,∞−→ P ′

(A-RaceExt) Pa,λ−→ P ′ ∧Q

a,∞−→ Q′ ∧ λ 6= ∞

P + Qa,∞−→ Q′

(A-RacePar) Pa,∞−→ P ′ ∧Q

a,λ−→ Q′ ∧ λ 6= ∞∧ a /∈ A

P ||AQa,∞−→ P ′||AQ

(A-RacePar) Pa,λ−→ P ′ ∧Q

a,∞−→ Q′ ∧ λ 6= ∞∧ a /∈ A

P ||AQa,∞−→ P ||AQ′

(A-RaceExtCoop) Pa,λ1−→ P ′ ∧Q

a,λ2−→ Q′ ∧ (λ1 = ∞ = λ2 ∨ λ1 6= ∞ 6= λ2)

P + Qa,λ1+λ2−→ P ′ ⊕ Q′

(A-Syn) Pa,λ1−→ P ′ ∧Q

a,λ2−→ Q′ ∧ a ∈ A

P ||AQa,min[{λ1,λ2}]

−→ P ′||AQ′

(A-RaceParCoop) Pa,λ1−→ P ′ ∧Q

a,λ2−→ Q′ ∧ (λ1 = ∞ = λ2 ∨ λ1 6= ∞ 6= λ2) ∧ a /∈ A

P ||AQa,λ1+λ2−→ P ′||AQ ⊕ P ||AQ′

Provided that DS[P ] ∧DS[Q]

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.8/55

ROSA Specification of MPEG (H.262)

I frame:

I ≡ 〈DCT_QI , α1〉.(〈V LCI , α2〉.out ||A 〈IQ_IDCTI , α3〉.〈FSI , α4〉.ESTP .COMPP .Θ)

P frame:

P ≡ 〈ESTP , γ1〉.〈COMPP , γ2〉.〈ERRORP , γ3〉.〈DCT_Q, γ4〉.(〈V LCP , γ5〉.out ||A 〈IQ_IDCT, γ6〉.〈FSP , γ7〉.Θ)

Bi frames:

Bi≡〈ESTBi, β1〉.〈COMPBi, β2〉.〈ERRORBi, β3〉.〈DCT_Q, β4〉.〈V LCBi, β5〉.out

Θ ≡ (ESTB1.COMPB1 ||A ESTB2.COMPB2)

MPEG Encoding Algorithm:

MPEG ≡ I ||A P ||A B1 ||A B2

A = {ESTP , ESTB1, ESTB2, COMPP , COMPB1, COMPB2}

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.9/55

LTS of MPEG specification

� � � �� � �� ��

�� � � �� � �� � � �� � � �� �� � � �� � � � �� � �� � ��

� � � � � � � � � � �� �� � � � � � � � �� � �� � � � � � �

� ��� � � � � � �� �� � � �� � � � �� � �� �

� ���

��

� � � � � � � � � �� � � � � �� � �� � �� �

� � � �

� � �

� � �

�� � � � ! � � �� � �! � � �� � � � ! �� �� � �! � � � � � � � ! � � �� � �! � � �" " � " ! � � � � � #$ �! � � � � � �

� � �

� � �

�% � %

� � � � �� � � � � #$ �! � � � �

� � � � � � � � � ��

� � �& ' �

# $ � �& ' �

� �� � �& '(� � �& ')

� � �& * �

�� � � �& * �

�" " � " �& *(

� � & *)

# $ � �& *+

� �� � & *,

� � �& *-

� � ! � & . �

�� � �! � & . �

� " " � " ! � & .(

� � & .)

#$ �! � & . +

� � ! �& . �

�� � �! � & . �

� " " � " ! �& .(

� � & .)

#$ �! �& . +

� �� � �& '(# $ � �& ' � � � �& ')

� � ! �& . �

�� � �! � & . �

�� � �! �& . �

�" " � " ! � & .(

�" " � " ! �& .(

� � & .)

� � & .)

# $ �! � & . +

#$ �! �& . +

# $ � �& ' �

� � �& * �

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.10/55

Looking for solutions: Genetics?

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.11/55

Pseudocode - Description

1: P = generateInitialPopulation();

2: evaluate(P );

FITNESS FUNCTION

3: while not stoppingCondition()do4: P0 = selectParents(P );

5: P0 = applyV ariationOperators(P0);

6: evaluate(P0);

FITNESS FUNCTION

7: P1 = selectNewPopulation(P0);

8: end while;9: return the best found solution;

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.12/55

Pseudocode - Description

1: P = generateInitialPopulation();

2: evaluate(P ); FITNESS FUNCTION3: while not stoppingCondition()do4: P0 = selectParents(P );

5: P0 = applyV ariationOperators(P0);

6: evaluate(P0); FITNESS FUNCTION7: P1 = selectNewPopulation(P0);

8: end while;9: return the best found solution;

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.12/55

FITNESS - given 2 target states

� � � �� � �� ��

�� � � �� � �� � � �� � � �� �� � � � � � � � �� � �� � ��

� �� � � � �� � � � � �� � � � � � � � �� � �� � � � � � �

� ��� �� � � � �� �� � � � � � � � �� � �� �

� ���

��

�� � � � �� � � �� � � � � �� � �� � �� �

� � � �

� � �

� � �

�� � � � ! � � �� � � ! � � �� � � � ! � � �� � � ! � � �� � � � ! � � �� � � ! � � �" " � " ! � � � � � #$ � ! � � �� � �

� � �

� � �

�% � %

� �� � �� � �� � #$ � ! � � ��

�� � �� � �� � ��

� � �& ' �

#$ � �& ' �

� �� � �& '(

� � �& ')

� � �& * �

�� � � � & * �

�" " � " � & *(

� � & *)

#$ � �& *+

� �� � & *,

� � � & *-

� � ! � & . �

�� � � ! � & . �

�" " � " ! � & .(

� � & .)

# $ � ! � & . +

� � ! � & . �

�� � � ! � & . �

�" " � " ! � & .(

� � & .)

# $ � ! � & . +

� �� � �& ' (#$ � �& ' � � � �& ')

� � ! � & . �

�� � � ! � & . �

�� � � ! � & . �

�" " � " ! � & .(

�" " � " ! � & .(

� � & .)

� � & .)

#$ � ! � & . +

# $ � ! � & . +

# $ � �& ' �

� � �& * �

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.13/55

FITNESS - given 2 target states

� � � �� � �� ��

�� � � �� � �� � � �� � � �� �� � � � � � � � �� � �� � ��

� �� � � � �� � � � � �� � � � � � � � �� � �� � � � � � �

� ��� �� � � � �� �� � � � � � � � �� � �� �

� ���

��

�� � � � �� � � �� � � � � �� � �� � �� �

� � � �

� � �

� � �

�� � � � ! � � �� � � ! � � �� � � � ! � � �� � � ! � � �� � � � ! � � �� � � ! � � �" " � " ! � � � � � #$ � ! � � �� � �

� � �

� � �

�% � %

� �� � �� � �� � #$ � ! � � ��

�� � �� � �� � ��

� � �& ' �

#$ � �& ' �

� �� � �& '(

� � �& ')

� � �& * �

�� � � � & * �

�" " � " � & *(

� � & *)

#$ � �& *+

� �� � & *,

� � � & *-

� � ! � & . �

�� � � ! � & . �

�" " � " ! � & .(

� � & .)

# $ � ! � & . +

� � ! � & . �

�� � � ! � & . �

�" " � " ! � & .(

� � & .)

# $ � ! � & . +

� �� � �& ' (#$ � �& ' � � � �& ')

� � ! � & . �

�� � � ! � & . �

�� � � ! � & . �

�" " � " ! � & .(

�" " � " ! � & .(

� � & .)

� � & .)

#$ � ! � & . +

# $ � ! � & . +

# $ � �& ' �

� � �& * �

/ 01 02 3 02 4 / 0 1 02 3 02 4

5 5

67 8 0 /9 /: ;<= > ?@ = > A@ < B > ;C D1 B > E 0 1 02 3 02 4 67 8 0 /9 /: ;<= > ? @= > A@ < B > ;C D1 B > E 0 1 02 3 02 4

F F

G G

H H

I I

67 8 0 E 0 67 8 0 /9 /: ;< > ? @ B > E 02 3 02 4 67 8 0 E 0 67 8 0 /9 / : ;< > ? @ B > E 02 3 02 4

J J J J

JK JK

J F 5 F5L

J G 5 G

67 8 0 A@ < M 4 > ;C D1 M 4 0 67 8 0 A @ < M 4 > ;C D1 M 4 0 67 8 0 A@ < M 4 > ;C D1 M 4 > AN N C N M 4 > : ;< 9 > OP ; M 4 > 67 8

JQJ I 5 I

KR

5 J 67 8 0 67 8 0 67 8 0 OP ; M 4 > 67 8

67 8 0 67 8 0 67 8 0 67 8 67 8 0 67 8 0 67 8 0 67 8

J ST 3J ST 4

J STUJ SV 3

J SV 4J SVW

J SVXJ SVY

J SZ 3J SZ 4

J SZ WJ SZ X

J SZ 3J SZ 4

J SZ WJ SZ X

J ST 3J ST 4

J ST UJ SV 3

J SV 4J SV W

J SV XJ SV Y

J SZ 3J SZ 3

J SZ 4J SZ 4

J SZ WJ SZ W

J SZ XJ SZ X

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.13/55

VARIATIONS

• Crossover

• Operational Semantics• Non-deterministic Transition Rules• Probabilistic Transition Rules• Action Transition Rules

• Mutation

• Variation on FITNESS

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.14/55

Towards a Cheaper Semantics for ROSA

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.15/55

A Complete Metric Space

Given a pair of ROSA processes P and Q thedistance between them is d(P, Q)

d(P, Q) =1

2l(PuQ)−

1

2n

• l(T ) is the length of process T

• n = max{l(P ), l(Q)}

• P uQ is the longest common initial part ofprocesses P and Q

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.16/55

Consistent with the Semantics of ROSA

• ∀P, Q ∈ {ROSA}.d(P, Q) = 0 ⇔ P = Q

• Commutability and Associativity of ⊕ and + .Weighted Commutability and W. Assoc. of ⊕r

• Distributivity:d((P ⊕ Q) + R, (P + R) ⊕ (Q + R)) = 0

• Derivative operators:d(a.0||∅b.0, a.b.0 + b.a.0) = 0

NORMAL FORMS:⊗

i

[qi]⊕

Aj∈Ai

+a∈Type(Aj)

〈a, λAj〉.nf(PAj ,a)

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.17/55

Consistent with the Semantics of ROSA

• ∀P, Q ∈ {ROSA}.d(P, Q) = 0 ⇔ P = Q

• Commutability and Associativity of ⊕ and + .Weighted Commutability and W. Assoc. of ⊕r

• Distributivity:d((P ⊕ Q) + R, (P + R) ⊕ (Q + R)) = 0

• Derivative operators:d(a.0||∅b.0, a.b.0 + b.a.0) = 0

NORMAL FORMS:⊗

i

[qi]⊕

Aj∈Ai

+a∈Type(Aj)

〈a, λAj〉.nf(PAj ,a)

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.17/55

Normal-Formed Genetic ROSA

∀P ∈ G−ROSA process :

P ::= 0 |⊗

i

[qi]Qi

Decreasing ordered qi and λA

Q ::=⊕

Aj∈A

Tj

Alphabetically ordered Tj and actions

T ::= +a∈Type(A)

〈a, λA〉.Va

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.18/55

The Complete Metric Space

Given a pair of ROSA processes P and Q thedistance between them is D(P, Q)

D(P, Q) =1

2l(‖P‖u‖Q‖)−

1

2N

• ‖P‖ is the ROSA normal form of process P

• l(T ) is the length of process T

• N = max{l(‖P‖), l(‖Q‖)}

• ‖P‖ u ‖Q‖ is the longest common initial part ofthe normal form of processes P and Q

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.19/55

Cheaper Semantics

According to a Means - Ends Policy:

p− f : {ROSA procs.} −→ (0,1]P 7→ 1−D(P, SF)

Higher values to the more promising states

p− f is a FITNESS FUNCTION

PROs: Several Symbolic Metrics could be valid

CONs: Harder specification process

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.20/55

PETRI NETS

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.21/55

Marked Ordinary Petri Nets

An Ordinary Petri Net (OPN) is a tuple

N = (P, T, F ):

P Set of places

T Set of transitions (P ∩ T = ∅)

F Flow relation , F ⊆ (P × T ) ∪ (T × P )

• Marking of N = (P, T, F ) is M : P −→ IN

• (P, T, F, M) is a Marked Ordinary Petri Net

• A PN is k-safe (k ∈ IN) if |M(p)| ≤ k,∀p ∈ P

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.22/55

Firing a transition

• X = P ∪ T

• ∀x ∈ X:

• •x = {y ∈ X | (y, x) ∈ F} (precondition set of x)

• x• = {y ∈ X | (x, y) ∈ F} (postcondition set of x)

• A transition t ∈ T of N = (P, T, F, M) isENABLED∗ AT MARKING M (M [t〉)iff ∀p ∈ •t . M(p) > 0

• M [t〉 can be fired ⇒ M ′ (M [t〉M ′):M ′(p) = M(p)−Wf(•t) + Wf(t•) ∀p ∈ P

• More than 1 transition can be fired at once

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.23/55

Non-determinism

� ��

qq q� ��

� ��

� ��

� ��

?

?

?

?

? ?

JJ JJ

? ?

t4

t2

t3

t1

p5p4

p3p2p1

� ��q

q� ��

� ��

� ��

� ��

?

?

?

?

? ?

JJ JJ

? ?

t4

t2

t3

t1

p5p4

p3p2p1

� �� q

q� ��

� ��

� ��

� ��

?

?

?

?

? ?

JJ JJ

? ?

t4

t2

t3

t1

p5p4

p3p2p1

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.24/55

Non-determinism

� ��

qq q� ��

� ��

� ��

� ��

?

?

?

?

? ?

JJ JJ

? ?

t4

t2

t3

t1

p5p4

p3p2p1

� ��q

q� ��

� ��

� ��

� ��

?

?

?

?

? ?

JJ JJ

? ?

t4

t2

t3

t1

p5p4

p3p2p1

� �� q

q� ��

� ��

� ��

� ��

?

?

?

?

? ?

JJ JJ

? ?

t4

t2

t3

t1

p5p4

p3p2p1

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.24/55

Examples and Analysis by Petri Nets

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.25/55

MTAPN for generic GoP

0

DCT_Q I

IQ_IDCTI VLC I

FS I

Iout

I

Perror P

ESTP

COMPP

OUTI

<595,595>

<298,358><673,673>

<0,0> <0,0>

<1180,1181>

<32,32>

B1out

<48,48>

<189,454>

<0,0> <0,0>

<189,454>

<521,521><521,521>

<0,0>

<48,48>

MV−B1 MV−B2

ERROR

DCT_Q

P

<521,521>

<0,0>

VLC P

<0,0>Pout

OUTP

<378,389>

IQ_IDCT FSP

<0,0><515,515>

I−B2

I−B1

B1

B2

<2398,2422>

P−B1

P−B2

<2398,2422>

B1error

<0,0>

B2error

B1

VLCB1

DCT_Q

ERRORB1

COMP B1

ESTB1

OUT B2

VLC B2

DCT_Q

ERRORB2

COMPB2

EST B2

OUT

MV−P

B2out

<0,0>

np

BBP

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.26/55

MTAPN Modelling MPEG-2 I

0

DCT_Q I

IQ_IDCTI VLC I

FS I

Iout

I

Perror P

ESTP

COMPP

OUTI

<595,595>

<298,358><673,673>

<0,0> <0,0>

<1180,1181>

<32,32>

B1out

<48,48>

<189,454>

<0,0> <0,0>

<189,454>

<521,521><521,521>

<0,0>

<48,48>

MV−B1 MV−B2

ERROR

DCT_Q

P

<521,521>

<0,0>

VLC P

<0,0>Pout

OUTP

<378,389>

IQ_IDCT FSP

<0,0><515,515>

I−B2

I−B1

B1

B2

<2398,2422>

P−B1

P−B2

<2398,2422>

B1error

<0,0>

B2error

B1

VLCB1

DCT_Q

ERRORB1

COMP B1

ESTB1

OUT B2

VLC B2

DCT_Q

ERRORB2

COMPB2

EST B2

OUT

MV−P

B2out

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.27/55

MTAPN Modelling MPEG-2 II

DCT_Q I

IQ_IDCTI VLC I

FS I

Iout

I

Perror P

ESTP

COMPP

OUTI

<595,595>

<298,358><673,673>

<0,0> <0,0>

<1180,1181>

<32,32>

B1out

<48,48>

<189,454>

<0,0> <0,0>

<189,454>

<521,521><521,521>

<0,0>

<48,48>

MV−B1 MV−B2

ERROR

DCT_Q

P

<521,521>

<0,0>

VLC P

<0,0>Pout

OUTP

<378,389>

IQ_IDCT FSP

<0,0><515,515>

I−B2

I−B1

B1

B2

<2398,2422>

P−B1

P−B2

<2398,2422>

B1error

<0,0>

B2error

B1

VLCB1

DCT_Q

ERRORB1

COMP B1

ESTB1

OUT B2

VLC B2

DCT_Q

ERRORB2

COMPB2

EST B2

OUT

MV−P

B2out00

Time = 595ms

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.28/55

MTAPN Modelling MPEG-2 III

DCT_Q I

IQ_IDCTI VLC I

FS I

Iout

I

Perror P

ESTP

COMPP

OUTI

<595,595>

<298,358><673,673>

<0,0> <0,0>

<1180,1181>

<32,32>

B1out

<48,48>

<189,454>

<0,0> <0,0>

<189,454>

<521,521><521,521>

<0,0>

<48,48>

MV−B1 MV−B2

ERROR

DCT_Q

P

<521,521>

<0,0>

VLC P

<0,0>Pout

OUTP

<378,389>

IQ_IDCT FSP

<0,0><515,515>

I−B2

I−B1

B1

B2

<2398,2422>

P−B1

P−B2

<2398,2422>

B1error

<0,0>

B2error

B1

VLCB1

DCT_Q

ERRORB1

COMP B1

ESTB1

OUT B2

VLC B2

DCT_Q

ERRORB2

COMPB2

EST B2

OUT

MV−P

B2out

Time = 895ms

300

0

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.29/55

MTAPN Modelling MPEG-2 IV

DCT_Q I

IQ_IDCTI VLC I

FS I

Iout

I

Perror P

ESTP

COMPP

OUTI

<595,595>

<298,358><673,673>

<0,0> <0,0>

<1180,1181>

<32,32>

B1out

<48,48>

<189,454>

<0,0> <0,0>

<189,454>

<521,521><521,521>

<0,0>

<48,48>

MV−B1 MV−B2

ERROR

DCT_Q

P

<521,521>

<0,0>

VLC P

<0,0>Pout

OUTP

<378,389>

IQ_IDCT FSP

<0,0><515,515>

I−B2

I−B1

B1

B2

<2398,2422>

P−B1

P−B2

<2398,2422>

B1error

<0,0>

B2error

B1

VLCB1

DCT_Q

ERRORB1

COMP B1

ESTB1

OUT B2

VLC B2

DCT_Q

ERRORB2

COMPB2

EST B2

OUT

MV−P

B2out

Time = 895ms

300

0

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.30/55

MTAPN Modelling MPEG-2 V

DCT_Q I

IQ_IDCTI VLC I

FS I

Iout

I

Perror P

ESTP

COMPP

OUTI

<595,595>

<298,358><673,673>

<0,0> <0,0>

<1180,1181>

<32,32>

B1out

<48,48>

<189,454>

<0,0> <0,0>

<189,454>

<521,521><521,521>

<0,0>

<48,48>

MV−B1 MV−B2

ERROR

DCT_Q

P

<521,521>

<0,0>

VLC P

<0,0>Pout

OUTP

<378,389>

IQ_IDCT FSP

<0,0><515,515>

I−B2

I−B1

B1

B2

<2398,2422>

P−B1

P−B2

<2398,2422>

B1error

<0,0>

B2error

B1

VLCB1

DCT_Q

ERRORB1

COMP B1

ESTB1

OUT B2

VLC B2

DCT_Q

ERRORB2

COMPB2

EST B2

OUT

MV−P

B2out

Time = 1268ms

0

373

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.31/55

MTAPN Modelling MPEG-2 VI

DCT_Q I

IQ_IDCTI VLC I

FS I

Iout

I

Perror P

ESTP

COMPP

OUTI

<595,595>

<298,358><673,673>

<0,0> <0,0>

<1180,1181>

<32,32>

B1out

<48,48>

<189,454>

<0,0> <0,0>

<189,454>

<521,521><521,521>

<0,0>

<48,48>

MV−B1 MV−B2

ERROR

DCT_Q

P

<521,521>

<0,0>

VLC P

<0,0>Pout

OUTP

<378,389>

IQ_IDCT FSP

<0,0><515,515>

I−B2

I−B1

B1

B2

<2398,2422>

P−B1

P−B2

<2398,2422>

B1error

<0,0>

B2error

B1

VLCB1

DCT_Q

ERRORB1

COMP B1

ESTB1

OUT B2

VLC B2

DCT_Q

ERRORB2

COMPB2

EST B2

OUT

MV−P

B2out

Time = 1268ms

373

0

000

0

0

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.32/55

MTAPN Modelling MPEG-2 VII

DCT_Q I

IQ_IDCTI VLC I

FS I

Iout

I

Perror P

ESTP

COMPP

OUTI

<595,595>

<298,358><673,673>

<0,0> <0,0>

<1180,1181>

<32,32>

B1out

<48,48>

<189,454>

<0,0> <0,0>

<189,454>

<521,521><521,521>

<0,0>

<48,48>

MV−B1 MV−B2

ERROR

DCT_Q

P

<521,521>

<0,0>

VLC P

<0,0>Pout

OUTP

<378,389>

IQ_IDCT FSP

<0,0><515,515>

I−B2

I−B1

B1

B2

<2398,2422>

P−B1

P−B2

<2398,2422>

B1error

<0,0>

B2error

B1

VLCB1

DCT_Q

ERRORB1

COMP B1

ESTB1

OUT B2

VLC B2

DCT_Q

ERRORB2

COMPB2

EST B2

OUT

MV−P

B2out

Time = 1863ms

595595 968

0 0

595

595

595

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.33/55

MTAPN Modelling MPEG-2 VIII

DCT_Q I

IQ_IDCTI VLC I

FS I

Iout

I

Perror P

ESTP

COMPP

OUTI

<595,595>

<298,358><673,673>

<0,0> <0,0>

<1180,1181>

<32,32>

B1out

<48,48>

<189,454>

<0,0> <0,0>

<189,454>

<521,521><521,521>

<0,0>

<48,48>

MV−B1 MV−B2

ERROR

DCT_Q

P

<521,521>

<0,0>

VLC P

<0,0>Pout

OUTP

<378,389>

IQ_IDCT FSP

<0,0><515,515>

I−B2

I−B1

B1

B2

<2398,2422>

P−B1

P−B2

<2398,2422>

B1error

<0,0>

B2error

B1

VLCB1

DCT_Q

ERRORB1

COMP B1

ESTB1

OUT B2

VLC B2

DCT_Q

ERRORB2

COMPB2

EST B2

OUT

MV−P

B2out

Time = 2163ms

895895 1268895

895

895

0

300

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.34/55

MTAPN Modelling MPEG-2 IX

DCT_Q I

IQ_IDCTI VLC I

FS I

Iout

I

Perror P

ESTP

COMPP

OUTI

<595,595>

<298,358><673,673>

<0,0> <0,0>

<1180,1181>

<32,32>

B1out

<48,48>

<189,454>

<0,0> <0,0>

<189,454>

<521,521><521,521>

<0,0>

<48,48>

MV−B1 MV−B2

ERROR

DCT_Q

P

<521,521>

<0,0>

VLC P

<0,0>Pout

OUTP

<378,389>

IQ_IDCT FSP

<0,0><515,515>

I−B2

I−B1

B1

B2

<2398,2422>

P−B1

P−B2

<2398,2422>

B1error

<0,0>

B2error

B1

VLCB1

DCT_Q

ERRORB1

COMP B1

ESTB1

OUT B2

VLC B2

DCT_Q

ERRORB2

COMPB2

EST B2

OUT

MV−P

B2out

Time = 2163ms

895895 895

895

895

300

12680

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.35/55

MTAPN Modelling MPEG-2 X

DCT_Q I

IQ_IDCTI VLC I

FS I

Iout

I

Perror P

ESTP

COMPP

OUTI

<595,595>

<298,358><673,673>

<0,0> <0,0>

<1180,1181>

<32,32>

B1out

<48,48>

<189,454>

<0,0> <0,0>

<189,454>

<521,521><521,521>

<0,0>

<48,48>

MV−B1 MV−B2

ERROR

DCT_Q

P

<521,521>

<0,0>

VLC P

<0,0>Pout

OUTP

<378,389>

IQ_IDCT FSP

<0,0><515,515>

I−B2

I−B1

B1

B2

<2398,2422>

P−B1

P−B2

<2398,2422>

B1error

<0,0>

B2error

B1

VLCB1

DCT_Q

ERRORB1

COMP B1

ESTB1

OUT B2

VLC B2

DCT_Q

ERRORB2

COMPB2

EST B2

OUT

MV−P

B2out

Time = 2448ms

1180

1180

585

1553285

1180

0

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.36/55

Demanding processors

DCT_Q I

IQ_IDCTI VLC I

FS I

Iout

I

Perror P

ESTP

COMPP

OUTI

<595,595>

<298,358><673,673>

<0,0> <0,0>

<1180,1181>

<32,32>

B1out

<48,48>

<189,454>

<0,0> <0,0>

<189,454>

<521,521><521,521>

<0,0>

<48,48>

MV−B1 MV−B2

ERROR

DCT_Q

P

<521,521>

<0,0>

VLC P

<0,0>Pout

OUTP

<378,389>

IQ_IDCT FSP

<0,0><515,515>

I−B2

I−B1

B1

B2

<2398,2422>

P−B1

P−B2

<2398,2422>

B1error

<0,0>

B2error

B1

VLCB1

DCT_Q

ERRORB1

COMP B1

ESTB1

OUT B2

VLC B2

DCT_Q

ERRORB2

COMPB2

EST B2

OUT

MV−P

B2out

0

PROCESSING FINISHEDPROCESSING STARTED

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.37/55

Analysis on Petri Nets

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.38/55

Behavioural properties

• Reachability• Can ever a marking be reached from another

one?• Reversibility

• Is M0 reachable from each reachable marking?• Boundness / Safeness

• Is there an upper limit on the number of tokensin a/all given place/s?

• Vivacity / Liveliness / Deadlock freeness• Can the system become blocked?

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.39/55

Analysis Means

• Reachability / Reversibility• Reachability or coverability tree• Explosion on the number of markings / states!

• Boundness / Safeness• Incidence Matrix and State Equations

• Vivacity / Liveliness / Deadlock freeness• Structural Analysis based on net structures

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.40/55

Codification to Discrete Dynamical Systems

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.41/55

DDS associated to a PN

The DDS which encodes the MOPN N = (P, T, F, M) is the triple (X, T,Φ), where:

• the Phase Space X = P(INn) is the set of all subsets of INn, being n the numberof places of the MOPN.

• T is the monoid N ∪ {0}

• Φ : T ×X → X is the evolution operator Φ which holds:

1. Φ(0, x) = x ∀x ∈ X, i.e., Φ0(x) = idX

2. Φ(1, x) = y x, y ∈ X where:• x = {x1, . . . , xk} where xi ∈ INn encodes Markings of the MOPN N• y = ∪k

i=1yi• yi = ∪t

j=1yij, i.e. the union of all (t) possible reachable markings from

xi, defined by xi[Ri〉yijbeing Ri the set of transitions of the net enabled

at marking xi

3. Φ(t,Φ(s, x)) = Φ(t + s, x) ∀t, s ∈ T , ∀x ∈ X

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.42/55

Distance on 1-safe PNs

Given a pair x, y ∈ {0,1}n (corresponding to a pairof markings) the distance between them is given by:

d(x, y) =1

2l(xuy)−

1

2n, x, y ∈ {0,1}n

• l(x u y) is the length of the longest common initialpart of the vectors x and y

• n ∈ IN is the number of places of the PN• Metric well defined but blind to big differences in

both k-safe and non-bounded cases

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.43/55

Problem of binary case metrics I

p1

p2

p3

p4

p5

p6

t1

t2

t3

t4

p1

p2

p3

p4

p5

p6

t1

t2

t3

t4

p1

p2

p3

p4

p5

p6

t1

t2

t3

t4

p1

p2

p3

p4

p5

p6

t1

t2

t3

t4

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.44/55

Problem of binary case metrics I

p1

p2

p3

p4

p5

p6

t1

t2

t3

t4

p1

p2

p3

p4

p5

p6

t1

t2

t3

t4

p1

p2

p3

p4

p5

p6

t1

t2

t3

t4

p1

p2

p3

p4

p5

p6

t1

t2

t3

t4

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.44/55

Problem of binary case metrics II

• In the first pair of MOPNs the states are(0,1,1,4,1,0) and (0,1,0,5,1,0) which meansdistance 1

4− 1

64but only the first can fire t2

• In the second pair of MOPNs the states are(0,1,1,4,1,0) and (0,1,2,3,1,0) which means thesame distance 1

4− 1

64but both can fire t2

• To solve this problem we will use the (ENABLED)TRANSITIONS VECTOR

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.45/55

Distance on k-safe and non-bounded PNs

Given a pair x, y ∈ INm the distance between them isgiven by:

d(x, y) =1

2l(tv(x)utv(y))−

1

2m, x, y ∈ INm

• tv(x)i = 1 ⇔ transitioni is enabled, 0 o.w.

• l(tv(x)u tv(y)) = length of the longest commoninitial part of the transition vectors of x and y

• m ∈ IN is the number of transitions of the PN

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.46/55

New distance

p1

p2

p3

p4

p5

p6

t1

t2

t3

t4

p1

p2

p3

p4

p5

p6

t1

t2

t3

t4

tv = (0,1,1,0) tv = (0,0,1,0)p1

p2

p3

p4

p5

p6

t1

t2

t3

t4

p1

p2

p3

p4

p5

p6

t1

t2

t3

t4

tv = (0,1,1,0) tv = (0,1,1,0)

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.47/55

Complete Metric Space X

• From this metric d, we can define the distancebetween a vector x ∈ INn and a subset B ofvectors of INn, i.e., an element in P(INn):

d(x, B) = min{d(x, y) : y ∈ B}

• Distance between A, B in P(INn):

D(A, B) = max{d(x, B) : x ∈ A}

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.48/55

Marked Timed-Arcs∗ Petri Net

����

����

����

����

����

����

?

?

?

?

?

?

aaa��

��

��

���>

PPPPPPPi

����*

��..............

......

��-

.......................... ..............

......

.......................�

t1

t2

t3

t4

p1

p2

p3

p4

p5

p6

00 0

< 0 >< 0 >

< 0 >

< 4 >

< 5 >

< 0 >

t = 0

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.49/55

MTAPNs∗ t = 4

& t = 5

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.50/55

MTAPNs∗ t = 4 & t = 5

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.50/55

Urgent TAPNs to DDSs

• X = P({IN, ∅}n). n = #(places) of the MTAPN.

• τ is the monoid N ∪ {0}

• Φ : τ ×X → X is the evolution operator Φ verifying:

1. Φ(0, A) = A ∀A ∈ X, i.e., Φ0 = idX

2. Φ(1, A) = B A, B ∈ X where:• A = {z1, . . . , zk}. zi ∈ {IN, ∅}n is a Marking.• ∀t ∈ {1 . . . k} . xt = 1 + zt where ∀i ∈ {1 . . . n}:

xti =

∅ when zti = ∅

zti + 1 otherwise• B = ∪k

i=1Bi

• Bi = ∪tj=1{y

ji }/xi[RRi〉y

ji being RRi maximal.

3. Φ(t,Φ(s, A)) = Φ(t + s, A) ∀t, s ∈ τ , ∀A ∈ XProcess Algebras and Petri Nets are Discrete Dynamical Systems – p.51/55

Conclusions and Future Work

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.52/55

Conclusions

• A Topology over ROSA processes consistent withROSA semantics has been provided

• A cheaper P.A. according to a Means - Ends Policy

• Discrete and Stochastic Petri Nets encoded asDynamical Systems

• A Complete Metric Space for the DDSs associatedto 1-safe, k-safe and unbounded PNs

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.53/55

Future Work

• If P.A. heuristics does not work (chosen path iswrong) → Mutation means different FITNESS . . .

• Improving expressive power of nf − P.A.

• Key points in DSs Theory:• Periodic Points• Semi-periodic points• Orbits from M0• In DDSs are sequences of elements of X• In CDSs are curves in X

• α-limit and ω-limit sets

• Comparison over PNs

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.54/55

Future Work

• If P.A. heuristics does not work (chosen path iswrong) → Mutation means different FITNESS . . .

• Improving expressive power of nf − P.A.

• Key points in DSs Theory:• Periodic Points• Semi-periodic points• Orbits from M0• In DDSs are sequences of elements of X• In CDSs are curves in X

• α-limit and ω-limit sets

• Comparison over PNs

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.54/55

Future Work

• If P.A. heuristics does not work (chosen path iswrong) → Mutation means different FITNESS . . .

• Improving expressive power of nf − P.A.

• Key points in DSs Theory:• Periodic Points• Semi-periodic points• Orbits from M0• In DDSs are sequences of elements of X• In CDSs are curves in X

• α-limit and ω-limit sets

• Comparison over PNs

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.54/55

Future Work

• If P.A. heuristics does not work (chosen path iswrong) → Mutation means different FITNESS . . .

• Improving expressive power of nf − P.A.

• Key points in DSs Theory:• Periodic Points• Semi-periodic points• Orbits from M0• In DDSs are sequences of elements of X• In CDSs are curves in X

• α-limit and ω-limit sets• Comparison over PNs

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.54/55

Process Algebras and Petri Nets are DiscreteDynamical Systems

Fernando Lopez Pelayo

Real Time and Concurrent Systems Group

Computing Systems Department of University of Castilla-La Mancha

Facultad de Informatica

Universidad Complutense

December 4th, 2014 Madrid, SPAIN

Process Algebras and Petri Nets are Discrete Dynamical Systems – p.55/55