anchor.diff:  |2|12
   |===
   
  -In all three cases, the semantics can be described as follows.
  -The set of <ProjectionItem>s _L_ is split in two set _LK_ and _LA_, so that
  -
  -* _LA_ are all <ProjectionItem>s `_aggex_ AS _al_` in _L_ that contain an aggregation function, i.e. where _aggex_ is of the form _agg_(_ex_) and _ex_ is a valid expression
  -* _LK_ are all remaining <ProjectionItem>s in _L_ but no _LA_, i.e. _LK_ = _L_ - _LA_
  -
  -Further
  -
  -* For a <ProjectionItem> _p_ = `_ex_ AS _al_`,
  -** If _p_ ∈ _LK_
  -*** Let `PROJ(_p_)` be `_ex_ AS _al_` and
  -*** Let `AGGR(_p_)` be `_al_ AS _al_`
  -** If _p_ ∈ _LA_ and _ex_ = _agg_(_x_)
  -*** Let `PROJ(_p_)` be `_x_ AS _al_` and
  -*** Let `AGGR(_p_)` be `_agg_(_al_) AS _al_`
  -* For a set of <ProjectionItem>s _L_ = {_p1_, _p2_, ... _pn_},
  -** Let `PROJ(_L_)` be `PROJ(_p1_), PROJ(_p2_), ..., PROJ(_pn_)` and
  -** Let `AGGR(_L_)` be `AGGR(_p1_), AGGR(_p2_), ..., AGGR(_pn_)`
  +The semantics of such an RETURN (and WITH) clause can be described as a rewrite to the two baseline semantics combined by Cypher's linear composition.
  +
  +For this purpose, the <ProjectionItem>s in _L_ can be spilt into _aggregates_ and _grouping keys_:
  +
  +* A <ProjectionItem> _p_ is an aggregate if it is of the form `_agg_(_ex_) AS _al_`, where
  +** _agg_ is an aggregation function,
  +** _ex_ is a valid expression, and
  +** _al_ is an alias; and
  +* A <ProjectionItem> _p_ is a grouping key if is not an aggregate
  +
  +Hence, for a <ProjectionItem> _p_
  +
  +* If _p_ is of the form `_ex_ AS _al_`
  +** Let `PROJ(_p_)` be `_ex_ AS _al_` and
  +** Let `AGGR(_p_)` be `_al_ AS _al_`
  +* If _p_ is of the form `_agg_(_ex_) AS _al_`
  +** Let `PROJ(_p_)` be `_x_ AS _al_` and
  +** Let `AGGR(_p_)` be `_agg_(_al_) AS _al_`
  +
  +Further, for a set of <ProjectionItem>s _L_ = {_p_~1~, _p_~2~, ... _p~N~_},
  +
  +* Let `PROJ(_L_)` be `PROJ(_p_~1~), PROJ(_p_~2~), ..., PROJ(_p~N~_)` and
  +* Let `AGGR(_L_)` be `AGGR(_p_~1~), AGGR(_p_~2~), ..., AGGR(_p~N~_)`
   
   With this the semantics of `RETURN _L_` can be defined as effectively equivalent to
   
  
positive.code: RETURN AGGR(_L_)
  ----
  
  Analoguously, the semantics of `WITH _L_` can be defined as effectively equivalent to
  
  [source, cypher, subs="quotes"]
  ----
  
negative.code: RETURN a AS a, (a + agg_1 - agg_2) * 2 AS agg
  ----
  
  // TODO syntactic restriction implied by this semantics
  
  === Examples
  
  