-----maxima-bounces at math.utexas.edu wrote: -----
>First compute the lists of indices of all the combinations of
>pairs of terms
>
>L1 = [[1,2],[3]]
>L2 = [[2,3],[1]]
>L3 = [[1,3],[2]]
The function set_partitions might be helpful:
(%i17) set_partitions(set(1,2,3));
(%o17) {{{1},{2},{3}},{{1},{2,3}},{{1,2},{3}},{{1,2,3}},{{1,3},{2}}}
BW