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

automaton.is_valid

A careful analysis of automata with spontaneous transitions shows that in some case, spontaneous-cycles may result in automata with an undefined behavior. They are called invalid.

Preconditions:

  • None

See also:

References:

Examples

import vcsn

The following examples are taken from lombardy.2013.ijac.

Automaton Q3\mathcal{Q}_3 (Fig. 2) (in Q\mathbb{Q})

The following automaton is invalid.

%%automaton q3 context = "lan_char, q" $ -> 0 0 -> 0 <-1/2>\e 0 -> 1 <1/2>\e 1 -> 1 <-1/2>\e 1 -> 0 <1/2>\e 0 -> $
Image in a Jupyter notebook
q3.is_valid()
False

Automaton Q4\mathcal{Q}_4 (Fig. 3) (in Q\mathbb{Q})

The following one, however, is valid. Spontaneous transitions can be eliminated.

%%automaton q4 context = "lan_char, q" $ -> 0 0 -> 1 <1/2>\e, a 1 -> 0 <-1>\e, b 1 -> $ <2>
Image in a Jupyter notebook
q4.proper()
Image in a Jupyter notebook

An Invalid Thompson Automaton (Fig. 5)

Sadly enough, the (weighted) Thompson construction may build invalid automata from valid expressions.

e = vcsn.context('lal_char, q').expression('(a*+<-1>b*)*') e.is_valid()
True
t = e.thompson() t
Image in a Jupyter notebook
t.is_valid()
False