package rocq-runtime

  1. Overview
  2. Docs
The Rocq Prover -- Core Binaries and Tools

Install

Dune Dependency

Authors

Maintainers

Sources

rocq-9.0.0.tar.gz
md5=8d522602d23e7a665631826dab9aa92b
sha512=f4f76a6a178e421c99ee7a331a2fd97a06e9c5d0168d7e60c44e3820d8e1a124370ea104ad90c7f87a9a1e9d87b2d0d7d2d387c998feeaed4a75ed04e176a4be

doc/rocq-runtime.clib/Diff2/Make/index.html

Module Diff2.MakeSource

Functor building an implementation of the diff structure given a sequence type.

Parameters

module M : SeqType

Signature

Sourcetype t = M.t

The type of input sequence.

Sourcetype elem = M.elem

The type of the elements of result / input sequence.

Sourceval lcs : ?equal:(elem -> elem -> bool) -> t -> t -> elem common list

lcs ~equal seq1 seq2 computes the LCS (longest common sequence) of seq1 and seq2. Elements of seq1 and seq2 are compared with equal. equal defaults to Pervasives.(=).

Elements of lcs are `Common (pos1, pos2, e) where e is an element, pos1 is a position in seq1, and pos2 is a position in seq2.

Sourceval diff : ?equal:(elem -> elem -> bool) -> t -> t -> elem edit list

diff ~equal seq1 seq2 computes the diff of seq1 and seq2. Elements of seq1 and seq2 are compared with equal.

Elements only in seq1 are represented as `Removed (pos, e) where e is an element, and pos is a position in seq1; those only in seq2 are represented as `Added (pos, e) where e is an element, and pos is a position in seq2; those common in seq1 and seq2 are represented as `Common (pos1, pos2, e) where e is an element, pos1 is a position in seq1, and pos2 is a position in seq2.

Sourceval fold_left : ?equal:(elem -> elem -> bool) -> f:('a -> elem edit -> 'a) -> init:'a -> t -> t -> 'a

fold_left ~equal ~f ~init seq1 seq2 is same as diff ~equal seq1 seq2 |> ListLabels.fold_left ~f ~init, but does not create an intermediate list.

Sourceval iter : ?equal:(elem -> elem -> bool) -> f:(elem edit -> unit) -> t -> t -> unit

iter ~equal ~f seq1 seq2 is same as diff ~equal seq1 seq2 |> ListLabels.iter ~f, but does not create an intermediate list.

OCaml

Innovation. Community. Security.