End DATAFLOW_SOLVER.
(** Kildall's algorithm manipulates worklists, which are sets of CFG nodes equipped with a ``pick next node to examine'' operation. The algorithm converges faster if the nodes are chosen in an order consistent with a reverse postorder traversal of the CFG. For now, we parameterize the dataflow solver over a module that implements sets of CFG nodes. *)
Module Type NODE_SET.
Parameter t: Type.
Parameter empty: t.
Parameter add: positive -> t -> t.
Parameter pick: t -> option (positive * t).
Parameter all_nodes: forall {A: Type}, PTree.t A -> t.
Parameter In: positive -> t -> Prop.

Axiom all_nodes_spec:
forall A (code: PTree.t A) n instr,
code!n = Some instr -> In n (all_nodes code).