![]() |
|
Navigation |
Synopsis Make sets of elements in the range that relate to the same element in the domain.
Function
set[set[&T]] groupRangeByDomain(rel[&U dom, &T ran] input)
Usage
import Relation;
Description
rascal>import Relation; ok rascal>skins = {<"bird", "feather">, <"dog", "fur">, <"tortoise", "shell">, <"human", "skin">, <"fish", "scale">, <"lizard", "scale">, <"crab", "shell">, <"cat", "fur">}; rel[str,str]: { <"fish","scale">, <"tortoise","shell">, <"lizard","scale">, <"human","skin">, <"cat","fur">, <"crab","shell">, <"dog","fur">, <"bird","feather"> } rascal>groupRangeByDomain(skins); set[set[str]]: { {"scale"}, {"shell"}, {"skin"}, {"feather"}, {"fur"} } ![]() |