# automaton.synchronize¶

Create a new transducer, equivalent to the first one, but where the transitions advance along all the tapes at the same rate, for as long as possible. The transitions before the final states may have the empty word on one of the tapes, to allow for words of different lengths on the input and output.

Preconditions:

• The input automaton is a transducer.
• Input.has_bounded_lag

Postconditions:

• Result.is_synchronized

## Examples¶

In [1]:
import vcsn
ctx = vcsn.context("lat<law_char, law_char>, b")
ctx

Out[1]:
$\{\ldots\}^* \times \{\ldots\}^*\to\mathbb{B}$

The following automaton is not synchronized (the first transition is already not synchronized):

In [2]:
a = ctx.expression(r"(abc|\e)(d|v)*(\e|wxyz)").standard()
a

Out[2]:

The lag is bounded, because every cycle (here, the loop) has a lag of 0.

In [3]:
a.has_bounded_lag()

Out[3]:
True

Apart from pure spontaneous transitions, the only transitions with $\varepsilon$ in them are right before the final state.

In [4]:
s = a.synchronize()
s

Out[4]:
In [5]:
s.is_synchronized()

Out[5]:
True

This is a (for the most part) letter-to-letter transducer equivalent to the input.

In [6]:
s.proper().letterize().minimize().strip()

Out[6]: