private void BtnTableaux_Click(object sender, EventArgs e) { SemanticTableux.nextNodes.Clear(); StreamWriter sw = new StreamWriter("tableux.dot"); //Writing label and formatting sw.WriteLine("graph logic {"); sw.WriteLine(" node [ fontname = \"Arial\" shape=box ]"); // SemanticTableux st = new SemanticTableux(processObject.getProposition(), 1, null); foreach (SemanticTableux s in SemanticTableux.nextNodes) { sw.Write(s.getGraphvizString()); } //Warping up the file sw.WriteLine(""); sw.WriteLine("}"); sw.Close(); // Process dot = new Process(); dot.StartInfo.FileName = @"C:\Program Files (x86)\Graphviz2.38\bin\dot.exe"; dot.StartInfo.Arguments = "-Tpng -o tableux.png tableux.dot"; dot.Start(); dot.WaitForExit(); Process.Start("tableux.png"); }
public void calculateLogic() { foreach (char[] charArray in ValuesEachLine) { string rawString = logicProposition.getRawString(); for (int i = 0; i < label.Length; i++) { rawString = rawString.Replace(label[i], charArray[i]); } ProcessLogicClass processTable = new ProcessLogicClass(rawString); bool result = processTable.getProposition().CalculateFinalTruthValue(); results.Add(Convert.ToInt32(result)); } }
public void GraphvizGenerator() { StreamWriter sw = new StreamWriter("log.dot"); //Writing label and formatting sw.WriteLine("graph logic {"); sw.WriteLine(" node [ fontname = \"Arial\" shape=box ]"); //Main function to write to the file GraphNode write = new GraphNode(1, null, logicProposition.getProposition(), sw); //Warping up the file sw.WriteLine(""); sw.WriteLine("}"); sw.Close(); }