# expression.infiltrate¶


## Examples¶

In [1]:
import vcsn
c = vcsn.context('lal_char, seriesset<lal_char, z>')
exp = c.expression
c

Out[1]:
$\{\ldots\}\to\mathsf{Series}[\{\ldots\}\to\mathbb{Z}]$

The following simple example aims at emphasizing that the transitions of the infiltration combine those of the shuffle and the conjunction products.

In [2]:
x = exp("<x>a"); x

Out[2]:
$\left\langle x \right\rangle \,a$
In [3]:
y = exp("<y>a"); y

Out[3]:
$\left\langle y \right\rangle \,a$
In [4]:
conj = x & y ; conj

Out[4]:
$\left\langle x \, y \right\rangle \,a$
In [5]:
shuff = x.shuffle(y) ; shuff

Out[5]:
$\left\langle x \right\rangle \,a \between \left\langle y \right\rangle \,a$
In [6]:
inf = x.infiltrate(y) ; inf

Out[6]:
$\left\langle x \right\rangle \,a \uparrow \left\langle y \right\rangle \,a$
In [7]:
inf.automaton() == (conj + shuff).automaton()

Out[7]:
True

### Associativity¶

This operator is associative: $(\Ed \infiltrate \Fd) \infiltrate \Gd \equiv \Ed \infiltrate (\Fd \infiltrate \Gd)$, i.e., both expressions denote the same series.

In [8]:
x = exp('<x>a', 'trivial')
y = exp('<y>a', 'trivial')
z = exp('<z>a', 'trivial')

In [9]:
x.infiltrate(y).infiltrate(z).automaton()

Out[9]:
In [10]:
x.infiltrate(y.infiltrate(z)).automaton()

Out[10]: