Index: branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/ExpressionTable.cs
===================================================================
--- branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/ExpressionTable.cs	(revision 14834)
+++ branches/PushGP/HeuristicLab.PushGP/HeuristicLab.Problems.ProgramSynthesis/Push/Expressions/ExpressionTable.cs	(revision 14875)
@@ -4,22 +4,23 @@
   using System.Linq;
 
-  using HeuristicLab.Problems.ProgramSynthesis.Push.Attributes;
-  using HeuristicLab.Problems.ProgramSynthesis.Push.Data.Pool;
-  using HeuristicLab.Problems.ProgramSynthesis.Push.Stack;
+  using Attributes;
+  using Data.Pool;
+  using Stack;
 
   public static class ExpressionTable {
-    public static readonly IDictionary<string, Expression> StatelessExpressionTable;
-    public static readonly IDictionary<string, Func<Expression>> StatefulExpressionFactory;
-    public static readonly IDictionary<StackTypes, IList<string>> StackTypeToNamesTable = new Dictionary<StackTypes, IList<string>>();
-    public static readonly IDictionary<int, string> IndexToNameTable = new Dictionary<int, string>();
-    public static readonly IDictionary<Type, string> TypeToNameTable = new Dictionary<Type, string>();
-    public static readonly IDictionary<Type, PushExpressionAttribute> TypeToAttributeTable = new Dictionary<Type, PushExpressionAttribute>();
-    public static readonly IDictionary<StackTypes, IList<string>> StackDependencyToNamesTable = new Dictionary<StackTypes, IList<string>>();
-    public static readonly string[] ExpressionNames;
-
-    public static readonly Type[] StatelessExpressionTypes;
-    public static readonly Type[] StatefulExpressionTypes;
-
-    public static readonly int Count;
+    public static readonly IReadOnlyDictionary<string, Expression> StatelessExpressionTable;
+    public static readonly IReadOnlyDictionary<string, Func<Expression>> StatefulExpressionFactory;
+    public static readonly IReadOnlyList<string> ExpressionNames;
+    public static readonly int ExpressionCount;
+
+    private static readonly Dictionary<int, string> indexToNameTable = new Dictionary<int, string>();
+    private static readonly Dictionary<Type, string> typeToNameTable = new Dictionary<Type, string>();
+    private static readonly Dictionary<string, Type> nameToTypeTable = new Dictionary<string, Type>();
+    private static readonly Dictionary<StackTypes, IList<string>> stackTypeToNamesTable = new Dictionary<StackTypes, IList<string>>();
+    private static readonly Dictionary<StackTypes, IList<string>> stackDependencyToNamesTable = new Dictionary<StackTypes, IList<string>>();
+    private static readonly Dictionary<Type, PushExpressionAttribute> typeToAttributeTable = new Dictionary<Type, PushExpressionAttribute>();
+
+    public static readonly IReadOnlyList<Type> StatelessExpressionTypes;
+    public static readonly IReadOnlyList<Type> StatefulExpressionTypes;
 
     static ExpressionTable() {
@@ -31,22 +32,13 @@
       ExpressionNames = StatelessExpressionTable.Keys.Concat(StatefulExpressionFactory.Keys).ToArray();
 
-      Count = StatelessExpressionTable.Count + StatefulExpressionFactory.Count;
-    }
-
-    public static int StatelessCount
-    {
-      get
-      {
-        return StatelessExpressionTable.Count;
-      }
-    }
-
-    public static int StatefullCount
-    {
-      get
-      {
-        return StatefulExpressionFactory.Count;
-      }
-    }
+      ExpressionCount = StatelessExpressionTable.Count + StatefulExpressionFactory.Count;
+    }
+
+    public static IReadOnlyDictionary<int, string> IndexToNameTable { get { return indexToNameTable; } }
+    public static IReadOnlyDictionary<Type, string> TypeToNameTable { get { return typeToNameTable; } }
+    public static IReadOnlyDictionary<string, Type> NameToTypeTable { get { return nameToTypeTable; } }
+    public static IReadOnlyDictionary<StackTypes, IList<string>> StackTypeToNamesTable { get { return stackTypeToNamesTable; } }
+    public static IReadOnlyDictionary<StackTypes, IList<string>> StackDependencyToNamesTable { get { return stackDependencyToNamesTable; } }
+    public static IReadOnlyDictionary<Type, PushExpressionAttribute> TypeToAttributeTable { get { return typeToAttributeTable; } }
 
     private static Dictionary<string, Expression> GetStatelessExpressionTable() {
@@ -57,21 +49,22 @@
         var attribute = (PushExpressionAttribute)Attribute.GetCustomAttribute(type, typeof(PushExpressionAttribute));
 
-        TypeToAttributeTable.Add(type, attribute);
+        typeToAttributeTable.Add(type, attribute);
         dictionary.Add(attribute.ExpressionName, expression);
-        IndexToNameTable.Add(IndexToNameTable.Keys.Count, attribute.ExpressionName);
-        TypeToNameTable.Add(type, attribute.ExpressionName);
-
-        if (!StackTypeToNamesTable.ContainsKey(attribute.StackType)) {
-          StackTypeToNamesTable.Add(attribute.StackType, new List<string>());
-        }
-
-        StackTypeToNamesTable[attribute.StackType].Add(attribute.ExpressionName);
+        indexToNameTable.Add(indexToNameTable.Keys.Count, attribute.ExpressionName);
+        typeToNameTable.Add(type, attribute.ExpressionName);
+        nameToTypeTable.Add(attribute.ExpressionName, type);
+
+        if (!stackTypeToNamesTable.ContainsKey(attribute.StackType)) {
+          stackTypeToNamesTable.Add(attribute.StackType, new List<string>());
+        }
+
+        stackTypeToNamesTable[attribute.StackType].Add(attribute.ExpressionName);
 
         var dependencies = attribute.StackType | attribute.AdditionalStackDependencies;
-        if (!StackDependencyToNamesTable.ContainsKey(dependencies)) {
-          StackDependencyToNamesTable.Add(dependencies, new List<string>());
-        }
-
-        StackDependencyToNamesTable[dependencies].Add(attribute.ExpressionName);
+        if (!stackDependencyToNamesTable.ContainsKey(dependencies)) {
+          stackDependencyToNamesTable.Add(dependencies, new List<string>());
+        }
+
+        stackDependencyToNamesTable[dependencies].Add(attribute.ExpressionName);
       }
 
@@ -90,21 +83,22 @@
         var attribute = (PushExpressionAttribute)Attribute.GetCustomAttribute(type, typeof(PushExpressionAttribute));
 
-        TypeToAttributeTable.Add(type, attribute);
+        typeToAttributeTable.Add(type, attribute);
         dictionary.Add(attribute.ExpressionName, creator);
-        IndexToNameTable.Add(IndexToNameTable.Keys.Count, attribute.ExpressionName);
-        TypeToNameTable.Add(type, attribute.ExpressionName);
-
-        if (!StackTypeToNamesTable.ContainsKey(attribute.StackType)) {
-          StackTypeToNamesTable.Add(attribute.StackType, new List<string>());
-        }
-
-        StackTypeToNamesTable[attribute.StackType].Add(attribute.ExpressionName);
+        indexToNameTable.Add(indexToNameTable.Keys.Count, attribute.ExpressionName);
+        typeToNameTable.Add(type, attribute.ExpressionName);
+        nameToTypeTable.Add(attribute.ExpressionName, type);
+
+        if (!stackTypeToNamesTable.ContainsKey(attribute.StackType)) {
+          stackTypeToNamesTable.Add(attribute.StackType, new List<string>());
+        }
+
+        stackTypeToNamesTable[attribute.StackType].Add(attribute.ExpressionName);
 
         var dependencies = attribute.StackType | attribute.AdditionalStackDependencies;
-        if (!StackDependencyToNamesTable.ContainsKey(dependencies)) {
-          StackDependencyToNamesTable.Add(dependencies, new List<string>());
-        }
-
-        StackDependencyToNamesTable[dependencies].Add(attribute.ExpressionName);
+        if (!stackDependencyToNamesTable.ContainsKey(dependencies)) {
+          stackDependencyToNamesTable.Add(dependencies, new List<string>());
+        }
+
+        stackDependencyToNamesTable[dependencies].Add(attribute.ExpressionName);
       }
 
@@ -146,5 +140,5 @@
 
     public static IReadOnlyList<string> GetExpressionsByStackTypes(StackTypes allowedTypes) {
-      return StackDependencyToNamesTable
+      return stackDependencyToNamesTable
           .Where(entry => (entry.Key & ~allowedTypes) == StackTypes.None)
           .SelectMany(entry => entry.Value)
@@ -163,5 +157,10 @@
 
     public static Expression GetExpression(int index) {
-      return GetExpression(IndexToNameTable[index]);
+      return GetExpression(indexToNameTable[index]);
+    }
+
+    public static Expression GetExpression(Type type) {
+      var name = TypeToNameTable[type];
+      return GetExpression(name);
     }
 
@@ -177,5 +176,5 @@
 
     public static Expression GetStatelessExpression<T>() where T : StatelessExpression {
-      return GetStatelessExpression(TypeToNameTable[typeof(T)]);
+      return GetStatelessExpression(typeToNameTable[typeof(T)]);
     }
 
@@ -198,5 +197,5 @@
 
     public static Expression GetStatefulExpression<T>() {
-      return GetStatefulExpression(TypeToNameTable[typeof(T)]);
+      return GetStatefulExpression(typeToNameTable[typeof(T)]);
     }
 
