Esempio n. 1
0
        public override Connective Copy()
        {
            ConnectiveNand temp = new ConnectiveNand();

            temp.setLeftConnective(con1.Copy());
            temp.setRightConnective(con2.Copy());
            return(temp);
        }
Esempio n. 2
0
        public override Connective GetNandProposition()
        {
            ConnectiveNand thistemp = new ConnectiveNand();

            thistemp.setLeftConnective(con1.GetNandProposition());
            thistemp.setRightConnective(con2.GetNandProposition());
            return(thistemp);
        }
Esempio n. 3
0
        public override Connective GetNandProposition()
        {
            ConnectiveNand mainNand = new ConnectiveNand();
            ConnectiveNot  not      = new ConnectiveNot();

            mainNand.setLeftConnective(con1.GetNandProposition());
            not.setLeftConnective(con2.Copy());
            mainNand.setRightConnective(not.GetNandProposition());
            return(mainNand);
        }
        public override Connective GetNandProposition()
        {
            ConnectiveNand mainNand = new ConnectiveNand();
            ConnectiveNand nand1    = new ConnectiveNand();
            ConnectiveNand nand2    = new ConnectiveNand();
            ConnectiveNot  not1     = new ConnectiveNot();
            ConnectiveNot  not2     = new ConnectiveNot();

            not1.setLeftConnective(con1.Copy());
            not2.setLeftConnective(con2.Copy());
            nand2.setLeftConnective(not1.GetNandProposition());
            nand2.setRightConnective(not2.GetNandProposition());
            nand1.setLeftConnective(con1.GetNandProposition());
            nand1.setRightConnective(con2.GetNandProposition());
            mainNand.setLeftConnective(nand1);
            mainNand.setRightConnective(nand2);
            return(mainNand);
        }
        //SPLITTING OF TABLEAUXSET NEEDED
        public List <Connective> ApplyBetaTableauxRules()
        {
            List <Connective> results = new List <Connective>();

            if (element is ConnectiveNot) //FIRST LAYER IS NOT
            {
                ConnectiveNot cn = (ConnectiveNot)element;

                if (cn.Con1 is ConnectiveAnd) //SECOND LAYER IS AND
                {
                    ConnectiveAnd cn1 = (ConnectiveAnd)cn.Con1;

                    ConnectiveNot not1 = new ConnectiveNot();
                    ConnectiveNot not2 = new ConnectiveNot();
                    not1.setLeftConnective(cn1.Con1.Copy());
                    not2.setLeftConnective(cn1.Con2.Copy());
                    results.Add(not1);
                    results.Add(not2);
                }
                else if (cn.Con1 is ConnectiveBiImplication) //SECOND LAYER IS BI-IMPLICATION
                {
                    ConnectiveBiImplication cn1 = (ConnectiveBiImplication)cn.Con1;

                    ConnectiveNot         not1 = new ConnectiveNot();
                    ConnectiveNot         not2 = new ConnectiveNot();
                    ConnectiveImplication imp1 = new ConnectiveImplication();
                    ConnectiveImplication imp2 = new ConnectiveImplication();
                    not1.setLeftConnective(imp1);
                    not2.setLeftConnective(imp2);
                    imp1.setLeftConnective(cn1.Con1.Copy());
                    imp1.setRightConnective(cn1.Con2.Copy());
                    imp2.setLeftConnective(cn1.Con2.Copy());
                    imp2.setRightConnective(cn1.Con1.Copy());

                    results.Add(not1);
                    results.Add(not2);
                }
            }
            else if (element is ConnectiveOr) //OR RULE
            {
                ConnectiveOr co = (ConnectiveOr)element;

                results.Add(co.Con1.Copy());
                results.Add(co.Con2.Copy());
            }
            else if (element is ConnectiveImplication) //IMPLICATION RULE
            {
                ConnectiveImplication ci = (ConnectiveImplication)element;

                ConnectiveNot not = new ConnectiveNot();
                not.setLeftConnective(ci.Con1.Copy());
                results.Add(not);
                results.Add(ci.Con2.Copy());
            }
            else if (element is ConnectiveNand)
            {
                ConnectiveNand cn = (ConnectiveNand)element;

                ConnectiveNot not1 = new ConnectiveNot();
                ConnectiveNot not2 = new ConnectiveNot();
                not1.setLeftConnective(cn.Con1.Copy());
                not2.setLeftConnective(cn.Con2.Copy());
                results.Add(not1);
                results.Add(not2);
            }

            return(results);
        }