
  -spec join(Relation1, I, Relation2, J) -> Relation3
                when
                    Relation1 :: relation(),
                    Relation2 :: relation(),
                    Relation3 :: relation(),
                    I :: pos_integer(),
                    J :: pos_integer().

  Returns the natural join of the relations Relation1 and 
  Relation2 on coordinates I and J.

    1> R1 = sofs:relation([{a,x,1},{b,y,2}]),
    R2 = sofs:relation([{1,f,g},{1,h,i},{2,3,4}]),
    J = sofs:join(R1, 3, R2, 1),
    sofs:to_external(J).
    [{a,x,1,f,g},{a,x,1,h,i},{b,y,2,3,4}]
