private string GetConvertedStatement(string statement) { ConvertedConclusion = SyllogismRules.GetConvertedProposition(statement); ConvertedSubject = SyllogismRules.GetSubjectByProposition(ConvertedConclusion); ConvertedPredicate = SyllogismRules.GetPredicateByProposition(ConvertedConclusion); return(ConvertedConclusion); }
private void button1_Click(object sender, EventArgs e) { Statement1 = txtStatement1.Text; Statement2 = txtStatement2.Text; Statement3 = txtStatement3.Text; Conclusion1 = txtConclusion1.Text; Conclusion2 = txtConclusion2.Text; Conclusion3 = txtConclusion3.Text; Conclusion4 = txtConclusion4.Text; Result1 = TableRules.AddStatements(Statement1, Statement2); Result2 = TableRules.AddStatements(Statement2, Statement3); Result3 = TableRules.AddStatements(Statement1, Statement3); //Consider Conclusion1 by taking subject and predicate. Conclusion1Subject = SyllogismRules.GetSubjectByProposition(Conclusion1); Conclusion1Predicate = SyllogismRules.GetPredicateByProposition(Conclusion2); if (Conclusion1Subject.ToUpper() != "INVALID TYPE" || Conclusion1Predicate.ToUpper() != "INVALID TYPE") { // ToD0 :- Check Which of the given statements having this suject and predicate by conclusion. string[] allStatements = new string[] { Statement1, Statement2, Statement3 }; string[] sortedStatements = new string[] { }; sortedStatements = SyllogismRules.GetPairedStatementsByConclusion(allStatements, Conclusion1); } if (Conclusion1 != string.Empty && Conclusion2 != string.Empty) { var r1 = TableRules.CheckConclusionByStatements(Conclusion1, Statement1, Statement2, Result1).ToUpper(); var r2 = TableRules.CheckConclusionByStatements(Conclusion2, Statement1, Statement2, Result1).ToUpper(); if (r1.ToUpper() == "CONCLUSION IS VALID" && r2.ToUpper() == "CONCLUSION IS NOT VALID") { lblResult.Text = "ONLY CONCLUSION 1 FOLLOWS"; } else if (r1.ToUpper() == "CONCLUSION IS NOT VALID" && r2.ToUpper() == "CONCLUSION IS VALID") { lblResult.Text = "ONLY CONCLUSION 2 FOLLOWS"; } else if (r1.ToUpper() == "CONCLUSION IS VALID" && r2.ToUpper() == "CONCLUSION IS VALID") { lblResult.Text = "BOTH CONCLUSION 1 AND CONCLUSION 2 FOLLOWS"; } else if (r1.ToUpper() == "CONCLUSION IS NOT VALID" && r2.ToUpper() == "CONCLUSION IS NOT VALID") { lblResult.Text = ComplementaryPair.IsComplementaryPair(Conclusion1, Conclusion2) ? "EITHER CONCLUSION 1 OR CONCLUSION 2 FOLLOWS" : "NEITHER CONCLUSION 1 NOR CONCLUSION 2 FOLLOWS"; } else { lblResult.Text = "NEITHER CONCLUSION 1 NOR CONCLUSION 2 FOLLOWS"; } } else if (Conclusion1 != string.Empty) { var r1 = TableRules.CheckConclusionByStatements(Conclusion1, Statement1, Statement2, Result1).ToUpper(); lblResult.Text = r1.ToUpper(); } else if (Conclusion2 != string.Empty) { var r2 = TableRules.CheckConclusionByStatements(Conclusion2, Statement1, Statement2, Result1).ToUpper(); lblResult.Text = r2.ToUpper(); } else { lblResult.Text = Result1; } }
private string GetSubject(string statement) { Subject = SyllogismRules.GetSubjectByProposition(statement).ToUpper(); return(Subject); }