package codex

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Imperative.MakeValuedNodeSource

This creates a valued node by wrapping an elt with a pointer (same as MakeSimpleNode), but here representatives also have a Value.t attached.

Parameters

module Value : Parameters.SIMPLE_GENERIC_VALUE with type ('a, 'b) relation = ('a, 'b) Relation.t

Signature

include Parameters.UF_NODE_WITH_VALUE with module Relation = Relation and module Value = Value
include Parameters.UF_NODE with module Relation = Relation
include Parameters.SIMPLE_GENERIC_ELT
Sourcetype 'a t

The type of elements (nodes) in the union-find structure

Sourceval polyeq : 'a t -> 'b t -> ('a, 'b) PatriciaTree.cmp

polymorphic equality on elements

Sourcemodule Relation = Relation
Sourcemodule Value = Value
Sourcetype 'a root = {
  1. mutable value : 'a Value.t;
  2. mutable size : int;
}

The type of root nodes, attached to each representative

Sourcetype 'a parent =
  1. | Node : 'b t * ('a, 'b) Relation.t -> 'a parent
  2. | Root of 'a root
    (*

    The type of parents. A term either points to:

    • a representative via a relation
    • a root if it is a representative
    *)
Sourceval get_parent : 'a t -> 'a parent
Sourceval set_parent : 'a t -> 'a parent -> unit
Sourceval payload : 'a t -> 'a Elt.t

Inspect the payload of a node

Sourceval make_node : 'a Elt.t -> 'a Value.t -> 'a t

Create a new node with given value, in its own class. At most one node should be created per element!