Automata — Weighted finite automata

This library defines the core data structures for weighted finite automata (WFAs) and the word type used throughout SWAL.

Modules

WFA representation

Weights are stored as flat arrays (row-major) wrapped in Algebra.Matrix. The mk constructor takes flat lists for ease of hand-writing benchmarks:

let aut = WFA.Make(S).mk
  [S.one; S.zero]          (* initial vector *)
  (Map.singleton (module Char) "a" [S.zero; S.one; S.one; S.zero])
  [S.one; S.zero]          (* output vector *)