private void WriteFileGRAPHVIZ(TableuxNode baseNode) { try { var temp = GenerateGraphVIZTEXT(baseNode); File.WriteAllText("abc.dot", GenerateGraphVIZTEXT(baseNode)); } catch (Exception e) { MessageBox.Show(e.Message); } }
public void GetGraphImage(PictureBox pictureBox, TableuxNode baseNode) { WriteFileGRAPHVIZ(baseNode); System.Diagnostics.Process dot = new System.Diagnostics.Process(); dot.StartInfo.FileName = "dot.exe"; dot.StartInfo.Arguments = "-Tpng -oabc.png abc.dot"; dot.Start(); dot.WaitForExit(); pictureBox.ImageLocation = "abc.png"; }
private void PrintNodeConnections(TableuxNode root) { if (root == null) { return; } nodeConnections += root.PrintConnections(); PrintNodeConnections(root.Left); PrintNodeConnections(root.Right); }
public void TautologyCheckInListOfTableuxNode() { PropositionNode propNode = new PropositionNode('R'.ToString()); NotNode notNode = new NotNode(); notNode.left = Functions.DeepCopyTree(propNode); PropositionNode p2 = new PropositionNode('Q'.ToString()); List <Node> list = new List <Node> { propNode, notNode, p2 }; Assert.True(TableuxNode.IsTautology(list)); }
private void PreOrderTraverse(TableuxNode node) { if (node == null) { return; } counterForInorderTraversal++; /* first print data of node */ transitional_output += "node" + node.id + " [ label = \"" + node + "\" ]\n"; /* then recur on left subtree */ PreOrderTraverse(node.Left); /* now recur on right subtree */ PreOrderTraverse(node.Right); }
private string GenerateGraphVIZTEXT(TableuxNode baseNode) { // ------------------------------------------------------------------- // resetting all variables output = "graph logics {\nnode [ fontname = \"Arial\" ]\n"; transitional_output = string.Empty; nodeConnections = string.Empty; counterForInorderTraversal = 0; PreOrderTraverse(baseNode); // ------------------------------------------------------------------- PrintNodeConnections(baseNode); output += transitional_output; output += nodeConnections; output += "}"; return(output); }
public void GenerateGraphImage(PictureBox pictureBox, TableuxNode node) { Graphiz graphiz = new Graphiz(); graphiz.GetGraphImage(pictureBox, node); }