Module Automata.Word

Words over the character alphabet.

A word is a Char.t list (i.e. a string list). This module provides the ordered, hashable, comparable type t needed to use words as map and set keys, together with the suffix / prefix closure operations used by the gen encoding and the Angluin learner.

module T : sig ... end
module TC : sig ... end
include module type of struct include TC end
include module type of struct include T end
type t = Char.t Base.list
val compare : t -> t -> Base.int
val hash_fold_t : Ppx_hash_lib.Std.Hash.state -> t -> Ppx_hash_lib.Std.Hash.state
val hash : t -> Ppx_hash_lib.Std.Hash.hash_value
val equal : t -> t -> Base.bool
val sexp_of_t : t -> Sexplib0.Sexp.t
include sig ... end
type comparator_witness = Base__Comparator.Make(T).comparator_witness
val comparator : (T.t, comparator_witness) Base__Comparator.comparator
type 'a map = (t, 'a, comparator_witness) Base.Map.t
type set = (t, comparator_witness) Base.Set.t
val empty : 'a list

The empty word ε.

val prefixes : Char.t Base.List.t -> (TC.t, TC.comparator_witness) Base.Set.t

prefixes w returns the set ε, a₁, a₁a₂, …, w of all prefixes of w.

val suffixes : Char.t Base.List.t -> (TC.t, TC.comparator_witness) Base.Set.t

suffixes w returns the set ε, aₙ, aₙ₋₁aₙ, …, w of all suffixes of w. Used by the gen encoding to compute the generator variable closure and by the SWAL learner's Suffixes counterexample extension strategy.

val to_string : Base.String.t list -> Base.String.t

to_string w pretty-prints w as a concatenated string, or "eps" for ε.