static Map> ai_gazelle_indexStatementsByRule_multiSet(MultiSet statements) { new Map> map; new Matches m; for (S s : keys(statements)) if "Rule *: ..." { S ruleID = $1; getOrCreateMultiSet(map, ruleID).add(m.rest(), statements.get(s)); } ret map; }