expansion.complement

An expansion which denotes the complement of this expansion.

See also:

References:

Examples

In [1]:
import vcsn
e = vcsn.B.expression('a*b')
e.expansion()
Out[1]:
$a \odot \left[{a}^{*} \, b\right] \oplus b \odot \left[\varepsilon\right]$
In [2]:
e.expansion().complement()
Out[2]:
$\left\langle \top\right\rangle \oplus a \odot \left[\left({a}^{*} \, b\right)^{c}\right] \oplus b \odot \left[{\varepsilon}^{c}\right]$
In [3]:
e.complement().expansion()
Out[3]:
$\left\langle \top\right\rangle \oplus a \odot \left[\left({a}^{*} \, b\right)^{c}\right] \oplus b \odot \left[{\varepsilon}^{c}\right]$
In [4]:
e.complement().derived_term()
Out[4]:
%3 I0 0 (a*b)ᶜ I0->0 F0 F2 0->F0 0->0 a 1 εᶜ 0->1 b 2 ∅ᶜ 1->2 a, b 2->F2 2->2 a, b

Note that complementing an expansion "determinizes" it: each first is mapped to a monomial. Note in the following example that the label $a$ maps to a two-term polynomial ($a$ and $b$), but in the complement, it has a single-term polynomial ($a+b$, observe $\oplus$ vs. $+$).

In [5]:
e = vcsn.B.expression('aa+ab')
x = e.expansion()
x
Out[5]:
$a \odot \left[a \oplus b\right]$
In [6]:
x.complement()
Out[6]:
$\left\langle \top\right\rangle \oplus a \odot \left[\left(a + b\right)^{c}\right] \oplus b \odot \left[{\emptyset}^{c}\right]$
In [7]:
e.derived_term()
Out[7]:
%3 I0 0 aa+ab I0->0 F3 1 a 0->1 a 2 b 0->2 a 3 ε 1->3 a 2->3 b 3->F3
In [8]:
e.complement().derived_term()
Out[8]:
%3 I0 0 (aa+ab)ᶜ I0->0 F0 F1 F2 0->F0 1 (a+b)ᶜ 0->1 a 2 ∅ᶜ 0->2 b 1->F1 3 εᶜ 1->3 a, b 2->F2 2->2 a, b 3->2 a, b