示例#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();
        }
        //
        // You can use the following additional attributes as you write your tests:
        //
        // Use ClassInitialize to run code before running the first test in the class
        // [ClassInitialize()]
        // public static void MyClassInitialize(TestContext testContext) { }
        //
        // Use ClassCleanup to run code after all tests in a class have run
        // [ClassCleanup()]
        // public static void MyClassCleanup() { }
        //
        // Use TestInitialize to run code before running each test
        // [TestInitialize()]
        // public void MyTestInitialize() { }
        //
        // Use TestCleanup to run code after each test has run
        // [TestCleanup()]
        // public void MyTestCleanup() { }
        //
        #endregion


        private void setup()
        {
            model          = new Model();
            propintr       = new PropositionInterpreter(ref model);
            input          = new FileInput(filePath);
            MyWorld        = new World(propintr.ParseProps(input.ReadFromFile()), model.Length);
            Truthsolver    = new TruthTable(model, MyWorld);
            forwardsolver  = new ForwardChain(model, MyWorld);
            backwardsolver = new BackwardsChain(model, MyWorld);
            strWriter      = new StringWriter();
            Console.SetOut(strWriter);
        }