anchor.diff:  *** a constant (such as a value literal or a label),
   *** a parameter, or
   *** a variable in the driving table _D_; and
  -** _al_ is an _alias_ that different from all other aliases _x_ with (·, _x_) ∈ _P_.
  +** _al_ is a variable name -- called an _alias_ -- that is different from all other aliases _x_ with (·, _x_) ∈ _P_.
   
   Assuming _P_ = {(_ex_~1~, _al_~1~), (_ex_~2~, _al_~2~), ..., (_ex~N~_, _al~N~_)}, the Cypher equivalent of π__~P~__(_D_) is
   
  
positive.code: |2|3|5
  |===
  
  === Baseline aggregation
  
  Cypher allows grouping and aggregating (form here on just referred to as _aggregation_) the driving table in the WITH and in the RETURN clause.
  
  Formally, the aggregation of a driving table _D_ can be described formally as
  pass:q[γ<sub>_K_, _A_</sub>(_D_)] where
  
  * _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 variable name -- also called 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 variable name -- also called an _alias_ -- that different from all other aliases _x_ with (·, ·, _x_) ∈ _A_ or _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"]
  ----
  WITH _k_~1~ AS _ka_~1~, _k_~2~ AS _ka_~2~, ..., _k~N~_ AS _ka~N~_,
       _agg_~1~(_x_~1~) AS _al_~1~, _agg_~2~(_x_~2~) AS _al_~2~, ..., _agg~M~_(_x~M~_) AS _al~M~_
  ----
  
  and
  
  [source, cypher, subs="quotes"]
  ----
  RETURN _k_~1~ AS _k_~1~, _k_~2~ AS _k_~2~, ..., _k~N~_ AS _k~N~_,
         _agg_~1~(_x_~1~) AS _al_~1~, _agg_~2~(_x_~2~) AS _al_~2~, ..., _agg~M~_(_x~M~_) AS _al~M~_
  ----
  
  .Baseline aggregation
  ====
  
  .[[Q1]]Q1
  [source, cypher]
  ----
  RETURN a AS a, SUM(c) AS sumC
  ----
  
  Grouped the driving table by `a` and computes the sum of all `c` as `sumC` for each group, so that result is:
  
  .Result Q1
  |===
  |a|sumC
  
  |1|7
  |2|5
  |===
  ====
  
  === Baseline projection
  
  The WITH and the RETURN clause also allow projecting the driving table including the computation of new columns (in database theory, this is called extended projection).
  
  The projection of a driving table _D_ can be described formally as π__~P~__(_D_) where
  
  
negative.code: |===
  ====
  
  === Baseline aggregation
  
  Cypher allows grouping and aggregating (often simply referred to as _aggregation_) the driving table in the WITH and in the RETURN clause.
  
  Formally, the aggregation of a driving table _D_ can be described formally as
  pass:q[γ<sub>_K_, _A_</sub>(_D_)] where
  
  * _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 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"]
  ----
  WITH _k_~1~ AS _ka_~1~, _k_~2~ AS _ka_~2~, ..., _k~N~_ AS _ka~N~_,
       _agg_~1~(_x_~1~) AS _al_~1~, _agg_~2~(_x_~2~) AS _al_~2~, ..., _agg~M~_(_x~M~_) AS _al~M~_
  ----
  
  and
  
  [source, cypher, subs="quotes"]
  ----
  RETURN _k_~1~ AS _k_~1~, _k_~2~ AS _k_~2~, ..., _k~N~_ AS _k~N~_,
         _agg_~1~(_x_~1~) AS _al_~1~, _agg_~2~(_x_~2~) AS _al_~2~, ..., _agg~M~_(_x~M~_) AS _al~M~_
  ----
  
  .Baseline aggregation
  ====
  
  The RETURN clause
  
  .[[Q2]]Q2
  [source, cypher]
  ----
  RETURN a AS a, SUM(c) AS sumC
  ----
  
  groups the driving table by `a` and computes the sum of all `c` as `sumC` for each group, so that result is:
  
  .Result Q2
  |===
  |a|sumC
  
  |1|7
  |2|5
  |===
  ====
  
  === Simple rewrite semantics
  
  Cypher's WITH and RETURN clause are syntactically more flexible than the two baseline semantics.
  In particular, they allow mixing aggregation and projection rather freely.
  
  Specifically, the WITH and the RETURN clause denoted the parameters for projection (_P_) and aggregation (_K_ and _A_) with a single nonempty set _L_ of https://raw.githack.com/openCypher/openCypher/master/tools/grammar-production-links/grammarLink.html?p=ProjectionItem[<ProjectionItem>]s `_ex_ AS _al_` where
  
  * _ex_ is an expression that is allowed to contain aggregation functions and
  