Posts 1-10 of 19

Using a database to store benchmarks logs


How and why I use a database instead of CSV or flat files to store benchmarks logs

For my benchmarks, I used to store logs of every executions into CSV files that I had to aggregate for analysis. I've decided to switch to a database. It is simpler and globally more efficient.

read more

SNAKES 0.9.18 is out


SNAKES release 0.9.18

Time Petri nets with SNAKES


How to extend SNAKES to handle time Petri nets

In this quite old paper, it was shown how to extend SNAKES to model and execute time Petri nets (Merlin & Farber's version, that with clocks on transitions). The code originally written in 2008 is broken because of slight changes in SNAKES. This post is both an update and a more complete explanation of the implementation. You can grab the full code here.

read more

Model-checking with ABCD and Neco


Example of modelling in ABCD and LTL model-checking with Neco

ABCD is a modelling language that brings together process algebras and Python programming with a Petri net semantics. A compiler for ABCD is shipped with SNAKES, a description of the language and its semantics can be found in my habilitation thesis (section 3.3). On the other hand, Neco, with the help of SPOT, is able to perform efficient LTL model-checking of Petri-nets and, in particular, it accepts ABCD models as its input.

In this post we look at a concrete example of how to use Neco to model-check the ABCD model of a railroad crossing system. A basic knowledge of ABCD and LTL is required to fully understand this post.

read more



SNAKES is presented at PETRI NETS 2015, twice!

A tool paper about SNAKES has been accepted at the PETRI NETS conference 2015, I'll add it soon to the list of my publications. Additionally, I was pleased to discover that Robert Lorenz was giving an invited talk and that the theory he has presented is implemented using SNAKES.

read more

Automating write-back to Python shelve


How to improve module shelve to automate objects saving

Module shelve is great but it only save objects when they are explicitly assigned to a shelf. This may be error prone as for instance in:

>>> db ="shelf.db")
>>> db["foo"] = []
>>> db["foo"].append("hello")
>>> db["foo"]

Calling append on the object does not lead to modify the stored object because it has not been assigned to the shelf. Instead, of a simple call to append we should have three instructions, which is not really convenient:

>>> l = db["foo"]
>>> l.append("hello")
>>> db["foo"] = l

I show below a simple wrapper around shelve to deal with this comfortably.

read more

Watching filesystem updates with gevent


How to monitor files and directories using gevent only

Many systems allow to monitor changes on a filesystem, but I could not find any that is both portable and compatible with gevent. For instance, watchdog is portable on Windows, Linux and MacOS, but it uses threads and does not work together with gevent. On the other hand, gevent_inotifyx, as its name says, works well with gevent, but it relies on inotify on so is for Linux only.

Here is a solution that is only based on gevent and should be as portable as gevent itself.

So far, this solution is buggy under Windows, an issue has been opened on gevent GitHub. The bug is that notifications arrive very slowly, I typically experience 30s delays between an update takes place and its notification is reported.
EDIT (July 3th 2015): there is few hope that is will ever work unless libev is updated on Windows, see the issue on GitHub for details
read more

Generating pronounceable passwords in Python


How to generate human-friendly yet secured passwords in Python

To generate human-readable and pronounceable passwords, I usually rely on apg or pwgen, but I needed a solution that can be used from a Python program, which should be portable so that I can't rely on the presence of apg or pwgen on the computer.

read more

Another SNAKES repository


IBISC lab now hosts a GitLab and SNAKES is also there now

SNAKES moved to GitHub


Because of Google code shutdown, SNAKES moved to GitHub