add utility for sorting expression graphs
use xn instead of x as next state in integrator spec