Generalize iterators to allow arbitrary symbolic expressions