Kernel: Python 3
automaton.evaluate(w)
Evaluates the weight of the given word through the automata.
Preconditions:
w
must be a valid word in the labelset.automaton
must not have spontaneous cycles.
Examples
In [1]:
In [2]:
Out[2]:
In [3]:
Out[3]:
In [4]:
Out[4]:
You can also write automaton('word')
to evaluate a word:
In [5]:
Out[5]:
In [6]:
Out[6]:
In [7]:
Out[7]:
In [8]:
Out[8]:
All automaton types are supported, evaluate is not limited to free labelsets. For instance, with word-labeled automata:
In [9]:
Out[9]:
In [10]:
Out[10]:
In [11]:
Out[11]:
Polynomials are also supported:
In [12]:
Out[12]:
Spontaneous transitions are allowed:
In [13]:
Out[13]:
In [14]:
Out[14]:
In [15]:
Out[15]:
Tuplesets are fully supported:
In [16]:
Out[16]:
In [17]:
Out[17]:
In [18]:
Out[18]: