Module Lang.Primes

Primes benchmark — unbounded natural-number WFA.

A 2-state WFA over a 4-letter alphabet {a, b, c, d} where each letter is associated with a distinct prime p: reading letter x in the second state multiplies by its prime. The language maps a word to the product of the primes of its letters. Used to exercise the learner on a multi-letter alphabet with unbounded Nat weights.

module S : sig ... end
module Matrix : sig ... end
module Aut : sig ... end
val primes : int list
val zipped : (Automata.Char.t * int) Base.List.t
val bound : int
val aut : Aut.t

The target automaton: 2 states. For each letter x with associated prime p, the transition matrix is [1;0];[1;p], encoding a "multiply by p" operation on the second component.

val out : Automata.Word.t -> Aut.s