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

automaton.letterize()

Split the transition labels into letters.

Preconditions:

  • None

Postconditions:

  • the output transitions are atomic, meaning that they are composed of one letter (as viewed by the labelset). The labelset is adapted to provide this guarantee.

See also:

Examples

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

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

a = ctx.expression("(cat)+(dog)*").standard() a
Image in a Jupyter notebook
al = a.letterize() al
Image in a Jupyter notebook
al.context()

({a,c,d,g,o,t})?B(\{a, c, d, g, o, t\})^?\to\mathbb{B}

Note that here, the transitions are no longer words (law) but instead letters (nullableset<lal_char>).

ctx_t = vcsn.context("lat<law_char, law_char, lal_char>, z")
b = ctx_t.expression(r"(<2>'cat,dog,c')*+'\e,b,d'").derived_term() b
Image in a Jupyter notebook
bl = b.letterize() bl
Image in a Jupyter notebook
bl.context()

({a,c,t})?×({b,d,g,o})?×({c,d})?Z(\{a, c, t\})^? \times (\{b, d, g, o\})^? \times (\{c, d\})^?\to\mathbb{Z}

Here, all three labelsets have been converted to letters or the empty word (nullableset<lal_char>).