public SemanticTableauxParser(IAsciiBasePropositionalOperator baseOperator)
        {
            var not = new NotPropositionalOperator(baseOperator.GetArgumentsManager());

            not.Instantiate(new [] { baseOperator.ToAndOrNot() });
            Step = new TableuaxStep(not);
            HandleSteps();
        }
        private void HandleQuantifierOperators()
        {
            var list = operators.Where(x => !(x is AbstractQuantifierOperator) && !(x is NotPropositionalOperator && x.GetChilds()[0] is AbstractQuantifierOperator)).ToList();

            foreach (var baseOperator in operators.Where(x => !list.Contains(x)).OrderBy(CalcScore))
            {
                IAsciiBasePropositionalOperator work;
                if (baseOperator is NotPropositionalOperator)
                {
                    var temp = baseOperator.GetChilds()[0].Negate();
                    work = temp;
                }
                else
                {
                    work = baseOperator;
                }

                operatorsMadeIntoChilds.Add(work);
                operatorsMadeIntoChilds.Add(baseOperator);

                if (!list.Contains(work))
                {
                    var q = work as AbstractQuantifierOperator;
                    if (work is UniversalQuantifierOperator)
                    {
                        list.Add(work);
                        foreach (var extensionalVariable in ExtensionalVariables)
                        {
                            var clone = StringParser.CloneOperator(work.GetChilds()[0]);
                            clone.ChangeArgument(q.GetVariable(), extensionalVariable);
                            if (!list.Contains(clone))
                            {
                                list.Add(clone);
                            }
                        }
                    }
                    else
                    {
                        var clone    = StringParser.CloneOperator(work.GetChilds()[0]);
                        var variable = clone.GetArgumentsManager().GetUnusedOperator();
                        ExtensionalVariables.Add(variable);
                        clone.ChangeArgument(q.GetVariable(), variable);
                        if (!list.Contains(clone))
                        {
                            list.Add(clone);
                        }
                    }
                }
            }

            var child = new TableuaxStep(list, ExtensionalVariables);

            childs.Add(child);
        }
        private bool AddOrChild(IAsciiBasePropositionalOperator baseOperator, IAsciiBasePropositionalOperator workChild)
        {
            List <IAsciiBasePropositionalOperator> list1 = operators.Where(x => x != baseOperator).ToList();

            if (!list1.Contains(workChild))
            {
                list1.Add(workChild);
            }



            var child1 = new TableuaxStep(list1, ExtensionalVariables);

            childs.Add(child1);
            return(true);
        }
        private void AddChild(IAsciiBasePropositionalOperator baseOperator)
        {
            //Console.WriteLine("Child: "+ baseOperator.ToLogicString());

            IAsciiBasePropositionalOperator work;

            if (baseOperator is NotPropositionalOperator)
            {
                var temp = baseOperator.GetChilds()[0].Negate();
                work = temp;
            }
            else
            {
                work = baseOperator;
            }

            var stop = operatorsMadeIntoChilds.Contains(work) || operatorsMadeIntoChilds.Contains(baseOperator);

            operatorsMadeIntoChilds.Add(baseOperator);

            if (stop)
            {
                Console.WriteLine("STOP!");
                return;
            }

            operatorsMadeIntoChilds.Add(work);


            if (work is OrPropositionalOperator)
            {
                AddOrChild(baseOperator, work.GetChilds()[0]);
                if (!work.GetChilds()[0].Equals(work.GetChilds()[1]))
                {
                    AddOrChild(baseOperator, work.GetChilds()[1]);
                }
                return;
            }
            if (work is AndPropositionalOperator)
            {
                List <IAsciiBasePropositionalOperator> list = operators.Where(x => x != baseOperator).ToList();
                var first  = work.GetChilds()[0];
                var second = work.GetChilds()[1];
                if (!list.Contains(first))
                {
                    list.Add(first);
                }

                if (!list.Contains(second))
                {
                    list.Add(second);
                }

                var child = new TableuaxStep(list, ExtensionalVariables);

                childs.Add(child);
                return;
            }

            if (work is AbstractConstantPropositionalOperator)
            {
                List <IAsciiBasePropositionalOperator> list = operators.Where(x => x != baseOperator).ToList();
                if (!list.Contains(work))
                {
                    list.Add(work);
                }

                var child = new TableuaxStep(list, ExtensionalVariables);
                childs.Add(child);
                return;
            }
            if (work is AbstractQuantifierOperator)
            {
                HandleQuantifierOperators();
                return;
            }
            throw new NotImplementedException();
        }