sig
  type reason =
      Dependency of (Cudf.package * Cudf_types.vpkg list * Cudf.package list)
    | Missing of (Cudf.package * Cudf_types.vpkg list)
    | Conflict of (Cudf.package * Cudf.package * Cudf_types.vpkg)
  type request = Package of Cudf.package | PackageList of Cudf.package list
  type result =
      Success of (?all:bool -> unit -> Cudf.package list)
    | Failure of (unit -> Diagnostic.reason list)
  type diagnosis = {
    result : Diagnostic.result;
    request : Diagnostic.request;
  }
  module ResultHash :
    sig
      type key = reason
      type 'a t
      val create : int -> 'a t
      val clear : 'a t -> unit
      val reset : 'a t -> unit
      val copy : 'a t -> 'a t
      val add : 'a t -> key -> '-> unit
      val remove : 'a t -> key -> unit
      val find : 'a t -> key -> 'a
      val find_all : 'a t -> key -> 'a list
      val replace : 'a t -> key -> '-> unit
      val mem : 'a t -> key -> bool
      val iter : (key -> '-> unit) -> 'a t -> unit
      val fold : (key -> '-> '-> 'b) -> 'a t -> '-> 'b
      val length : 'a t -> int
      val stats : 'a t -> Hashtbl.statistics
    end
  type summary = {
    mutable missing : int;
    mutable conflict : int;
    mutable unique_missing : int;
    mutable unique_conflict : int;
    summary : Cudf.package list Pervasives.ref Diagnostic.ResultHash.t;
  }
  val default_result : int -> Diagnostic.summary
  val collect : Diagnostic.summary -> Diagnostic.diagnosis -> unit
  type pp = Cudf.package -> string * string * (string * string) list
  val default_pp : Diagnostic.pp
  val pp_package :
    ?source:bool -> Diagnostic.pp -> Format.formatter -> Cudf.package -> unit
  val pp_vpkglist :
    Diagnostic.pp -> Format.formatter -> Cudf_types.vpkglist -> unit
  val pp_dependency :
    Diagnostic.pp ->
    ?label:string ->
    Format.formatter -> Cudf.package * Cudf_types.vpkglist -> unit
  val pp_dependencies :
    Diagnostic.pp ->
    Format.formatter ->
    (Cudf.package * Cudf_types.vpkglist) list list -> unit
  val pp_list :
    (Format.formatter -> '-> unit) -> Format.formatter -> 'a list -> unit
  val print_error :
    Diagnostic.pp ->
    Cudf.package -> Format.formatter -> Diagnostic.reason list -> unit
  val get_installationset :
    ?minimal:bool -> Diagnostic.diagnosis -> Cudf.package list
  val is_solution : Diagnostic.diagnosis -> bool
  val pp_summary :
    ?pp:(Cudf.package -> Cudf_types.pkgname * string * (string * string) list) ->
    ?explain:bool -> unit -> Format.formatter -> Diagnostic.summary -> unit
  val print_error_human :
    ?prefix:string ->
    Diagnostic.pp ->
    Cudf.package -> Format.formatter -> Diagnostic.reason list -> unit
  val fprintf_human :
    ?pp:Diagnostic.pp ->
    ?prefix:string -> Format.formatter -> Diagnostic.diagnosis -> unit
  val fprintf :
    ?pp:Diagnostic.pp ->
    ?failure:bool ->
    ?success:bool ->
    ?explain:bool ->
    ?minimal:bool -> Format.formatter -> Diagnostic.diagnosis -> unit
  val printf :
    ?pp:Diagnostic.pp ->
    ?failure:bool ->
    ?success:bool -> ?explain:bool -> Diagnostic.diagnosis -> unit
end