add invariant parsing