예제 #1
0
        /**
         * Returns the answer to the specified question using the TT-Entails
         * algorithm.
         *
         * @param queryString
         *            a question to ASK the knowledge base
         *
         * @return the answer to the specified question using the TT-Entails
         *         algorithm.
         */
        public bool askWithTTEntails(string queryString)
        {
            PLParser parser = new PLParser();

            Sentence alpha = parser.parse(queryString);

            return(new TTEntails().ttEntails(this, alpha));
        }
예제 #2
0
        static void displayResolutionResults(KnowledgeBase kb, string query)
        {
            PLParser parser = new PLParser();

            System.Console.WriteLine("Running plResolution of query "
                                     + query
                                     + " on knowledgeBase  gives "
                                     + plr.plResolution(kb, parser.parse(query)));
        }
예제 #3
0
 public void setUp()
 {
     parser                = new PLParser();
     trueSentence          = (Sentence)parser.parse("true");
     falseSentence         = (Sentence)parser.parse("false");
     andSentence           = (Sentence)parser.parse("(P  &  Q)");
     orSentence            = (Sentence)parser.parse("(P  |  Q)");
     impliedSentence       = (Sentence)parser.parse("(P  =>  Q)");
     biConditionalSentence = (Sentence)parser.parse("(P  <=>  Q)");
     m = new Model();
 }
예제 #4
0
        public static void displayDPLLSatisfiableStatus(string query)
        {
            PLParser parser = new PLParser();

            if (dpll.dpllSatisfiable(parser.parse(query)))
            {
                System.Console.WriteLine(query + " is  (DPLL) satisfiable");
            }
            else
            {
                System.Console.WriteLine(query + " is NOT (DPLL)  satisfiable");
            }
        }
예제 #5
0
 public void setUp()
 {
     parser = new PLParser();
     plfce  = new PLFCEntails();
 }
예제 #6
0
 public void setUp()
 {
     parser = new PLParser();
 }
예제 #7
0
 public DPLLTest()
 {
     this.dpll   = new DPLLSatisfiable();
     this.parser = new PLParser();
 }
예제 #8
0
 public PLResolutionTest()
 {
     this.resolution = new PLResolution(false);
     parser          = new PLParser();
 }
예제 #9
0
 public PLKbInferProcedureInfo()
 {
     parser             = new PLParser();
     WalkSatProbability = 0.5;
     WalkSatMaxFlips    = 100;
 }