anchor.diff:  pattern({match,_Line,Pat1,Pat2}, Vt, Old, Bvt, St0) ->
       {Lvt,Bvt1,St1} = pattern(Pat1, Vt, Old, Bvt, St0),
       {Rvt,Bvt2,St2} = pattern(Pat2, Vt, Old, Bvt, St1),
  -    St3 = reject_bin_alias(Pat1, Pat2, St2),
  +    St3 = reject_invalid_alias(Pat1, Pat2, Vt, St2),
       {vtmerge_pat(Lvt, Rvt),vtmerge_pat(Bvt1,Bvt2),St3};
   %% Catch legal constant expressions, including unary +,-.
   pattern(Pat, _Vt, _Old, _Bvt, St) ->
  
positive.code:     D = sofs:projection({external,fun({_,_,P1,_,P2}) -> {P1,P2} end}, C),
      E = sofs:to_external(D),
      {Ps1,Ps2} = lists:unzip(E),
      reject_bin_alias_list(Ps1, Ps2, St).
  
  rbia_field_vars(Fs) ->
      [{Name,Pat} || {record_field,_,{atom,_,Name},Pat} <- Fs].
  
negative.code:                   {vtmerge_pat(Pvt, Psvt),vtmerge_pat(Bvt,Bvt1),St1}
            end, {[],[],St}, Ps).
  
  
  
  %% reject_invalid_alias(Pat, Expr, Vt, St) -> St'
  %%  Reject aliases for binary patterns at the top level.
  %%  Reject aliases for maps patterns at the top level.
  %%  The variables table (Vt) are for maps checkking.
  
  reject_invalid_alias_expr({bin,_,_}=P, {match,_,P0,E}, Vt, St0) ->
      St = reject_invalid_alias(P, P0, Vt, St0),
      reject_invalid_alias_expr(P, E, Vt, St);
  reject_invalid_alias_expr({map,_,_}=P, {match,_,P0,E}, Vt, St0) ->
      St = reject_invalid_alias(P, P0, Vt, St0),
      reject_invalid_alias_expr(P, E, Vt, St);
  reject_invalid_alias_expr({match,_,_,_}=P, {match,_,P0,E}, Vt, St0) ->
      St = reject_invalid_alias(P, P0, Vt, St0),
      reject_invalid_alias_expr(P, E, Vt, St);
  reject_invalid_alias_expr(_, _, _, St) -> St.
  
  
  
  %% reject_invalid_alias(Pat1, Pat2, St) -> St'
  %%  Aliases of binary patterns, such as <<A:8>> = <<B:4,C:4>> or even
  %%  <<A:8>> = <<A:8>>, are not allowed. Traverse the patterns in parallel
  %%  and generate an error if any binary aliases are found.
  %%    We generate an error even if is obvious that the overall pattern can't
  %%  possibly match, for instance, {a,<<A:8>>,c}={x,<<A:8>>} WILL generate an
  %%  error.
  %%    Maps should reject unbound variables here.
  
  reject_invalid_alias({bin,Line,_}, {bin,_,_}, _, St) ->
      add_error(Line, illegal_bin_pattern, St);
  reject_invalid_alias({map,_Line,Ps1}, {map,_,Ps2}, Vt, St0) ->
      Fun = fun ({map_field_exact,L,{var,_,K},_V}, Sti) ->
                    case is_var_bound(K,Vt) of
                        true ->
                            Sti;
                        false ->
                            add_error(L, {unbound_var,K}, Sti)
                    end;
                ({map_field_exact,_L,_K,_V}, Sti) ->
                    Sti
            end,
      foldl(Fun, foldl(Fun, St0, Ps1), Ps2);
  reject_invalid_alias({cons,_,H1,T1}, {cons,_,H2,T2}, Vt, St0) ->
      St = reject_invalid_alias(H1, H2, Vt, St0),
      reject_invalid_alias(T1, T2, Vt, St);
  reject_invalid_alias({tuple,_,Es1}, {tuple,_,Es2}, Vt, St) ->
      reject_invalid_alias_list(Es1, Es2, Vt, St);
  reject_invalid_alias({record,_,Name1,Pfs1}, {record,_,Name2,Pfs2}, Vt,
                   #lint{records=Recs}=St) ->
      case {dict:find(Name1, Recs),dict:find(Name2, Recs)} of
          {{ok,{_Line1,Fields1}},{ok,{_Line2,Fields2}}} ->
  	    reject_invalid_alias_rec(Pfs1, Pfs2, Fields1, Fields2, Vt, St);
          {_,_} ->
  	    %% One or more non-existing records. (An error messages has
  	    %% already been generated, so we are done here.)
  	    St
      end;
  reject_invalid_alias({match,_,P1,P2}, P, Vt, St0) ->
      St = reject_invalid_alias(P1, P, Vt, St0),
      reject_invalid_alias(P2, P, Vt, St);
  reject_invalid_alias(P, {match,_,_,_}=M, Vt, St) ->
      reject_invalid_alias(M, P, Vt, St);
  reject_invalid_alias(_P1, _P2, _Vt, St) -> St.
  
  reject_invalid_alias_list([E1|Es1], [E2|Es2], Vt, St0) ->
      St = reject_invalid_alias(E1, E2, Vt, St0),
      reject_invalid_alias_list(Es1, Es2, Vt, St);
  reject_invalid_alias_list(_, _, _, St) -> St.
  
  reject_invalid_alias_rec(PfsA0, PfsB0, FieldsA0, FieldsB0, Vt, St) ->
      %% We treat records as if they have been converted to tuples.
      PfsA1 = rbia_field_vars(PfsA0),
      PfsB1 = rbia_field_vars(PfsB0),
  