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

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

See also:

Examples

import vcsn lb = vcsn.context('lal_char(a-z), b') wb = vcsn.context('law_char(a-z), b')
lba = lb.expression('(ab)(cd)(ef)').derived_term() lba
Image in a Jupyter notebook
lba.transpose()
Image in a Jupyter notebook

Transposing a transposed automaton returns the original automaton.

lba.transpose().transpose()
Image in a Jupyter notebook
lba == lba.transpose().transpose()
True

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

wb.expression('(abc)(def)').derived_term()
Image in a Jupyter notebook
_.transpose()
Image in a Jupyter notebook