Example #1
0
        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++;
            }
        }
Example #2
0
        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");
        }
Example #3
0
 protected override void ExecuteParsingActivities()
 {
     SemanticTableaux = new SemanticTableaux(Root);
 }