expression.lift

$\newcommand{\lweight}[2]{\bra{#1}{#2}} \newcommand{\bra}[1]{\langle#1\rangle}$ Turn an expression into a spontaneous expression by mapping it into $\lweight{expression}{\varepsilon}$.

See also:

Examples

In [1]:
import vcsn
from IPython.display import display
In [2]:
a = vcsn.Q.expression('(<1>a+<2>b+<3>c){2}')
a
Out[2]:
$\left(a + \left\langle 2 \right\rangle \,b + \left\langle 3 \right\rangle \,c\right)^{2}$
In [3]:
b = a.lift()
b
Out[3]:
$ \left\langle \left(a + \left\langle 2 \right\rangle \,b + \left\langle 3 \right\rangle \,c\right)^{2} \right\rangle \,\varepsilon$
In [4]:
display(a.context(), b.context())
$\{a, b, c\}\to\mathbb{Q}$
$\{\varepsilon\}\to\mathsf{RatE}[\{a, b, c\}\to\mathbb{Q}]$
In [5]:
display(a.type(), b.type())
'expressionset<letterset<char_letters(abc)>, q>'
'expressionset<lao, expressionset<letterset<char_letters(abc)>, q>>'