Index: /trunk/sources/HeuristicLab.GP.Boolean/And.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/And.cs	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/And.cs	(revision 720)
@@ -0,0 +1,45 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+using System.Xml;
+using HeuristicLab.Constraints;
+using HeuristicLab.DataAnalysis;
+
+namespace HeuristicLab.GP.Boolean{
+  public sealed class And : FunctionBase {
+
+    public override string Description {
+      get { return ""; }
+    }
+
+    public And()
+      : base() {
+      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
+      AddConstraint(new SubOperatorTypeConstraint(0));
+      AddConstraint(new SubOperatorTypeConstraint(1));
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.GP.Boolean/BooleanTreeInterpreter.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/BooleanTreeInterpreter.cs	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/BooleanTreeInterpreter.cs	(revision 720)
@@ -0,0 +1,76 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.DataAnalysis;
+using HeuristicLab.Core;
+using System.Xml;
+using System.Diagnostics;
+using HeuristicLab.Data;
+
+namespace HeuristicLab.GP.Boolean {
+  internal class BooleanTreeInterpreter {
+    private const double EPSILON = 0.00001;
+    private Dataset dataset;
+    private IFunctionTree tree;
+    private int targetVariable;
+    private int currentRow;
+
+    public void Reset(Dataset dataset, IFunctionTree tree, int targetVariable) {
+      this.dataset = dataset;
+      this.tree = tree;
+      this.targetVariable = targetVariable;
+    }
+
+    internal int GetNumberMatchingInstances(int start, int end) {
+      int matchingInstances = 0;
+      for(int i = start; i < end; i++) {
+        currentRow = i;
+        int result = Step(tree) ? 1 : 0;
+        if(result - dataset.GetValue(i, targetVariable) < EPSILON) matchingInstances++;
+      }
+      return matchingInstances;
+    }
+
+    internal bool Step(IFunctionTree tree) {
+      int symbol = SymbolTable.MapFunction(tree.Function);
+      switch(symbol) {
+        case SymbolTable.AND: return Step(tree.SubTrees[0]) & Step(tree.SubTrees[0]);
+        case SymbolTable.OR: return Step(tree.SubTrees[0]) | Step(tree.SubTrees[0]);
+        case SymbolTable.NOT: return !Step(tree.SubTrees[0]);
+        case SymbolTable.XOR: return Step(tree.SubTrees[0]) ^ Step(tree.SubTrees[1]);
+        case SymbolTable.NAND: return !(Step(tree.SubTrees[0]) & Step(tree.SubTrees[0]));
+        case SymbolTable.NOR: return !(Step(tree.SubTrees[0]) | Step(tree.SubTrees[0]));
+        case SymbolTable.VARIABLE:
+          int index = ((ConstrainedIntData)tree.LocalVariables.ToArray()[0].Value).Data;
+          if(dataset.GetValue(currentRow, targetVariable) == 0.0) return false;
+          else return true;
+        case SymbolTable.UNKNOWN:
+        default:
+          throw new InvalidOperationException(tree.Function.ToString());
+
+      }
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.GP.Boolean/Evaluator.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/Evaluator.cs	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/Evaluator.cs	(revision 720)
@@ -0,0 +1,57 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.DataAnalysis;
+
+namespace HeuristicLab.GP.Boolean {
+  public class Evaluator : OperatorBase {
+    public Evaluator()
+      : base() {
+      AddVariableInfo(new VariableInfo("FunctionTree", "The function tree representing the ant", typeof(IFunctionTree), VariableKind.In));
+      AddVariableInfo(new VariableInfo("Dataset", "The boolean dataset (values 0.0 = false, 1.0=true)", typeof(Dataset), VariableKind.In));
+      AddVariableInfo(new VariableInfo("TargetVariable", "Index of the column of the dataset that holds the target variable", typeof(IntData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("SamplesStart", "Start index of samples in dataset to evaluate", typeof(IntData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("SamplesEnd", "End index of samples in dataset to evaluate", typeof(IntData), VariableKind.In));
+      AddVariableInfo(new VariableInfo("MatchingCases", "", typeof(DoubleData), VariableKind.New | VariableKind.Out));
+    }
+
+    public override IOperation Apply(IScope scope) {
+      IFunctionTree tree = GetVariableValue<IFunctionTree>("FunctionTree", scope, true);
+      Dataset dataset = GetVariableValue<Dataset>("Dataset", scope, true);
+      int targetVariable = GetVariableValue<IntData>("TargetVariable", scope, true).Data;
+      int start = GetVariableValue<IntData>("SamplesStart", scope, true).Data;
+      int end = GetVariableValue<IntData>("SamplesEnd", scope, true).Data;
+
+      BooleanTreeInterpreter interpreter = new BooleanTreeInterpreter();
+      interpreter.Reset(dataset, tree, targetVariable);
+      int matchingCases = interpreter.GetNumberMatchingInstances(start, end);
+
+      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName("MatchingCases"), new DoubleData(matchingCases)));
+      return null;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.GP.Boolean/FunctionLibraryInjector.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/FunctionLibraryInjector.cs	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/FunctionLibraryInjector.cs	(revision 720)
@@ -0,0 +1,106 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Xml;
+using HeuristicLab.Core;
+using HeuristicLab.Data;
+using HeuristicLab.DataAnalysis;
+using HeuristicLab.Constraints;
+
+namespace HeuristicLab.GP.Boolean {
+  public class FunctionLibraryInjector : OperatorBase {
+    private const string OPERATORLIBRARY = "FunctionLibrary";
+
+    private GPOperatorLibrary operatorLibrary;
+
+    public override string Description {
+      get { return @"Injects a function library for boolean logic."; }
+    }
+
+    public FunctionLibraryInjector()
+      : base() {
+      AddVariableInfo(new VariableInfo(OPERATORLIBRARY, "Preconfigured default operator library", typeof(GPOperatorLibrary), VariableKind.New));
+    }
+
+    public override IOperation Apply(IScope scope) {
+      InitDefaultOperatorLibrary();
+      scope.AddVariable(new HeuristicLab.Core.Variable(scope.TranslateName(OPERATORLIBRARY), operatorLibrary));
+      return null;
+    }
+
+    private void InitDefaultOperatorLibrary() {
+      And and = new And();
+      Or or = new Or();
+      Not not = new Not();
+      Nand nand = new Nand();
+      Nor nor = new Nor();
+      Xor xor = new Xor();
+      HeuristicLab.GP.Boolean.Variable variable = new HeuristicLab.GP.Boolean.Variable();
+
+      IFunction[] allFunctions = new IFunction[] {
+        and,
+        or,
+        not,
+        nand,
+        nor,
+        xor,
+        variable
+      };
+
+      SetAllowedSubOperators(and, allFunctions);
+      SetAllowedSubOperators(or, allFunctions);
+      SetAllowedSubOperators(not, allFunctions);
+      SetAllowedSubOperators(nand, allFunctions);
+      SetAllowedSubOperators(nor, allFunctions);
+      SetAllowedSubOperators(not, allFunctions);
+
+      operatorLibrary = new GPOperatorLibrary();
+      operatorLibrary.GPOperatorGroup.AddOperator(and);
+      operatorLibrary.GPOperatorGroup.AddOperator(or);
+      operatorLibrary.GPOperatorGroup.AddOperator(not);
+      operatorLibrary.GPOperatorGroup.AddOperator(nand);
+      operatorLibrary.GPOperatorGroup.AddOperator(nor);
+      operatorLibrary.GPOperatorGroup.AddOperator(xor);
+      operatorLibrary.GPOperatorGroup.AddOperator(variable);
+    }
+
+    private void SetAllowedSubOperators(IFunction f, IFunction[] gs) {
+      foreach(IConstraint c in f.Constraints) {
+        if(c is SubOperatorTypeConstraint) {
+          SubOperatorTypeConstraint typeConstraint = c as SubOperatorTypeConstraint;
+          typeConstraint.Clear();
+          foreach(IFunction g in gs) {
+            typeConstraint.AddOperator(g);
+          }
+        } else if(c is AllSubOperatorsTypeConstraint) {
+          AllSubOperatorsTypeConstraint typeConstraint = c as AllSubOperatorsTypeConstraint;
+          typeConstraint.Clear();
+          foreach(IFunction g in gs) {
+            typeConstraint.AddOperator(g);
+          }
+        }
+      }
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.GP.Boolean/HeuristicLab.GP.Boolean.csproj
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/HeuristicLab.GP.Boolean.csproj	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/HeuristicLab.GP.Boolean.csproj	(revision 720)
@@ -0,0 +1,113 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>9.0.30729</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{A0821479-801F-43DF-B788-AE92FB410DA9}</ProjectGuid>
+    <OutputType>Library</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>HeuristicLab.GP.Boolean</RootNamespace>
+    <AssemblyName>HeuristicLab.GP.Boolean-1.0</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <SignAssembly>true</SignAssembly>
+    <AssemblyOriginatorKeyFile>HeuristicLab.snk</AssemblyOriginatorKeyFile>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Core">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Xml.Linq">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data.DataSetExtensions">
+      <RequiredTargetFramework>3.5</RequiredTargetFramework>
+    </Reference>
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="BooleanTreeInterpreter.cs" />
+    <Compile Include="Not.cs" />
+    <Compile Include="Xor.cs" />
+    <Compile Include="Or.cs" />
+    <Compile Include="Nand.cs" />
+    <Compile Include="Nor.cs" />
+    <Compile Include="Evaluator.cs" />
+    <Compile Include="FunctionLibraryInjector.cs" />
+    <Compile Include="HeuristicLabGPBooleanPlugin.cs" />
+    <Compile Include="And.cs" />
+    <Compile Include="Variable.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+    <Compile Include="SymbolTable.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <None Include="HeuristicLab.snk" />
+    <None Include="Properties\AssemblyInfo.frame" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\HeuristicLab.Constraints\HeuristicLab.Constraints.csproj">
+      <Project>{FCD62C6F-4793-4593-AE9A-0BDCA256EE99}</Project>
+      <Name>HeuristicLab.Constraints</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Core\HeuristicLab.Core.csproj">
+      <Project>{F43B59AB-2B8C-4570-BC1E-15592086517C}</Project>
+      <Name>HeuristicLab.Core</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.DataAnalysis\HeuristicLab.DataAnalysis.csproj">
+      <Project>{7DD3A97A-56E9-462F-90E2-A351FE7AF5C2}</Project>
+      <Name>HeuristicLab.DataAnalysis</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Data\HeuristicLab.Data.csproj">
+      <Project>{F473D9AF-3F09-4296-9F28-3C65118DAFFA}</Project>
+      <Name>HeuristicLab.Data</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.GP\HeuristicLab.GP.csproj">
+      <Project>{1F1CF3ED-374C-4288-995B-93F6B872F571}</Project>
+      <Name>HeuristicLab.GP</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Operators\HeuristicLab.Operators.csproj">
+      <Project>{A9983BA2-B3B2-475E-8E2C-62050B71D1C5}</Project>
+      <Name>HeuristicLab.Operators</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.PluginInfrastructure\HeuristicLab.PluginInfrastructure.csproj">
+      <Project>{94186A6A-5176-4402-AE83-886557B53CCA}</Project>
+      <Name>HeuristicLab.PluginInfrastructure</Name>
+    </ProjectReference>
+    <ProjectReference Include="..\HeuristicLab.Random\HeuristicLab.Random.csproj">
+      <Project>{47019A74-F7F7-482E-83AA-D3F4F777E879}</Project>
+      <Name>HeuristicLab.Random</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+  <PropertyGroup>
+    <PreBuildEvent>cmd /c ""$(SolutionDir)PreBuildEvent.cmd" "$(ProjectDir).""</PreBuildEvent>
+  </PropertyGroup>
+</Project>
Index: /trunk/sources/HeuristicLab.GP.Boolean/HeuristicLabGPBooleanPlugin.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/HeuristicLabGPBooleanPlugin.cs	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/HeuristicLabGPBooleanPlugin.cs	(revision 720)
@@ -0,0 +1,36 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.PluginInfrastructure;
+
+namespace HeuristicLab.GP.SantaFe {
+  [ClassInfo(Name = "HeuristicLab.GP.Boolean-1.0")]
+  [PluginFile(Filename = "HeuristicLab.GP.Boolean-1.0.dll", Filetype = PluginFileType.Assembly)]
+  [Dependency(Dependency = "HeuristicLab.GP-3.2")]
+  [Dependency(Dependency = "HeuristicLab.Core-3.2")]
+  [Dependency(Dependency = "HeuristicLab.Data-3.2")]
+  [Dependency(Dependency = "HeuristicLab.DataAnalysis-3.2")]
+  public class HeuristicLabGPBooleanPlugin : PluginBase {
+  }
+}
Index: /trunk/sources/HeuristicLab.GP.Boolean/Nand.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/Nand.cs	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/Nand.cs	(revision 720)
@@ -0,0 +1,45 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+using System.Xml;
+using HeuristicLab.Constraints;
+using HeuristicLab.DataAnalysis;
+
+namespace HeuristicLab.GP.Boolean{
+  public sealed class Nand : FunctionBase {
+
+    public override string Description {
+      get { return ""; }
+    }
+
+    public Nand()
+      : base() {
+      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
+      AddConstraint(new SubOperatorTypeConstraint(0));
+      AddConstraint(new SubOperatorTypeConstraint(1));
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.GP.Boolean/Nor.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/Nor.cs	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/Nor.cs	(revision 720)
@@ -0,0 +1,45 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+using System.Xml;
+using HeuristicLab.Constraints;
+using HeuristicLab.DataAnalysis;
+
+namespace HeuristicLab.GP.Boolean{
+  public sealed class Nor : FunctionBase {
+
+    public override string Description {
+      get { return ""; }
+    }
+
+    public Nor()
+      : base() {
+      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
+      AddConstraint(new SubOperatorTypeConstraint(0));
+      AddConstraint(new SubOperatorTypeConstraint(1));
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.GP.Boolean/Not.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/Not.cs	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/Not.cs	(revision 720)
@@ -0,0 +1,44 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+using System.Xml;
+using HeuristicLab.Constraints;
+using HeuristicLab.DataAnalysis;
+
+namespace HeuristicLab.GP.Boolean{
+  public sealed class Not : FunctionBase {
+
+    public override string Description {
+      get { return ""; }
+    }
+
+    public Not()
+      : base() {
+      AddConstraint(new NumberOfSubOperatorsConstraint(1, 1));
+      AddConstraint(new SubOperatorTypeConstraint(0));
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.GP.Boolean/Or.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/Or.cs	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/Or.cs	(revision 720)
@@ -0,0 +1,45 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+using System.Xml;
+using HeuristicLab.Constraints;
+using HeuristicLab.DataAnalysis;
+
+namespace HeuristicLab.GP.Boolean{
+  public sealed class Or : FunctionBase {
+
+    public override string Description {
+      get { return ""; }
+    }
+
+    public Or()
+      : base() {
+      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
+      AddConstraint(new SubOperatorTypeConstraint(0));
+      AddConstraint(new SubOperatorTypeConstraint(1));
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.GP.Boolean/Properties/AssemblyInfo.frame
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/Properties/AssemblyInfo.frame	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/Properties/AssemblyInfo.frame	(revision 720)
@@ -0,0 +1,58 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+using HeuristicLab.PluginInfrastructure;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("HeuristicLab.GP.Boolean")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("HeuristicLab")]
+[assembly: AssemblyCopyright("(c) 2002-2008 HEAL")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("863021a4-3cde-48be-8af6-dac1077f5fb5")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// You can specify all the values or you can default the Revision and Build Numbers 
+// by using the '*' as shown below:
+[assembly: AssemblyVersion("1.0.0.$WCREV$")]
+[assembly: AssemblyFileVersion("1.0.0.$WCREV$")]
+[assembly: AssemblyBuildDate("$WCNOW$")]
Index: /trunk/sources/HeuristicLab.GP.Boolean/SymbolTable.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/SymbolTable.cs	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/SymbolTable.cs	(revision 720)
@@ -0,0 +1,58 @@
+﻿#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using HeuristicLab.Core;
+using System.Xml;
+
+namespace HeuristicLab.GP.Boolean {
+  class SymbolTable : StorableBase {
+    public const int VARIABLE = 1;
+    public const int NOT = 2;
+    public const int AND = 3;
+    public const int OR = 4;
+    public const int NAND = 5;
+    public const int NOR = 6;
+    public const int XOR = 7;
+    public const int UNKNOWN = 8;
+    private static Dictionary<Type, int> staticTypes = new Dictionary<Type, int>();
+
+    // needs to be public for persistence mechanism (Activator.CreateInstance needs empty constructor)
+    static SymbolTable() {
+      staticTypes = new Dictionary<Type, int>();
+      staticTypes[typeof(Variable)] = VARIABLE;
+      staticTypes[typeof(Not)] = NOT;
+      staticTypes[typeof(And)] = AND;
+      staticTypes[typeof(Or)] = OR;
+      staticTypes[typeof(Nand)] = NAND;
+      staticTypes[typeof(Nor)] = NOR;
+      staticTypes[typeof(Xor)] = XOR;
+    }
+
+    internal static int MapFunction(IFunction function) {
+      if(staticTypes.ContainsKey(function.GetType())) return staticTypes[function.GetType()];
+      else return UNKNOWN;
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.GP.Boolean/Variable.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/Variable.cs	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/Variable.cs	(revision 720)
@@ -0,0 +1,149 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+using System.Xml;
+using HeuristicLab.Constraints;
+using HeuristicLab.DataAnalysis;
+using HeuristicLab.Operators;
+using HeuristicLab.Random;
+
+namespace HeuristicLab.GP.Boolean {
+  public sealed class Variable : FunctionBase {
+    public const string INDEX = "Variable";
+
+    private int minIndex;
+    private int maxIndex;
+
+    public override string Description {
+      get { return ""; }
+    }
+
+    public Variable()
+      : base() {
+      AddVariableInfo(new VariableInfo(INDEX, "Index of the variable in the dataset representing this feature", typeof(ConstrainedIntData), VariableKind.None));
+      GetVariableInfo(INDEX).Local = true;
+      AddVariableInfo(new VariableInfo(INITIALIZATION, "Initialization operator for variables", typeof(CombinedOperator), VariableKind.None));
+      GetVariableInfo(INITIALIZATION).Local = false;
+      AddVariableInfo(new VariableInfo(MANIPULATION, "Manipulation operator for variables", typeof(CombinedOperator), VariableKind.None));
+      GetVariableInfo(MANIPULATION).Local = false;
+
+      AddConstraint(new NumberOfSubOperatorsConstraint(0, 0));
+
+      ConstrainedIntData variable = new ConstrainedIntData();
+      AddVariable(new HeuristicLab.Core.Variable(INDEX, variable));
+      minIndex = 0; maxIndex = 100;
+
+      SetupInitialization();
+      SetupManipulation();
+
+    }
+
+    private void SetupInitialization() {
+      CombinedOperator combinedOp = new CombinedOperator();
+      SequentialProcessor seq = new SequentialProcessor();
+      UniformRandomizer indexRandomizer = new UniformRandomizer();
+      indexRandomizer.Min = minIndex;
+      indexRandomizer.Max = maxIndex + 1; // uniform randomizer generates numbers in the range [min, max[
+      indexRandomizer.GetVariableInfo("Value").ActualName = INDEX;
+      indexRandomizer.Name = "Index Randomizer";
+
+      combinedOp.OperatorGraph.AddOperator(seq);
+      combinedOp.OperatorGraph.AddOperator(indexRandomizer);
+      combinedOp.OperatorGraph.InitialOperator = seq;
+      seq.AddSubOperator(indexRandomizer);
+      HeuristicLab.Core.IVariable initOp = GetVariable(INITIALIZATION);
+      if(initOp == null) {
+        AddVariable(new HeuristicLab.Core.Variable(INITIALIZATION, combinedOp));
+      } else {
+        initOp.Value = combinedOp;
+      }
+    }
+
+    private void SetupManipulation() {
+      // manipulation operator
+      CombinedOperator combinedOp = new CombinedOperator();
+      SequentialProcessor seq = new SequentialProcessor();
+      UniformRandomizer indexRandomizer = new UniformRandomizer();
+      indexRandomizer.Min = minIndex;
+      indexRandomizer.Max = maxIndex + 1;
+      indexRandomizer.GetVariableInfo("Value").ActualName = INDEX;
+      indexRandomizer.Name = "Index Randomizer";
+
+      combinedOp.OperatorGraph.AddOperator(seq);
+      combinedOp.OperatorGraph.AddOperator(indexRandomizer);
+      combinedOp.OperatorGraph.InitialOperator = seq;
+      seq.AddSubOperator(indexRandomizer);
+      HeuristicLab.Core.IVariable manipulationOp = GetVariable(MANIPULATION);
+      if(manipulationOp == null) {
+        AddVariable(new HeuristicLab.Core.Variable(MANIPULATION, combinedOp));
+      } else {
+        manipulationOp.Value = combinedOp;
+      }
+    }
+
+    public void SetConstraints(int[] allowedIndexes) {
+      ConstrainedIntData index = GetVariableValue<ConstrainedIntData>(INDEX, null, false);
+      Array.Sort(allowedIndexes);
+      minIndex = allowedIndexes[0]; maxIndex = allowedIndexes[allowedIndexes.Length - 1];
+      List<IConstraint> constraints = new List<IConstraint>();
+      int start = allowedIndexes[0];
+      int prev = start;
+      for(int i = 1; i < allowedIndexes.Length; i++) {
+        if(allowedIndexes[i] != prev + 1) {
+          IntBoundedConstraint lastRange = new IntBoundedConstraint();
+          lastRange.LowerBound = start;
+          lastRange.LowerBoundEnabled = true;
+          lastRange.LowerBoundIncluded = true;
+          lastRange.UpperBound = prev;
+          lastRange.UpperBoundEnabled = true;
+          lastRange.UpperBoundIncluded = true;
+          constraints.Add(lastRange);
+          start = allowedIndexes[i];
+          prev = start;
+        }
+        prev = allowedIndexes[i];
+      }
+      IntBoundedConstraint range = new IntBoundedConstraint();
+      range.LowerBound = start;
+      range.LowerBoundEnabled = true;
+      range.LowerBoundIncluded = true;
+      range.UpperBound = prev;
+      range.UpperBoundEnabled = true;
+      range.UpperBoundIncluded = true;
+      constraints.Add(range);
+      if(constraints.Count > 1) {
+        OrConstraint or = new OrConstraint();
+        foreach(IConstraint c in constraints) or.Clauses.Add(c);
+        index.AddConstraint(or);
+      } else {
+        index.AddConstraint(constraints[0]);
+      }
+
+      SetupInitialization();
+      SetupManipulation();
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.GP.Boolean/Xor.cs
===================================================================
--- /trunk/sources/HeuristicLab.GP.Boolean/Xor.cs	(revision 720)
+++ /trunk/sources/HeuristicLab.GP.Boolean/Xor.cs	(revision 720)
@@ -0,0 +1,45 @@
+#region License Information
+/* HeuristicLab
+ * Copyright (C) 2002-2008 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ *
+ * This file is part of HeuristicLab.
+ *
+ * HeuristicLab is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * HeuristicLab is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
+ */
+#endregion
+
+using System;
+using System.Collections.Generic;
+using System.Text;
+using HeuristicLab.Data;
+using HeuristicLab.Core;
+using System.Xml;
+using HeuristicLab.Constraints;
+using HeuristicLab.DataAnalysis;
+
+namespace HeuristicLab.GP.Boolean{
+  public sealed class Xor : FunctionBase {
+
+    public override string Description {
+      get { return ""; }
+    }
+
+    public Xor()
+      : base() {
+      AddConstraint(new NumberOfSubOperatorsConstraint(2, 2));
+      AddConstraint(new SubOperatorTypeConstraint(0));
+      AddConstraint(new SubOperatorTypeConstraint(1));
+    }
+  }
+}
Index: /trunk/sources/HeuristicLab.sln
===================================================================
--- /trunk/sources/HeuristicLab.sln	(revision 719)
+++ /trunk/sources/HeuristicLab.sln	(revision 720)
@@ -119,4 +119,6 @@
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.Hive.Client.Console", "HeuristicLab.Hive.Client.Console\HeuristicLab.Hive.Client.Console.csproj", "{8B14A35E-DBDF-43EB-B019-23E9FBC5A35E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HeuristicLab.GP.Boolean", "HeuristicLab.GP.Boolean\HeuristicLab.GP.Boolean.csproj", "{A0821479-801F-43DF-B788-AE92FB410DA9}"
 EndProject
 Global
@@ -545,4 +547,10 @@
 		{8B14A35E-DBDF-43EB-B019-23E9FBC5A35E}.Release|Any CPU.Build.0 = Release|Any CPU
 		{8B14A35E-DBDF-43EB-B019-23E9FBC5A35E}.Release|x86.ActiveCfg = Release|Any CPU
+		{A0821479-801F-43DF-B788-AE92FB410DA9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{A0821479-801F-43DF-B788-AE92FB410DA9}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{A0821479-801F-43DF-B788-AE92FB410DA9}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{A0821479-801F-43DF-B788-AE92FB410DA9}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{A0821479-801F-43DF-B788-AE92FB410DA9}.Release|Any CPU.Build.0 = Release|Any CPU
+		{A0821479-801F-43DF-B788-AE92FB410DA9}.Release|x86.ActiveCfg = Release|Any CPU
 	EndGlobalSection
 	GlobalSection(SolutionProperties) = preSolution
Index: /trunk/sources/HeuristicLab/CopyAssemblies.cmd
===================================================================
--- /trunk/sources/HeuristicLab/CopyAssemblies.cmd	(revision 719)
+++ /trunk/sources/HeuristicLab/CopyAssemblies.cmd	(revision 720)
@@ -29,4 +29,5 @@
 copy %1\HeuristicLab.Evolutionary\%2\HeuristicLab.Evolutionary-3.2.dll .\plugins
 copy %1\HeuristicLab.GP\%2\HeuristicLab.GP-3.2.dll .\plugins
+copy %1\HeuristicLab.GP.Boolean\%2\HeuristicLab.GP.Boolean-1.0.dll .\plugins
 copy %1\HeuristicLab.GP.SantaFe\%2\HeuristicLab.GP.SantaFe-3.2.dll .\plugins
 copy %1\HeuristicLab.GP.StructureIdentification\%2\HeuristicLab.GP.StructureIdentification-3.2.dll .\plugins
