// Ensure reflexivity axiom is added to usable if using paramodulation.
if (isUseParamodulation()) {
// Reflexivity Axiom: x = x
TermEquality reflexivityAxiom = new TermEquality(new Variable("x"),
new Variable("x"));
Clause reflexivityClause = new Clause();
reflexivityClause.addLiteral(new Literal(reflexivityAxiom));
reflexivityClause = KB.standardizeApart(reflexivityClause);
reflexivityClause.setStandardizedApartCheckNotRequired();
usable.add(reflexivityClause);
}
Sentence notAlpha = new NotSentence(alpha);
// Want to use an answer literal to pull
// query variables where necessary
Literal answerLiteral = KB.createAnswerLiteral(notAlpha);
Set<Variable> answerLiteralVariables = KB
.collectAllVariables(answerLiteral.getAtomicSentence());
Clause answerClause = new Clause();
if (answerLiteralVariables.size() > 0) {
Sentence notAlphaWithAnswer = new ConnectedSentence(Connectors.OR,
notAlpha, answerLiteral.getAtomicSentence());
for (Clause c : KB.convertToClauses(notAlphaWithAnswer)) {
c = KB.standardizeApart(c);
c.setProofStep(new ProofStepGoal(c));
c.setStandardizedApartCheckNotRequired();
sos.addAll(c.getFactors());
}
answerClause.addLiteral(answerLiteral);
} else {
for (Clause c : KB.convertToClauses(notAlpha)) {
c = KB.standardizeApart(c);
c.setProofStep(new ProofStepGoal(c));
c.setStandardizedApartCheckNotRequired();