Index: trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/nodeequality/SequenceComparisonRule.java
===================================================================
--- trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/nodeequality/SequenceComparisonRule.java	(revision 1113)
+++ trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/nodeequality/SequenceComparisonRule.java	(revision 1125)
@@ -14,4 +14,6 @@
 
 package de.ugoe.cs.autoquest.tasktrees.nodeequality;
+
+import java.util.List;
 
 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence;
@@ -47,34 +49,72 @@
     }
 
-    /*
-     * (non-Javadoc)
-     * 
-     * @see de.ugoe.cs.tasktree.nodeequality.NodeEqualityRule#apply(TaskTreeNode, TaskTreeNode)
+    /* (non-Javadoc)
+     * @see NodeComparisonRule#isApplicable(ITaskTreeNode, ITaskTreeNode)
+     */
+    @Override
+    public boolean isApplicable(ITaskTreeNode node1, ITaskTreeNode node2) {
+        return (node1 instanceof ISequence) && (node2 instanceof ISequence);
+    }
+
+    /* (non-Javadoc)
+     * @see NodeComparisonRule#areLexicallyEqual(ITaskTreeNode, ITaskTreeNode)
+     */
+    @Override
+    public boolean areLexicallyEqual(ITaskTreeNode node1, ITaskTreeNode node2) {
+        NodeEquality equality = getEquality(node1, node2, NodeEquality.LEXICALLY_EQUAL);
+        return (equality != null) && (equality.isAtLeast(NodeEquality.LEXICALLY_EQUAL));
+    }
+
+    /* (non-Javadoc)
+     * @see NodeComparisonRule#areSyntacticallyEqual(ITaskTreeNode, ITaskTreeNode)
+     */
+    @Override
+    public boolean areSyntacticallyEqual(ITaskTreeNode node1, ITaskTreeNode node2) {
+        NodeEquality equality = getEquality(node1, node2, NodeEquality.SYNTACTICALLY_EQUAL);
+        return (equality != null) && (equality.isAtLeast(NodeEquality.SYNTACTICALLY_EQUAL));
+    }
+
+    /* (non-Javadoc)
+     * @see NodeComparisonRule#areSemanticallyEqual(ITaskTreeNode, ITaskTreeNode)
+     */
+    @Override
+    public boolean areSemanticallyEqual(ITaskTreeNode node1, ITaskTreeNode node2) {
+        NodeEquality equality = getEquality(node1, node2, NodeEquality.SEMANTICALLY_EQUAL);
+        return (equality != null) && (equality.isAtLeast(NodeEquality.SEMANTICALLY_EQUAL));
+    }
+
+    /* (non-Javadoc)
+     * @see NodeComparisonRule#compare(ITaskTreeNode, ITaskTreeNode)
      */
     @Override
     public NodeEquality compare(ITaskTreeNode node1, ITaskTreeNode node2) {
-        if ((!(node1 instanceof ISequence)) || (!(node2 instanceof ISequence))) {
-            return null;
-        }
+        return getEquality(node1, node2, null);
+    }
 
-        if (node1 == node2) {
-            return NodeEquality.IDENTICAL;
-        }
+    /**
+     * 
+     */
+    private NodeEquality getEquality(ITaskTreeNode node1,
+                                     ITaskTreeNode node2,
+                                     NodeEquality  requiredEqualityLevel)
+    {
+        List<ITaskTreeNode> children1 = node1.getChildren();
+        List<ITaskTreeNode> children2 = node2.getChildren();
 
         // if both sequences do not have children, they are equal although this doesn't make sense
-        if ((node1.getChildren().size() == 0) && (node2.getChildren().size() == 0)) {
+        if ((children1.size() == 0) && (children2.size() == 0)) {
             return NodeEquality.LEXICALLY_EQUAL;
         }
 
-        if (node1.getChildren().size() != node2.getChildren().size()) {
+        if (children1.size() != children2.size()) {
             return NodeEquality.UNEQUAL;
         }
 
         NodeEquality resultingEquality = NodeEquality.LEXICALLY_EQUAL;
-        for (int i = 0; i < node1.getChildren().size(); i++) {
-            ITaskTreeNode child1 = node1.getChildren().get(i);
-            ITaskTreeNode child2 = node2.getChildren().get(i);
+        for (int i = 0; i < children1.size(); i++) {
+            ITaskTreeNode child1 = children1.get(i);
+            ITaskTreeNode child2 = children2.get(i);
 
-            NodeEquality nodeEquality = mRuleManager.applyRules(child1, child2);
+            NodeEquality nodeEquality = callRuleManager(child1, child2, requiredEqualityLevel);
 
             if ((nodeEquality == null) || (nodeEquality == NodeEquality.UNEQUAL)) {
@@ -88,3 +128,27 @@
     }
 
+    /**
+     * <p>
+     * TODO: comment
+     * </p>
+     *
+     * @param child1
+     * @param child2
+     * @param requiredEqualityLevel
+     * @return
+     */
+    private NodeEquality callRuleManager(ITaskTreeNode child1,
+                                         ITaskTreeNode child2,
+                                         NodeEquality  requiredEqualityLevel)
+    {
+        if (requiredEqualityLevel == null) {
+            return mRuleManager.compare(child1, child2);
+        }
+        else if (mRuleManager.areAtLeastEqual(child1, child2, requiredEqualityLevel)) {
+            return requiredEqualityLevel;
+        }
+        else {
+            return NodeEquality.UNEQUAL;
+        }
+    }
 }
