The mathematics of Petri Nets