package asak

  1. Overview
  2. Docs
module Distance : sig ... end
val symmetric_difference : 'a list -> 'a list -> bool * 'a list

Compute the symmetric difference of two sorted lists. Return also if the intersection was not empty.

val dist : ((int * string) list * 'b) Wtree.wtree -> ((int * string) list * 'b) Wtree.wtree -> Distance.t

Compute recursively the distance between two clusters:

  • If there is two Wtree.wtree.Leaf, use the sum of the weight of the symmetric difference of their hash lists (or Infinity if the intersection was empty).
  • If there is a Wtree.wtree.Node, use the maximum of the distances between the sub-trees and the other tree.
val cluster : ('a * (int * string) list) list -> 'a list Wtree.wtree list

Given a list of AST hashes (identified by a key), perform a kind of complete-linkage clustering using dist.

  • returns

    A list of trees, where two keys are in the same tree if they share at least one hash, and in the same leaf if they share exactly the same hash list.

    The list is sorted with biggest trees first.

OCaml

Innovation. Community. Security.