package asak

  1. Overview
  2. Docs
type threshold =
  1. | Percent of int
    (*

    A percentage threshold, a number between 0 and 100.

    *)
  2. | Hard of int
    (*

    A hard threshold.

    *)
val hash_lambda : bool -> threshold -> Lambda.lambda -> (int * string) * (int * string) list

Hash a lambda expression. Usage: hash_lambda will_sort threshold expr. Two lambda expressions "of the same shape" will share the same hash.

  • parameter will_sort

    If true, then all lists of hash will be sorted. This is useful to identify more codes, but can leads to some false-positive.

  • parameter threshold

    Used to decide which sub-AST's hash is kept.

  • parameter expr

    The expression.

  • returns

    A tuple with the main hash, and a list of hashes of sub-ASTs. All hashes are given with the weight of their AST.

val inline_all : Lambda.lambda -> Lambda.lambda

Inline all possible (ie. without side effect) expressions in a lambda expression.

OCaml

Innovation. Community. Security.