/** * Inference between a compound term and a component of it * * @param compound The compound term * @param component The component term * @param compoundTask Whether the compound comes from the task * @param memory Reference to the memory */ private static void compoundAndSelf( CompoundTerm compound, Term component, boolean compoundTask, Memory memory) { if ((compound instanceof Conjunction) || (compound instanceof Disjunction)) { if (memory.currentBelief != null) { CompositionalRules.decomposeStatement(compound, component, compoundTask, memory); } else if (compound.containComponent(component)) { StructuralRules.structuralCompound(compound, component, compoundTask, memory); } } else if ((compound instanceof Negation) && !memory.currentTask.isStructural()) { if (compoundTask) { StructuralRules.transformNegation(((Negation) compound).componentAt(0), memory); } else { StructuralRules.transformNegation(compound, memory); } } }