get a PDF version

SNAKES
a high-level Petri nets library
Franck Pommereau
IBISC/COSMO, university of Évry/Paris-Saclay
23 boulevard de France, 91037 Évry Cedex France
[email protected]
http://www.ibisc.univ-evry.fr/~fpommereau/SNAKES/
SNAKES in a nutshell
SNAKES is a
Python library
Very generic
Petri net
definition
Extensible
with plugins
Fully reflexive
for maximal
flexibility
Inspired
by Emacs
Define and
manipulate
Petri nets
Tokens are
Python
objects
Annotations
are Python
expressions
About SNAKES
open source (GNU LGPL)
works out of the box
81.5k lines of portable Python
maintained for 10+ years
one permanent developer/user
online documentation has
300+ visitors per month
SNAKES vs GitHub’s top 10
∗
Python projects (on Nov. 2013)
django
$5.3M (432)
snakes
Even SNAKES’
net objects
$2.7M (2)
sick-beard
$2.6M (110)
ipython
$2.3M (236)
boto
Plugins
gv: draw Petri nets using GraphViz
ops: algebras of Petri nets compositions (PBC, PNA, M-nets, . . . )
pids: dynamic processes creation and destruction
labels: arbitrary objects annotations
let: variables assignation during computation
. . . (your plugin here: try, it’s easy)
ABCD for friendly modelling
process algebra with friendly Python-like syntax
embeds full Python
compiler shipped with SNAKES library
generates Petri nets objects
export to pictures or PNML files
simulation and reachability analysis
$1.5M (87)
sentry
$1.3M (166)
$0.6M (120)
requests
$0.3M (275)
flask
$0.2M (159)
httpie $0.1M (22)
estimated cost to develop (generated
using David A. Wheeler’s “SLOCCount”)
and number of contributors
∗
10 most forked or followed Python projects
Using SNAKES out of Python
write a binding in Cython
1
3
# this is Cython code
public cdef int foo (...):
# Python with SNAKES here
Cython compiles to C/C++
with a .h file:
https://code.google.com/p/neco-net-compiler/)
Neco compiles SNAKES Petri nets into fast native code
• optimised marking structure
• per-transition optimised firing
reads PNML, ABCD, or net objects
net
compiler
process-symmetries reductions
state space exploration and LTL model-checking (using SPOT)
awarded at the model-checking contest 2013 (PETRI NETS conf.)
reddit
tornado
2
Neco for fast analysis
Lukasz Fronc’s companion tool (available separately at
$2.1M (314)
1
2
// this is C/C++ code
extern int foo(...);
use this API in your project
Isn’t Python slow?
no for handling nets even large ones
yes for firing transitions
is fast at that! ;-)