anchor.diff:  
   Such expressions can still be sensible and useful.
   
  -.Aggregation functions a sub-expressions
  +.aggregation functions a sub-expressions
   ====
   The RETURN clause
   
  
positive.code: 
  To prevent such invalid rewrites, this CIP imposes a syntax restriction on RETURN and WITH clauses.
  
  Given a set of <ProjectionItem>s _L_ = {_p_~1~, _p_~2~, ... _p~N~_}, let GROUPING_KEYS(_L_) be the set of all expressions and _ex_ and aliases _a_ in <ProjectionItem>s _p_ = `_ex_ AS _a_` in _L_ where _AGG_(_p_) is empty.
  
  For an expression _ex_ and projection list _L_, let CONSTANT(_ex_) hold
  
  * If _ex_ is either
  ** A aggregation function, i.e. of the form `_agg_(_subEx_)`,
  ** A grouping key (either expression or alias), i.e. _o_ ∈ GROUPING_KEYS(_L_),
  ** A constant,
  ** A parameter
  * or if _ex_ comprises of sub-expression, it only comprises sub-expression _subEx_ for which CONSTANT(_subEx_) holds.
  
  [IMPORTANT]
  .Syntax restriction
  ====
  For clauses `WITH _L_` and `RETURN _L_` and every _p_ = `_ex_ AS _a_` in _L_ where _AGG_(_p_) is not empty, CONSTANT(_ex_) shall hold.
  ====
  
  .Effect of the restriction
  
negative.code: ----
  ====
  
  Note that the grouping and aggregation semantics also provides for the mixing of projection and aggregation that the <<Simple rewrite semantics>> covers, i.e. it is a generalization of the simple rewrite semantics.
  
  .Rewrite semantics on simple mixing of projection and aggregation
  ====
  