%% %CopyrightBegin%
%%
%% SPDX-License-Identifier: Apache-2.0
%%
%% Copyright Ericsson AB 2021-2025. All Rights Reserved.
%%
%% %CopyrightEnd%

[;1m  partition_family(SetFun, Set)[0m

  Returns family [;;4mFamily[0m where the indexed set is a partition of [;;4m[0m
  [;;4mSet[0m such that two elements are considered equal if the results of
  applying [;;4mSetFun[0m are the same value i.

  This is the index that [;;4mFamily[0m maps onto the equivalence class.

[;1mExamples[0m

    1> S = sofs:relation([{a,a,a,a},{a,a,b,b},{a,b,b,b}]).
    2> SetFun = {external, fun({A,_,C,_}) -> {A,C} end}.
    3> F = sofs:partition_family(SetFun, S).
    4> sofs:to_external(F).
    [{{a,a},[{a,a,a,a}]},{{a,b},[{a,a,b,b},{a,b,b,b}]}]
