petri net code