expression.partial_identity

An expression which denotes a partial identity of the series denoted by the input expression. In other words, every label $\ell$ is turned into a two-tape label $\ell|\ell$.

Postconditions:

  • The identities are preserved.

See also:

Examples

In [1]:
import vcsn
e = vcsn.Q.expression('ab*<3>c', 'associative')
e
Out[1]:
$a \, {b}^{*} \, \left\langle 3 \right\rangle \,c$
In [2]:
e2 = e.partial_identity()
e2
Out[2]:
$\left(a|a\right) \, \left(b|b\right)^{*} \, \left\langle 3 \right\rangle \,\left(c|c\right)$
In [3]:
e2.context()
Out[3]:
$\{a, b, c, \ldots\} \times \{a, b, c, \ldots\}\to\mathbb{Q}$
In [4]:
e2.project(0)
Out[4]:
$a \, {b}^{*} \, \left\langle 3 \right\rangle \,c$
In [5]:
e2.project(1)
Out[5]:
$a \, {b}^{*} \, \left\langle 3 \right\rangle \,c$