Function ffa = new Function("F", terms);
terms = new ArrayList<Term>();
terms.add(ffa);
Predicate query = new Predicate("P", terms);
InferenceResult answer = akb.ask(query);
Assert.assertTrue(null != answer);
if (expectedToFail) {
Assert.assertTrue(answer.isPossiblyFalse());
Assert.assertFalse(answer.isTrue());
Assert.assertFalse(answer.isUnknownDueToTimeout());
Assert.assertFalse(answer.isPartialResultDueToTimeout());
Assert.assertTrue(0 == answer.getProofs().size());
} else {
Assert.assertFalse(answer.isPossiblyFalse());
Assert.assertTrue(answer.isTrue());
Assert.assertFalse(answer.isUnknownDueToTimeout());
Assert.assertFalse(answer.isPartialResultDueToTimeout());
Assert.assertTrue(1 == answer.getProofs().size());
Assert.assertTrue(0 == answer.getProofs().get(0)
.getAnswerBindings().size());
}
}