Esempio n. 1
0
def test_condition_simple():
    rl = rewriterule(x, x+1, [x], lambda x: x < 10)
    assert not list(rl(S(15)))
    assert rebuild(next(rl(S(5)))) == 6
Esempio n. 2
0
def test_rebuild():
    from sympy import Add
    expr = Basic.__new__(Add, 1, 2)
    assert rebuild(expr) == 3