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

[;1m  product(TupleOfSets)[0m

  Returns the Cartesian product of the non-empty tuple of sets [;;4m[0m
  [;;4mTupleOfSets[0m.

  If (x[1], ..., x[n]) is an element of the n-ary relation [;;4mRelation[0m,
  then x[i] is drawn from element i of [;;4mTupleOfSets[0m.

[;1mExamples[0m

    1> S1 = sofs:set([a,b]).
    2> S2 = sofs:set([1,2]).
    3> S3 = sofs:set([x,y]).
    4> P3 = sofs:product({S1,S2,S3}).
    5> sofs:to_external(P3).
    [{a,1,x},{a,1,y},{a,2,x},{a,2,y},{b,1,x},{b,1,y},{b,2,x},{b,2,y}]
