Expression resolver in cube rewriter