expression
.automaton(
algo
="auto")
Generate an automaton from an expression.
The algo
can be:
"auto"
: currently equivalent to "expansion"
, eventually should mix "standard"
for basic expressions (faster) and "expansion"
otherwise (more general)."derivation"
: use derivation-based expression.derived_term, trim and stripped."derived_term"
: same as "expansion"
"expansion"
: use expansion-based expression.derived_term, trim and stripped."standard"
: use expression.standard."thompson"
: use expression.thompson."zpc"
: use expression.zpc, trim."zpc_compact"
: use expression.zpc, "compact" version, trim.See also:
In [1]:
import vcsn
e = vcsn.Q.expression('\e+<2>a+<3>b')
e
Out[1]:
In [2]:
e.automaton('derived_term')
Out[2]:
In [3]:
e.automaton('standard')
Out[3]:
In [4]:
e.automaton('thompson')
Out[4]:
In [5]:
e.automaton('zpc')
Out[5]:
In [6]:
e.automaton('zpc_compact')
Out[6]:
In [7]:
e = vcsn.Q.expression('abc&abd')
e.derived_term()
Out[7]:
In [8]:
e.automaton('derived_term')
Out[8]:
In [9]:
e = vcsn.Q.expression('a?')
e.zpc()
Out[9]:
In [10]:
e.automaton('zpc')
Out[10]: