Index: trunk/sources/HeuristicLab.Functions/BakedFunctionTree.cs
===================================================================
--- trunk/sources/HeuristicLab.Functions/BakedFunctionTree.cs	(revision 518)
+++ trunk/sources/HeuristicLab.Functions/BakedFunctionTree.cs	(revision 519)
@@ -344,4 +344,10 @@
       return new FunctionTreeView(this);
     }
+
+    public override string ToString() {
+      SymbolicExpressionExporter exporter = new SymbolicExpressionExporter();
+      exporter.Visit(this);
+      return exporter.GetStringRepresentation();
+    }
   }
 }
Index: trunk/sources/HeuristicLab.Functions/FunctionView.Designer.cs
===================================================================
--- trunk/sources/HeuristicLab.Functions/FunctionView.Designer.cs	(revision 518)
+++ trunk/sources/HeuristicLab.Functions/FunctionView.Designer.cs	(revision 519)
@@ -60,4 +60,5 @@
       this.treeNodeContextMenu = new System.Windows.Forms.ContextMenuStrip(this.components);
       this.copyToClipboardMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+      this.copyToClipboardSExpressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
       this.splitContainer.Panel1.SuspendLayout();
       this.splitContainer.Panel2.SuspendLayout();
@@ -167,14 +168,22 @@
       // 
       this.treeNodeContextMenu.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
-            this.copyToClipboardMenuItem});
+            this.copyToClipboardMenuItem,
+            this.copyToClipboardSExpressionToolStripMenuItem});
       this.treeNodeContextMenu.Name = "treeNodeContextMenu";
-      this.treeNodeContextMenu.Size = new System.Drawing.Size(248, 26);
+      this.treeNodeContextMenu.Size = new System.Drawing.Size(259, 70);
       // 
       // copyToClipboardMenuItem
       // 
       this.copyToClipboardMenuItem.Name = "copyToClipboardMenuItem";
-      this.copyToClipboardMenuItem.Size = new System.Drawing.Size(247, 22);
+      this.copyToClipboardMenuItem.Size = new System.Drawing.Size(258, 22);
       this.copyToClipboardMenuItem.Text = "Copy to clip-board (Model-Analyzer)";
       this.copyToClipboardMenuItem.Click += new System.EventHandler(this.copyToClipboardMenuItem_Click);
+      // 
+      // copyToClipboardSExpressionToolStripMenuItem
+      // 
+      this.copyToClipboardSExpressionToolStripMenuItem.Name = "copyToClipboardSExpressionToolStripMenuItem";
+      this.copyToClipboardSExpressionToolStripMenuItem.Size = new System.Drawing.Size(258, 22);
+      this.copyToClipboardSExpressionToolStripMenuItem.Text = "Copy to clip-board (S-Expression)";
+      this.copyToClipboardSExpressionToolStripMenuItem.Click += new System.EventHandler(this.copyToClipboardSExpressionToolStripMenuItem_Click);
       // 
       // FunctionTreeView
@@ -209,4 +218,5 @@
     private System.Windows.Forms.ContextMenuStrip treeNodeContextMenu;
     private System.Windows.Forms.ToolStripMenuItem copyToClipboardMenuItem;
+    private System.Windows.Forms.ToolStripMenuItem copyToClipboardSExpressionToolStripMenuItem;
 
   }
Index: trunk/sources/HeuristicLab.Functions/FunctionView.cs
===================================================================
--- trunk/sources/HeuristicLab.Functions/FunctionView.cs	(revision 518)
+++ trunk/sources/HeuristicLab.Functions/FunctionView.cs	(revision 519)
@@ -139,4 +139,13 @@
       Clipboard.SetText(visitor.ModelAnalyzerPrefix);
     }
+
+    private void copyToClipboardSExpressionToolStripMenuItem_Click(object sender, EventArgs e) {
+      TreeNode node = funTreeView.SelectedNode;
+      if(node == null || node.Tag == null) return;
+
+      string sexp = ((IFunctionTree)node.Tag).ToString();
+      Clipboard.SetText(sexp);
+    }
+
     private void funTreeView_MouseUp(object sender, MouseEventArgs e) {
       if(e.Button == MouseButtons.Right) {
Index: trunk/sources/HeuristicLab.Functions/HeuristicLab.Functions.csproj
===================================================================
--- trunk/sources/HeuristicLab.Functions/HeuristicLab.Functions.csproj	(revision 518)
+++ trunk/sources/HeuristicLab.Functions/HeuristicLab.Functions.csproj	(revision 519)
@@ -78,4 +78,5 @@
     <Compile Include="LessThan.cs" />
     <Compile Include="Not.cs" />
+    <Compile Include="SymbolicExpressionExporter.cs" />
     <Compile Include="Signum.cs" />
     <Compile Include="Logarithm.cs" />
Index: trunk/sources/HeuristicLab.Functions/SymbolicExpressionExporter.cs
===================================================================
--- trunk/sources/HeuristicLab.Functions/SymbolicExpressionExporter.cs	(revision 519)
+++ trunk/sources/HeuristicLab.Functions/SymbolicExpressionExporter.cs	(revision 519)
@@ -0,0 +1,168 @@
+﻿#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.Data;
+
+namespace HeuristicLab.Functions {
+  public class SymbolicExpressionExporter : IFunctionVisitor {
+    private IFunctionTree currentBranch;
+    private StringBuilder builder;
+    private string currentIndent;
+    public SymbolicExpressionExporter() {
+      Reset();
+    }
+
+    public void Reset() {
+      currentIndent = "";
+      builder = new StringBuilder();
+    }
+
+    public string GetStringRepresentation() {
+      return builder.ToString();
+    }
+
+    private void VisitFunction(string name, IFunction f) {
+      builder.Append(currentIndent);
+      builder.Append("(" + name + " ");
+    }
+
+    #region IFunctionVisitor Members
+
+    public void Visit(IFunction function) {
+      builder.Append(function.Name);
+    }
+
+    public void Visit(Addition addition) {
+      VisitFunction("+", addition);
+    }
+
+    public void Visit(Constant constant) {
+      builder.Append(currentIndent+currentBranch.GetLocalVariable(Constant.VALUE).Value);
+    }
+
+    public void Visit(Cosinus cosinus) {
+      VisitFunction("cos", cosinus);
+    }
+
+    public void Visit(Division division) {
+      VisitFunction("/", division);
+    }
+
+    public void Visit(Exponential exponential) {
+      VisitFunction("exp", exponential);
+    }
+
+    public void Visit(Logarithm logarithm) {
+      VisitFunction("log", logarithm);
+    }
+
+    public void Visit(Multiplication multiplication) {
+      VisitFunction("*", multiplication);
+    }
+
+    public void Visit(Power power) {
+      VisitFunction("expt", power);
+    }
+
+    public void Visit(Signum signum) {
+      VisitFunction("sign", signum);
+    }
+
+    public void Visit(Sinus sinus) {
+      VisitFunction("sin", sinus);
+    }
+
+    public void Visit(Sqrt sqrt) {
+      VisitFunction("sqrt", sqrt);
+    }
+
+    public void Visit(Subtraction subtraction) {
+      VisitFunction("-", subtraction);
+    }
+
+    public void Visit(Tangens tangens) {
+      VisitFunction("tan", tangens);
+    }
+
+    public void Visit(Variable variable) {
+      builder.Append(currentIndent + "(variable " + currentBranch.GetLocalVariable(Variable.WEIGHT).Value + " " +
+        currentBranch.GetLocalVariable(Variable.INDEX).Value + " " + currentBranch.GetLocalVariable(Variable.OFFSET).Value + ")");
+    }
+    public void Visit(Differential differential) {
+      builder.Append(currentIndent+"(differential " + currentBranch.GetLocalVariable(Differential.WEIGHT).Value + " "+
+        currentBranch.GetLocalVariable(Differential.INDEX).Value+ " " + currentBranch.GetLocalVariable(Differential.OFFSET).Value+")");
+    }
+
+    public void Visit(And and) {
+      VisitFunction("and", and);
+    }
+
+    public void Visit(Average average) {
+      VisitFunction("mean", average);
+    }
+
+    public void Visit(IfThenElse ifThenElse) {
+      VisitFunction("if", ifThenElse);
+    }
+
+    public void Visit(Not not) {
+      VisitFunction("not", not);
+    }
+
+    public void Visit(Or or) {
+      VisitFunction("or", or);
+    }
+
+    public void Visit(Xor xor) {
+      VisitFunction("xor", xor);
+    }
+
+    public void Visit(Equal equal) {
+      VisitFunction("equ", equal);
+    }
+
+    public void Visit(LessThan lessThan) {
+      VisitFunction("<", lessThan);
+    }
+
+    public void Visit(GreaterThan greaterThan) {
+      VisitFunction(">", greaterThan);
+    }
+    #endregion
+
+    public void Visit(IFunctionTree functionTree) {
+      currentBranch = functionTree;
+      functionTree.Function.Accept(this);
+      currentIndent += "  ";
+
+      foreach(IFunctionTree subTree in functionTree.SubTrees) {
+        builder.Append("\n");
+        Visit(subTree);
+      }
+      if(functionTree.SubTrees.Count > 0) builder.Append(")");
+      currentIndent = currentIndent.Remove(0, 2);
+    }
+  }
+}
