Skip to content

Commit

Permalink
Revert "Fix links to Sigs module"
Browse files Browse the repository at this point in the history
This reverts commit 24f001d.
  • Loading branch information
dlesbre committed Jul 18, 2024
1 parent a3287ca commit 7913415
Show file tree
Hide file tree
Showing 5 changed files with 164 additions and 167 deletions.
8 changes: 3 additions & 5 deletions src/PatriciaTree.mli
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
(* for more details (enclosed in the file LICENSE). *)
(**************************************************************************)

exception Not_found

(** Association maps from key to values, and sets, implemented with
Patricia Trees, allowing fast merge operations by making use of
physical equality between subtrees; and custom implementation of
Expand Down Expand Up @@ -99,8 +97,8 @@ exception Not_found
notably (key,value) pairs or different types to be in the same map,
or to choose the memory representation of the nodes of the tree.}
{- Some operations like {{!Sigs.BASE_MAP.pop_unsigned_minimum}[pop_unsigned_minimum]} and
{{!Sigs.BASE_MAP.pop_unsigned_maximum}[pop_unsigned_maximum]} make our Set
{- Some operations like {{!BASE_MAP.pop_unsigned_minimum}[pop_unsigned_minimum]} and
{{!BASE_MAP.pop_unsigned_maximum}[pop_unsigned_maximum]} make our Set
suitable as priority queue (but remember that each element in the
queue must map to a distinct integer, and that using the {{!unsigned_lt}unsigned order}
means elements with negative priority are seen as greater than elements with
Expand Down Expand Up @@ -136,7 +134,7 @@ include module type of Ints
include module type of Key_value

(** {1:node_impl Some implementations of NODE} *)
(** We provide a few different implementations of {!Sigs.NODE}, the internal representation
(** We provide a few different implementations of {!NODE}, the internal representation
of a PatriciaTree's nodes. They can be used with
the {!MakeCustomMap}, {!MakeCustomSet}, {!MakeCustomHeterogeneousMap} and
{!MakeCustomHeterogeneousSet} functors to build maps and sets with custom
Expand Down
30 changes: 15 additions & 15 deletions src/functors.mli
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,9 @@ module MakeHeterogeneousMap(Key: HETEROGENEOUS_KEY)(Value: HETEROGENEOUS_VALUE)
disk, lazy evaluation and/or caching, adding size information for
constant time [cardinal] functions, etc.
See {!node_impl} for the provided implementations of {!Sigs.NODE}, or create your own. *)
See {!node_impl} for the provided implementations of {!NODE}, or create your own. *)

(** Create a homogeneous map with a custom {!Sigs.NODE}. Also allows
(** Create a homogeneous map with a custom {!NODE}. Also allows
customizing the map values *)
module MakeCustomMap
(Key: KEY)
Expand All @@ -81,7 +81,7 @@ module MakeCustomMap
and type 'm t = 'm Node.t


(** Create a homogeneous set with a custom {!Sigs.NODE}.
(** Create a homogeneous set with a custom {!NODE}.
@since v0.10.0 *)
module MakeCustomSet
(Key: KEY)
Expand All @@ -90,7 +90,7 @@ module MakeCustomSet
with type elt = Key.t
and type 'a BaseMap.t = 'a Node.t

(** Create an heterogeneous map with a custom {!Sigs.NODE}. *)
(** Create an heterogeneous map with a custom {!NODE}. *)
module MakeCustomHeterogeneousMap
(Key: HETEROGENEOUS_KEY)
(Value: HETEROGENEOUS_VALUE)
Expand All @@ -100,7 +100,7 @@ module MakeCustomHeterogeneousMap
and type ('k,'m) value = ('k,'m) Value.t
and type 'm t = 'm Node.t

(** Create an heterogeneous set with a custom {!Sigs.NODE}.
(** Create an heterogeneous set with a custom {!NODE}.
@since v0.10.0 *)
module MakeCustomHeterogeneousSet
(Key: HETEROGENEOUS_KEY)
Expand All @@ -115,20 +115,20 @@ module MakeCustomHeterogeneousSet
if so they return it, else they return a new node with a new number.
With this unique numbering:
- [equal] and [compare] become constant time operations;
- two maps with the same bindings (where keys are compared by {!Sigs.KEY.to_int} and
values by {!Sigs.HASHED_VALUE.polyeq}) will always be physically equal;
- functions that benefit from sharing, like {!Sigs.BASE_MAP.idempotent_union} and
{!Sigs.BASE_MAP.idempotent_inter} will see improved performance;
- two maps with the same bindings (where keys are compared by {!KEY.to_int} and
values by {!HASHED_VALUE.polyeq}) will always be physically equal;
- functions that benefit from sharing, like {!BASE_MAP.idempotent_union} and
{!BASE_MAP.idempotent_inter} will see improved performance;
- constructors are slightly slower, as they now require a hash-table lookup;
- memory usage is increased: nodes store their tags inside themselves, and
a global hash-table of all built nodes must be maintained.
This is quickly amortized if multiple identical nodes are built,
as only one will be kept in memory.
- hash-consed maps assume their keys and values are immutable, where regular
maps can mutate values freely;
- {b WARNING:} when using physical equality as {!Sigs.HASHED_VALUE.polyeq}, some
- {b WARNING:} when using physical equality as {!HASHED_VALUE.polyeq}, some
{b maps of different types may be given the same identifier}. See the end of
the documentation of {!Sigs.HASHED_VALUE.polyeq} for details.
the documentation of {!HASHED_VALUE.polyeq} for details.
Note that this is the case in the default implementations {!HashedValue}
and {!HeterogeneousHashedValue}.
Expand All @@ -137,7 +137,7 @@ module MakeCustomHeterogeneousSet
twice with same arguments will lead to two numbering systems for identifiers,
and thus the types should not be considered compatible. *)

(** Hash-consed version of {!Sigs.MAP}. See {!hash_consed} for the differences between
(** Hash-consed version of {!MAP}. See {!hash_consed} for the differences between
hash-consed and non hash-consed maps.
This is a generative functor, as calling it creates a new hash-table to store
Expand All @@ -153,7 +153,7 @@ module MakeHashconsedMap(Key: KEY)(Value: HASHED_VALUE)() : sig
include HASH_CONSED_OPERATIONS with type 'a t := 'a t (** @inline *)
end

(** Hash-consed version of {!Sigs.SET}. See {!hash_consed} for the differences between
(** Hash-consed version of {!SET}. See {!hash_consed} for the differences between
hash-consed and non hash-consed sets.
This is a generative functor, as calling it creates a new hash-table to store
Expand All @@ -169,7 +169,7 @@ module MakeHashconsedSet(Key: KEY)() : sig
include HASH_CONSED_OPERATIONS with type 'a t := t (** @inline *)
end

(** Hash-consed version of {!Sigs.HETEROGENEOUS_SET}. See {!hash_consed} for the differences between
(** Hash-consed version of {!HETEROGENEOUS_SET}. See {!hash_consed} for the differences between
hash-consed and non hash-consed sets.
This is a generative functor, as calling it creates a new hash-table to store
Expand All @@ -185,7 +185,7 @@ module MakeHashconsedHeterogeneousSet(Key: HETEROGENEOUS_KEY)() : sig
include HASH_CONSED_OPERATIONS with type 'a t := t (** @inline *)
end

(** Hash-consed version of {!Sigs.HETEROGENEOUS_MAP}. See {!hash_consed} for the differences between
(** Hash-consed version of {!HETEROGENEOUS_MAP}. See {!hash_consed} for the differences between
hash-consed and non hash-consed maps.
This is a generative functor, as calling it creates a new hash-table to store
Expand Down
Loading

0 comments on commit 7913415

Please sign in to comment.