1. A processor-implemented method of generating a plurality of clusters of a plurality of actions for manipulating a plurality of packets of a communication protocol, comprising: inputting a declarative description of a processor of the packets of the communication protocol, the declarative description specifying a hierarchical tree structure including a plurality of modules, the modules including a plurality of respective leaf modules for the actions for manipulating the packets of the communication protocol and a plurality of instance modules; wherein one of the instance modules is a root of the hierarchical tree structure and each of the respective leaf and instance modules other than the root is a child of one of the instance modules; inputting a constraint-specification of at least one dependent pair of the actions; for each respective leaf module, generating a cluster that includes the action of the respective leaf module; for each instance module, generating at least one cluster that collectively includes the actions in each cluster of each child of the instance module; wherein for each cluster of each child of the instance module, the actions in the cluster are included in a same one of the at least one cluster, and each dependent pair of the actions are not included in a same one of the at least one cluster; and outputting a cluster-specification of the at least one cluster of the root.