コード例 #1
0
ファイル: TableRules.cs プロジェクト: Sujeshchandr/syllogism
        private static string CheckconclusionByConvertingResult(string result, string conclusion)
        {
            RESULTTYPE1 = SyllogismRules.GetTypeByProposition(result);
            string tempresult;

            switch (RESULTTYPE1)
            {
            case "A":
                tempresult = AType.ConvertProposition(result) == conclusion.ToUpper() ? VALIDCONCLUSION : INVALIDCONCLUSION;
                if (tempresult == INVALIDCONCLUSION)
                {
                    tempresult = AType.ImplicateProposition(result) == conclusion.ToUpper()
                            ? VALIDCONCLUSION
                            : INVALIDCONCLUSION;
                }
                result = tempresult;
                break;

            case "E":
                tempresult = EType.ConvertStatement(result) == conclusion.ToUpper() ? VALIDCONCLUSION : INVALIDCONCLUSION;
                if (tempresult == INVALIDCONCLUSION)
                {
                    tempresult = EType.ImplicateStatement(result) == conclusion.ToUpper() ? VALIDCONCLUSION : INVALIDCONCLUSION;
                }
                result = tempresult;
                break;

            case "I":
                tempresult = IType.ConvertStatement(result) == conclusion.ToUpper() ? VALIDCONCLUSION : INVALIDCONCLUSION;
                if (tempresult == INVALIDCONCLUSION)
                {
                    tempresult = IType.ImplicateStatement(result) == conclusion.ToUpper()
                            ? VALIDCONCLUSION
                            : INVALIDCONCLUSION;
                }
                result = tempresult;
                break;

            case "O":
                tempresult = OType.ConvertStatement(result) == conclusion.ToUpper() ? VALIDCONCLUSION : INVALIDCONCLUSION;
                if (tempresult == INVALIDCONCLUSION)
                {
                    tempresult = OType.ImplicateStatement(result) == conclusion.ToUpper()
                            ? VALIDCONCLUSION
                            : INVALIDCONCLUSION;
                }
                result = tempresult;
                break;
            }
            return(result);
        }
コード例 #2
0
 public static string GetImplicatedProposition(string proposition)
 {
     if (AType.IsTrue(proposition))
     {
         return(AType.ImplicateProposition(proposition).ToUpper());
     }
     if (EType.IsTrue(proposition))
     {
         return(EType.ImplicateStatement(proposition).ToUpper());
     }
     if (IType.IsTrue(proposition))
     {
         return(IType.ImplicateStatement(proposition).ToUpper());
     }
     if (OType.IsTrue(proposition))
     {
         return(OType.ImplicateStatement(proposition).ToUpper());
     } //TODo:- Add Hidden & Exclusive  Proportion
     return(INVALIDTYPE);
 }