![]() |
|
Navigation |
Synopsis Indexes a binary relation as a map
Function
map[&K, set[&V]] index(rel[&K, &V] R)
Usage
import Relation;
Description Converts a binary relation to a map of the domain to a set of the range.
Examples
rascal>import Relation; ok rascal>index({<1,10>, <2,20>, <3,30>, <30,10>}); map[int, set[int]]: ( 1:{10}, 2:{20}, 3:{30}, 30:{10} ) ![]() |