package tezos-protocol-012-Psithaca

  1. Overview
  2. Docs
Module type
Class type

The Nodes module is used to count the number of computation steps performed when evaluating the size of the in-memory graph corresponding to an OCaml value.

In first approximation, the value of type Nodes.t threaded through expr_size below and through the module Script_typed_ir_size is meant to match the number of recursive calls in the traverse functions of Script_typed_ir and in that of node_size.

The assumption is that there's a bounded amount of work performed between two such recursive calls, hence that the total work is bounded above by something proportional to the Nodes.t accumulator.

Computations on values of type Nodes.t do not overflow, as they are bounded above by the number of nodes traversed when computing an OCaml value.

type t = private int
val zero : t
val one : t
val succ : t -> t
val add : t -> t -> t
val to_int : t -> int

Innovation. Community. Security.