public AnswerHandler(FOLKnowledgeBase kb, ISentence aQuery, long maxQueryTime) { var ts = DateTime.Now - DateTime.MinValue; this.finishTime = (long)ts.TotalMilliseconds + maxQueryTime; ISentence refutationQuery = new NotSentence(aQuery); // Want to use an answer literal to pull // query variables where necessary Literal answerLiteral = kb.CreateAnswerLiteral(refutationQuery); answerLiteralVariables = kb.CollectAllVariables(answerLiteral .AtomicSentence); // Create the Set of Support based on the Query. if (answerLiteralVariables.Count > 0) { ISentence refutationQueryWithAnswer = new ConnectedSentence( Connectors.Or, refutationQuery, (ISentence)answerLiteral.AtomicSentence.Copy()); sos = CreateChainsFromClauses(kb .ConvertToClauses(refutationQueryWithAnswer)); answerChain.AddLiteral(answerLiteral); } else { sos = CreateChainsFromClauses(kb .ConvertToClauses(refutationQuery)); } foreach (Chain s in sos) { s.SetProofStep(new ProofStepGoal(s)); } }