Index: /Code/ModelTranslator/.checkstyle
===================================================================
--- /Code/ModelTranslator/.checkstyle	(revision 48)
+++ /Code/ModelTranslator/.checkstyle	(revision 48)
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
+  <fileset name="all" enabled="true" check-config-name="SSE Checkstyle Configuration" local="false">
+    <file-match-pattern match-pattern="." include-pattern="true"/>
+  </fileset>
+</fileset-config>
Index: /Code/ModelTranslator/.project
===================================================================
--- /Code/ModelTranslator/.project	(revision 47)
+++ /Code/ModelTranslator/.project	(revision 48)
@@ -11,7 +11,13 @@
 			</arguments>
 		</buildCommand>
+		<buildCommand>
+			<name>net.sf.eclipsecs.core.CheckstyleBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
 	</buildSpec>
 	<natures>
 		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>net.sf.eclipsecs.core.CheckstyleNature</nature>
 	</natures>
 </projectDescription>
Index: /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/ModelReader.java
===================================================================
--- /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/ModelReader.java	(revision 47)
+++ /Code/ModelTranslator/src/de/uni_hildesheim/sse/trans/in/ModelReader.java	(revision 48)
@@ -11,8 +11,16 @@
 import org.apache.commons.io.FilenameUtils;
 
+import de.uni_hildesheim.sse.model.cst.ConstraintSyntaxTree;
+import de.uni_hildesheim.sse.model.cst.OCLFeatureCall;
+import de.uni_hildesheim.sse.model.cst.Variable;
 import de.uni_hildesheim.sse.model.validation.IvmlIdentifierCheck;
+import de.uni_hildesheim.sse.model.varModel.Constraint;
 import de.uni_hildesheim.sse.model.varModel.DecisionVariableDeclaration;
 import de.uni_hildesheim.sse.model.varModel.Project;
 import de.uni_hildesheim.sse.model.varModel.datatypes.BooleanType;
+import de.uni_hildesheim.sse.model.varModel.datatypes.OclKeyWords;
+import de.uni_hildesheim.sse.utils.logger.AdvancedJavaLogger;
+import de.uni_hildesheim.sse.utils.logger.EASyLoggerFactory;
+import de.uni_hildesheim.sse.utils.logger.EASyLoggerFactory.EASyLogger;
 
 /**
@@ -25,4 +33,11 @@
  */
 public class ModelReader {
+    private static final EASyLogger LOGGER = EASyLoggerFactory.INSTANCE.getLogger(ModelReader.class, "ModelReader");
+    
+    static {
+        EASyLoggerFactory.INSTANCE.setLogger(new AdvancedJavaLogger());
+        //EASyLoggerFactory.INSTANCE.setLoggingLevel(LoggingLevel.DEBUG);
+    }
+    
     private BufferedReader reader;
     private Project model;
@@ -67,4 +82,104 @@
     
     /**
+     * Reads a single line into a {@link ConstraintSyntaxTree}.
+     * 
+     * @param line the line to read
+     * @return a {@link ConstraintSyntaxTree} representing the line
+     * @throws TODO
+     */
+    public ConstraintSyntaxTree parseLine(String line, int ebene) throws Exception {
+        StringBuffer debugLine = new StringBuffer();
+        for (int i = 0; i < ebene; i++) {
+            debugLine.append('\t');
+        }
+        debugLine.append(line);
+       
+        if (line.startsWith("def(") && line.indexOf(')') == line.lastIndexOf(')')) {
+            String variableName = line.substring("def(".length(), line.length() - 1);
+            LOGGER.debug(debugLine.toString());
+            return new Variable(getVariable(variableName));
+        }
+        
+        if (line.startsWith("!def(") && line.indexOf(')') == line.lastIndexOf(')')) {
+            String variableName = line.substring("!def(".length(), line.length() - 1);
+            LOGGER.debug(debugLine.toString());
+            return new OCLFeatureCall(new Variable(getVariable(variableName)), OclKeyWords.NOT);
+        }
+        
+        int highestOperandPos = line.length();
+        int highestOperandLevel = Integer.MAX_VALUE;
+        String highestOperand = "";
+        int currentLevel = 0;
+        for (int i = 0; i < line.length(); i++) {
+            char c = line.charAt(i);
+            switch (c) {
+            case '(':
+                currentLevel++;
+                break;
+            case ')':
+                currentLevel--;
+                break;
+                
+            case '&':
+                if (highestOperandLevel > currentLevel) {
+                    highestOperand = OclKeyWords.AND;
+                    highestOperandPos = i;
+                    highestOperandLevel = currentLevel;
+                }
+                break;
+            
+            case '|':
+                if (highestOperandLevel > currentLevel) {
+                    highestOperand = OclKeyWords.OR;
+                    highestOperandPos = i;
+                    highestOperandLevel = currentLevel;
+                }
+                break;
+            
+            default:
+                break;
+            }
+        }
+        
+        debugLine.append(" -> " + highestOperand + " (" + highestOperandPos + ")");
+        LOGGER.debug(debugLine.toString());
+        
+        StringBuffer left = new StringBuffer(line.substring(0, highestOperandPos));
+        StringBuffer right = new StringBuffer(line.substring(highestOperandPos + 1, line.length()));
+        
+        currentLevel = 0;
+        for (int i = 0; i < left.length(); i++) {
+            char c = left.charAt(i);
+            if ((c == '(' || c == ')') && currentLevel < highestOperandLevel) {
+                left.replace(i, i + 1, "");
+            }
+            if (c == '(') {
+                currentLevel++;
+            }
+            if (c == ')') {
+                currentLevel--;
+            }
+        }
+        currentLevel = 0;
+        for (int i = right.length() - 1; i >= 0; i--) {
+            char c = right.charAt(i);
+            if ((c == '(' || c == ')') && currentLevel < highestOperandLevel) {
+                right.replace(i, i + 1, "");
+            }
+            if (c == ')') {
+                currentLevel++;
+            }
+            if (c == '(') {
+                currentLevel--;
+            }
+        }
+        
+        ConstraintSyntaxTree leftSide = parseLine(left.toString(), ebene + 1);
+        ConstraintSyntaxTree rightSide = parseLine(right.toString(), ebene + 1);
+        
+        return new OCLFeatureCall(leftSide, highestOperand, rightSide);
+    }
+    
+    /**
      * Parses the given file and converts it to a {@link Project}.
      * @return The parsed file as a {@link Project}.
@@ -76,5 +191,12 @@
             // Skip lines starting with a #
             if (line.charAt(0) != '#') {
-                System.out.println(line);
+                try {
+                    ConstraintSyntaxTree cst = parseLine(line, 0);
+                    Constraint constraint = new Constraint(model);
+                    constraint.setConsSyntax(cst);
+                    model.add(constraint);
+                } catch (Exception e) {
+                    
+                }
             }
         }
Index: /Code/ModelTranslator/src/out/DimacsWriter.java
===================================================================
--- /Code/ModelTranslator/src/out/DimacsWriter.java	(revision 48)
+++ /Code/ModelTranslator/src/out/DimacsWriter.java	(revision 48)
@@ -0,0 +1,109 @@
+package out;
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import de.uni_hildesheim.sse.model.confModel.AssignmentState;
+import de.uni_hildesheim.sse.model.confModel.Configuration;
+import de.uni_hildesheim.sse.model.confModel.ConfigurationException;
+import de.uni_hildesheim.sse.model.confModel.IDecisionVariable;
+import de.uni_hildesheim.sse.model.cstEvaluation.EvaluationVisitor;
+import de.uni_hildesheim.sse.model.varModel.AbstractVariable;
+import de.uni_hildesheim.sse.model.varModel.Constraint;
+import de.uni_hildesheim.sse.model.varModel.Project;
+import de.uni_hildesheim.sse.model.varModel.filter.ConstraintFinder;
+import de.uni_hildesheim.sse.model.varModel.filter.DeclarationFinder;
+import de.uni_hildesheim.sse.model.varModel.filter.DeclarationFinder.VisibilityType;
+import de.uni_hildesheim.sse.model.varModel.filter.DeclrationInConstraintFinder;
+import de.uni_hildesheim.sse.model.varModel.filter.FilterType;
+import de.uni_hildesheim.sse.model.varModel.values.BooleanValue;
+
+public class DimacsWriter {
+
+    private Project project;
+    private Map<String, Integer> variables;
+    
+    public DimacsWriter(Project project) {
+        this.project = project;
+        variables = new HashMap<String, Integer>();
+    }
+    
+    public void write(PrintStream out) throws IOException {
+        DeclarationFinder declarationFinder = new DeclarationFinder(project, FilterType.ALL, null);
+        List<AbstractVariable> variableDeclarations = declarationFinder.getVariableDeclarations(VisibilityType.ALL);
+        Collections.sort(variableDeclarations, new Comparator<AbstractVariable>() {
+            public int compare(AbstractVariable o1, AbstractVariable o2) {
+                return o1.getName().compareTo(o2.getName());
+            }
+        });
+        
+        Integer i = 1;
+        for (AbstractVariable variable : variableDeclarations) {
+            variables.put(variable.getName(), i++);
+            out.print("c ");
+            out.print(i.toString());
+            out.print(" ");
+            out.print(variable.getName());
+            out.println();
+        }
+        
+        // TODO print(p CNF numVars numConstrains);
+        
+        ConstraintFinder constraintFinder = new ConstraintFinder(project);
+        
+        Configuration config = new Configuration(project);
+        EvaluationVisitor evalVisitor = new EvaluationVisitor();
+        
+        int anz = 0;
+        for (Constraint constraint : constraintFinder.getConstraints()) {
+            anz++;
+            if (anz > 100) {
+                break;
+            }
+            
+            DeclrationInConstraintFinder varFinder = new DeclrationInConstraintFinder(constraint.getConsSyntax());
+            
+            Object[] vars = varFinder.getDeclarations().toArray();
+            
+            int bitmask = 0;
+            for (int k = 0; k < Math.pow(2, vars.length); k++) {
+                bitmask++;
+                boolean[] values = new boolean[vars.length];
+                for (int j = 0; j < vars.length; j++) {
+                    IDecisionVariable decisionVar = config.getDecision((AbstractVariable) vars[j]);
+                    try {
+                        boolean bool = (bitmask & 1 << j) != 0;
+                        values[j] = bool;
+                        decisionVar.setValue(bool ? BooleanValue.TRUE : BooleanValue.FALSE, AssignmentState.ASSIGNED);
+                    } catch (ConfigurationException e) {
+                        e.printStackTrace();
+                    }
+                }
+                
+                boolean result = Math.random() >= 0.5; // TODO
+                
+                if (result) {
+                    for (int j = 0; j < vars.length; j++) {
+                        if (!values[j]) {
+                            out.print("-");
+                        }
+                        out.print(variables.get(((AbstractVariable) vars[j]).getName()));
+                        out.print(" ");
+                    }
+                    out.println("0");
+                }
+            }
+            
+            
+            //out.print(constraint.toString());
+            //out.println();
+        }
+        out.flush();
+    }
+    
+}
Index: /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/in/ModelReaderTest.java
===================================================================
--- /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/in/ModelReaderTest.java	(revision 47)
+++ /Code/ModelTranslator/test/de/uni_hildesheim/sse/trans/in/ModelReaderTest.java	(revision 48)
@@ -1,13 +1,17 @@
 package de.uni_hildesheim.sse.trans.in;
 
+import java.io.BufferedWriter;
 import java.io.File;
 import java.io.IOException;
+import java.io.PrintStream;
+import java.io.PrintWriter;
 import java.io.StringWriter;
 
+import org.apache.commons.io.output.WriterOutputStream;
 import org.junit.Before;
 import org.junit.Test;
 
+import out.DimacsWriter;
 import de.uni_hildesheim.sse.model.varModel.Project;
-import de.uni_hildesheim.sse.persistency.IVMLWriter;
 import de.uni_hildesheim.sse.trans.AllTests;
 
@@ -20,5 +24,5 @@
     
     private StringWriter sWriter;
-    private IVMLWriter iWriter;
+    //private IVMLWriter iWriter;
     
     /**
@@ -28,5 +32,5 @@
     public void setUp() {
         sWriter = new StringWriter();
-        iWriter = new IVMLWriter(sWriter);
+        //iWriter = new IVMLWriter(sWriter);
     }
 
@@ -37,6 +41,26 @@
         Project project = reader.read();
         
-        project.accept(iWriter);
+        PrintStream writer = new PrintStream(new WriterOutputStream(sWriter));
+        new DimacsWriter(project).write(writer);
+        
         System.out.println(sWriter);
+        
+        //project.accept(iWriter);
+        //System.out.println(sWriter);
+    }
+    
+    @Test
+    public void testParseLine() throws IOException {
+        File modelFile = new File(AllTests.INPUT_FOLDER, "model.model");
+        ModelReader reader = new ModelReader(modelFile);
+        
+        try {
+            //reader.parseLine("(!def(3C515_MODULE)|def(MODULES))");
+            reader.parseLine("((def(TR)&def(PCI)&def(NETDEVICES))|(def(NETDEVICES)&((def(TR)&def(PCI))|"
+                + "(def(PCI)&(def(TR)|def(TR_MODULE)))))|def(MODULES)|!def(3C359))", 0);
+        } catch (Exception e) {
+            e.printStackTrace();
+            fail(e.toString());
+        }
     }
 
