automata
Types
Values
pub fn accepts(
automaton: Automaton(state, symbol),
inputs: List(symbol),
) -> Bool
Return True when the automaton accepts the supplied input.
pub fn initial_state(
automaton: Automaton(state, symbol),
) -> state
Return the initial state.
pub fn new(
initial_state initial_state: state,
transition transition: fn(state, symbol) -> state,
accepting accepting: fn(state) -> Bool,
) -> Automaton(state, symbol)
Construct an automaton from its initial state, transition function, and acceptance predicate.
pub fn run(
automaton: Automaton(state, symbol),
inputs: List(symbol),
) -> state
Fold a list of input symbols over the automaton’s transition function and return the resulting state.