14
13.09.2008 1 Implementing Petri Net Transformations Tony Modica Implementing Petri Net Transformations using Graph Transformation Tools Enrico Biermann, Claudia Ermel, Tony Modica and Peggy Sylopp 3rd Workshop on Petri Nets and Graph Transformations

Implementing Petri Net Transformations using Graph Transformation Tools

  • Upload
    keon

  • View
    42

  • Download
    0

Embed Size (px)

DESCRIPTION

Implementing Petri Net Transformations using Graph Transformation Tools. Enrico Biermann, Claudia Ermel , Tony Modica and Peggy Sylopp 3rd Workshop on Petri Nets and Graph Transformations. Category of Petri nets. Properties of Petri net morphisms. Petri net transformation rules. - PowerPoint PPT Presentation

Citation preview

Page 1: Implementing Petri Net Transformations using Graph Transformation Tools

13.09.2008 1Implementing Petri Net TransformationsTony Modica

Implementing Petri Net Transformations using Graph

Transformation Tools

Enrico Biermann, Claudia Ermel,Tony Modica and Peggy Sylopp

3rd Workshop on Petri Nets and Graph Transformations

Page 2: Implementing Petri Net Transformations using Graph Transformation Tools

13.09.2008 2Implementing Petri Net TransformationsTony Modica

Overview

Category of Petri nets

Properties of Petri net morphisms

Petri net transformation rules

Petri nets to typed attributed graphs

Problems for rule translation

Extended rule translation

Future work and outlook

Example

Tool implementation

Page 3: Implementing Petri Net Transformations using Graph Transformation Tools

13.09.2008 3Implementing Petri Net TransformationsTony Modica

Category of Petri nets

• Common framework:High-level Replacement Systems (DPO)

• category PTSys– Petri systems PS = (PN, M)

• algebraic with monoids• net PN = (P,T, pre,post:T→P )• (similar to graphs with

hyper edges)• marking M∈P

– morphisms (fP,fT):PS1→PS2

• place mapping fP:P1→P2

• transition mapping fT:T1→T2

• with some structural conditions

Page 4: Implementing Petri Net Transformations using Graph Transformation Tools

13.09.2008 4Implementing Petri Net TransformationsTony Modica

Properties of Petri net morphisms

• conditions for (fP,fT):PS1→PS2

– preservation of transitions‘ pre andpost domain (environment)

– preservation of markings per token

• Morphism called strict if “=“ (and injective)

• in general not

• conditions ensure preservation of firing behavior

Page 5: Implementing Petri Net Transformations using Graph Transformation Tools

13.09.2008 5Implementing Petri Net TransformationsTony Modica

Petri net transformation rules

• strict rule morphisms l, r • rule is applicable if l and m

satisfy gluing condition (ensuring existence of pushout complement D)– Gluing Points are all LHS nodes in the image of l

(matched by the rule but not deleted)– Dangling Points are all LHS places that would leave

a dangling edge after deletion– Identification Points are all LHS nodes being matched non-injectively– gluing condition: (1)

(2) m is strict on places to be deleted– In short: “Don’t delete places without their adjacent transitions!

And don’t match those places with less tokens!”– we only consider injective matches for now

• (no transitions as DP because P/T-morphisms preserve environments)

Page 6: Implementing Petri Net Transformations using Graph Transformation Tools

13.09.2008 6Implementing Petri Net TransformationsTony Modica

Simulating Petri net transformationwith graph transformation

• rule application and match search• obvious translation of

P/T-systems and extension to (injective) P/T-morphisms

• problems: because of P/T-morphism properties straightforward translation of P/T-rules yields graph rules with

– too many applications (graph matches do not preserve transition node environments)

– less applications (graph matching of token attribute is strict)

• we want match calculation, so we need a proper rule translation

• (translation is not a functor, non-strict P/T-morphisms do not have valid translations)

type graph for the visuallanguage of Petri nets

Page 7: Implementing Petri Net Transformations using Graph Transformation Tools

13.09.2008 7Implementing Petri Net TransformationsTony Modica

Problem 1: domain preservation

• graph morphisms are not restricted to preserve transition environments– translated graph rule can

have more applicable matches than original Petri net rule

• solution: two negative application conditions for each transition in LHS– forbid matching of

transition if there are unmatched places in its environment ∃mG such that pG

applicable

N

∄mN such that pN applicable

L 1 2 K 1 2 R 1 2

pN

pG

L

2:TransitionNode

1:PlaceNodeK

2:TransitionNode

1:PlaceNode R

:PlaceNode

2:TransitionNode

1:PlaceNode

trans(N)

:PlaceNode

:TransitionNode

:PlaceNode 2:TransitionNode

:PlaceNode

NAC1

2:TransitionNode

:PlaceNodeNAC2

Page 8: Implementing Petri Net Transformations using Graph Transformation Tools

13.09.2008 8Implementing Petri Net TransformationsTony Modica

Problem 2: token matching

• graph attributes can be matched on same values only!– non-strict P/T-morphisms can not be directly translated

• introduce token variable for each place in LHS that will not be deleted (i.e., has preimage in K)– rule attributes assume values determined by match

• attribute condition to allow non-strict token attribute matching for graph morphisms

• (each “x≥y” equivalent to y NACs with less than y tokens on respective place)

Page 9: Implementing Petri Net Transformations using Graph Transformation Tools

13.09.2008 9Implementing Petri Net TransformationsTony Modica

Tool implementation

• Eclipse Plug-In based on EMF (Eclipse Modeling Framework) and GEF (Graphical Editor Framework)

• RON - Reconfigurable Object Nets (variant of Algebraic Higher-Order Nets)

• editing of P/T-systems, rules, controlling high-level net• uses AGG as graph transformation engine for match search and

rule application– converts Petri nets and rules to AGG graphs and rules– reflects changes on translated graph back to

Petri net after rule application

Page 10: Implementing Petri Net Transformations using Graph Transformation Tools

13.09.2008 10Implementing Petri Net TransformationsTony Modica

Example: Train loading

• trains that can be (un)loaded over a ramp on the last wagon– each wagon can hold 3 pieces

of load

– loads can be shifted to adjacent wagons

– if the loading wagon is full we can add an empty one after it

– we can remove an empty loading wagon, but only if there’s still another wagon

X

∃!

Page 11: Implementing Petri Net Transformations using Graph Transformation Tools

13.09.2008 11Implementing Petri Net TransformationsTony Modica

Example: Train loading (formal)

• Petri net for train with 2 wagons– places for counting free

spaces instead of capacities– firing of transitions for

(un)loading and shifting

• rule for extending a train– applicable on loading wagons

carrying 3 cargo units

• rule for reducing a train– applicable on loading wagons

with 3 free spaces– the next wagon is preserved

Page 12: Implementing Petri Net Transformations using Graph Transformation Tools

13.09.2008 12Implementing Petri Net TransformationsTony Modica

Future work and outlook

• extended translation for non-injective matches (regarding arc weight sums)

• theory for P/T-rules with non-strict morphisms to change markings

• formal proofs for ourextended translation– correctness: for a Petri

net rule each result of a translated possible application is equivalent to translationof the application’s result

– completeness: for a Petri net rule there are no other applications for its translation than the translated possible applications for itself

Page 13: Implementing Petri Net Transformations using Graph Transformation Tools

1313.09.2008 Implementing Petri Net TransformationsTony Modica

Thank you!

Page 14: Implementing Petri Net Transformations using Graph Transformation Tools

13.09.2008 14Implementing Petri Net TransformationsTony Modica

Literature

• [AGG] AGG Homepage. http://tfs.cs.tu-berlin.de/agg

• [BEHM07] E. Biermann, C. Ermel, F. Hermann, T. Modica. A Visual Editor for Reconfigurable Object Nets based on the ECLIPSE Graphical Editor Framework. Proc. Workshop on Algorithms and Tools for Petri Nets (AWPN’07). 2007.http://tfs.cs.tu-berlin.de/roneditor

• [BM08] E. Biermann, T. Modica. Independence Analysis of Firing and Rule-based Net Transformations in Reconfigurable Object Nets. Proc. Workshop on Graph Transformation and Visual Modeling Techniques. (GT-VMT’08). Vol. 10. EC-EASST, 2008.

• [EHP+08] H. Ehrig, K. Hoffmann, J. Padberg, C. Ermel, U. Prange, E. Biermann, T. Modica. Petri Net Transformations. In Petri Net Theory and Applications. Pp. 1–16. I-Tech Education and Publication, 2008.