Compute the Join and Meet of Partitions
CJam, 32 - 10 = 22

q_~{_{T&amp;},:U-U:+a+}fTp~m*::&amp;La-p


::&amp; is newer than this question.

CJam, 36 - 10 = 26

q_~{:T;_{T&amp;},:U-U:+a+}/p~m*{~&amp;}%La-p


Input:

[[0] [1] [2 3 4 7 6]]
[[2 3] [4 7] [6] [1 0]]


Output:

[[2 3 4 7 6] [0 1]]
[[0] [1] [2 3] [4 7] [6]]


Explanation

q                 " Read the input. ";
_~                " Evaluate a copy. ";
{:T;              " For each list T in the second partition: ";
    _{T&amp;},        " Select all lists in the first partition which share items with T. ";
    :U-           " Save to U and remove them from the first partition. ";
    U:+a+         " Append the union of U to the first partition. ";
}/
p                 " Print the meet. ";
~                 " Evaluate another copy. ";
m*                " Get the Cartesian product. ";
{~&amp;}%             " Get the intersections of each pair of lists. ";
La-               " Remove empty lists. ";
p                 " Print. ";