示例#1
0
        //Metoda liczaca rozwiazania dla zadanego faktu wejsciowego.
        //Zwraca liste znalezionych faktow wyjsciowych (fakt = lista formul).
        public List <List <OutputFormula> > CalculateOutputFormulas(List <InputFormula> factU)
        {
            var S = new List <List <OutputFormula> >();

            while (HasNextIteration(FormBase.GetFormulas()))
            {
                if (FormBase.Fact1(FormBase.GetFormulas()))
                {
                    if (FormBase.Fact2(FormBase.GetFormulas()))
                    {
                        if (FormBase.Fact3(FormBase.GetFormulas()))
                        {
                            if (FormBase.Fact4(FormBase.GetFormulas()))
                            {
                                if (FormBase.Fact5(FormBase.GetFormulas()))
                                {
                                    if (FormBase.Fact6(FormBase.GetFormulas()))
                                    {
                                        if (FormBase.Fact7(FormBase.GetFormulas()))
                                        {
                                            //checking Fu = 1
                                            if (CheckFactU(FormBase.GetFormulas(), factU))
                                            {
                                                var result = new List <OutputFormula>(8);
                                                for (var j = 11; j < FormBase.GetFormulas().Count; j++)
                                                {
                                                    result.Add(new OutputFormula((OutputFormula)FormBase.GetFormulas()[j]));
                                                }
                                                if (!ContainsSameItem(S, result))
                                                {
                                                    S.Add(result);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
                NextIteration(FormBase.GetFormulas());
            }

            return(S);
        }