### Substitution of multiple variables, for linearization

Hi

we want to substitute multiple variables, for example
x1*x3 would be z1, x2*x4 would be z2 and so on.

We save all combinations of monomials in a dictionary, then we wanted to use subs to replace the variables, but it does not work.
How could one implement this?

The purpose is for linearization of a large system of equations.
A system like this:
x[1] + x[1]*x[2]*x[3] + x[1]*x[4]*x[6] + x[1] + x[4] + x[5] + x[7],
x[0]*x[1]*x[4] + x[0]*x[1] + x[2]*x[4] + x[3]*x[5]*x[6] + x[3]*x[5] + x[7] + 1,
x[1]*x[2] + x[2]*x[3]*x[6] + x[2]*x[4] + 1,
x[0]*x[5]*x[6]*x[7] + x[1]*x[7] + x[2] + x[7],
x[1]*x[3]*x[7] + x[4] + x[5]*x[6] + x[6],
x[1]*x[3] + x[2]*x[4] + x[3]*x[4]