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
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 \e 12 12 0->12 \e 1 1 1->F1 2 2 3 3 2->3 ab 3->2 \e 5 5 3->5 \e 4->2 \e 4->5 \e 5->1 \e 6 6 8 8 6->8 \e 10 10 6->10 \e 7 7 7->6 \e 13 13 7->13 \e 9 9 8->9 cd 9->7 \e 11 11 10->11 ef 11->7 \e 12->6 \e 12->13 \e 13->1 \e
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\}\to\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