package kappa-library

  1. Overview
  2. Docs

Functions from a subset of nat to a subset of nat

exception Undefined
exception NotBijective
exception Clashing
type t
val dummy : t
val empty : unit -> t
val is_identity : t -> bool
val identity : int list -> t
val cyclic_permutation_from_list : stop_at:int -> int list -> t

very specific use case for Connected_component.remove_ag_cc

val imperative_add : debug_mode:bool -> int -> int -> t -> bool
  • returns

    if the addition preserves injectivity

val add : debug_mode:bool -> int -> int -> t -> t option
  • returns

    None if the addition would break injectivity

val compose : debug_mode:bool -> bool -> t -> t -> t
val apply : debug_mode:bool -> t -> int -> int
val mem : int -> t -> bool
val inverse : t -> t
val compare : t -> t -> int
val equal : t -> t -> bool
val min_elt : t -> (int * int) option
val fold : (int -> int -> 'a -> 'a) -> t -> 'a -> 'a
val to_list : t -> (int * int) list
val print : Format.formatter -> t -> unit

prints only non identity points

val print_full : Format.formatter -> t -> unit
val to_yojson : t -> Yojson.Basic.t
val of_yojson : Yojson.Basic.t -> t
OCaml

Innovation. Community. Security.