Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News Sign UpSign In
| Download
Views: 45856
Kernel: Python 3

automaton.has_bounded_lag

Check if the transducer has bounded lag, i.e. that the difference of length between the input and output words is bounded, for every word accepted.

It is a pre-condition for transducer synchronization.

Preconditions:

  • The automaton has at least 2 tapes

Examples

import vcsn ctx = vcsn.context("lat<lan_char(ab), lan_char(xy)>, b") ctx

({a,b})?×({x,y})?B(\{a, b\})^? \times (\{x, y\})^?\to\mathbb{B}

a = ctx.expression(r"'a,x''b,y'*'a,\e'").automaton() a
Image in a Jupyter notebook

This automaton has a bounded lag: there is at most a difference of 1 between the length of the input and the length of the output (e.g., abbaxyyabba \rightarrow xyy).

a.has_bounded_lag()
True
b = ctx.expression(r"(\e|x)(a|\e)*(b|y)").automaton() b
Image in a Jupyter notebook

This transducer, however, doesn't have a bounded lag: there can be an arbitrary large difference between the input and output. For example, abxyab \rightarrow xy, but aaaaaaaaabxyaaaaaaaaab \rightarrow xy.

b.has_bounded_lag()
False
ctx_3 = vcsn.context("lat<lan_char(ab), lan_char(jk), lan_char(xy)>, b") c = ctx_3.expression(r"(a|j|x)(b|k|\e)*").automaton() c
Image in a Jupyter notebook

In the case of more than 2 tapes, has_bounded_lag checks that every tape has a bounded lag compared to the first one (incidentally, if that is the case, it will insure that every tapes has a bounded lag in respect to every other). This transducer has a bounded lag if you only consider the first 2 tapes, but the third tape doesn't.

c.has_bounded_lag()
False