ratexp.transpose

Reverse all the concatenations, and transpose the labels.

Preconditions:

  • None

Properties:

  • involution

See also:

Examples

In [2]:
import vcsn
c = vcsn.context('law_char(abc), seriesset<law_char(xyz), b>')
c
Out[2]:
$\{a, b, c\}^*\rightarrow\mathsf{Series}[\{x, y, z\}^*\rightarrow\mathbb{B}]$
In [3]:
r = c.ratexp('(<x>a+<xyz>(abc))*')
r
Out[3]:
$\left( \langle x \rangle \,a + \langle xyz \rangle \,\left(abc\right)\right)^{*}$
In [4]:
r.transpose()
Out[4]:
$\left( \langle x \rangle \,a + \langle zyx \rangle \,\left(cba\right)\right)^{*}$
In [5]:
assert(r.transpose().transpose() == r)

transpose and transposition should not be confused. The former completely rewrites the expression, while the latter only wraps it in a syntactic transposition operator:

In [7]:
r = c.ratexp('<xyz>(abc)')
r
Out[7]:
$ \langle xyz \rangle \,\left(abc\right)$
In [8]:
r.transpose()
Out[8]:
$ \langle zyx \rangle \,\left(cba\right)$
In [10]:
r.transposition()
Out[10]:
$\left( \langle xyz \rangle \,\left(abc\right)\right)^{T}$