Exemplo n.º 1
0
        public override Proposition Nandify()
        {
            if (LeftSuccessor.GetType() != typeof(Proposition))
            {
                LeftSuccessor = LeftSuccessor.Nandify();
            }

            if (RightSuccessor.GetType() != typeof(Proposition))
            {
                RightSuccessor = RightSuccessor.Nandify();
            }

            return(this);
        }
Exemplo n.º 2
0
        public override Proposition Nandify()
        {
            // ~(A) == ~(A & A) == A % A
            Nand        nand          = new Nand();
            Proposition nandifiedLeft = LeftSuccessor;

            if (LeftSuccessor.GetType() != typeof(Proposition))
            {
                nandifiedLeft = LeftSuccessor.Nandify();
            }

            nand.LeftSuccessor  = nandifiedLeft;
            nand.RightSuccessor = nandifiedLeft;

            return(nand);
        }