expression.project(tape)

An expression that keeps only the selected tape of the original expression.

Preconditions:

  • the original expression is multitape.
  • the tape number is smaller than the number of tapes.

Examples

In [1]:
import vcsn
ctx = vcsn.context("lat<lal_char(ab), lan_char(cd), lal_char(ef)>, q")
In [2]:
e = ctx.expression("(a*|<-1>c*|f)(a|\e|f) + (b|c|e)*")
e
Out[2]:
$\left(b|c|e\right)^{*} + \left( \left. {a}^{*} \middle| \left\langle -1 \right\rangle \,{c}^{*} \middle| f \right. \right) \, \left(a|\varepsilon|f\right)$
In [3]:
e.project(0)
Out[3]:
${b}^{*} + {a}^{*} \, a$
In [4]:
e.project(1)
Out[4]:
$\emptyset$
In [5]:
e.project(2)
Out[5]:
${e}^{*} + f \, f$