Index: /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskComparator.java
===================================================================
--- /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskComparator.java	(revision 1853)
+++ /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskComparator.java	(revision 1853)
@@ -0,0 +1,305 @@
+//   Copyright 2012 Georg-August-Universität Göttingen, Germany
+//
+//   Licensed under the Apache License, Version 2.0 (the "License");
+//   you may not use this file except in compliance with the License.
+//   You may obtain a copy of the License at
+//
+//       http://www.apache.org/licenses/LICENSE-2.0
+//
+//   Unless required by applicable law or agreed to in writing, software
+//   distributed under the License is distributed on an "AS IS" BASIS,
+//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+//   See the License for the specific language governing permissions and
+//   limitations under the License.
+
+package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.util.HashMap;
+
+import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality;
+import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
+import de.ugoe.cs.autoquest.usageprofiles.SymbolComparator;
+
+/**
+ * <p>
+ * implementation of a symbol comparator for task instances. Internally, it uses comparison buffers
+ * to prevent comparing two tasks or task instances several times. It internally instantiates
+ * comparers being the implementation strategy of the comparisons required for a specific level
+ * of task equality. The comparers internally use the {@link TaskEqualityRuleManager} for
+ * performing comparisons.
+ * </p>
+ */
+public class TaskComparator implements SymbolComparator<ITask> {
+    
+    /**  */
+    private static final long serialVersionUID = 1L;
+    
+    /**
+     * the maximum size of the internal buffer used for storing comparison results
+     */
+    private static final int MAX_BUFFER_SIZE = 2 * 1024 * 1024;
+
+    /**
+     * the considered level of task equality
+     */
+    private TaskEquality minimalTaskEquality;
+
+    /**
+     * the comparer used internally for comparing two tasks
+     */
+    private transient Comparer comparer;
+
+    /**
+     * the comparer used for comparing two tasks on the lexical level
+     */
+    private transient Comparer lexicalComparer;
+
+    /**
+     * internal buffer used for storing comparison results
+     */
+    private transient HashMap<Long, Boolean> equalityBuffer = new HashMap<Long, Boolean>();
+
+    /**
+     * internal buffer used for storing comparison results only for lexical comparisons
+     */
+    private transient HashMap<Long, Boolean> lexicalEqualityBuffer;
+
+    /**
+     * <p>
+     * initializes the comparator with a considered task equality level
+     * </p>
+     * 
+     * @param minimalTaskEquality the considered task equality level
+     */
+    public TaskComparator(TaskEquality minimalTaskEquality) {
+        this.minimalTaskEquality = minimalTaskEquality;
+        init();
+    }
+
+    /**
+     * <p>
+     * returns true, if this comparator considers the provided tasks as equal, false else
+     * </p>
+     * 
+     * @param task1 the first task to compare
+     * @param task2 the second task to compare
+     * 
+     * @return as described
+     */
+    @Override
+    public boolean equals(ITask task1, ITask task2) {
+        Boolean result;
+        
+        if (task1 != task2) {
+            //if ((task1 instanceof IEventTask) && (task2 instanceof IEventTask)) {
+                long key = ((long) System.identityHashCode(task1)) << 32;
+                key += System.identityHashCode(task2);
+            
+                result = equalityBuffer.get(key);
+            
+                if (result == null) {
+                    result = comparer.compare(task1, task2);
+                    
+                    if (equalityBuffer.size() < MAX_BUFFER_SIZE) {
+                        //equalityBuffer.put(key, result);
+                    }
+                }
+            /*}
+            else {
+                result = false;
+            }*/
+        }
+        else {
+            result = true;
+        }
+        
+        return result;
+    }
+
+    /**
+     * <p>
+     * returns true, if this comparator considers the provided tasks as lexically equal, false else
+     * </p>
+     * 
+     * @param task1 the first task to compare
+     * @param task2 the second task to compare
+     * 
+     * @return as described
+     */
+    public boolean areLexicallyEqual(ITask task1, ITask task2) {
+        Boolean result;
+        
+        if (task1 != task2) {
+            long key = ((long) System.identityHashCode(task1)) << 32;
+            key += System.identityHashCode(task2);
+            
+            result = lexicalEqualityBuffer.get(key);
+            
+            if (result == null) {
+                result = lexicalComparer.compare(task1, task2);
+                if (equalityBuffer.size() < MAX_BUFFER_SIZE) {
+                    lexicalEqualityBuffer.put(key, result);
+                }
+            }
+        }
+        else {
+            result = true;
+        }
+        
+        return result;
+    }
+    
+    /**
+     * <p>
+     * can be called externally to clear the internal comparison buffers
+     * </p>
+     */
+    public void clearBuffers() {
+        equalityBuffer.clear();
+        init();
+    }
+    
+    /**
+     * <p>
+     * initializes the comparator with comparers depending on the different comparison levels as
+     * well as with the required comparison buffers. Comparers and buffers for lexical comparison
+     * may be reused if the considered equality level is also lexical.
+     * </p>
+     */
+    private void init() {
+        if (minimalTaskEquality == TaskEquality.LEXICALLY_EQUAL) {
+            comparer = new LexicalComparer();
+        }
+        else if (minimalTaskEquality == TaskEquality.SYNTACTICALLY_EQUAL) {
+            comparer = new SyntacticalComparer();
+        }
+        else if (minimalTaskEquality == TaskEquality.SEMANTICALLY_EQUAL) {
+            comparer = new SemanticalComparer();
+        }
+        else {
+            comparer = new DefaultComparer(this.minimalTaskEquality);
+        }
+        
+        if (minimalTaskEquality == TaskEquality.LEXICALLY_EQUAL) {
+            lexicalComparer = comparer;
+            lexicalEqualityBuffer = equalityBuffer;
+        }
+        else {
+            lexicalComparer = new LexicalComparer();
+            lexicalEqualityBuffer = new HashMap<Long, Boolean>();
+        }
+    }
+    
+    /**
+     * <p>
+     * deserialize this object and reinitialize the buffers
+     * </p>
+     */
+    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
+        in.defaultReadObject();
+        init();
+    }
+
+
+    /**
+     * <p>
+     * interface for internally used comparers containing only a compare method
+     * </p>
+     */
+    private static interface Comparer {
+        
+        /**
+         * <p>
+         * returns true, if this comparator considers the provided tasks as equal, false else
+         * </p>
+         * 
+         * @param task1 the first task to compare
+         * @param task2 the second task to compare
+         * 
+         * @return as described
+         */
+        boolean compare(ITask task1, ITask task2);
+    }
+
+    /**
+     * <p>
+     * comparer that performs comparisons only on the lexical level
+     * </p>
+     */
+    private static class LexicalComparer implements Comparer {
+        
+        /* (non-Javadoc)
+         * @see Comparer#compare(ITask, ITask)
+         */
+        public boolean compare(ITask task1, ITask task2) {
+            return TaskEqualityRuleManager.getInstance().areLexicallyEqual(task1, task2);
+        }
+    }
+
+    /**
+     * <p>
+     * comparer that performs comparisons only on the syntactical level
+     * </p>
+     * 
+     */
+    private static class SyntacticalComparer implements Comparer {
+        
+        /* (non-Javadoc)
+         * @see Comparer#compare(ITask, ITask)
+         */
+        public boolean compare(ITask task1, ITask task2) {
+            return TaskEqualityRuleManager.getInstance().areSyntacticallyEqual(task1, task2);
+        }
+    }
+
+    /**
+     * <p>
+     * comparer that performs comparisons only on the semantical level
+     * </p>
+     */
+    private static class SemanticalComparer implements Comparer {
+        
+        /* (non-Javadoc)
+         * @see Comparer#compare(ITask, ITask)
+         */
+        public boolean compare(ITask task1, ITask task2) {
+            return TaskEqualityRuleManager.getInstance().areSemanticallyEqual(task1, task2);
+        }
+    }
+
+    /**
+     * <p>
+     * comparer that performs comparisons only on the provided level
+     * </p>
+     */
+    private static class DefaultComparer implements Comparer {
+        
+        /**
+         * <p>
+         * the minimal task equality considered by this comparer
+         * </p>
+         */
+        private TaskEquality minimalTaskEquality;
+        
+        /**
+         * <p>
+         * initializes this comparer with the task equality to be considered
+         * </p>
+         */
+        public DefaultComparer(TaskEquality minimalTaskEquality) {
+           this.minimalTaskEquality = minimalTaskEquality;
+        }
+        
+        /* (non-Javadoc)
+         * @see Comparer#compare(ITask, ITask)
+         */
+        public boolean compare(ITask task1, ITask task2) {
+            return TaskEqualityRuleManager.getInstance().areAtLeastEqual
+                (task1, task2, minimalTaskEquality);
+        }
+    }
+
+}
Index: /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskHandlingStrategy.java
===================================================================
--- /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskHandlingStrategy.java	(revision 1852)
+++ /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskHandlingStrategy.java	(revision 1853)
@@ -16,5 +16,5 @@
 
 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
 import de.ugoe.cs.autoquest.usageprofiles.SymbolComparator;
 import de.ugoe.cs.autoquest.usageprofiles.SymbolMap;
@@ -32,5 +32,5 @@
  * @author Patrick Harms
  */
-public class TaskHandlingStrategy implements SymbolStrategy<ITaskInstance> {
+public class TaskHandlingStrategy implements SymbolStrategy<ITask> {
     
     /**  */
@@ -49,5 +49,5 @@
      * </p>
      */
-    private TaskInstanceComparator comparator;
+    private TaskComparator comparator;
 
     /**
@@ -65,5 +65,5 @@
         }
         else {
-            comparator = new TaskInstanceComparator(this.consideredEquality);
+            comparator = new TaskComparator(this.consideredEquality);
         }
     }
@@ -73,5 +73,5 @@
      */
     @Override
-    public SymbolComparator<ITaskInstance> getSymbolComparator() {
+    public SymbolComparator<ITask> getSymbolComparator() {
         return comparator;
     }
@@ -83,5 +83,5 @@
      * </p>
      */
-    public TaskInstanceComparator getTaskComparator() {
+    public TaskComparator getTaskComparator() {
         return comparator;
     }
@@ -91,5 +91,5 @@
      */
     @Override
-    public <V> SymbolMap<ITaskInstance, V> createSymbolMap() {
+    public <V> SymbolMap<ITask, V> createSymbolMap() {
         if (consideredEquality == TaskEquality.IDENTICAL) {
             return new TaskSymbolIdentityMap<V>();
@@ -104,5 +104,5 @@
      */
     @Override
-    public <V> SymbolMap<ITaskInstance, V> copySymbolMap(SymbolMap<ITaskInstance, V> other) {
+    public <V> SymbolMap<ITask, V> copySymbolMap(SymbolMap<ITask, V> other) {
         if (consideredEquality == TaskEquality.IDENTICAL) {
             return new TaskSymbolIdentityMap<V>(other);
Index: /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskIdentityComparator.java
===================================================================
--- /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskIdentityComparator.java	(revision 1852)
+++ /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskIdentityComparator.java	(revision 1853)
@@ -17,5 +17,4 @@
 import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality;
 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance;
 
 /**
@@ -25,5 +24,5 @@
  * </p>
  */
-class TaskIdentityComparator extends TaskInstanceComparator {
+class TaskIdentityComparator extends TaskComparator {
 
     /**  */
@@ -38,12 +37,4 @@
         super(TaskEquality.IDENTICAL);
     }
-    
-    /* (non-Javadoc)
-     * @see SymbolComparator#equals(Object, Object)
-     */
-    @Override
-    public boolean equals(ITaskInstance taskInstance1, ITaskInstance taskInstance2) {
-        return equals(taskInstance1.getTask(), taskInstance2.getTask());
-    }
 
     /* (non-Javadoc)
Index: unk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceComparator.java
===================================================================
--- /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceComparator.java	(revision 1852)
+++ 	(revision )
@@ -1,313 +1,0 @@
-//   Copyright 2012 Georg-August-Universität Göttingen, Germany
-//
-//   Licensed under the Apache License, Version 2.0 (the "License");
-//   you may not use this file except in compliance with the License.
-//   You may obtain a copy of the License at
-//
-//       http://www.apache.org/licenses/LICENSE-2.0
-//
-//   Unless required by applicable law or agreed to in writing, software
-//   distributed under the License is distributed on an "AS IS" BASIS,
-//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-//   See the License for the specific language governing permissions and
-//   limitations under the License.
-
-package de.ugoe.cs.autoquest.tasktrees.temporalrelation;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.util.HashMap;
-
-import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEquality;
-import de.ugoe.cs.autoquest.tasktrees.taskequality.TaskEqualityRuleManager;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance;
-import de.ugoe.cs.autoquest.usageprofiles.SymbolComparator;
-
-/**
- * <p>
- * implementation of a symbol comparator for task instances. Internally, it uses comparison buffers
- * to prevent comparing two tasks or task instances several times. It internally instantiates
- * comparers being the implementation strategy of the comparisons required for a specific level
- * of task equality. The comparers internally use the {@link TaskEqualityRuleManager} for
- * performing comparisons.
- * </p>
- */
-public class TaskInstanceComparator implements SymbolComparator<ITaskInstance> {
-    
-    /**  */
-    private static final long serialVersionUID = 1L;
-    
-    /**
-     * the maximum size of the internal buffer used for storing comparison results
-     */
-    private static final int MAX_BUFFER_SIZE = 2 * 1024 * 1024;
-
-    /**
-     * the considered level of task equality
-     */
-    private TaskEquality minimalTaskEquality;
-
-    /**
-     * the comparer used internally for comparing two tasks
-     */
-    private transient Comparer comparer;
-
-    /**
-     * the comparer used for comparing two tasks on the lexical level
-     */
-    private transient Comparer lexicalComparer;
-
-    /**
-     * internal buffer used for storing comparison results
-     */
-    private transient HashMap<Long, Boolean> equalityBuffer = new HashMap<Long, Boolean>();
-
-    /**
-     * internal buffer used for storing comparison results only for lexical comparisons
-     */
-    private transient HashMap<Long, Boolean> lexicalEqualityBuffer;
-
-    /**
-     * <p>
-     * initializes the comparator with a considered task equality level
-     * </p>
-     * 
-     * @param minimalTaskEquality the considered task equality level
-     */
-    public TaskInstanceComparator(TaskEquality minimalTaskEquality) {
-        this.minimalTaskEquality = minimalTaskEquality;
-        init();
-    }
-
-    /* (non-Javadoc)
-     * @see SymbolComparator#equals(Object, Object)
-     */
-    @Override
-    public boolean equals(ITaskInstance taskInstance1, ITaskInstance taskInstance2) {
-        return equals(taskInstance1.getTask(), taskInstance2.getTask());
-    }        
-
-    /**
-     * <p>
-     * returns true, if this comparator considers the provided tasks as equal, false else
-     * </p>
-     * 
-     * @param task1 the first task to compare
-     * @param task2 the second task to compare
-     * 
-     * @return as described
-     */
-    public boolean equals(ITask task1, ITask task2) {
-        Boolean result;
-        
-        if (task1 != task2) {
-            //if ((task1 instanceof IEventTask) && (task2 instanceof IEventTask)) {
-                long key = ((long) System.identityHashCode(task1)) << 32;
-                key += System.identityHashCode(task2);
-            
-                result = equalityBuffer.get(key);
-            
-                if (result == null) {
-                    result = comparer.compare(task1, task2);
-                    
-                    if (equalityBuffer.size() < MAX_BUFFER_SIZE) {
-                        equalityBuffer.put(key, result);
-                    }
-                }
-            /*}
-            else {
-                result = false;
-            }*/
-        }
-        else {
-            result = true;
-        }
-        
-        return result;
-    }
-
-    /**
-     * <p>
-     * returns true, if this comparator considers the provided tasks as lexically equal, false else
-     * </p>
-     * 
-     * @param task1 the first task to compare
-     * @param task2 the second task to compare
-     * 
-     * @return as described
-     */
-    public boolean areLexicallyEqual(ITask task1, ITask task2) {
-        Boolean result;
-        
-        if (task1 != task2) {
-            long key = ((long) System.identityHashCode(task1)) << 32;
-            key += System.identityHashCode(task2);
-            
-            result = lexicalEqualityBuffer.get(key);
-            
-            if (result == null) {
-                result = lexicalComparer.compare(task1, task2);
-                if (equalityBuffer.size() < MAX_BUFFER_SIZE) {
-                    lexicalEqualityBuffer.put(key, result);
-                }
-            }
-        }
-        else {
-            result = true;
-        }
-        
-        return result;
-    }
-    
-    /**
-     * <p>
-     * can be called externally to clear the internal comparison buffers
-     * </p>
-     */
-    public void clearBuffers() {
-        equalityBuffer.clear();
-        init();
-    }
-    
-    /**
-     * <p>
-     * initializes the comparator with comparers depending on the different comparison levels as
-     * well as with the required comparison buffers. Comparers and buffers for lexical comparison
-     * may be reused if the considered equality level is also lexical.
-     * </p>
-     */
-    private void init() {
-        if (minimalTaskEquality == TaskEquality.LEXICALLY_EQUAL) {
-            comparer = new LexicalComparer();
-        }
-        else if (minimalTaskEquality == TaskEquality.SYNTACTICALLY_EQUAL) {
-            comparer = new SyntacticalComparer();
-        }
-        else if (minimalTaskEquality == TaskEquality.SEMANTICALLY_EQUAL) {
-            comparer = new SemanticalComparer();
-        }
-        else {
-            comparer = new DefaultComparer(this.minimalTaskEquality);
-        }
-        
-        if (minimalTaskEquality == TaskEquality.LEXICALLY_EQUAL) {
-            lexicalComparer = comparer;
-            lexicalEqualityBuffer = equalityBuffer;
-        }
-        else {
-            lexicalComparer = new LexicalComparer();
-            lexicalEqualityBuffer = new HashMap<Long, Boolean>();
-        }
-    }
-    
-    /**
-     * <p>
-     * deserialize this object and reinitialize the buffers
-     * </p>
-     */
-    private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
-        in.defaultReadObject();
-        init();
-    }
-
-
-    /**
-     * <p>
-     * interface for internally used comparers containing only a compare method
-     * </p>
-     */
-    private static interface Comparer {
-        
-        /**
-         * <p>
-         * returns true, if this comparator considers the provided tasks as equal, false else
-         * </p>
-         * 
-         * @param task1 the first task to compare
-         * @param task2 the second task to compare
-         * 
-         * @return as described
-         */
-        boolean compare(ITask task1, ITask task2);
-    }
-
-    /**
-     * <p>
-     * comparer that performs comparisons only on the lexical level
-     * </p>
-     */
-    private static class LexicalComparer implements Comparer {
-        
-        /* (non-Javadoc)
-         * @see Comparer#compare(ITask, ITask)
-         */
-        public boolean compare(ITask task1, ITask task2) {
-            return TaskEqualityRuleManager.getInstance().areLexicallyEqual(task1, task2);
-        }
-    }
-
-    /**
-     * <p>
-     * comparer that performs comparisons only on the syntactical level
-     * </p>
-     * 
-     */
-    private static class SyntacticalComparer implements Comparer {
-        
-        /* (non-Javadoc)
-         * @see Comparer#compare(ITask, ITask)
-         */
-        public boolean compare(ITask task1, ITask task2) {
-            return TaskEqualityRuleManager.getInstance().areSyntacticallyEqual(task1, task2);
-        }
-    }
-
-    /**
-     * <p>
-     * comparer that performs comparisons only on the semantical level
-     * </p>
-     */
-    private static class SemanticalComparer implements Comparer {
-        
-        /* (non-Javadoc)
-         * @see Comparer#compare(ITask, ITask)
-         */
-        public boolean compare(ITask task1, ITask task2) {
-            return TaskEqualityRuleManager.getInstance().areSemanticallyEqual(task1, task2);
-        }
-    }
-
-    /**
-     * <p>
-     * comparer that performs comparisons only on the provided level
-     * </p>
-     */
-    private static class DefaultComparer implements Comparer {
-        
-        /**
-         * <p>
-         * the minimal task equality considered by this comparer
-         * </p>
-         */
-        private TaskEquality minimalTaskEquality;
-        
-        /**
-         * <p>
-         * initializes this comparer with the task equality to be considered
-         * </p>
-         */
-        public DefaultComparer(TaskEquality minimalTaskEquality) {
-           this.minimalTaskEquality = minimalTaskEquality;
-        }
-        
-        /* (non-Javadoc)
-         * @see Comparer#compare(ITask, ITask)
-         */
-        public boolean compare(ITask task1, ITask task2) {
-            return TaskEqualityRuleManager.getInstance().areAtLeastEqual
-                (task1, task2, minimalTaskEquality);
-        }
-    }
-
-}
Index: /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceTrie.java
===================================================================
--- /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceTrie.java	(revision 1852)
+++ /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskInstanceTrie.java	(revision 1853)
@@ -19,4 +19,5 @@
 import java.util.List;
 import java.util.Map;
+import java.util.logging.Level;
 
 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
@@ -26,4 +27,5 @@
 import de.ugoe.cs.autoquest.usageprofiles.Trie;
 import de.ugoe.cs.autoquest.usageprofiles.TrieProcessor;
+import de.ugoe.cs.util.console.Console;
 
 /**
@@ -39,5 +41,5 @@
  * @author Patrick Harms
  */
-class TaskInstanceTrie extends Trie<ITaskInstance> {
+class TaskInstanceTrie extends Trie<ITask> {
 
     /**  */
@@ -77,18 +79,18 @@
         }
         
-        SymbolMap<ITaskInstance, Counter> equalTaskInstancesMap =
+        SymbolMap<ITask, Counter> equalTaskInstancesMap =
             taskStrategy.createSymbolMap();
         
         Map<ITask, Counter> instanceCountMap = new HashMap<ITask, Counter>();
         
-        System.out.println("preparing training");
+        Console.traceln(Level.FINEST, "preparing training");
         int noOfTaskInstances = 0;
         for (IUserSession session : userSessions) {
             for (ITaskInstance taskInstance : session) {
-                Counter counter = equalTaskInstancesMap.getValue(taskInstance);
+                Counter counter = equalTaskInstancesMap.getValue(taskInstance.getTask());
                 
                 if (counter == null) {
                     counter = new Counter();
-                    equalTaskInstancesMap.addSymbol(taskInstance, counter);
+                    equalTaskInstancesMap.addSymbol(taskInstance.getTask(), counter);
                 }
                 
@@ -100,5 +102,7 @@
         }
         
-        System.out.println("performing training of " + noOfTaskInstances + " task instances");
+        Console.traceln
+            (Level.FINEST, "performing training of " + noOfTaskInstances + " task instances");
+        
         Counter processedTaskInstances = new Counter();
         int counterRecheckAt = noOfTaskInstances / 10; // recheck the maximum count after each
@@ -146,5 +150,5 @@
                        int                 counterRecheckAt)
     {
-        List<ITaskInstance> subsequence = new LinkedList<ITaskInstance>();
+        List<ITask> subsequence = new LinkedList<ITask>();
         
         int sequenceMaxCount = 0;
@@ -172,5 +176,5 @@
             }
             else {
-                subsequence.add(currentTaskInstance);
+                subsequence.add(currentTaskInstance.getTask());
 
                 if (subsequence.size() == maxOrder) {
@@ -211,5 +215,5 @@
      * @author Patrick Harms
      */
-    private static class MaxSequenceCountFinder implements TrieProcessor<ITaskInstance> {
+    private static class MaxSequenceCountFinder implements TrieProcessor<ITask> {
         
         /**
@@ -224,5 +228,5 @@
          */
         @Override
-        public TrieProcessor.Result process(List<ITaskInstance> foundTask, int count) {
+        public TrieProcessor.Result process(List<ITask> foundTask, int count) {
             if (foundTask.size() == 2) {
                 this.currentCount = Math.max(this.currentCount, count);
Index: /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskSymbolBucketedMap.java
===================================================================
--- /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskSymbolBucketedMap.java	(revision 1852)
+++ /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskSymbolBucketedMap.java	(revision 1853)
@@ -27,8 +27,11 @@
 
 import de.ugoe.cs.autoquest.eventcore.Event;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTask;
 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.IIterationInstance;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelectionInstance;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequenceInstance;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.IIteration;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptional;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelection;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ISequence;
+import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance;
 import de.ugoe.cs.autoquest.usageprofiles.SymbolMap;
@@ -56,5 +59,5 @@
  * @param <V>
  */
-class TaskSymbolBucketedMap<V> implements SymbolMap<ITaskInstance, V>, Serializable {
+class TaskSymbolBucketedMap<V> implements SymbolMap<ITask, V>, Serializable {
 
     /**
@@ -78,5 +81,5 @@
      * </p>
      */
-    private TaskInstanceComparator comparator;
+    private TaskComparator comparator;
 
     /**
@@ -85,5 +88,5 @@
      * </p>
      */
-    private List<Map.Entry<ITaskInstance, V>> symbolList;
+    private List<Map.Entry<ITask, V>> symbolList;
 
     /**
@@ -93,5 +96,5 @@
      * </p>
      */
-    private Map<Integer, List<Map.Entry<ITaskInstance, V>>> symbolBuckets;
+    private Map<Integer, List<Map.Entry<ITask, V>>> symbolBuckets;
     
     /**
@@ -113,5 +116,5 @@
      * @throws IllegalArgumentException if the provided comparator is null
      */
-    public TaskSymbolBucketedMap(TaskInstanceComparator comparator) {
+    public TaskSymbolBucketedMap(TaskComparator comparator) {
         if (comparator == null) {
             throw new IllegalArgumentException("comparator must not be null");
@@ -119,5 +122,5 @@
         
         this.comparator = comparator;
-        this.symbolList = new ArrayList<Map.Entry<ITaskInstance, V>>();
+        this.symbolList = new ArrayList<Map.Entry<ITask, V>>();
     }
 
@@ -137,5 +140,5 @@
 
         this.comparator = otherMap.comparator;
-        this.symbolList = new ArrayList<Map.Entry<ITaskInstance, V>>(otherMap.symbolList);
+        this.symbolList = new ArrayList<Map.Entry<ITask, V>>(otherMap.symbolList);
         
         if (this.symbolList.size() > MAX_LIST_SIZE) {
@@ -177,5 +180,5 @@
      * @throws IllegalArgumentException if the provided task instance is null
      */
-    public boolean containsSymbol(ITaskInstance symbol) {
+    public boolean containsSymbol(ITask symbol) {
         if (symbol == null) {
             throw new IllegalArgumentException("symbol must not be null");
@@ -198,10 +201,10 @@
      * @throws IllegalArgumentException if the provided task instance is null
      */
-    public V getValue(ITaskInstance symbol) {
+    public V getValue(ITask symbol) {
         if (symbol == null) {
             throw new IllegalArgumentException("symbol must not be null");
         }
         
-        Map.Entry<ITaskInstance, V> entry = getEntry(symbol);
+        Map.Entry<ITask, V> entry = getEntry(symbol);
         
         if (entry != null) {
@@ -230,10 +233,10 @@
      * @throws IllegalArgumentException if the provided task instance is null
      */
-    public void addSymbol(ITaskInstance symbol, V value) {
+    public void addSymbol(ITask symbol, V value) {
         if (symbol == null) {
             throw new IllegalArgumentException("symbol must not be null");
         }
         
-        Map.Entry<ITaskInstance, V> entry = new SymbolMapEntry(symbol, value);
+        Map.Entry<ITask, V> entry = new SymbolMapEntry(symbol, value);
         
         symbolList.add(entry);
@@ -261,5 +264,5 @@
      * @throws IllegalArgumentException if the provided task instance is null
      */
-    public V removeSymbol(ITaskInstance symbol) {
+    public V removeSymbol(ITask symbol) {
         if (symbol == null) {
             throw new IllegalArgumentException("symbol must not be null");
@@ -289,6 +292,6 @@
      * @return as described
      */
-    public Collection<ITaskInstance> getSymbols() {
-        return new ReadOnlyCollectionFacade<ITaskInstance>(symbolList, new SymbolFacade());
+    public Collection<ITask> getSymbols() {
+        return new ReadOnlyCollectionFacade<ITask>(symbolList, new SymbolFacade());
     }
     
@@ -351,8 +354,7 @@
      */
     private void createSymbolBuckets() {
-        //System.out.println("creating symbol buckets");
-        symbolBuckets = new HashMap<Integer, List<Map.Entry<ITaskInstance, V>>>();
-        
-        for (Map.Entry<ITaskInstance, V> symbol : symbolList) {
+        symbolBuckets = new HashMap<Integer, List<Map.Entry<ITask, V>>>();
+        
+        for (Map.Entry<ITask, V> symbol : symbolList) {
             addToSymbolBucket(symbol);
         }
@@ -368,5 +370,5 @@
      * </p>
      */
-    private void addToSymbolBucket(Map.Entry<ITaskInstance, V> symbolEntry) {
+    private void addToSymbolBucket(Map.Entry<ITask, V> symbolEntry) {
         int bucketId = defaultBucket;
         int[] bucketSearchOrder = getBucketSearchOrder(symbolEntry.getKey());
@@ -380,8 +382,8 @@
         }
         
-        List<Map.Entry<ITaskInstance, V>> list = symbolBuckets.get(bucketId);
+        List<Map.Entry<ITask, V>> list = symbolBuckets.get(bucketId);
         
         if (list == null) {
-            list = new LinkedList<Map.Entry<ITaskInstance, V>>();
+            list = new LinkedList<Map.Entry<ITask, V>>();
             symbolBuckets.put(bucketId, list);
         }
@@ -396,25 +398,36 @@
      * </p>
      */
-    private int[] getBucketSearchOrder(ITaskInstance taskInstance) {
+    private int[] getBucketSearchOrder(ITask task) {
         // 0 = sequence; 1 = selection; 2 = iteration; 3 = optional; 4 = event task in general;
         // other = hashCode of name of event type
         
-        if (taskInstance instanceof IEventTaskInstance) {
+        if (task instanceof IEventTask) {
             // event tasks are most likely equal to those of the same type happening on the same
             // target. Afterwards, they should be equal to those of the event type with the same
             // name. Afterwards, they may be equal to iterations, optionals, other event tasks,
             // selections, and finally the rest.
-            Event event = ((IEventTaskInstance) taskInstance).getEvent();
-            return new int[] { event.getTarget().hashCode() + event.getType().getName().hashCode(),
-                               event.getType().getName().hashCode(), 2, 3, 4, 1 };                       
-        }
-        else if (taskInstance instanceof ISequenceInstance) {
+            
+            if (task.getInstances().iterator().hasNext()) {
+                Event event =
+                    ((IEventTaskInstance) ((IEventTask) task).getInstances().iterator().next()).getEvent();
+                
+                return new int[] { event.getTarget().hashCode() + event.getType().getName().hashCode(),
+                                   event.getType().getName().hashCode(), 2, 3, 4, 1 };
+            }
+            else {
+                return new int[] { 4, 2, 3, 1 };
+            }
+        }
+        else if (task instanceof ISequence) {
             return new int[] { 0, 2, 3, 1 };                       
         }
-        else if (taskInstance instanceof ISelectionInstance) {
+        else if (task instanceof ISelection) {
             return new int[] { 1, 4, 2, 3 };                       
         }
-        else if (taskInstance instanceof IIterationInstance) {
+        else if (task instanceof IIteration) {
             return new int[] { 2, 1, 4 };                       
+        }
+        else if (task instanceof IOptional) {
+            return new int[] { 3, 4, 2, 1, 0 };                       
         }
         
@@ -428,5 +441,5 @@
      * </p>
      */
-    private Map.Entry<ITaskInstance, V> removeFromSymbolBuckets(ITaskInstance symbol) {
+    private Map.Entry<ITask, V> removeFromSymbolBuckets(ITask symbol) {
         int bucketId = defaultBucket;
         int[] bucketSearchOrder = getBucketSearchOrder(symbol);
@@ -436,6 +449,6 @@
         }
         
-        List<Map.Entry<ITaskInstance, V>> list = symbolBuckets.get(bucketId);
-        Map.Entry<ITaskInstance, V> result = null;
+        List<Map.Entry<ITask, V>> list = symbolBuckets.get(bucketId);
+        Map.Entry<ITask, V> result = null;
         
         if (list != null) {
@@ -479,6 +492,6 @@
      * </p>
      */
-    private Map.Entry<ITaskInstance, V> getEntry(ITaskInstance symbol) {
-        Map.Entry<ITaskInstance, V> entry = null;
+    private Map.Entry<ITask, V> getEntry(ITask symbol) {
+        Map.Entry<ITask, V> entry = null;
         if (symbolBuckets == null) {
             entry = lookup(symbol, symbolList);
@@ -487,5 +500,5 @@
             int[] bucketSearchOrder = getBucketSearchOrder(symbol);
             for (int bucketId : bucketSearchOrder) {
-                List<Map.Entry<ITaskInstance, V>> list = symbolBuckets.get(bucketId);
+                List<Map.Entry<ITask, V>> list = symbolBuckets.get(bucketId);
                 if (list != null) {
                     entry = lookup(symbol, list);
@@ -499,7 +512,7 @@
             if (entry == null) {
                 Arrays.sort(bucketSearchOrder);
-                for (Map.Entry<Integer, List<Map.Entry<ITaskInstance, V>>> bucket : symbolBuckets.entrySet()) {
+                for (Map.Entry<Integer, List<Map.Entry<ITask, V>>> bucket : symbolBuckets.entrySet()) {
                     if (Arrays.binarySearch(bucketSearchOrder, bucket.getKey()) < 0) {
-                        List<Map.Entry<ITaskInstance, V>> list = bucket.getValue();
+                        List<Map.Entry<ITask, V>> list = bucket.getValue();
                         if (list != null) {
                             entry = lookup(symbol, list);
@@ -521,6 +534,6 @@
      * </p>
      */
-    private Map.Entry<ITaskInstance, V> lookup(ITaskInstance symbol, List<Map.Entry<ITaskInstance, V>> list) {
-        for (Map.Entry<ITaskInstance, V> candidate : list) {
+    private Map.Entry<ITask, V> lookup(ITask symbol, List<Map.Entry<ITask, V>> list) {
+        for (Map.Entry<ITask, V> candidate : list) {
             if (comparator.equals(candidate.getKey(), symbol)) {
                 return candidate;
@@ -538,10 +551,10 @@
      * @author Patrick Harms
      */
-    private class SymbolMapEntry implements Map.Entry<ITaskInstance, V> {
+    private class SymbolMapEntry implements Map.Entry<ITask, V> {
         
         /**
          * the task instance to map to a value
          */
-        private ITaskInstance symbol;
+        private ITask symbol;
         
         /**
@@ -556,5 +569,5 @@
          * </p>
          */
-        private SymbolMapEntry(ITaskInstance symbol, V value) {
+        private SymbolMapEntry(ITask symbol, V value) {
             super();
             this.symbol = symbol;
@@ -566,5 +579,5 @@
          */
         @Override
-        public ITaskInstance getKey() {
+        public ITask getKey() {
             return symbol;
         }
@@ -640,5 +653,5 @@
          * the list facaded by this facade
          */
-        private List<Map.Entry<ITaskInstance, V>> list;
+        private List<Map.Entry<ITask, V>> list;
         
         /**
@@ -652,6 +665,6 @@
          * </p>
          */
-        private ReadOnlyCollectionFacade(List<Map.Entry<ITaskInstance, V>> list,
-                                         EntryFacade<TYPE>                 entryFacade)
+        private ReadOnlyCollectionFacade(List<Map.Entry<ITask, V>> list,
+                                         EntryFacade<TYPE>         entryFacade)
         {
             this.list = list;
@@ -681,5 +694,5 @@
         public boolean contains(Object o) {
             if (o == null) {
-                for (Map.Entry<ITaskInstance, V> entry : list) {
+                for (Map.Entry<ITask, V> entry : list) {
                     if (entryFacade.getFacadedElement(entry) == null) {
                         return true;
@@ -688,5 +701,5 @@
             }
             else {
-                for (Map.Entry<ITaskInstance, V> entry : list) {
+                for (Map.Entry<ITask, V> entry : list) {
                     if (o.equals(entryFacade.getFacadedElement(entry))) {
                         return true;
@@ -812,5 +825,5 @@
          * the facaded iterator
          */
-        private Iterator<Map.Entry<ITaskInstance, V>> iterator;
+        private Iterator<Map.Entry<ITask, V>> iterator;
         
         /**
@@ -825,6 +838,6 @@
          * </p>
          */
-        private ReadOnlyCollectionIteratorFacade(Iterator<Map.Entry<ITaskInstance, V>> iterator,
-                                                 EntryFacade<TYPE>                     entryFacade)
+        private ReadOnlyCollectionIteratorFacade(Iterator<Map.Entry<ITask, V>> iterator,
+                                                 EntryFacade<TYPE>             entryFacade)
         {
             this.iterator = iterator;
@@ -877,5 +890,5 @@
          * @return the part of the entry to be returned
          */
-        protected abstract T getFacadedElement(Entry<ITaskInstance, V> entry);
+        protected abstract T getFacadedElement(Entry<ITask, V> entry);
         
     }
@@ -888,5 +901,5 @@
      * @author Patrick Harms
      */
-    private class SymbolFacade extends EntryFacade<ITaskInstance> {
+    private class SymbolFacade extends EntryFacade<ITask> {
 
         /* (non-Javadoc)
@@ -894,5 +907,5 @@
          */
         @Override
-        protected ITaskInstance getFacadedElement(Entry<ITaskInstance, V> entry) {
+        protected ITask getFacadedElement(Entry<ITask, V> entry) {
             return entry.getKey();
         }
@@ -913,5 +926,5 @@
          */
         @Override
-        protected V getFacadedElement(Entry<ITaskInstance, V> entry) {
+        protected V getFacadedElement(Entry<ITask, V> entry) {
             return entry.getValue();
         }
Index: /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskSymbolIdentityMap.java
===================================================================
--- /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskSymbolIdentityMap.java	(revision 1852)
+++ /trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/TaskSymbolIdentityMap.java	(revision 1853)
@@ -20,5 +20,4 @@
 
 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask;
-import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskInstance;
 import de.ugoe.cs.autoquest.usageprofiles.SymbolMap;
 
@@ -31,5 +30,5 @@
  * @author Patrick Harms
  */
-public class TaskSymbolIdentityMap<V> implements SymbolMap<ITaskInstance, V> {
+public class TaskSymbolIdentityMap<V> implements SymbolMap<ITask, V> {
 
     /**  */
@@ -48,5 +47,5 @@
      * </p>
      */
-    private Map<ITask, ITaskInstance> symbols;
+    private Map<ITask, ITask> symbols;
 
     /**
@@ -57,5 +56,5 @@
     public TaskSymbolIdentityMap() {
         delegate = new HashMap<ITask, V>();
-        symbols = new HashMap<ITask, ITaskInstance>();
+        symbols = new HashMap<ITask, ITask>();
     }
 
@@ -67,5 +66,5 @@
      * @param other the map to be copied
      */
-    public TaskSymbolIdentityMap(SymbolMap<ITaskInstance, V> other) {
+    public TaskSymbolIdentityMap(SymbolMap<ITask, V> other) {
         if (other == null) {
             throw new IllegalArgumentException("other map must not be null");
@@ -73,9 +72,9 @@
         
         delegate = new HashMap<ITask, V>();
-        symbols = new HashMap<ITask, ITaskInstance>();
+        symbols = new HashMap<ITask, ITask>();
         
-        for (ITaskInstance symbol : other.getSymbols()) {
-            delegate.put(symbol.getTask(), other.getValue(symbol));
-            symbols.put(symbol.getTask(), symbol);
+        for (ITask symbol : other.getSymbols()) {
+            delegate.put(symbol, other.getValue(symbol));
+            symbols.put(symbol, symbol);
         }
     }
@@ -101,10 +100,10 @@
      */
     @Override
-    public boolean containsSymbol(ITaskInstance symbol) {
+    public boolean containsSymbol(ITask symbol) {
         if (symbol == null) {
             throw new IllegalArgumentException("symbol must not be null");
         }
         
-        return delegate.containsKey(symbol.getTask());
+        return delegate.containsKey(symbol);
     }
 
@@ -113,10 +112,10 @@
      */
     @Override
-    public V getValue(ITaskInstance symbol) {
+    public V getValue(ITask symbol) {
         if (symbol == null) {
             throw new IllegalArgumentException("symbol must not be null");
         }
         
-        return delegate.get(symbol.getTask());
+        return delegate.get(symbol);
     }
 
@@ -125,11 +124,11 @@
      */
     @Override
-    public void addSymbol(ITaskInstance symbol, V value) {
+    public void addSymbol(ITask symbol, V value) {
         if (symbol == null) {
             throw new IllegalArgumentException("symbol must not be null");
         }
         
-        delegate.put(symbol.getTask(), value);
-        symbols.put(symbol.getTask(), symbol);
+        delegate.put(symbol, value);
+        symbols.put(symbol, symbol);
     }
 
@@ -138,11 +137,11 @@
      */
     @Override
-    public V removeSymbol(ITaskInstance symbol) {
+    public V removeSymbol(ITask symbol) {
         if (symbol == null) {
             throw new IllegalArgumentException("symbol must not be null");
         }
         
-        symbols.remove(symbol.getTask());
-        return delegate.remove(symbol.getTask());
+        symbols.remove(symbol);
+        return delegate.remove(symbol);
     }
 
@@ -151,5 +150,5 @@
      */
     @Override
-    public Collection<ITaskInstance> getSymbols() {
+    public Collection<ITask> getSymbols() {
         return symbols.values();
     }
