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

label.multiply

This function is overloaded, it supports these signatures:

  • label.multiply(l)

    The product (i.e., the concatenation) of two labels: a.multiply(b) => ab.

  • label.multiply(num)

    The repeated multiplication (concatenation) of an label with itself: a.multiply(3) => aaa.

Precondition:

  • num must be nonnegative.

Examples

import vcsn label = vcsn.context('law_char, q').label

Simple Multiplication

Instead of a.multiply(b), you may write a * b.

label('ab') * label('cd')

abcd\mathit{abcd}

label('ab').multiply(label('cd'))

abcd\mathit{abcd}

label('ab') * label(r'\e')

ab\mathit{ab}

Repeated Multiplication

Instead of a.multiply(3), you may write a ** 3.

label('ab') ** 0

ε\varepsilon

label('ab') ** 1

ab\mathit{ab}

label('ab') ** 3

ababab\mathit{ababab}