コード例 #1
0
        public override Connective Copy()
        {
            ConnectiveImplication temp = new ConnectiveImplication();

            temp.setLeftConnective(con1.Copy());
            temp.setRightConnective(con2.Copy());
            return(temp);
        }
コード例 #2
0
        //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);
        }