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

expansion.ldivide(xpn)

xpn//expansion

An expansion which denotes the left quotient of both expansions. Beware that the notation lhs // rhs is somewhat misleading, and corresponds to lhs \ rhs, i.e. lhs is the divisor, and rhs the dividend.

Precondition:

  • the labelset features a one (empty word)

See also:

Examples

import vcsn ctx = vcsn.context('lan, q') def exp(e): return ctx.expression(e) def xpn(e): return exp(e).expansion() xpn('ab') // xpn('abc')

ε[b\bc]\varepsilon \odot \left[b \backslash b \, c\right]

The support for the left-quotient operator in expansion relies on the left quotient of the expansions. Contrast the following result with the previous one.

xpn('ab {\} abc')

ε[b\bc]\varepsilon \odot \left[b \backslash b \, c\right]

And with a more complex expression:

xpn('[ab]* {\} (ab)*')

1ε[ab(ab)a(a+b)\εb(a+b)\ε(a+b)\b(ab)]\left\langle 1\right\rangle \oplus \varepsilon \odot \left[a \, b \, \left(a \, b\right)^{*} \oplus a \, \left(a + b\right)^{*} \backslash \varepsilon \oplus b \, \left(a + b\right)^{*} \backslash \varepsilon \oplus \left(a + b\right)^{*} \backslash b \, \left(a \, b\right)^{*}\right]

xpn('[ab]*') // xpn('(ab)*')

1ε[ab(ab)a(a+b)\εb(a+b)\ε(a+b)\b(ab)]\left\langle 1\right\rangle \oplus \varepsilon \odot \left[a \, b \, \left(a \, b\right)^{*} \oplus a \, \left(a + b\right)^{*} \backslash \varepsilon \oplus b \, \left(a + b\right)^{*} \backslash \varepsilon \oplus \left(a + b\right)^{*} \backslash b \, \left(a \, b\right)^{*}\right]

And the corresponding derived-term automaton:

exp('[ab]* {\} (ab)*').derived_term()
Image in a Jupyter notebook