
[;1m  restriction(BinRel1, Set)[0m

  Returns the restriction of the binary relation [;;4mBinRel1[0m to [;;4mSet[0m.

    1> R1 = sofs:relation([{1,a},{2,b},{3,c}]),
    S = sofs:set([1,2,4]),
    R2 = sofs:restriction(R1, S),
    sofs:to_external(R2).
    [{1,a},{2,b}]

[;1m  restriction(SetFun, Set1, Set2)[0m

  Returns a subset of [;;4mSet1[0m containing those elements that gives an
  element in [;;4mSet2[0m as the result of applying [;;4mSetFun[0m.

    1> S1 = sofs:relation([{1,a},{2,b},{3,c}]),
    S2 = sofs:set([b,c,d]),
    S3 = sofs:restriction(2, S1, S2),
    sofs:to_external(S3).
    [{2,b},{3,c}]
