automaton.conjugate

Create the conjugate of an automaton. The conjugate of $\mathcal{A}$ is defined as the automaton recognizing the language $\{vu \mid u, v \in \Sigma^*\text{ and }uv\text{ recognized by }\mathcal{A}\}$.

Preconditions:

  • labelset is nullable

Postconditions:

  • None

Examples

In [1]:
import vcsn
In [2]:
ctx = vcsn.context('lan_char, b')
a = ctx.expression('ab*').automaton()
a
Out[2]:
%3 I0 0 0 I0->0 F1 1 1 0->1 a 1->F1 1->1 b
In [3]:
a.shortest(10)
Out[3]:
$\mathit{a} \oplus \mathit{ab} \oplus \mathit{abb} \oplus \mathit{abbb} \oplus \mathit{abbbb} \oplus \mathit{abbbbb} \oplus \mathit{abbbbbb} \oplus \mathit{abbbbbbb} \oplus \mathit{abbbbbbbb} \oplus \mathit{abbbbbbbbb}$
In [4]:
conj = a.conjugate()
conj
Out[4]:
%3 I0 0 0 I0->0 I2 2 2 I2->2 I7 7 7 I7->7 F1 F4 F9 1 1 0->1 a 1->F1 1->1 b 3 3 2->3 a 3->3 b 4 4 3->4 ε 4->F4 5 5 4->5 a 5->5 b 6 6 6->7 a 7->7 b 8 8 7->8 ε 9 9 8->9 a 9->F9 9->9 b
In [5]:
conj.shortest(10)
Out[5]:
$\mathit{a} \oplus \mathit{ab} \oplus \mathit{ba} \oplus \mathit{abb} \oplus \mathit{bab} \oplus \mathit{bba} \oplus \mathit{abbb} \oplus \mathit{babb} \oplus \mathit{bbab} \oplus \mathit{bbba}$