anchor.diff:  %% Convert a piece set to an ordered list of the piece indexes
   %% that are members of this set.
   %% @end
  --spec to_list(pieceset()) -> list(pos_integer()).
  +-spec to_list(pieceset()) -> list(non_neg_integer()).
   to_list(Pieceset) ->
       #pieceset{elements=Elements} = Pieceset,
       to_list(Elements, 0).
  
positive.code: %% false if not. If the piece index is negative or is larger
  %% than the size of this piece set, the function exits with badarg.
  %% @end
  -spec is_member(pos_integer(), pieceset()) -> boolean().
  is_member(PieceIndex, _) when PieceIndex < 0 ->
      error(badarg);
  is_member(PieceIndex, Pieceset) ->
  
negative.code: %% negative or larger than the size of this piece set, this
  %% function exists with the reason badarg.
  %% @end
  -spec insert(non_neg_integer(), pieceset()) -> pieceset().
  insert(PieceIndex, _) when PieceIndex < 0 ->
      error(badarg);
  insert(PieceIndex, Pieceset) ->
  