Module Imperative.MakeNumberedNode

Parameters

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

Signature

include sig ... end
module Node : sig ... end
module Relation : sig ... end
module Value : sig ... end
type !'a root = 'a MakeNode(Term)(Relation)(Value).root = {
  1. mutable value : 'a Value.t;
  2. mutable size : int;
}
type !'a parent = 'a MakeNode(Term)(Relation)(Value).parent =
  1. | Node : 'b Node.t * ('a0, 'b) Relation.t -> 'a0 parent
  2. | Root of 'a root
val get_parent : 'a Node.t -> 'a parent
val set_parent : 'a Node.t -> 'a parent -> unit
val payload : 'a Node.t -> 'a Term.t

Inspect the payload of a node

val make_node : 'a Term.t -> 'a Value.t -> 'a Node.t

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

val get_node : 'a Term.t -> 'a Node.t option

Checks if a node has already been constructed for the given term

val get_or_make_node : 'a Term.t -> 'a Value.t -> 'a Node.t

Returns the node associated with the given term if it exists, else builds it The value is only used when creating nodes