I was kind of caught up on comment "if (m2, m1) and (m1, p), then output (m1, (m2, p))". When input is [(m2, m1), (m1, p)] and is pairwise switched and joined with unreversed input.<p>If m2 manages m1 and m1 manages p then m2 manages p via m1, but I could not quite understand what this example output should mean. M1 manages m2 and p? M1 is managed by m2 and p. Neither seems correct.