package goblint
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=af01aac256229f33a90a9fcbfed04b01e3097f154d4d124f006476d6387c6a66
sha512=2a93bfe16881adbc2d8dcbfe38c1e19cd24ca105d8e1eda13d02440f3002874ffe2957dfd937510765233a054a40568b0052db92e31d382a5bd215d1ec12565c
doc/goblint.lib/Goblint_lib/UnionFind/UnionFind/index.html
Module UnionFind.UnionFind
Quantitative union find
module ValMap = TMapval equal_node :
'v. ('v -> 'v -> Ppx_deriving_runtime.bool) ->
'v node ->
'v node ->
Ppx_deriving_runtime.boolval compare_node :
'v. ('v -> 'v -> Ppx_deriving_runtime.int) ->
'v node ->
'v node ->
Ppx_deriving_runtime.intval hash_node : ('v -> int) -> 'v node -> intval equal : t -> t -> Ppx_deriving_runtime.boolval compare : t -> t -> Ppx_deriving_runtime.intval hash : t -> intexception UnknownValue of T.tval empty : 'a ValMap.tval parent : ('a * 'b) ValMap.t -> ValMap.key -> 'a`parent uf v` returns (p, z) where p is the parent element of v in the union find tree and z is the offset.
Throws "Unknown value" if v is not present in the data structure.
val parent_opt : ('a * 'b) ValMap.t -> ValMap.key -> 'a option`parent_opt uf v` returns Some (p, z) where p is the parent element of v in the union find tree and z is the offset. It returns None if v is not present in the data structure.
val parent_term : (('a * 'b) * 'c) ValMap.t -> ValMap.key -> 'aval parent_offset : (('a * 'b) * 'c) ValMap.t -> ValMap.key -> 'bval subtree_size : ('a * 'b) ValMap.t -> ValMap.key -> 'bval modify_size :
ValMap.key ->
((T.t * 'a) * 'b) ValMap.t ->
('b -> 'b) ->
((T.t * 'a) * 'b) ValMap.tModifies the size of the equivalence class for the current element and for the whole path to the root of this element.
The third parameter `modification` is the function to apply to the sizes.
val modify_parent :
(('a * 'b) * 'c) ValMap.t ->
ValMap.key ->
('a * 'b) ->
(('a * 'b) * 'c) ValMap.tval modify_offset :
(('a * 'b) * 'c) ValMap.t ->
ValMap.key ->
('b -> 'b) ->
(('a * 'b) * 'c) ValMap.tReturns true if each equivalence class in the data structure contains only one element, i.e. every node is a root.
val is_root :
((T.t * 'a) * 'b) ValMap.t ->
ValMap.key ->
Ppx_deriving_runtime.boolReturns true if v is the representative value of its equivalence class.
Throws "Unknown value" if v is not present in the data structure.
For a variable v it returns the reference variable v' and the offset r'. This find performs path compression. It returns als the updated union-find tree after the path compression.
Throws "Unknown value" if v is not present in the data structure. Throws "Invalid Union Find" if it finds an element in the data structure that is a root but it has a non-zero distance to itself.
val find_no_pc : ((T.t * Z.t) * 'a) ValMap.t -> ValMap.key -> T.t * Z.tFor a variable v it returns the reference variable v' and the offset r'. This find DOES NOT perform path compression.
Throws "Unknown value" if t is not present in the data structure. Throws "Invalid Union Find" if it finds an element in the data structure that is a root but it has a non-zero distance to itself.
val compare_repr_v : (T.t * 'a) -> (T.t * 'b) -> Ppx_deriving_runtime.intCompare only first element of the tuples (= the parent term). It ignores the offset.
val union :
((T.t * Z.t) * int) ValMap.t ->
ValMap.key ->
ValMap.key ->
Z.t ->
T.t * ((T.t * Z.t) * int) ValMap.t * boolParameters: uf v1 v2 r
changes the union find data structure `uf` such that the equivalence classes of `v1` and `v2` are merged and `v1 = v2 + r`
returns v,uf,b where
- `v` is the new reference term of the merged equivalence class. It is either the old reference term of v1 or of v2, depending on which equivalence class is bigger.
- `uf` is the new union find data structure
- `b` is true iff v = find v1
val get_eq_classes :
((T.t * Z.t) * 'a) ValMap.t ->
(ValMap.key * ((T.t * Z.t) * 'a)) list listReturns a list of equivalence classes.
Throws "Unknown value" if the data structure is invalid.
val get_representatives : ((T.t * 'a) * 'b) ValMap.t -> ValMap.key listReturns a list of representative elements.