LIP6 UPMC CNRS Move-team Macao FrameKit CPN-AMI
2007-10-24
LIP6 > Software > MoVe Sofware > CPN-AMI > Manual > Modelling facilities

Introduction

Several tools are grouped under this section. They all provide services valuable when building a new Petri net specification. The following serices are available now:

Petri net Assembling

To build large Petri net models, designer appreciate to assemble modules. The usual mechanisms are either by place fusion or transition fusion. Thus, we have designed a tool that performs canonical place and transition fusion. This tool is very usefull when assembling large models. It does not forget any arc conection and eases the procedure.

Then, you can build several Macao models. Then, when assembling time has come, you just have to paste all modules in one model and use modular services to fusion places or transitions. You also could script your model with PetriScript.

The Petri net assembling menu

When you are connected to CPN-AMI, you can reach the modular services menu that offers three services (in red). These servicse do not require syntactic check to be processed.

Petri net assembling
Assembling by transition fusion
Assembling by place fusion
Execute PetriScript program
Execute PetriScript program (debug mode)

Usage and display of results

Let us consider this small Petri net. It is composed of two parts: a producer (sending a message and waiting for an acknowledge) and a consumer (waiting for a message and sending an acknowledge). Places Msg and M have to be fusionned in order to assemble the two parts.


Two Petri net modules not yet asembled.

When the places to be assembled (at least two) are selected, service "...Assembling by place fusion" is activated (otherwise, both services remain gray). An answer is required to name the resultant place.


Confirmation of the name for the resultant place.

Arcs are automatically recomputed. In case of potential conflicts on the initial markin, a dialog window asks the user to provide the appropriate solution. If color domains are not identical, the fusion is rejected (for a place). Arcs valuations are tried to be add, but if it fail, valuations are appened with the signus '+' between them.

When it is processed, the service modify the Petri net model and proposes the one of the next Figure.


Petri net model when places M and Msg are merged into Res.

This service works similarily for transitrion fusion (and queues or immediates transitions). The main difference is that you may have to provide a valuation for arcs generated when fusionning the transition (the tool may not be able to compute them all).

Warnings : The new version of this tool don't take care of arcs's intermediary points. (Will be correct in another release)

PetriScript HOWTO

This language is designed to process Petri nets using the AMI-Net formalism. You thus create a new model from the Macao user interface and select the AMI-Net description as shown in the figure below.

 

Now, you may (it's not an obligation) put some nodes (places,
transitions, immediate transitions, queues) in the model and connect them.

Now, all is in order to launch the PetriScript interpreter. Select the "Execute list of Commands" item in the menu.

A window pops-up, whose purpose is to let you to create a PetriScript program. Strike OK to execute it on the current Petri Net.

Look at the result !

Sometime, a window such as the one below may appear. PetriScript needs unique names to identify nodes in the net. So this window means that one (or more) nodes in the net have no name, or that two (or more) nodes have the same name. So enter a new name for each nodes you are asked for.

Do not hesitate to play with the examples provided in the full PDF PetriScript documentation.

The debug mode

The "Debug" mode is exactly the same, except that if there is an error during the execution, the current net is update to show its state when the error happened.

The complete documentation about PetriScript is available here in PDF format.

The Petri net Beautifier

This service aims to rearrange "spagetti" Petri nets. This service has been made to be exploited by other Petri net services (like CPN-Unfolder, Prefix or reachability graph display). However, it can be directly invoked by a user.

Important remark: This service rely on dot, a nice graphic display tool designed at AT&T Bell Labs.

The Petri net beautifier menu

When you are connected to CPN-AMI, you can reach the Petri net Beautifier menu that offers two services (in red). This service does not require syntactic check to be processed. By selecting one service, you launch the application.

Petri net Beautifier
Oriented graph strategy
Non oriented graph strategy
Options
90 degres rotation
Reduction factor: 50%
Expantion factor: 150%
Expansion factor: 200%

Basically, the tool supports two layout strategies: the one for oriented graphs and the one for non oriented graphs. Of course, the first one is the most relevant to compute a pretty layout on Petri nets. Options allow you to have some impact on the result.

Display of results

Let us consider this small scrambled net.


"scrambled" Petri net example.

You can see below the same Petri net but arranged to make it more readable (and scaled to 50%). The tool tries to minimize arc crossing.


Arranged Petri net.

Remark: for large models, the computation of layouts may be quite long, be patient;-).

Suppress structuraly useless places and transitions

Petri nets produced automatically from a higher level language, as well as the ones produced by assembling of many modules, may contain places that are structurally 0-bounded. Then, such places generate transitions that are not firable. For some analysis, it can be usefull to detect and delete such places and the corresponding ransitions. The resulting model has the same reachability graph that the complex one but it may be more readable.

The service menu

When the Petri net you have designed is syntactically correct, you can reach the service dedicated to simplification of P/T nets (in red).

Suppress structuraly useless places and transitions

Display of results

Let us consider this small example net.


The complete Petri net example.

This model contains 13 places, 12 transitions and 40 arcs. However, according to the initial marking, some of them are structurally 0-bounded. Thus, they could be discarded.

Our service deletes 6 places and 7 transitions. We then get the following model.


The Petri net without 0-bounded places and transitions connected to it.

Remark: for large models, the computation places bounds may be quite long, be patient;-).

Warning: the deletion of never fired transition may generate 0-bounded places. Thus, you may have to run the tool several times to delete all "useless" objects in your P/T Net.

Bas