expression | exp

Build the tuple of expressions, ie the $k$-tape expression whose behavior is the Cartesian product of the behaviors of the input expressions.

See also:

Examples

In [1]:
import vcsn
exp = vcsn.context('lan, q').expression
e1 = exp('abc')
e1
Out[1]:
$a \, b \, c$
In [2]:
e2 = exp('(<2>x)*')
e2
Out[2]:
$\left( \left\langle 2 \right\rangle \,x\right)^{*}$
In [3]:
e1 | e2
Out[3]:
$ \left. a \, b \, c \middle| \left( \left\langle 2 \right\rangle \,x\right)^{*} \right. $
In [4]:
(e1 | e2).automaton()
Out[4]:
%3 I0 0 0 I0->0 F5 F6 1 1 0->1 a|ε 2 2 0->2 ⟨2⟩a|x 3 3 1->3 b|ε 2->3 b|ε 4 4 2->4 ⟨2⟩b|x 5 5 3->5 c|ε 4->5 c|ε 6 6 4->6 ⟨2⟩c|x 5->F5 6->F6 6->6 ⟨2⟩ε|x
In [5]:
e1.automaton() | e2.automaton()
Out[5]:
%3 I0 0 0, 0 I0->0 F5 F6 F7 1 1, post 0->1 a|ε 2 1, 0 0->2 ⟨2⟩a|x 3 2, post 1->3 b|ε 2->3 b|ε 4 2, 0 2->4 ⟨2⟩b|x 5 3, post 3->5 c|ε 4->5 c|ε 6 3, 0 4->6 ⟨2⟩c|x 5->F5 6->F6 7 post, 0 6->7 ⟨2⟩ε|x 7->F7 7->7 ⟨2⟩ε|x