def getAmbiguitiesByOriginalForm(cls, model): """ generated source for method getAmbiguitiesByOriginalForm """ result = ArrayListMultimap.create() formsByName = getFormsByName(model) for name in formsByName.keySet(): for form in forms: result.putAll(form, getAmbiguities(form, forms)) allForms = ImmutableSet.copyOf(formsByName.values()) for ambiguity in result.values(): Assert.assertTrue(allForms.contains(ambiguity.getOriginal())) Assert.assertTrue(allForms.contains(ambiguity.getReplacement())) return result
def getVarDomains(cls, rule, domainModel, includeHead): """ generated source for method getVarDomains """ # For each positive definition of sentences in the rule, intersect their # domains everywhere the variables show up varDomainsByVar = ArrayListMultimap.create() for literal in getSentences(rule, includeHead): if isinstance(literal, (GdlSentence, )): while i < len(tuple_): if isinstance(term, (GdlVariable, )): varDomainsByVar.put(var, domain) i += 1 varDomainByVar = combineDomains(varDomainsByVar) return varDomainByVar