Add a debugging function to dump state machine into a dotty format file