# automaton.transpose¶

Transpose the automaton, i.e., change the direction of all the arrows (i.e., change the direction of the transitions, and exchance initial and final states), and transpose their labels and weights.

Also known as:

• reverse

Preconditions:

• None

Properties:

• involution

## Examples¶

In [1]:
import vcsn
lb = vcsn.context('lal_char(a-z), b')
wb = vcsn.context('law_char(a-z), b')

In [2]:
lba = lb.expression('(ab)(cd)(ef)').derived_term()
lba

Out[2]:
In [3]:
lba.transpose()

Out[3]:

Transposing a transposed automaton returns the original automaton.

In [4]:
lba.transpose().transpose()

Out[4]:
In [5]:
lba == lba.transpose().transpose()

Out[5]:
True

Of course labels and weights are transposed too when it applies.

In [6]:
wb.expression('(abc)(def)').derived_term()

Out[6]:
In [7]:
_.transpose()

Out[7]: