/** * The TaskLink is of type TRANSFORM, and the conclusion is an equivalent transformation * * @param tLink The task link * @param memory Reference to the memory */ public static void transformTask(TaskLink tLink, Memory memory) { CompoundTerm content = (CompoundTerm) memory.currentTask.getContent().clone(); short[] indices = tLink.getIndices(); Term inh = null; if ((indices.length == 2) || (content instanceof Inheritance)) { // <(*, term, #) --> #> inh = content; } else if (indices.length == 3) { // <<(*, term, #) --> #> ==> #> inh = content.componentAt(indices[0]); } else if (indices.length == 4) { // <(&&, <(*, term, #) --> #>, #) ==> #> Term component = content.componentAt(indices[0]); if ((component instanceof Conjunction) && (((content instanceof Implication) && (indices[0] == 0)) || (content instanceof Equivalence))) { inh = ((CompoundTerm) component).componentAt(indices[1]); } else { return; } } if (inh instanceof Inheritance) { StructuralRules.transformProductImage((Inheritance) inh, content, indices, memory); } }