Beispiel #1
0
 public static void PopulatePreviewPropertiesByConclusion(PropositionList pList, Conclusion currentPreviewConclusion)
 {
     Propositions = pList;
     Statements   = pList.StatementList;
     Conclusion   = currentPreviewConclusion;
     SortedList   = currentPreviewConclusion.sortedStatementList;
     CorrespondingAllignedStatements = currentPreviewConclusion.CorrespondingAlignedStatements;
     ResultStatement = currentPreviewConclusion.ResultStatement;
 }
        private SyllogismResult GetResult(IList <Conclusion> cList)
        {
            Conclusion c1 = null;
            Conclusion c2 = null;
            Conclusion c3 = null;
            Conclusion c4 = null;

            var result = SyllogismResult.NORESULT;

            switch (cList.Count)
            {
            case 1:
                #region ONECONCLUSION

                c1 = cList[0];

                if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.CONCLSUIONISVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.CONCLSUIONISNOTVALID;
                }
                else
                {
                    result = SyllogismResult.NORESULT;
                }

                #endregion
                break;

            case 2:
                #region TWOCONCLUSION
                c1 = cList[0];
                c2 = cList[1];
                if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                    c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.ALLAREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.C1ISVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.C2ISVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.ALLAREINVALID;
                }
                else
                {
                    result = SyllogismResult.NORESULT;
                }
                #endregion
                break;

            case 3:
                #region THREECONCLUSION
                c1 = cList[0];
                c2 = cList[1];
                c3 = cList[2];
                if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                    c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                    c3.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.ALLAREINVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.ALLAREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.C1ISVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.C2ISVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.C3ISVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.C1C2AREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.C1C3AREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.C2C3AREVALID;
                }
                else
                {
                    result = SyllogismResult.NORESULT;
                }
                #endregion
                break;

            case 4:
                #region FOURCONCLUSION
                c1 = cList[0];
                c2 = cList[1];
                c3 = cList[2];
                c4 = cList[3];

                if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                    c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                    c3.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                    c4.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.ALLAREINVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.ALLAREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.C1C2C3AREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.C1C2C4AREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.C1C3C4AREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.C2C3C4AREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.C1ISVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.C2ISVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.C3ISVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.C4ISVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.C1C2AREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.C1C3AREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.C1C4AREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid)
                {
                    result = SyllogismResult.C2C3AREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.C2C4AREVALID;
                }
                else if (c1.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c2.ConclusionValidity == SyllogismRules.ConclusionValidity.InValid &&
                         c3.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid &&
                         c4.ConclusionValidity == SyllogismRules.ConclusionValidity.Valid)
                {
                    result = SyllogismResult.C3C4AREVALID;
                }
                else
                {
                    result = SyllogismResult.NORESULT;
                }

                #endregion
                break;

            default:
                result = SyllogismResult.NORESULT;
                break;
            }
            return(result);
        }