isFalse() public method

public isFalse ( Sentence clause ) : bool
clause AIMA.Core.Logic.Propositional.Parsing.Ast.Sentence
return bool
Esempio n. 1
0
 public void testSentenceStatusWhenPFalseAndQFalse()
 {
     String p = "P";
     String q = "Q";
     m = m.extend(new Symbol(p), false);
     m = m.extend(new Symbol(q), false);
     Assert.AreEqual(true, m.isFalse(andSentence));
     Assert.AreEqual(true, m.isFalse(orSentence));
     Assert.AreEqual(true, m.isTrue(impliedSentence));
     Assert.AreEqual(true, m.isTrue(biConditionalSentence));
 }
Esempio n. 2
0
        private bool isEvenOneClauseFalse(Model model, List <Sentence> clauseList)
        {
            for (int i = 0; i < clauseList.Count; i++)
            {
                Sentence clause = (Sentence)clauseList[i];
                if (model.isFalse(clause))
                {
                    // System.Console.WriteLine(clause.ToString() + " is false");
                    return(true);
                }
            }

            return(false);
        }
Esempio n. 3
0
        private bool isClauseTrueInModel(Sentence clause, Model model)
        {
            List <Symbol> positiveSymbols = new SymbolClassifier().getPositiveSymbolsIn(clause);
            List <Symbol> negativeSymbols = new SymbolClassifier().getNegativeSymbolsIn(clause);

            foreach (Symbol symbol in positiveSymbols)
            {
                if ((model.isTrue(symbol)))
                {
                    return(true);
                }
            }
            foreach (Symbol symbol in negativeSymbols)
            {
                if ((model.isFalse(symbol)))
                {
                    return(true);
                }
            }
            return(false);
        }
Esempio n. 4
0
        private bool isClauseTrueInModel(Sentence clause, Model model)
        {
            List<Symbol> positiveSymbols = new SymbolClassifier().getPositiveSymbolsIn(clause);
            List<Symbol> negativeSymbols = new SymbolClassifier().getNegativeSymbolsIn(clause);

            foreach (Symbol symbol in positiveSymbols)
            {
                if ((model.isTrue(symbol)))
                {
                    return true;
                }
            }
            foreach (Symbol symbol in negativeSymbols)
            {
                if ((model.isFalse(symbol)))
                {
                    return true;
                }
            }
            return false;

        }
Esempio n. 5
0
        private bool isEvenOneClauseFalse(Model model, List<Sentence> clauseList)
        {
            for (int i = 0; i < clauseList.Count; i++)
            {
                Sentence clause = (Sentence)clauseList[i];
                if (model.isFalse(clause))
                {
                    // System.Console.WriteLine(clause.ToString() + " is false");
                    return true;
                }

            }

            return false;
        }
Esempio n. 6
0
 public void testComplexSentence()
 {
     String p = "P";
     String q = "Q";
     m = m.extend(new Symbol(p), true);
     m = m.extend(new Symbol(q), false);
     Sentence sent = (Sentence)parser.parse("((P OR Q) AND  (P => Q))");
     Assert.IsFalse(m.isTrue(sent));
     Assert.IsTrue(m.isFalse(sent));
     Sentence sent2 = (Sentence)parser.parse("((P OR Q) AND  (Q))");
     Assert.IsFalse(m.isTrue(sent2));
     Assert.IsTrue(m.isFalse(sent2));
 }