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

[;1m  family_specification(Fun, Family1)[0m

  If [;;4mFamily1[0m is a family, then [;;4mFamily2[0m is the restriction of [;;4m[0m
  [;;4mFamily1[0m to those elements i of the index set for which [;;4mFun[0m
  applied to [;;4mFamily1[0m[i] returns [;;4mtrue[0m.

  If [;;4mFun[0m is a tuple [;;4m{external, Fun2}[0m, then [;;4mFun2[0m is applied to
  the external set of [;;4mFamily1[0m[i]; otherwise [;;4mFun[0m is applied to [;;4m[0m
  [;;4mFamily1[0m[i].

[;1mExamples[0m

    1> F1 = sofs:family([{a,[1,2,3]},{b,[1,2]},{c,[1]}]).
    2> SpecFun = fun(S) -> sofs:no_elements(S) =:= 2 end.
    3> F2 = sofs:family_specification(SpecFun, F1).
    4> sofs:to_external(F2).
    [{b,[1,2]}]
