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

[;1m  family_intersection(Family1)[0m

  If [;;4mFamily1[0m is a family and [;;4mFamily1[0m[i] is a set of sets for
  every i in the index set of [;;4mFamily1[0m, then [;;4mFamily2[0m is the
  family with the same index set as [;;4mFamily1[0m such that [;;4mFamily2[0m[i]
  is the intersection of [;;4mFamily1[0m[i].

  If [;;4mFamily1[0m[i] is an empty set for some i, a [;;4mbadarg[0m exception
  is raised.

[;1mExamples[0m

    1> F1 = sofs:from_term([{a,[[1,2,3],[2,3,4]]},{b,[[x,y,z],[x,y]]}]).
    2> F2 = sofs:family_intersection(F1).
    3> sofs:to_external(F2).
    [{a,[2,3]},{b,[x,y]}]
    4> F3 = sofs:from_term([{a,[[1,2]]},{b,[]}]).
    5> sofs:family_intersection(F3).
    ** exception error: bad argument
         in function  sofs:family_intersection/1
