static BasicLogicRule ai_sharedWordsIntoDollarVars(BasicLogicRule r) { LS words = antiFilter isDollarVar(sharedWords(r.lhs, r.rhs)); SS map = ciMapWithUnusedCountingDollarVars(words, linesLL(r.lhs, r.rhs)); ret mapBasicLogicRule(r, s -> replaceCodeTokensUsingMap(s, map)); }