Index: branches/GP-MemoryOperations/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj	(revision 4865)
+++ branches/GP-MemoryOperations/HeuristicLab.Problems.DataAnalysis/3.3/HeuristicLab.Problems.DataAnalysis-3.3.csproj	(revision 4897)
@@ -149,4 +149,8 @@
     <Compile Include="Symbolic\Symbols\Constant.cs" />
     <Compile Include="Symbolic\Symbols\ConstantTreeNode.cs" />
+    <Compile Include="Symbolic\Symbols\ReadMem.cs" />
+    <Compile Include="Symbolic\Symbols\ReadMemTreeNode.cs" />
+    <Compile Include="Symbolic\Symbols\SetMem.cs" />
+    <Compile Include="Symbolic\Symbols\SetMemTreeNode.cs" />
     <Compile Include="Symbolic\Symbols\LaggedVariable.cs" />
     <Compile Include="Symbolic\Symbols\LaggedVariableTreeNode.cs" />
Index: branches/GP-MemoryOperations/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs	(revision 4865)
+++ branches/GP-MemoryOperations/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/FullFunctionalExpressionGrammar.cs	(revision 4897)
@@ -60,4 +60,6 @@
       var or = new Or();
       var not = new Not();
+      var setMem = new SetMem();
+      var readMem = new ReadMem();
       var constant = new Constant();
       constant.MinValue = -20;
@@ -67,9 +69,9 @@
       laggedVariable.InitialFrequency = 0.0;
 
-      var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, exp, @if, gt, lt, and, or, not, constant, variableSymbol, laggedVariable };
-      var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, not };
+      var allSymbols = new List<Symbol>() { add, sub, mul, div, mean, sin, cos, tan, log, exp, @if, gt, lt, and, or, not, setMem, readMem, constant, variableSymbol, laggedVariable };
+      var unaryFunctionSymbols = new List<Symbol>() { sin, cos, tan, log, exp, not, setMem};
       var binaryFunctionSymbols = new List<Symbol>() { gt, lt };
       var functionSymbols = new List<Symbol>() { add, sub, mul, div, mean, and, or };
-      var terminalSymbols = new List<Symbol>() { variableSymbol, constant, laggedVariable };
+      var terminalSymbols = new List<Symbol>() { variableSymbol, constant, laggedVariable, readMem };
 
       foreach (var symb in allSymbols)
Index: branches/GP-MemoryOperations/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs	(revision 4865)
+++ branches/GP-MemoryOperations/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SimpleArithmeticExpressionInterpreter.cs	(revision 4897)
@@ -57,5 +57,4 @@
       public const byte NOT = 15;
 
-
       public const byte Average = 16;
 
@@ -66,4 +65,7 @@
       public const byte Constant = 20;
       public const byte Arg = 21;
+
+      public const byte Set = 22;
+      public const byte Read = 23;
     }
 
@@ -90,6 +92,9 @@
       { typeof(Constant), OpCodes.Constant },
       { typeof(Argument), OpCodes.Arg },
+      { typeof(SetMem), OpCodes.Set },
+      { typeof(ReadMem), OpCodes.Read },
     };
     private const int ARGUMENT_STACK_SIZE = 1024;
+    private const int MAX_MEMORY_SIZE = 128;
 
     private Dataset dataset;
@@ -99,4 +104,5 @@
     private double[] argumentStack = new double[ARGUMENT_STACK_SIZE];
     private int argStackPointer;
+    private double[] memory = new double[MAX_MEMORY_SIZE];
 
     public override bool CanChangeName {
@@ -124,4 +130,5 @@
       compiler.AddInstructionPostProcessingHook(PostProcessInstruction);
       code = compiler.Compile(tree, MapSymbolToOpCode);
+      Array.Clear(memory, 0, MAX_MEMORY_SIZE);
       foreach (var row in rows) {
         this.row = row;
@@ -139,4 +146,10 @@
         var variableTreeNode = instr.dynamicNode as LaggedVariableTreeNode;
         instr.iArg0 = (ushort)dataset.GetVariableIndex(variableTreeNode.VariableName);
+      } else if (instr.opCode == OpCodes.Set) {
+        var setMemTreeNode = instr.dynamicNode as SetMemTreeNode;
+        instr.iArg0 = (ushort)setMemTreeNode.Address;
+      } else if (instr.opCode == OpCodes.Read) {
+        var readMemTreeNode = instr.dynamicNode as ReadMemTreeNode;
+        instr.iArg0 = (ushort)readMemTreeNode.Address;
       }
       return instr;
@@ -290,4 +303,12 @@
             return constTreeNode.Value;
           }
+        case OpCodes.Set: {
+            double d = Evaluate();
+            memory[currentInstr.iArg0] = d;
+            return d;
+          }
+        case OpCodes.Read: {
+            return memory[currentInstr.iArg0];
+          }
         default: throw new NotSupportedException();
       }
