Added trap and deadlock detectability

Not yet tested, because something seems wrong in the classifier, which I call here for easy checking of post and pre places