示例#1
0
文件: Grapher.cs 项目: sjokkateer/LPP
        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++;
            }
        }
示例#2
0
文件: Grapher.cs 项目: sjokkateer/LPP
        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");
        }
示例#3
0
 protected override void ExecuteParsingActivities()
 {
     SemanticTableaux = new SemanticTableaux(Root);
 }