Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download
Views: 45905
Kernel: Python 3

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
Image in a Jupyter notebook
a.lweight(a.context().weight('5'))
Image in a Jupyter notebook

Instead of a.lweight(a.context().weight('5')), you may write 5 * a.

5 * a
Image in a Jupyter notebook

To force the execution of the general algorithm you can do it this way.

a.lweight(a.context().weight('5'), 'general')
Image in a Jupyter notebook