Esempio n. 1
0
        public StatementPair(Statement s1, Statement s2)
        {
            Statement1 = s1;
            Statement2 = s2;

            Statement alignedS1 = new Statement();
            Statement alignedS2 = new Statement();


            if (IAERule.AlignStatements(Statement1, Statement2, out alignedS1, out alignedS2))//out variables return aligned statements
            {
                this.IsAligned    = true;
                this.CanBeAligned = true;
                this.Statement1   = new Statement(alignedS1.StatementName);
                this.Statement2   = new Statement(alignedS2.StatementName);

                this.ResultStatement = AddStatemets.Add(Statement1, Statement2);

                this.IsResultValid = ResultStatement == null ? false : true;
            }
            else
            {
                this.IsAligned     = false;
                this.CanBeAligned  = false;
                this.IsResultValid = false;
            }
        }
Esempio n. 2
0
 private SyllogismRules.ConclusionValidity GetConclusionValidity()
 {
     if (this.CorrespondingAlignedStatements == null || this.CorrespondingAlignedStatements.Count == 0)
     {
         return(SyllogismRules.ConclusionValidity.InValid);
     }
     else if (this.CorrespondingAlignedStatements.Count == 1)
     {
         Statement result = this.CorrespondingAlignedStatements[0];
         this.ResultStatement = result;
         if (result == null)
         {
             return(SyllogismRules.ConclusionValidity.InValid);
         }
         if (result.StatementName.ToUpper() == this.ConclusionName.ToUpper())
         {
             return(SyllogismRules.ConclusionValidity.Valid);
         }
         else if (result.ImplicatedStatement.ToUpper() == this.ConclusionName.ToUpper())
         {
             return(SyllogismRules.ConclusionValidity.Valid);
         }
         else if (result.ConvertedStatement.ToUpper() == this.ConclusionName.ToUpper())
         {
             return(SyllogismRules.ConclusionValidity.Valid);
         }
         else
         {
             return(SyllogismRules.ConclusionValidity.InValid);
         }
     }
     else if (this.CorrespondingAlignedStatements.Count == 2)
     {
         Statement result = AddStatemets.Add(this.CorrespondingAlignedStatements[0],
                                             this.CorrespondingAlignedStatements[1]);
         this.ResultStatement = result;
         if (result == null)
         {
             return(SyllogismRules.ConclusionValidity.InValid);
         }
         if (result.StatementName.ToUpper() == this.ConclusionName.ToUpper())
         {
             return(SyllogismRules.ConclusionValidity.Valid);
         }
         else if (result.ImplicatedStatement.ToUpper() == this.ConclusionName.ToUpper())
         {
             return(SyllogismRules.ConclusionValidity.Valid);
         }
         else if (result.ConvertedStatement.ToUpper() == this.ConclusionName.ToUpper())
         {
             return(SyllogismRules.ConclusionValidity.Valid);
         }
         else
         {
             return(SyllogismRules.ConclusionValidity.InValid);
         }
     }
     else if (this.CorrespondingAlignedStatements.Count == 3)
     {
         Statement result1 = AddStatemets.Add(this.CorrespondingAlignedStatements[0],
                                              this.CorrespondingAlignedStatements[1]);
         this.ResultStatement = result1;
         if (result1 == null)
         {
             return(SyllogismRules.ConclusionValidity.InValid);
         }
         else
         {
             Statement result2 = AddStatemets.Add(result1,
                                                  this.CorrespondingAlignedStatements[2]);
             this.ResultStatement = result2;
             if (result2 == null)
             {
                 return(SyllogismRules.ConclusionValidity.InValid);
             }
             else
             {
                 if (result2.StatementName.ToUpper() == this.ConclusionName.ToUpper())
                 {
                     return(SyllogismRules.ConclusionValidity.Valid);
                 }
                 else if (result2.ImplicatedStatement.ToUpper() == this.ConclusionName.ToUpper())
                 {
                     return(SyllogismRules.ConclusionValidity.Valid);
                 }
                 else if (result2.ConvertedStatement.ToUpper() == this.ConclusionName.ToUpper())
                 {
                     return(SyllogismRules.ConclusionValidity.Valid);
                 }
                 else
                 {
                     return(SyllogismRules.ConclusionValidity.InValid);
                 }
             }
         }
     }
     return(SyllogismRules.ConclusionValidity.InValid);
 }