Fair enough; I copied the code from `expression.resolve_state_vars` (https://github.com/uwescience/raco/blob/master/raco/expression/util.py#L106) without thinking hard about what it does.