Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 45900
Kernel: Python 3

expansion.project(tape)

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

Preconditions:

  • the original expression is multitape.

  • the tape number is smaller than the number of tapes.

Examples

import vcsn ctx = vcsn.context("lat<lan_char(ab), lan_char(cd), lan_char(ef)>, q")
e = ctx.expression("a*|c|[ef]") x = e.expansion() x

εce[ε]εcf[ε]ace[a|ε|ε]acf[a|ε|ε]\varepsilon|c|e \odot \left[\varepsilon\right] \oplus \varepsilon|c|f \odot \left[\varepsilon\right] \oplus a|c|e \odot \left[ \left. {a}^{*} \middle| \varepsilon \middle| \varepsilon \right. \right] \oplus a|c|f \odot \left[ \left. {a}^{*} \middle| \varepsilon \middle| \varepsilon \right. \right]

x.project(0)

2a[2a]\left\langle 2\right\rangle \oplus a \odot \left[\left\langle 2\right\rangle {a}^{*}\right]

x.project(1)

c[4ε]c \odot \left[\left\langle 4\right\rangle \varepsilon\right]

x.project(2)

e[2ε]f[2ε]e \odot \left[\left\langle 2\right\rangle \varepsilon\right] \oplus f \odot \left[\left\langle 2\right\rangle \varepsilon\right]

Beware that, because of possible redundancy on other tapes, the projection of an expansion is not necessarily the expansions of the projection.

e.project(0).expansion()

1a[a]\left\langle 1\right\rangle \oplus a \odot \left[{a}^{*}\right]

e.project(1).expansion()

c[ε]c \odot \left[\varepsilon\right]

e.project(2).expansion()

e[ε]f[ε]e \odot \left[\varepsilon\right] \oplus f \odot \left[\varepsilon\right]