automaton.realtime

Compute the realtime automaton, i.e. the equivalent automaton in which transitions are labeled with only letters (as viewed by the labelset), without spontaneous transitions.

Calling realtime is equivalent to calling letterize then proper.

Preconditions:

  • The automaton is_valid

Postconditions:

  • The automaton is_letterized

  • The automaton is_proper

See also:

Examples


In [1]:
import vcsn


:0: FutureWarning: IPython widgets are experimental and may change in the future.

In [2]:
law = vcsn.context("law_char, b")

In [3]:
a = law.expression("(ab)*+(cd+ef)*").thompson()
a


Out[3]:
%3 I0 0 0 I0->0 F1 4 4 0->4 ε 12 12 0->12 ε 1 1 1->F1 2 2 3 3 2->3 ab 3->2 ε 5 5 3->5 ε 4->2 ε 4->5 ε 5->1 ε 6 6 8 8 6->8 ε 10 10 6->10 ε 7 7 7->6 ε 13 13 7->13 ε 9 9 8->9 cd 9->7 ε 11 11 10->11 ef 11->7 ε 12->6 ε 12->13 ε 13->1 ε

In [4]:
a.is_valid()


Out[4]:
True

In [5]:
a.is_letterized()


Out[5]:
False

In [6]:
a.is_proper()


Out[6]:
False

In [7]:
r = a.realtime()
r


Out[7]:
%3 I0 0 0 I0->0 F0 F1 F2 F3 0->F0 4 4 0->4 a 5 5 0->5 c 6 6 0->6 e 1 1 1->F1 1->4 a 2 2 2->F2 2->5 c 2->6 e 3 3 3->F3 3->5 c 3->6 e 4->1 b 5->2 d 6->3 f

In [8]:
r.context()


Out[8]:
$\{a, b, c, d, e, f\}\rightarrow\mathbb{B}$

In [9]:
r.is_letterized()


Out[9]:
True

In [10]:
r.is_proper()


Out[10]:
True

In [11]:
a.letterize().proper()


Out[11]:
%3 I0 0 0 I0->0 F0 F1 F2 F3 0->F0 4 4 0->4 a 5 5 0->5 c 6 6 0->6 e 1 1 1->F1 1->4 a 2 2 2->F2 2->5 c 2->6 e 3 3 3->F3 3->5 c 3->6 e 4->1 b 5->2 d 6->3 f