anchor.diff:  default_bucket(_) ->
       false.
   
  +maybe_bad_mult(error, Props) ->
  +    lists:keydelete(allow_mult, 1, Props);
  +maybe_bad_mult(_, Props) ->
  +    Props.
  +
   -endif.
   
   -endif.
  
positive.code:                        io:format("Bucket ~p~n", [Bucket]),
                         io:format("Existing ~p~n", [Existing]),
                         io:format("New ~p~n", [New]),
                         io:format("Result ~p~n", [Result])
                     end,
                     collect(with_title("{has_datatype, valid_datatype, allow_mult}"),
                             {has_datatype(New), valid_datatype(New), allow_mult(New)},
                             only_create_if_valid(Result, New)))
              end).
  
  %% As of 2.0pre? validate/4 must merge the new and existing props,
  %% verify that.
  prop_merges() ->
      ?FORALL({Bucket, Existing, New}, {gen_bucket(update, any),
                                        gen_existing(), gen_new(update)},
              begin
                  Result={Good, _Bad} = validate(update, Bucket, Existing, New),
  
                  Expected = case {default_bucket(Bucket), has_allow_mult(New), allow_mult(New), has_datatype(Existing)} of
                                 {true, _, Mult,  _} when Mult /= error ->
                                     merge(New, Existing);
                                 {true, true, error, _} ->
                                     merge([proplists:lookup(datatype, New)], lists:keydelete(allow_mult, 1, Existing));
                                 {false, true, Mult,  false} when Mult /= error ->
                                     merge([proplists:lookup(allow_mult, New)], Existing);
                                 {false,true,error,false} ->
                                     Existing;
                                 {false, true, _Mult, true} ->
                                     Existing
                             end,
  
                  ?WHENFAIL(
  
negative.code:                        io:format("Bucket ~p~n", [Bucket]),
                         io:format("Existing ~p~n", [lists:sort(Existing)]),
                         io:format("New ~p~n", [New]),
                         io:format("Result ~p~n", [Result]),
                         io:format("Diff ~p~n", [sets:to_list(sets:subtract(sets:from_list(Expected), sets:from_list(Good)))])
                     end,
                     sets:is_subset(sets:from_list(Expected), sets:from_list(Good)))
              end).
  