1. A method of representing behaviors of a processor of a plurality of packets, comprising: inputting a declarative description that specifies a plurality of rules for manipulating the packets; generating a dependency graph from the declarative description, wherein the dependency graph specifies each of the rules that depends upon another one or more of the rules; transforming, by a computer, the declarative description and the dependency graph into a Petri net representing the behaviors of the processor, wherein the Petri net includes a plurality of respective transitions for the rules and a plurality of places for enabling the respective transitions to fire; and outputting a specification of the Petri net representing the behaviors of the processor.