Module Imperative.MakeSimpleNumberedNode

Same as MakeSimpleNode, but also remembers all built node in a PatriciaTree so we can check if terms already have an associated node

Parameters

Signature

include sig ... end
module Node : sig ... end
module Relation : sig ... end
type root = MakeSimpleNode(Term)(Relation).root = {
  1. mutable size : int;
}
type !'a parent = 'a MakeSimpleNode(Term)(Relation).parent =
  1. | Node : 'b Node.t * ('a0, 'b) Relation.t -> 'a0 parent
  2. | Root of 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 Node.t

Create a new node, 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 Node.t

Returns the node associated with the given term if it exists, else builds it