Navigation
Synopsis Relation restricted to certain domain elements.
Function
  1. rel[&T0,&T1] domainR (rel[&T0,&T1] R, set[&T0] S)
  2. rel[&T0,&T1,&T2] domainR (rel[&T0,&T1,&T2] R, set[&T0] S)
  3. rel[&T0,&T1,&T2,&T3] domainR (rel[&T0,&T1,&T2,&T3] R, set[&T0] S)
  4. rel[&T0,&T1,&T2,&T3,&T4] domainR (rel[&T0,&T1,&T2,&T3,&T4] R, set[&T0] S)
Usage import Relation;
Description Restriction of a relation R to tuples with first element in S.
Examples
rascal>import Relation;
ok
rascal>domainR({<1,10>, <2,20>, <3,30>}, {3, 1});
rel[int,int]: {
  <3,30>,
  <1,10>
}

Questions
Question [1].
The type of domainR({<8, 13>, <2, 19>}, {19, 5, 18}) is

Question [2].
domainR({<0, 15>, <7, 10>, <1, 19>, <2, 16>}, {19}) == 



Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit ask.rascal-mpl.org.