package term-indexing

  1. Overview
  2. Docs

Module Make.PathSource

Paths in first-order terms.

Sourcetype t = private Path.t =
  1. | Root
    (*

    Root corresponds to the empty path.

    *)
  2. | At_index of int * t
    (*

    At_index(i, p) corresponds to the ith subterm corresponding to the term at path p.

    *)

The type of backward paths. A value of type t describes a path from a subterm to the root.

Sourcetype forward = int list

The type of forward paths. A value of type forward describes a path from the root to a subterm.

Sourceval root : t

root is Root

Sourceval at_index : int -> t -> t

at_index i p is At_index (i, p).

Sourceval concat : above:t -> under:t -> t

concat above under is the path obtained by concatenating above and under.

Sourceval reverse : t -> forward

reverse p is the forward path corresponding to the backward path p.

Sourceval compare : t -> t -> int

compare is a total order.

Sourceval equal : t -> t -> bool

equal s1 s2 tests whether s1 and s2 are equal.

Sourceval hash : t -> int

hash s is a hash of s.

Sourceval pp : Format.formatter -> t -> unit

pp fmt s prints a representation of s to the formatter fmt.

Sourceval to_string : t -> string
OCaml

Innovation. Community. Security.