The stimulus-driven theory of Petri nets