Exemple #1
0
        static void Main(string[] args)
        {
            Console.WriteLine("Enter 2 DNF");
            DNF a = new DNF(Console.ReadLine());
            DNF b = new DNF(Console.ReadLine());

            Console.WriteLine(a);
            Console.WriteLine("Check insert");
            a.Insert(new Konj(Console.ReadLine()));
            Console.WriteLine(a);
            Console.WriteLine("Check disjunc");
            Console.WriteLine(DNF.Disj(a, b));
            Console.WriteLine("Check calculate");
            bool[] c = new bool[5];
            for (int i = 0; i < 5; i++)
            {
                c[i] = bool.Parse(Console.ReadLine());
            }
            Console.WriteLine(a.Value(c));
            Console.WriteLine("Check sort");
            a.SortByLength();
            Console.WriteLine(a);
            Console.WriteLine("Check dnfWith");
            Console.WriteLine(DNF.DNFWith(a, int.Parse(Console.ReadLine())));
            Console.ReadLine();
        }
Exemple #2
0
        public static DNF Disj(DNF a, DNF b)
        {
            DNF w = new DNF();

            w.KList = a.KList;
            foreach (Konj i in b.KList)
            {
                w.Insert(i);//,true);
            }
            return(w);
        }