automaton
.lweight(weight, algo="auto")
¶The left scalar product of an automaton by a weight.
The algo
parameter must be one of these:
"auto"
: default parameter, same as "standard"
."general"
: puts the weight on the initial transitions."standard"
: does not put the weight on the initial transitions.Postconditions:
"standard"
: when applied to standard automata, the result is standard.See also:
import vcsn
a = vcsn.context('lal_char, q').expression('<2>a<3>b<4>', 'none').standard()
a
a.lweight(a.context().weight('5'))
Instead of a.lweight(a.context().weight('5'))
, you may write 5 * a
.
5 * a
To force the execution of the general algorithm you can do it this way.
a.lweight(a.context().weight('5'), 'general')