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

automaton.delay_automaton

Create a new transducer, equivalent to the first one, with the states labeled with the delay of the state, i.e. the difference of input length on each tape.

Preconditions:

  • The input automaton is a transducer.

  • Input.has_bounded_lag

Caveat:

  • If the input does not have bounded lag, the construct will not terminate

See also:

Examples

import vcsn
ctx = vcsn.context("lat<law_char, law_char>, b") ctx

{}×{}B\{\ldots\}^* \times \{\ldots\}^*\to\mathbb{B}

a = ctx.expression(r"'abc,\e' 'd,v'* '\e,wxyz'").standard() a
Image in a Jupyter notebook

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

a.delay_automaton()
Image in a Jupyter notebook

State 1 has a delay of (3,0)(3, 0) because the first tape is 3 characters longer than the shortest tape (the second one) for all possible inputs leading to this state.

s = ctx.expression(r"(abc|x+ab|y)(d|z)").automaton() s
Image in a Jupyter notebook
s.delay_automaton()
Image in a Jupyter notebook

Here, state 1 is split in two, because for one input the delay is (1,0)(1, 0), and for the other the delay is (2,0)(2, 0).