Index: trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicExpressionTreeSmalltalkStringFormatter.cs
===================================================================
--- trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicExpressionTreeSmalltalkStringFormatter.cs	(revision 9649)
+++ trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Formatters/SymbolicExpressionTreeSmalltalkStringFormatter.cs	(revision 9794)
@@ -1,5 +1,5 @@
 ﻿#region License Information
 /* HeuristicLab
- * Copyright (C) 2002-2010 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
+ * Copyright (C) 2002-2013 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
  *
  * This file is part of HeuristicLab.
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Globalization;
 using System.Text;
 using HeuristicLab.Core;
@@ -41,4 +42,6 @@
     }
 
+    // returns the smalltalk expression corresponding to the node 
+    // smalltalk expressions are always surrounded by parantheses "(<expr>)"
     private string FormatRecursively(ISymbolicExpressionTreeNode node) {
 
@@ -48,5 +51,5 @@
         return FormatRecursively(node.GetSubtree(0));
 
-      StringBuilder stringBuilder = new StringBuilder();
+      StringBuilder stringBuilder = new StringBuilder(20);
 
       stringBuilder.Append("(");
@@ -61,7 +64,7 @@
         for (int i = 0; i < node.SubtreeCount; i++) {
           if (i > 0) stringBuilder.Append("&");
-          stringBuilder.Append("((");
+          stringBuilder.Append("(");
           stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
-          stringBuilder.Append(")>=0)");
+          stringBuilder.Append(" > 0)");
         }
         stringBuilder.Append(") ifTrue:[1] ifFalse:[-1]");
@@ -72,12 +75,10 @@
         for (int i = 0; i < node.SubtreeCount; i++) {
           if (i > 0) stringBuilder.Append("+");
-          stringBuilder.Append("(");
           stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
-          stringBuilder.Append(")");
         }
         stringBuilder.Append(")");
       } else if (symbol is Constant) {
         ConstantTreeNode constantTreeNode = node as ConstantTreeNode;
-        stringBuilder.Append(constantTreeNode.Value.ToString().Replace(",", "."));
+        stringBuilder.Append(constantTreeNode.Value.ToString(CultureInfo.InvariantCulture));
       } else if (symbol is Cosine) {
         stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
@@ -114,5 +115,5 @@
         stringBuilder.Append("]");
       } else if (symbol is LaggedVariable) {
-        stringBuilder.Append("not implemented");
+        stringBuilder.Append("lagged variable not implemented");
       } else if (symbol is LessThan) {
         stringBuilder.Append("(");
@@ -130,13 +131,14 @@
         }
       } else if (symbol is Not) {
-        stringBuilder.Append("-1*");
+        stringBuilder.Append("(");
         stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
+        stringBuilder.Append(">0) ifTrue: [-1] ifFalse: [1.0]");
       } else if (symbol is Or) {
         stringBuilder.Append("(");
         for (int i = 0; i < node.SubtreeCount; i++) {
           if (i > 0) stringBuilder.Append("|");
-          stringBuilder.Append("((");
+          stringBuilder.Append("(");
           stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
-          stringBuilder.Append(")>=0)");
+          stringBuilder.Append(">0)");
         }
         stringBuilder.Append(") ifTrue:[1] ifFalse:[-1]");
@@ -151,5 +153,5 @@
           stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
           for (int i = 1; i < node.SubtreeCount; i++) {
-            stringBuilder.Append("-");
+            stringBuilder.Append(" - ");
             stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
           }
@@ -157,12 +159,17 @@
       } else if (symbol is Tangent) {
         stringBuilder.Append(FormatRecursively(node.GetSubtree(0)));
-        stringBuilder.Append("tan");
+        stringBuilder.Append(" tan");
       } else if (symbol is Variable) {
         VariableTreeNode variableTreeNode = node as VariableTreeNode;
-        stringBuilder.Append(variableTreeNode.Weight.ToString().Replace(",", "."));
+        stringBuilder.Append(variableTreeNode.Weight.ToString(CultureInfo.InvariantCulture));
         stringBuilder.Append("*");
         stringBuilder.Append(variableTreeNode.VariableName);
       } else {
-        stringBuilder.Append("ERROR");
+        stringBuilder.Append("(");
+        for (int i = 0; i < node.SubtreeCount; i++) {
+          if (i > 0) stringBuilder.Append(", ");
+          stringBuilder.Append(FormatRecursively(node.GetSubtree(i)));
+        }
+        stringBuilder.AppendFormat(" {0} [Not Supported] )", node.Symbol.Name);
       }
 
