def tell(self, sentence): if is_definite_clause(sentence): self.clauses.append(sentence) self.const_syms.update(constant_symbols(sentence)) self.pred_syms.update(predicate_symbols(sentence)) else: raise Exception('Not a definite clause: {}'.format(sentence))
def tell(self, sentence): if is_definite_clause(sentence): self.clauses.append(sentence) self.const_syms.update(constant_symbols(sentence)) self.pred_syms.update(predicate_symbols(sentence)) else: raise Exception("Not a definite clause: {}".format(sentence))
def tell(self, sentence): if issubclass(sentence.__class__, str): sentence = expr(sentence) if is_definite_clause(sentence): self.clauses.append(sentence) else: raise Exception("Not a definite clause: %s" % sentence)
def tell(self, sentence): if issubclass(sentence.__class__, str): sentence = expr(sentence) if is_definite_clause(sentence): self.clauses.append(sentence) else: raise Exception("Not a definite clause: %s" % sentence)