def getFunctors(self) -> Set[Functor]: ''' Returns set of functors. :rtype: set of Functor ''' return unionSets(map(lambda atom: atom.getFunctors(), self.atoms))
def getLiterals(self) -> Set[Literal]: ''' Returns set of literals. :rtype: set of Literal ''' return unionSets(clause.literals for clause in self.clauses)
def getConstants(self) -> Set[Constant]: ''' Returns set of constants. :rtype: set of Constant ''' return unionSets(atom.getConstants() for atom in self.atoms)
def getGroundLiterals(self) -> Set[Literal]: ''' Returns set of ground literals. :rtype: set of Literal ''' return unionSets(clause.getGroundLiterals() for clause in self.clauses)
def getPositiveLiterals(self) -> Set[Literal]: ''' Returns set of positive literals. :rtype: set of Literal ''' return unionSets(clause.getPositiveLiterals() for clause in self.clauses)
def getPredicates(self) -> Set[Predicate]: ''' Returns set of predicates in the CNF. :rtype: set of Predicate ''' return unionSets(clause.getPredicates() for clause in self.clauses)
def getConstants(self) -> Set[Constant]: ''' Returns set of constants of the atom. :rtype: set of Constant ''' return unionSets(term.getConstants() for term in self.terms)
def getVariables(self) -> Set[Variable]: ''' Returns set of variables in the atom. :rtype: set of Variable ''' return unionSets(term.getVariables() for term in self.terms)
def getConstants(self) -> Set[Constant]: ''' Returns all constants in the dataset. :rtype: set of Constant ''' return tools.unionSets( map(lambda sample: sample.data.getConstants(), self.samples))
def getPredicates(self) -> Set[Predicate]: ''' Returns set of all predicates used in the dataset. :rtype: set of Predicate ''' return tools.unionSets( map(lambda sample: sample.data.getPredicates(), self.samples))
def getFunctors(self) -> Set[Functor]: ''' Returns all functors in the dataset. :rtype: set of Functor ''' return tools.unionSets( map(lambda sample: sample.data.getFunctors(), self.samples))
def getVariables(self) -> Set[Variable]: ''' Returns set of variables in the clause. :rtype: set of Variable ''' if not self.literals: return set() return unionSets(literal.getVariables() for literal in self.literals)
def getFunctors(self) -> Set[Functor]: ''' Returns set of functors. :rtype: set of Functor ''' result = set() result.add(self.functor) result = result.union(unionSets(map(lambda term: term.getFunctors(), self.terms))) return result