Posts 1-10 of 19

Using a database to store benchmarks logs

2016-12-10

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

2016-06-23

SNAKES release 0.9.18

Time Petri nets with SNAKES

2016-04-25

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

2016-01-06

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 at PETRI NETS 2015

2015-06-24

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

2015-06-01

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 = shelve.open("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

2015-05-28

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

2015-05-07

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

2015-03-21

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

SNAKES moved to GitHub

2015-03-14

Because of Google code shutdown, SNAKES moved to GitHub