positive = tempProp;
}
//Positive is now set and in temporaryComponents
//Evidently, wasn't in temporaryNegations
//So we add the "not" gate and set it in temporaryNegations
Not not = new Not();
//Add positive as input
not.addInput(positive);
positive.addOutput(not);
temporaryNegations.put(transformed, not);
conj = not;
}
if(conj == null) {
Component positive = components.get(transformed);
//No, because then that will be attached to "negations", which could be bad
if(positive == null) {
//So the positive can't possibly be true (unless we have recurstion)
//and so this would be positive always
//We want to just skip this conjunct, so we continue to the next
continue; //to the next conjunct
}
//Check if we're sharing a component with another sentence with a negation
//(i.e. look for "nots" in our outputs and use those instead)
Not existingNotOutput = getNotOutput(positive);
if(existingNotOutput != null) {
componentsToConnect.add(existingNotOutput);
negations.put(transformed, existingNotOutput);
continue; //to the next conjunct
}
Not not = new Not();
not.addInput(positive);
positive.addOutput(not);
negations.put(transformed, not);
conj = not;
}
componentsToConnect.add(conj);