Navigation
Synopsis The number of arguments of an operator differ from what is required.
Description Various operators like Rascal:Relation/Composition, Rascal:Relation/TransitiveClosure and Rascal:Relation/ReflexiveTransitiveClosure expect binary relations or tuples as arguments.
Examples This composition is correct:
rascal>{<1,10>, <2,20>} o {<10,100>, <20, 200>};
rel[int,int]: {
  <2,200>,
  <1,100>
}
This is not, since the first argument has arity 3:
rascal>{<1,5,10>, <2,6,20>} o {<10,100>, <20, 200>};
|stdin:///|(39,3,<1,39>,<1,42>): Expected arity : 2, unequal to 3
These transitive closures are correct:
rascal>{<1,2>, <2,3>,<4,5>}+
rel[int,int]: {
  <4,5>,
  <1,2>,
  <1,3>,
  <2,3>
}
rascal>{<1,2>, <2,3>,<4,5>}*
rel[int,int]: {
  <4,4>,
  <4,5>,
  <5,5>,
  <2,2>,
  <1,2>,
  <1,3>,
  <2,3>,
  <1,1>,
  <3,3>
}
But these are incorrect:
rascal>{<1,2,3>, <2,3,4>,<4,5,6>}+
|stdin:///|(23,1,<1,23>,<1,24>): Expected arity : 2, unequal to 3
rascal>{<1,2,3>, <2,3,4>,<4,5,6>}*
|stdin:///|(23,1,<1,23>,<1,24>): Expected arity : 2, unequal to 3
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.