Esempio n. 1
0
 def replaceVariablesAndConstants(self, function_):
     """ generated source for method replaceVariablesAndConstants """
     assignment = Maps.newHashMap()
     termsToReplace = Sets.newHashSet()
     GdlVisitors.visitAll(function_, GdlVisitor())
     for var in GdlUtils.getVariables(function_):
         assignment.put(var, getUnusedVariable())
     return CommonTransforms.replaceVariables(function_, assignment)
Esempio n. 2
0
 def getAllSentenceForms(cls, model):
     """ generated source for method getAllSentenceForms """
     # The model may only have sentence forms for sentences that can actually be
     # true. It may be missing sentence forms that are used in the rules only,
     # with no actual corresponding sentences. We want to make sure these are
     # included.
     forms = Sets.newHashSet(model.getSentenceForms())
     GdlVisitors.visitAll(model.getDescription(), GdlVisitor())
     return forms
 def getAllSentencesInBody(cls, body):
     """ generated source for method getAllSentencesInBody """
     sentences = Lists.newArrayList()
     GdlVisitors.visitAll(body, GdlVisitor())
     return sentences
Esempio n. 4
0
 def getSentenceFormsInBody(cls, bodyLiteral, sentenceForms):
     """ generated source for method getSentenceFormsInBody """
     forms = HashSet()
     GdlVisitors.visitAll(bodyLiteral, GdlVisitor())
     return forms