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

expression.transpose

Reverse all the concatenations, and transpose the labels.

Preconditions:

  • None

Properties:

  • involution

See also:

Examples

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

{a,b,c}Series[{x,y,z}B]\{a, b, c\}^*\to\mathsf{Series}[\{x, y, z\}^*\to\mathbb{B}]

r = c.expression('(<x>a+<xyz>(abc))*') r

(xa+xyz(abc))\left( \left\langle \mathit{x} \right\rangle \,\mathit{a} + \left\langle \mathit{xyz} \right\rangle \,\left(\mathit{abc}\right)\right)^{*}

r.transpose()

(xa+zyx(cba))\left( \left\langle \mathit{x} \right\rangle \,\mathit{a} + \left\langle \mathit{zyx} \right\rangle \,\left(\mathit{cba}\right)\right)^{*}

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:

r = c.expression('<xyz>(abc)') r

xyz(abc) \left\langle \mathit{xyz} \right\rangle \,\left(\mathit{abc}\right)

r.transpose()

zyx(cba) \left\langle \mathit{zyx} \right\rangle \,\left(\mathit{cba}\right)

r.transposition()

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