Index: /Code/ModelTranslator/.classpath
===================================================================
--- /Code/ModelTranslator/.classpath	(revision 369)
+++ /Code/ModelTranslator/.classpath	(revision 370)
@@ -7,6 +7,6 @@
 	<classpathentry combineaccessrules="false" kind="src" path="/Utils"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
-	<classpathentry kind="lib" path="lib/commons-io-2.4.jar"/>
-	<classpathentry kind="lib" path="lib/commons-cli-1.2.jar" sourcepath="lib/commons-cli-1.2-sources.jar"/>
+	<classpathentry kind="lib" path="resources/lib/commons-cli-1.2.jar"/>
+	<classpathentry kind="lib" path="resources/lib/commons-io-2.4.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
Index: /Code/ModelTranslator/build-jk.xml
===================================================================
--- /Code/ModelTranslator/build-jk.xml	(revision 369)
+++ /Code/ModelTranslator/build-jk.xml	(revision 370)
@@ -3,12 +3,14 @@
 	<!-- import von globalen Properties Einstellungen -->
 	<property file="${user.home}/global-build.properties"/>
+	<property name="res" value="resources"/>
 	
 	<!-- Jacoco Support -->
 	<taskdef uri="antlib:org.jacoco.ant" resource="org/jacoco/ant/antlib.xml">
-        <classpath path="jacocoLibs/jacocoant.jar"/>
+        <classpath path="${res}/jacocoLibs/jacocoant.jar"/>
     </taskdef>
 	
 	<!-- Einstellungen fuer dieses Projekt -->
 	<property name="src.dir" value="src"/>
+	<property name="lib" value="${res}/lib"/>
 	<property name="test.dir" value="test"/>
 	<property name="build.test.classes.dir" value="${build.base.dir}/test_classes"/>
@@ -21,5 +23,5 @@
 		<pathelement path="${libs.model}"/>
 		<!-- Lib -->
-        <fileset dir="lib">
+        <fileset dir="${lib}">
             <include name="**/*.jar" />
         </fileset>
@@ -111,10 +113,10 @@
 		<!-- Copy Start Scripts -->
 		<copy todir="${build.jar.dir}" failonerror="true" overwrite="true">
-            <fileset dir="scripts"/>
+            <fileset dir="${res}/scripts"/>
         </copy>
 		<!-- Copy libraries -->
         <mkdir dir="${build.jar.dir}/lib" />
 		<copy todir="${build.jar.dir}/lib" failonerror="true" overwrite="true">
-            <fileset dir="lib">
+            <fileset dir="${res}/lib">
                 <include name="commons-io-2.4.jar" />
                 <include name="commons-cli-1.2.jar" />
Index: /Code/ModelTranslator/resources/scripts/dimacsExample.bat
===================================================================
--- /Code/ModelTranslator/resources/scripts/dimacsExample.bat	(revision 370)
+++ /Code/ModelTranslator/resources/scripts/dimacsExample.bat	(revision 370)
@@ -0,0 +1,2 @@
+@echo off
+java -Xms1175m -Xmx1175m -jar ModelTranslator.jar -in input/model.model output/Linux_x86_2.6.33.3.dimacs -v 2.6.33.3 -comment "X86 translation of Linux 2.6.33.3 using KConfigReader"
Index: /Code/ModelTranslator/resources/scripts/dimacsExample.sh
===================================================================
--- /Code/ModelTranslator/resources/scripts/dimacsExample.sh	(revision 370)
+++ /Code/ModelTranslator/resources/scripts/dimacsExample.sh	(revision 370)
@@ -0,0 +1,8 @@
+#!/bin/sh
+#Qsub parameters
+#$ -cwd
+#$ -l mem=10000m
+#$ -q all.q,fast.q,acogpr.q
+#
+#
+java -Xms8000m -Xmx8000m -XX:ParallelGCThreads=1 -XX:ConcGCThreads=1 -jar ModelTranslator.jar -in input/model.model output/Linux_x86_2.6.33.3.dimcas -v 2.6.33.3 -comment "X86 translation of Linux 2.6.33.3 using KConfigReader"
Index: /Code/ModelTranslator/resources/scripts/ivmlExample.bat
===================================================================
--- /Code/ModelTranslator/resources/scripts/ivmlExample.bat	(revision 370)
+++ /Code/ModelTranslator/resources/scripts/ivmlExample.bat	(revision 370)
@@ -0,0 +1,2 @@
+@echo off
+java -Xms1175m -Xmx1175m -jar ModelTranslator.jar -in input/model.model output/Linux_x86_2.6.33.3.ivml -v 2.6.33.3 -comment "X86 translation of Linux 2.6.33.3 using KConfigReader"
Index: /Code/ModelTranslator/resources/scripts/ivmlExample.sh
===================================================================
--- /Code/ModelTranslator/resources/scripts/ivmlExample.sh	(revision 370)
+++ /Code/ModelTranslator/resources/scripts/ivmlExample.sh	(revision 370)
@@ -0,0 +1,10 @@
+#!/bin/sh
+#Qsub parameters
+#$ -cwd
+#$ -l mem=10000m
+#$ -q all.q,fast.q,acogpr.q
+#$ -N ModelTranslation
+#$ -m abe
+#
+#
+java -Xms8000m -Xmx8000m -XX:ParallelGCThreads=1 -XX:ConcGCThreads=1 -jar ModelTranslator.jar -in input/Linux.tsv -out output/Linux_x86_2.6.33.3.ivml -v 2.6.33.3 -comment "X86 translation of Linux 2.6.33.3 using KConfigReader"
Index: /Code/ModelTranslator/resources/testdata/input/testModel.model
===================================================================
--- /Code/ModelTranslator/resources/testdata/input/testModel.model	(revision 370)
+++ /Code/ModelTranslator/resources/testdata/input/testModel.model	(revision 370)
@@ -0,0 +1,9 @@
+# A small test-model
+# Has 7 constraints and 6 variables
+(!def(AB3100_CORE_MODULE)|def(MODULES))
+(!def(AB3100_CORE)|!def(AB3100_CORE_MODULE))
+((def(HAS_IOMEM)&def(I2C))|(def(HAS_IOMEM)&(def(I2C)|def(I2C_MODULE)))|def(MODULES)|!def(AB3100_CORE))
+((def(HAS_IOMEM)&def(I2C))|(def(HAS_IOMEM)&(def(I2C)|def(I2C_MODULE)))|!def(MODULES)|!def(AB3100_CORE_MODULE))
+((def(HAS_IOMEM)&def(I2C))|(def(HAS_IOMEM)&(def(I2C)|def(I2C_MODULE)))|!def(MODULES)|!def(AB3100_CORE))
+((def(HAS_IOMEM)&def(I2C))|(def(HAS_IOMEM)&(def(I2C)|def(I2C_MODULE)))|!def(AB3100_CORE_MODULE))
+(!def(AB3100_CORE)|(def(HAS_IOMEM)&def(I2C)))
Index: /Code/ModelTranslator/resources/testdata/input/testModel.rsf
===================================================================
--- /Code/ModelTranslator/resources/testdata/input/testModel.rsf	(revision 370)
+++ /Code/ModelTranslator/resources/testdata/input/testModel.rsf	(revision 370)
@@ -0,0 +1,16 @@
+# A small test-model
+# Has 8 variables (2 of them are tristates, 1 string, 1 constant in constraints) and 7 constraints (1 string comparison)
+Item	a	boolean
+Item	b	boolean
+Item	c	boolean
+Item	d	boolean
+Depends	a	"c && b"
+Depends	b	"!a || c"
+ItemSelects	a	d	"c && b"
+ItemSelects	b	c	"(!d && b) || a"
+Item	e	tristate
+Item	f	tristate
+Depends	e	"f!='m' || 'UML'"
+Depends	f	"e!='m'"
+Item	g	string
+Depends	c	"g='x86'"
Index: /Code/ModelTranslator/resources/testdata/input/testModel_ItemSelects.rsf
===================================================================
--- /Code/ModelTranslator/resources/testdata/input/testModel_ItemSelects.rsf	(revision 370)
+++ /Code/ModelTranslator/resources/testdata/input/testModel_ItemSelects.rsf	(revision 370)
@@ -0,0 +1,14 @@
+# A small test-model
+Item	MISC_DEVICES	boolean	
+Item	BLUBB	boolean	
+Item	IWMC3200TOP	tristate	
+Depends	IWMC3200TOP	MISC_DEVICES
+Prompt	IWMC3200TOP	MISC_DEVICES
+HasPrompts	IWMC3200TOP	1	
+ItemSelects	IWMC3200TOP	FW_LOADER	BLUBB
+Item	FW_LOADER	tristate	
+Depends	FW_LOADER	HOTPLUG	
+Prompt	FW_LOADER	HOTPLUG
+HasPrompts	FW_LOADER	1	
+Default	FW_LOADER	'y'	HOTPLUG
+Item	HOTPLUG	boolean
Index: /Code/ModelTranslator/resources/testdata/input/testModel_emptyString.rsf
===================================================================
--- /Code/ModelTranslator/resources/testdata/input/testModel_emptyString.rsf	(revision 370)
+++ /Code/ModelTranslator/resources/testdata/input/testModel_emptyString.rsf	(revision 370)
@@ -0,0 +1,6 @@
+# A small test-model for testing Strings
+Item	FW_LOADER	tristate
+Item	EXTRA_FIRMWARE	string
+Depends	EXTRA_FIRMWARE	FW_LOADER
+Item	EXTRA_FIRMWARE_DIR	string
+Depends	EXTRA_FIRMWARE_DIR	EXTRA_FIRMWARE!=''
Index: /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/out/DimacsWriter.java
===================================================================
--- /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/out/DimacsWriter.java	(revision 369)
+++ /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/out/DimacsWriter.java	(revision 370)
@@ -32,4 +32,23 @@
  */
 public class DimacsWriter implements IModelWriter {
+    public static final String HELP =
+        // Tristates
+        "\r\nc Explanation of Tristate variables:\r\n"
+        + "c VAR VAR_Module Meaning\r\n"
+        + "c  0       0     VAR is disabled (selection is 'n')\r\n"
+        + "c  1       0     VAR is permanetely selected (selection is 'y')\r\n"
+        + "c  0       1     Illegal state\r\n"
+        + "c  1       1     VAR is selected as module (selection is 'm')\r\n"
+        + "c As a consequence, if KConfig specifies that a tristate variable shall be selected \r\n"
+        + "c (permanetely or as a module), only the VAR variable has to be checked.\r\n\r\n"
+        // String, Integer, Hex
+        + "c Explanation of String, Integer, and Hex variables:\r\n"
+        + "c Variable   Meaning\r\n"
+        + "c STR        Variable STR will (0 = not) exist / be selectable\r\n"
+        + "c STR_Empty  Variable STR must (0 = not) be empty\r\n"
+        + "c STR=Value  Variable STR must (0 = not) have the value \"Value\"\r\n\r\n"
+        // End of help: Start of translation
+        + "c Start of translation:\r\n";
+    
     private static final EASyLogger LOGGER = EASyLoggerFactory.INSTANCE.getLogger(DimacsWriter.class, Main.ID);
     
@@ -133,5 +152,5 @@
             }
             // Readme ;-)
-            writeHelp();
+            writer.append(HELP);
             write();
         } catch (IOException e) {
@@ -139,47 +158,3 @@
         }
     }
-
-    /**
-     * Writes a small help into the DIMACS file to explain how the model shall be interpreted.
-     * @throws IOException When writing to the {@link Writer} fails
-     */
-    private void writeHelp() throws IOException {
-        // Tristates
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append("c Explanation of Tristate variables:");
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append("c VAR VAR_Module Meaning");
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append("c  0       0     VAR is disabled (selection is 'n')");
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append("c  1       0     VAR is permanetely selected (selection is 'y')");
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append("c  0       1     Illegal state");
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append("c  1       1     VAR is selected as module (selection is 'm')");
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append("c As a consequence, if KConfig specifies that a tristate variable shall be selected ");
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append("c (permanetely or as a module), only the VAR variable has to be checked.");
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append(IvmlKeyWords.LINEFEED);
-        
-        // String
-        writer.append("c Explanation of String, Integer, and Hex variables:");
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append("c Variable   Meaning");
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append("c STR        Variable STR will (0 = not) exist / be selectable");
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append("c STR_Empty  Variable STR must (0 = not) be empty");
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append("c STR=Value  Variable STR must (0 = not) have the value \"Value\"");
-        writer.append(IvmlKeyWords.LINEFEED);
-        writer.append(IvmlKeyWords.LINEFEED);
-        
-        // End of help -> Start of translation
-        writer.append("c Start of translation:");
-        writer.append(IvmlKeyWords.LINEFEED);
-    }
-
 }
Index: /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/AllTests.java
===================================================================
--- /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/AllTests.java	(revision 369)
+++ /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/AllTests.java	(revision 370)
@@ -39,5 +39,5 @@
 public class AllTests {
     
-    public static final File TESTDATA = new File("testdata");
+    public static final File TESTDATA = new File("resources/testdata");
     
     public static final File INPUT_FOLDER = new File(TESTDATA, "input");
Index: /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/out/DimacsWriterTest.java
===================================================================
--- /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/out/DimacsWriterTest.java	(revision 369)
+++ /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/out/DimacsWriterTest.java	(revision 370)
@@ -22,19 +22,4 @@
  */
 public class DimacsWriterTest {
-    private static final String HELP = "\r\nc Explanation of Tristate variables:\r\n"
-        + "c VAR VAR_Module Meaning\r\n"
-        + "c  0       0     VAR is disabled (selection is 'n')\r\n"
-        + "c  1       0     VAR is permanetely selected (selection is 'y')\r\n"
-        + "c  0       1     Illegal state\r\n"
-        + "c  1       1     VAR is selected as module (selection is 'm')\r\n"
-        + "c As a consequence, if KConfig specifies that a tristate variable shall be selected \r\n"
-        + "c (permanetely or as a module), only the VAR variable has to be checked.\r\n\r\n"
-        + "c Explanation of String, Integer, and Hex variables:\r\n"
-        + "c Variable   Meaning\r\n"
-        + "c STR        Variable STR will (0 = not) exist / be selectable\r\n"
-        + "c STR_Empty  Variable STR must (0 = not) be empty\r\n"
-        + "c STR=Value  Variable STR must (0 = not) have the value \"Value\"\r\n\r\n"
-        + "c Start of translation:\r\n";
-
     /**
      * Tests the write method.
@@ -82,5 +67,5 @@
         Assert.assertEquals("c A test-file" + IvmlKeyWords.LINEFEED
             + "c Version 1.0" + IvmlKeyWords.LINEFEED
-            + HELP
+            + DimacsWriter.HELP
             + "c 1 a" + IvmlKeyWords.LINEFEED
             + "c 2 b" + IvmlKeyWords.LINEFEED
Index: /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/scenario/RsfToDimacsTranslationTest.java
===================================================================
--- /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/scenario/RsfToDimacsTranslationTest.java	(revision 369)
+++ /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/scenario/RsfToDimacsTranslationTest.java	(revision 370)
@@ -3,4 +3,6 @@
 import java.io.File;
 import java.io.StringWriter;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 
 import org.junit.Assert;
@@ -12,4 +14,5 @@
 import de.uni_hildesheim.sse.trans.convert.OptimizationParameter;
 import de.uni_hildesheim.sse.trans.in.InputType;
+import de.uni_hildesheim.sse.trans.out.DimacsWriter;
 import de.uni_hildesheim.sse.trans.out.OutputType;
 
@@ -22,4 +25,94 @@
     
     /**
+     * Loads the given input file and transforms it into a DIMACS model using the given <tt>optimizations</tt>.
+     * @param input The input file to load (must exist).
+     * @param optimizations Specification which optimizations shall be applied to the transformed model. Will only be
+     *     applied to transformations into CNF.
+     * @param removePreamble <tt>true</tt> the preamble (comment, version, and a help information) will be removed
+     *     from the beginning of this string). 
+     * @return The translated DIMACS model.
+     */
+    private static String loadModel(File input, OptimizationParameter optimizations, boolean removePreamble) {
+        String comment = "A comment";
+        String version = "0.1";
+        StringWriter sWriter = new StringWriter();
+        
+        // Test precondition
+        Assert.assertTrue(input.exists());
+        
+        // Translation
+        ModelTranslator.translate(input, sWriter, InputType.RSF, OutputType.DIMCAS, comment, version, optimizations);
+        String result = sWriter.toString();
+        
+        // Test correct translation of comment, version, and help
+        Assert.assertNotNull(result);
+        Assert.assertTrue("Error in preamble.",
+            result.startsWith(
+                "c " + comment + IvmlKeyWords.LINEFEED
+                + "c Version " + version + IvmlKeyWords.LINEFEED
+                + DimacsWriter.HELP));
+        
+        if (removePreamble) {
+            result = removePreamble(result);
+        }
+        
+        return result;
+    }
+    
+    /**
+     * Removes the preamble of a already translated dimacs model.
+     * @param dimacsModel The model where the preamble shall be deleted
+     * @return Only the relevant information of the translated dimacs model.
+     */
+    private static String removePreamble(String dimacsModel) {
+        int beginning = dimacsModel.indexOf(DimacsWriter.HELP);
+        return dimacsModel.substring(beginning + DimacsWriter.HELP.length());
+    }
+    
+    /**
+     * Returns the DIMACs number of the given variable which is used inside the constraints.
+     * @param dimacsModel The complete dimacs model
+     * @param variable The variable for which the number shall be retrieved.
+     * @return The number of the variable used inside the constraints.
+     */
+    private static int getNumberOfVariable(String dimacsModel, String variable) {
+        Pattern dimacsVarDefintion = Pattern.compile("(?m)^c (\\d+) " + variable + "$");
+        Matcher m = dimacsVarDefintion.matcher(dimacsModel);
+        String result = null;
+        if (m.find()) {
+            result = m.group(1);
+        }
+        
+        Assert.assertNotNull("Error: Variable not found.", result);
+        
+        
+        return Integer.valueOf(result);
+    }
+    
+    /**
+     * Checks whether a given constraint is included in <tt>dimacsModel</tt>.
+     * @param dimacsModel The complete dimacs model
+     * @param literals positive and negative variable numbers (must not be 0).
+     * @return <tt>true</tt> if the constraint is included in <tt>dimacsModel</tt>.
+     */
+    private static boolean containsConstraint(String dimacsModel, int... literals) {
+        StringBuffer constraintDef = new StringBuffer("(?m)^(");
+        constraintDef.append(literals[0]);
+        constraintDef.append(" ");
+        for (int i = 1; i < literals.length; i++) {
+            constraintDef.append("|");
+            constraintDef.append(literals[i]);
+            constraintDef.append(" ");
+        }
+        constraintDef.append("){");
+        constraintDef.append(literals.length);
+        constraintDef.append("}0$");
+        
+        Pattern constraintDefinition = Pattern.compile(constraintDef.toString());
+        Matcher m = constraintDefinition.matcher(dimacsModel);
+        return m.find();
+    }
+    
+    /**
      * Tests whether Strings are translated correctly.
      */
@@ -27,23 +120,42 @@
     public void testEmptyStrings() {
         File input = new File(AllTests.INPUT_FOLDER, "testModel_emptyString.rsf");
-        StringWriter sWriter = new StringWriter();
         OptimizationParameter noOptimization = new OptimizationParameter();
-        String comment = "A comment";
-        String version = "0.1";
-        
+
         // Test precondition
-        Assert.assertTrue(input.exists());
         Assert.assertFalse(noOptimization.hasAtLeastOneOption());
         
         // Translation
-        ModelTranslator.translate(input, sWriter, InputType.RSF, OutputType.DIMCAS, comment, version, noOptimization);
-        String result = sWriter.toString();
-        System.out.println(result);
+        String result = loadModel(input, noOptimization, true);
+        //System.out.println(result);
         
         // Test correct translation
-        //1. comment and version
-        Assert.assertNotNull(result);
-        Assert.assertTrue(result.startsWith(
-            "c " + comment + IvmlKeyWords.LINEFEED + "c Version " + version + IvmlKeyWords.LINEFEED));
+        // TODO SE: test correct translation of strings
+    }
+    
+    /**
+     * Tests whether ItemSelect statements are translated correctly into CNF constraints.
+     */
+    @Test
+    public void testItemSelectStatements() {
+        File input = new File(AllTests.INPUT_FOLDER, "testModel_ItemSelects.rsf");
+        OptimizationParameter noOptimization = new OptimizationParameter();
+        
+        // Test precondition
+        Assert.assertFalse(noOptimization.hasAtLeastOneOption());
+        
+        // Translation
+        String result = loadModel(input, noOptimization, true);
+        System.out.println(result);
+        int iwc3200top = getNumberOfVariable(result, "IWMC3200TOP") * -1;
+        int fwLoader = getNumberOfVariable(result, "FW_LOADER");
+        int blubb = getNumberOfVariable(result, "BLUBB") * -1;
+        
+        /* Test whether following constraint is included:
+         * Not(IWMC3200TOP AND BLUBB) or FW_LOADER
+         * -->
+         * Not(IWMC3200TOP) OR NOT(BLUBB) or FW_LOADER
+         */
+        Assert.assertTrue("Error: Expected Constraint not included.",
+            containsConstraint(result, iwc3200top, blubb, fwLoader));
     }
 
