Exemplo n.º 1
0
 public static void FindAndInfer(FilmKnowledgeBase kb, List <ISentence> premises, ISentence conclusion, Substitution s)
 {
     if (premises.Count == 0)
     {
         ForwardChain(kb, conclusion.Substitute(s));
     }
     foreach (var kbSentence in kb.Sentences)
     {
         var unifyResult = Unify(kbSentence, premises.First().Substitute(s));
         if (unifyResult.Successful)
         {
             FindAndInfer(kb, premises.Skip(1).ToList(), conclusion, s.Compose(unifyResult));
         }
     }
 }