AIMA.Test.Core.Unit.Logic.Fol.Inference.ParamodulationTest.testSimpleExample C# (CSharp) Метод

testSimpleExample() приватный Метод

private testSimpleExample ( ) : void
Результат void
        public void testSimpleExample()
        {
            FOLDomain domain = new FOLDomain();
            domain.addConstant("A");
            domain.addConstant("B");
            domain.addPredicate("P");
            domain.addPredicate("Q");
            domain.addPredicate("R");
            domain.addFunction("F");

            FOLParser parser = new FOLParser(domain);

            List<Literal> lits = new List<Literal>();
            AtomicSentence a1 = (AtomicSentence)parser.parse("P(F(x,B),x)");
            AtomicSentence a2 = (AtomicSentence)parser.parse("Q(x)");
            lits.Add(new Literal(a1));
            lits.Add(new Literal(a2));

            Clause c1 = new Clause(lits);

            lits.Clear();
            a1 = (AtomicSentence)parser.parse("F(A,y) = y");
            a2 = (AtomicSentence)parser.parse("R(y)");
            lits.Add(new Literal(a1));
            lits.Add(new Literal(a2));

            Clause c2 = new Clause(lits);

            List<Clause> paras = paramodulation.apply(c1, c2);
            Assert.AreEqual(2, paras.Count);

            foreach (Clause c in paras)
            {
                Assert.AreEqual("[P(B,A), Q(A), R(B)]", c.ToString());
                Assert.AreEqual("[P(F(A,F(x,B)),x), Q(x), R(F(x,B))]", c
                        .ToString());
            }
        }