package dose3

  1. Overview
  2. Docs

Dependency solver. Implementation of the Edos algorithms

type solver

the solver is an abstract data type associated to a universe

val load : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> Cudf.universe -> solver

initialize the solver.

val is_consistent : Cudf.universe -> Diagnostic.diagnosis

check if the universe universe is consistent (all installed packages are coinstallable) This function is a wrapper of Cudf_checker.is_consistent.

val edos_install : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> Cudf.universe -> Cudf.package -> Diagnostic.diagnosis

check if the given package can be installed in the universe

Packages marked as `Keep_package must be always installed.

val edos_coinstall : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> Cudf.universe -> Cudf.package list -> Diagnostic.diagnosis

check if the give package list can be installed in the universe

val edos_coinstall_prod : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> Cudf.universe -> Cudf.package list list -> Diagnostic.diagnosis list

accept a list of list of packages and return the coinstallability test of the cartesian product.

val trim : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> Cudf.universe -> Cudf.universe

remove uninstallable packages from the universe .

val trimlist : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> Cudf.universe -> Cudf.package list -> Cudf.package list

remove uninstallable packages from the pkglist.

val find_broken : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> Cudf.universe -> Cudf.package list

return the list of broken packages.

val find_installable : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> Cudf.universe -> Cudf.package list

return the list of installable packages.

val find_listbroken : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> Cudf.universe -> Cudf.package list -> Cudf.package list

return the list of broken packages.

val find_listinstallable : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> Cudf.universe -> Cudf.package list -> Cudf.package list

return the list of installable packages.

val univcheck : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> ?callback:(Diagnostic.diagnosis -> unit) -> ?explain:bool -> Cudf.universe -> int

univcheck check if all packages in the universe can be installed. Since not all packages are directly tested for installation, if a packages is installable, the installation might be empty. To obtain an installation set for each installable packages, the correct procedure is to iter on the list of packages.

  • parameter callback

    : execute a function for each package. This function can have side effects and can be used to collect the installation set or the failure reason.

  • returns

    the number of broken packages

val univcheck_lowmem : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> ?callback:(Diagnostic.diagnosis -> unit) -> ?explain:bool -> Cudf.universe -> int
val listcheck : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> ?callback:(Diagnostic.diagnosis -> unit) -> ?explain:bool -> Cudf.universe -> Cudf.package list -> int

listcheck ~callback:c subuniverse l check if all packages in l can be installed.

Invariant : l is a subset of universe can be installed in the solver universe.

It is responsability of the user to pass listcheck an appropriate subuniverse`

  • parameter callback

    : execute a function for each package.

  • returns

    the number of broken packages

val dependency_closure : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> ?maxdepth:int -> ?conjunctive:bool -> Cudf.universe -> Cudf.package list -> Cudf.package list

dependency_closure index l return the union of the dependency closure of all packages in l .

  • parameter maxdepth

    the maximum cone depth (infinite by default)

  • parameter conjunctive

    consider only conjunctive dependencies (false by default)

  • parameter universe

    the package universe

  • parameter pkglist

    a subset of universe

val reverse_dependencies : Cudf.universe -> Cudf.package list Dose_common.CudfAdd.Cudf_hashtbl.t

reverse_dependencies univ compute the reverse dependency list of all packages in the universe univ

val reverse_dependency_closure : ?maxdepth:int -> Cudf.universe -> Cudf.package list -> Cudf.package list

reverse_dependencies_closure univ compute the reverse dependency list of all packages in l in the universe univ

type enc =
  1. | Cnf
  2. | Dimacs
val output_clauses : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> ?enc:enc -> Cudf.universe -> string

output_clauses enc univ return a string encoded accordingly to enc (default cnf).

type depclean_result = Cudf.package * (Cudf_types.vpkglist * Cudf_types.vpkg * Cudf.package list) list * (Cudf_types.vpkg * Cudf.package list) list

The result of the depclean function is a tuple containing a package, a list of dependencies that are redundant and a list of conflicts that are redundant

val depclean : ?global_constraints:(Cudf_types.vpkglist * Cudf.package list) list -> ?callback:(depclean_result -> unit) -> Cudf.universe -> Cudf.package list -> depclean_result list

For each package p in packagelist, depclean univ packagelist detect redundundant dependencies that refer to packages that are either missing or not co-installable together with the root package p

type solver_result =
  1. | Sat of Cudf.preamble option * Cudf.universe
  2. | Unsat of Diagnostic.diagnosis option
  3. | Error of string
val dummy_request : Cudf.package

an empty package used to enforce global contraints on the request

val check_request : ?cmd:string -> ?criteria:string -> ?dummy:Cudf.package -> ?explain:bool -> Cudf.cudf -> solver_result

check_request check if there exists a solution for the give cudf document if ?dummy is specified, adds this dummy package to the user request. This parameter is used to encode a list of 'essential' packages that must always be installed in the solution alongside with the user request. if ?cmd is specified, it will be used to call an external cudf solver to satisfy the request. if ?criteria is specified it will be used as optimization criteria. if ?explain is specified and there is no solution for the give request, the result will contain the failure reason.

val check_request_using : ?call_solver:(Cudf.cudf -> Cudf.preamble option * Cudf.universe) -> ?dummy:Cudf.package -> ?explain:bool -> Cudf.cudf -> solver_result

Same as check_request, but allows to specify any function to call the external solver. It should raise Depsolver.Unsat on failure.

val installation_graph : solution:Cudf.universe -> (Dose_common.CudfAdd.Cudf_set.t * Dose_common.CudfAdd.Cudf_set.t) -> Defaultgraphs.ActionGraph.G.t

Build the installation graph from a cudf solution universe and sets of packages to be installed/removed (see CudfAdd.make_summary)

OCaml

Innovation. Community. Security.