package lrgrep

  1. Overview
  2. Docs
Analyse the stack of a Menhir-generated LR parser using regular expressions

Install

dune-project
 Dependency

Authors

Maintainers

Sources

lrgrep-0.3.tbz
sha256=84a1874d0c063da371e19c84243aac7c40bfcb9aaf204251e0eb0d1f077f2cde
sha512=5a16ff42a196fd741bc64a1bdd45b4dca0098633e73aa665829a44625ec15382891c3643fa210dbe3704336eab095d4024e093e37ae5313810f6754de6119d55

doc/utils/Utils/Refine/Make/argument-1-Set/index.html

Parameter Make.Set

type 'a t

The abstract type representing sets that we want to refine.

val is_empty : 'a t -> bool

is_empty s determines whether the set s is empty.

val compare : 'a t -> 'a t -> int

Total ordering.

val compare_minimum : 'a t -> 'a t -> int

compare_minimum s1 s2 compares the nonempty sets s1 and s2 based on their minimum elements.

val sorted_union : 'a t list -> 'a t

sorted_union ss computes the union of all sets in the list ss. Every set in the list ss must be nonempty. The intervals that underlie these sets must be ordered and nonoverlapping: that is, if s1 and s2 are two adjacent sets in the list ss, then they must satisfy the condition maximum s1 < minimum s2.

val extract_unique_prefix : 'a t -> 'a t -> 'a t * 'a t

extract_unique_prefix s1 s2 requires compare_minimum s1 s2 < 0, that is, minimum s1 < minimum s2. It splits s1 in two disjoint subsets head1 and tail1 such that head1 is exactly the subset of s1 whose elements are less than minimum s2. Therefore, head1 must be nonempty, whereas tail1 may be empty.

val extract_shared_prefix : 'a t -> 'a t -> 'a t * ('a t * 'a t)

extract_shared_prefix s1 s2 requires compare_minimum s1 s2 = 0, that is, minimum s1 = minimum s2. It splits s1 and s2 into three subsets head, tail1, and tail2, as follows:

  • s1 is head U tail1 and s2 is head U tail2. This implies that head is a subset of both s1 and s2.
  • An element in head is smaller than every element in tail1 and tail2.
  • head is maximal with respect to the previous two properties.

In summary, head is the maximal shared prefix of the sets s1 and s2.