def test_many_variables(self):
"""
It can eliminate all x's from the chain
``(a = x0, x0 = x1, ..., x19 = x20, x20 = b)``.
"""
symbols = list(itertools.islice(sympy.numbered_symbols("x"), 20))
equations = [sympy.Eq(symbols[i], symbols[i + 1])
for i in range(len(symbols) - 1)]
equations.append(sympy.Eq(a, symbols[0]))
equations.append(sympy.Eq(b, symbols[-1]))
new_equations = vadouvan.symbolic_utils.eliminate(equations, symbols)
assert len(new_equations) == 1
assert new_equations[0].free_symbols == {a, b}
评论列表
文章目录