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

automaton.is_letterized

Whethere the automaton is letterized, i.e. each transition is labeled by a single letter. It's always true when labels are letters, for example.

Examples

import vcsn
a1 = vcsn.b.expression("ab+c*").standard() a1
Image in a Jupyter notebook
a1.is_letterized()
True

Here, no computation is done, the result is implied by the labelset.

ctx = vcsn.context("law_char, b") a2 = ctx.expression("a+bc*").standard() a2
Image in a Jupyter notebook
a2.is_letterized()
True

Here, as labels can be words, each transition's label is checked to see that it is a letter (or the empty word).

a3 = ctx.expression("abc").standard() a3
Image in a Jupyter notebook
a3.is_letterized()
False