anchor.diff:  ====
   
   To prevent such invalid rewrites, this proposal includes a syntax restriction to be imposed on RETURN and WITH clauses.
  -
  -Given a list of <ProjectionItem>s _L_ = {_p_~1~, _p_~2~, ..., _p~N~_}, let _GROUPING_KEYS_(_L_) be the set of all expressions _ex_ for which there is a <ProjectionItem>s _p_ = `_ex_ AS _al_` in _L_ where _AGG_(_p_) is empty.
  +The definition of the syntax restriction happens in three steps:
  +
  +. Definition of grouping keys that are recognized as constant sub-expressions
  +. Definition of constant sub-expressions
  +. Definition of the syntax restriction
  +
  +Given a list of <ProjectionItem>s _L_ = {_p_~1~, _p_~2~, ..., _p~N~_}, let _RECOGNIZED_GROUPING_KEYS_(_L_) be the set of all expressions _ex_
  +
  +* For which there is a <ProjectionItem>s _p_ = `_ex_ AS _al_` in _L_ where _AGG_(_p_) is empty and
  +* Which are either
  +** A variable
  +** Element property access on a variable
  +** Static map access on a variable
   
   .Grouping keys
   ====
  
positive.code: 
  * _K_ is a (possibly empty) set of pairs (_k_, _al_) where
  ** _k_ is a variable -- called a _grouping key_ -- in the driving table _D_,
  ** _al_ is an _alias_ that different from all other aliases _x_ with (·, _x_) ∈ _K_., and
  * _A_ is a non-empty set of triple (_agg_, _x_, _al_) where
  ** _agg_ is an aggregation function and
  ** _x_ is a variable in the driving table _D_
  ** _al_ is an alias that is different from all other aliases _x_ with (·, ·, _x_) ∈ _A_ and _x_ with (·, _x_) ∈ _K_.
  
  Assuming _K_ = {(_k_~1~, _ka_~1~), (_k_~2~, _ka_~1~), ..., (_k~N~_, _ka~N~_)} and _A_ = {(_agg_~1~, _x_~1~, _al_~1~), (_agg_~2~, _x_~2~, _al_~2~), ..., (_agg~M~_, _x~M~_, _al~M~_)}, the Cypher equivalent of pass:q[γ<sub>_K_, _A_</sub>(_D_)] is
  
  [source, cypher, subs="quotes"]
  ----
  
negative.code: 
  However, <SortItem>s can refer to aliases introduced by _POST_PROJ_(_p~i~_).
  
  Given a list of <ProjectionItem>s _L_ = {_p_~1~, _p_~2~, ..., _p~N~_}, let _RECOGNIZED_ALIASES_(_L_) be the set of all aliases _al_ for which there is a <ProjectionItem>s _p_ = `_ex_ AS _al_` in _L_.
  
  For an expression _ex_ and a projection list _L_, let _AVAILABLE_TO_ORDER_(_ex_, _L_) hold
  
  * If _ex_ is either
  ** A constant,
  ** A parameter,
  ** A grouping key, i.e. _ex_ ∈ _RECOGNIZED_GROUPING_KEYS_(_L_), or
  ** An alias, i.e. _ex_ ∈ _RECOGNIZED_ALIASES_(_L_),
  * or if _ex_ comprises sub-expressions, it only comprises sub-expressions _subEx_ for which _AVAILABLE_TO_ORDER_(_subEx_, _L_) holds.
  
  [IMPORTANT]
  ====
  