*/
boolean rule2(final IFactory factory, final Inclusion[] gcis) {
boolean result = false;
if (lhs instanceof Conjunction) {
Conjunction conjunction = (Conjunction) lhs;
final AbstractConcept[] concepts = conjunction.getConcepts();
if (concepts.length == 1) {
// unwrap redundant conjuncts
gcis[0] = new GCI(concepts[0], rhs);
result = true;
} else if (concepts.length == 0) {
log.warn("Empty conjunct detected in: " + this);
gcis[0] = new GCI(IFactory.TOP_CONCEPT, rhs);
result = true;
} else {
// Swap out any non-Concept concepts (ie Existentials)
for (int i = 0; !result && i < concepts.length; i++) {
if (!(concepts[i] instanceof Concept)) {
final Concept a = getA(factory, concepts[i]);
gcis[0] = new GCI(concepts[i], a);
final AbstractConcept[] newConcepts = new AbstractConcept[concepts.length];
System.arraycopy(concepts, 0, newConcepts, 0,
concepts.length);
newConcepts[i] = a;
gcis[1] = new GCI(new Conjunction(newConcepts), rhs);
result = true;
}
}
if (!result) {
if (concepts.length > 2) {
// Binarise a conjunction of Concepts (expected/assumed
// by NF1)
result = true;
final AbstractConcept[] newConcepts = new AbstractConcept[concepts.length - 1];
System.arraycopy(concepts, 1, newConcepts, 0,
concepts.length - 1);
final AbstractConcept d = new Conjunction(newConcepts);
final Concept a = getA(factory, d);
final AbstractConcept cAndA = new Conjunction(
new AbstractConcept[] { concepts[0], a });
gcis[0] = new GCI(cAndA, rhs);
gcis[1] = new GCI(d, a);
} else if (concepts.length < 2) {