package term-indexing

  1. Overview
  2. Docs

Paths in first-order terms.

type 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.

type forward = int list

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

val root : t

root is Root

val at_index : int -> t -> t

at_index i p is At_index (i, p).

val concat : above:t -> under:t -> t

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

val reverse : t -> forward

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

val compare : t -> t -> int

compare is a total order.

val equal : t -> t -> bool

equal s1 s2 tests whether s1 and s2 are equal.

val hash : t -> int

hash s is a hash of s.

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

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

val to_string : t -> string
OCaml

Innovation. Community. Security.