Interface
KnuthBendix.Automata.Automaton — Type
Automaton{S} aka. DFAStruct for deterministic finite automata (DFA) with states of type S.
KnuthBendix.Automata.initial — Function
initial(A::Automaton)Return the initial state of a (deterministic) automaton.
KnuthBendix.Automata.hasedge — Function
hasedge(A::Automaton, σ, label)Check if A contains an edge starting at σ labeled by label
KnuthBendix.Automata.isfail — Function
isfail(A::Automaton, σ)Check if state σ is a fail state in automaton A.
KnuthBendix.Automata.isaccepting — Function
isaccepting(A::Automaton, σ)Check if state σ is an accepting (terminal) state of automaton A.
KnuthBendix.Automata.trace — Function
trace(label, A::Automaton, σ)Return τ if (σ, label, τ) is in A, otherwise return nothing.
trace(w::AbstractVector, A::Automaton[, σ=initial(A)])Return a pair (l, τ), where
lis the length of the longest prefix ofwwhich defines a path starting
at σ in A and
τis the last state (node) on the path.
returned.
Proving finiteness
KnuthBendix.Automata.infiniteness_certificate — Function
infiniteness_certificate(ia::IndexAutomaton)Find a family of irreducible words of unbounded length if it exists.
Returns a witness w of the infiniteness, i.e.
[w.prefix * w.suffix^n for n in ℕ]is an infinite family of words irreducible with respect to ia.
Conversly if w.suffix is the trivial word no such infinite family exists and therefore the there are only finitely many irreducible words for ia.
Base.isfinite — Method
isfinite(ia::Automaton)Return true if the language of the automaton is proven to be finite.
KnuthBendix.Automata.irreducible_words — Function
irreducible_words(a::Automaton[, min_length=0, max_length=typemax(UInt)])All words from the language of a, of length between min_length and max_length.
The words are returned form depth-first search, and hence are not ordered lexicographically.