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]:
In [3]:
In [4]:
You can also write automaton('word')
to evaluate a word:
In [5]:
In [6]:
In [7]:
In [8]:
All automaton types are supported, evaluate is not limited to free labelsets. For instance, with word-labeled automata:
In [9]:
In [10]:
In [11]:
Polynomials are also supported:
In [12]:
Spontaneous transitions are allowed:
In [13]:
In [14]:
In [15]:
Tuplesets are fully supported:
In [16]:
In [17]:
In [18]: