Beispiel #1
0
        public void ForwardChain()
        {
            FileInput input             = new FileInput("./t1.txt");
            Model     temp              = new Model();
            PropositionInterpreter test = new PropositionInterpreter(ref temp);
            World        MyWorld        = new World(test.ParseProps(input.ReadFromFile()), temp.Length);
            ForwardChain solver         = new ForwardChain(temp, MyWorld);

            solver.Start();
        }
        public void All_t1()
        {
            filePath = "t1.txt";
            bool rightAns = true;

            setup();
            Truthsolver.solve();
            bool truth = (strWriter.ToString()[0] == 'Y'); // if it returns YES

            clearsw();
            backwardsolver.Start();
            bool backwards = (strWriter.ToString()[0] == 'Y'); // if it returns YES

            clearsw();
            forwardsolver.Start();
            bool forward = (strWriter.ToString()[0] == 'Y'); // if it returns YES

            Assert.AreEqual(truth, rightAns);
            Assert.AreEqual(truth, backwards);
            Assert.AreEqual(backwards, forward);
        }