anchor.diff:  %%-------------------------------------------------------------------------------------
   transform1({dim, Xi}=Di, _P, HD, _HV) when is_list(Xi) orelse is_atom(Xi) ->
     case lists:keyfind(Xi, 3, HD) of
  -    {dim, _, Xi} = HiddenDimReplacingLocalDim ->
  -      HiddenDimReplacingLocalDim;
  +    {dim, _, Xi} = HDim ->
  +      %% Replace local dimension of wheredim clause with previously
  +      %% allocated hidden dimension
  +      HDim;
       false ->
         Di
     end;
  
positive.code:   transform1(E, root_expr_pos(), [], []).
  
  
  -spec transform1(
          AstIn :: term(),
          P :: pos(),
          HiddenDimsReplacingLocalDims, %% i.e. local dimensions in wheredim
          HiddenDimsReplacingLocalVars %% i.e. formal parameters in abstraction
         ) -> AstOut :: term() when
      HiddenDimsReplacingLocalDims :: [{dim, hidden_dim(), VarId}],
      HiddenDimsReplacingLocalVars :: [{phi, VarId}],
      VarId :: nonempty_string() | atom().
  
  %%------------------------------------------------------------------------------
  
negative.code: %%-------------------------------------------------------------------------------------
  transform1(Xi, _P, _HD, HV) when is_list(Xi) orelse is_atom(Xi) ->
    case lists:keyfind(Xi, 2, HV) of
      {phi, Xi} = HDim ->
        %% Replace formal parameter of abstraction with context query of
        %% previously allocated hidden dimension
        %% XXX Re-introduce internal '?' (constant dimension query) in tcore?
        {'#', HDim};
      false ->
        Xi
    end.
  