private static void NumberElements(SemanticTableaux semanticTableaux) { List <SemanticTableauxElement> queue = new List <SemanticTableauxElement>(); queue.Add(semanticTableaux.Head); int nodeCounter = 1; SemanticTableauxElement currentElement = null; while (queue.Count > 0) { currentElement = queue[0]; queue.RemoveAt(0); currentElement.NodeNumber = nodeCounter; if (currentElement.LeftChild != null) { queue.Add(currentElement.LeftChild); } if (currentElement.RightChild != null) { queue.Add(currentElement.RightChild); } nodeCounter++; } }
public static void CreateGraphOfTableaux(SemanticTableaux semanticTableaux, string fileName) { if (semanticTableaux == null) { throw new ArgumentNullException("Semantic tableaux cannot be null!"); } NumberElements(semanticTableaux); CreateGraph(fileName, semanticTableaux.Head.NodeLabel(), "rectangle"); }
protected override void ExecuteParsingActivities() { SemanticTableaux = new SemanticTableaux(Root); }