Module Type DATAFLOW_SOLVER.
Declare Module L: SEMILATTICE.
(** [fixpoint successors transf ep ev] is the solver. It returns either an error or a mapping from program points to values of type [L.t] representing the solution.  [successors] is a finite map returning the list of successors of the given program point. [transf] is the transfer function, [ep] the entry point, and [ev] the minimal abstract value for [ep]. *)
Parameter fixpoint:
forall {A: Type} (code: PTree.t A) (successors: A -> list positive)
(transf: positive -> L.t -> L.t)
(ep: positive) (ev: L.t),
option (PMap.t L.t).
(** The [fixpoint_solution] theorem shows that the returned solution, if any, satisfies the dataflow inequations. *)
(** The [fixpoint_entry] theorem shows that the returned solution, if any, satisfies the additional constraint over the entry point. *)
(** Finally, any property that is preserved by [L.lub] and [transf] and that holds for [L.bot] also holds for the results of the analysis. *)

Axiom fixpoint_invariant:
forall A (code: PTree.t A) successors transf ep ev
(P: L.t -> Prop),
P L.bot ->
(forall x y, P x -> P y -> P (L.lub x y)) ->
(forall pc instr x, code!pc = Some instr -> P x -> P (transf pc x)) ->
P ev ->
forall res pc,
fixpoint code successors transf ep ev = Some res ->
P res!!pc.