# expression.transpose¶

Reverse all the concatenations, and transpose the labels.

Preconditions:

• None

Properties:

• involution

## Examples¶

In :
import vcsn
c = vcsn.context('law_char(abc), seriesset<law_char(xyz), b>')
c

Out:
$\{a, b, c\}^*\to\mathsf{Series}[\{x, y, z\}^*\to\mathbb{B}]$
In :
r = c.expression('(<x>a+<xyz>(abc))*')
r

Out:
$\left( \left\langle \mathit{x} \right\rangle \,\mathit{a} + \left\langle \mathit{xyz} \right\rangle \,\left(\mathit{abc}\right)\right)^{*}$
In :
r.transpose()

Out:
$\left( \left\langle \mathit{x} \right\rangle \,\mathit{a} + \left\langle \mathit{zyx} \right\rangle \,\left(\mathit{cba}\right)\right)^{*}$
In :
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 :
r = c.expression('<xyz>(abc)')
r

Out:
$\left\langle \mathit{xyz} \right\rangle \,\left(\mathit{abc}\right)$
In :
r.transpose()

Out:
$\left\langle \mathit{zyx} \right\rangle \,\left(\mathit{cba}\right)$
In :
r.transposition()

Out:
$\left( \left\langle \mathit{xyz} \right\rangle \,\left(\mathit{abc}\right)\right)^{T}$