Example #1
0
 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))
Example #2
0
 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))
Example #3
0
 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)
Example #4
0
 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)