anchor.diff:  
   -include("antidote.hrl").
   
  +-define(CLAIMED, claimed).
  +
   %% API
   -export([u_index/4,
            read_u_index/3,
  
positive.code: index(IndexName, IndexValue, RefKey, TxId) ->
      RootKey = make_u_index_key(IndexName, IndexValue),
      IndexKey = make_index_key(IndexName, IndexValue, RefKey),
      {ok, [Val]} = pvc:read_keys(RootKey, TxId),
      Updates = case Val of
          <<>> ->
              [{RootKey, taken}, {IndexKey, RefKey}];
          taken ->
              [{IndexKey, RefKey}]
      end,
      update_indices(Updates, TxId).
  
negative.code:     ok = pvc:update_keys(Updates, TxId),
      gen_fsm:sync_send_event(Pid, {pvc_index, Updates}, ?OP_TIMEOUT).
  
  %% Util functions
  
  claimed_index(RootKey, TxId) ->
      {ok, [RootVal]} = pvc:read_keys(RootKey, TxId),
      RootVal =:= ?CLAIMED.
  
  %% TODO(borja): Handle non-binary data
  make_u_index_key(IndexName, IndexValue) ->
      <<IndexName/binary, IndexValue/binary>>.
  