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

automaton.project

Create a copy of the automaton and keeping only the selected tape of the original automaton's label.

Preconditions:

  • the original automaton has tuple labels.

  • the tape number is smaller than the tuples' size.

Examples

import vcsn ctx = vcsn.context("lat<lal_char(ab), lan_char(cd), lal_char(ef)>, q")
a = ctx.expression("(a|c|f)(a|\e|f)+(b|c|e)*").automaton() a
Image in a Jupyter notebook
a.project(0)
Image in a Jupyter notebook
a.project(1)
Image in a Jupyter notebook
a.project(2)
Image in a Jupyter notebook

If after the projection two transitions are equivalent, they are fused into one using the weightset's addition.

a = ctx.expression("a|c|e + a|c|f").automaton() a
Image in a Jupyter notebook
a.project(0)
Image in a Jupyter notebook
a.project(1)
Image in a Jupyter notebook
a.project(2)
Image in a Jupyter notebook