automaton.expression(identities="default", algo="auto")
Apply the Brzozowski-McCluskey procedure, to compute a (basic) expression from an automaton.
Arguments:
identities: the identities of the resulting expressionalgo: a heuristics to choose the order in which states are eliminated"auto": same as
"best""best": run all the heuristics, and return the shortest result
"naive": a simple heuristics which eliminates states with few incoming/outgoing transitions
"delgado": choose a state whose removal would add a small expression (number of nodes) to the result
"delgado_label": choose a state whose removal would add a small expression (number of labels in the expression) to the result
See also:
Examples
Unfortunately there is no guarantee that the resulting expression is as simple as one could hope for. Note also that expression.derived_term tends to build automata which give nicer results than expression.standard.
Identities
You may pass the desired identities as an argument.