Ejemplo n.º 1
0
        public void setUp()
        {
            StandardizeApartIndexicalFactory.flush();

            weaponsKB = new FOLKnowledgeBase(DomainFactory.weaponsDomain());

            kingsKB = new FOLKnowledgeBase(DomainFactory.kingsDomain());
        }
Ejemplo n.º 2
0
        public static FOLKnowledgeBase createWeaponsKnowledgeBase(InferenceProcedure infp)
        {
            FOLKnowledgeBase kb = new FOLKnowledgeBase(DomainFactory.weaponsDomain(), infp);

            kb.tell("( (((American(x) AND Weapon(y)) AND Sells(x,y,z)) AND Hostile(z)) => Criminal(x))");
            kb.tell(" Owns(Nono, M1)");
            kb.tell(" Missile(M1)");
            kb.tell("((Missile(x) AND Owns(Nono,x)) => Sells(West,x,Nono))");
            kb.tell("(Missile(x) => Weapon(x))");
            kb.tell("(Enemy(x,America) => Hostile(x))");
            kb.tell("American(West)");
            kb.tell("Enemy(Nono,America)");

            return(kb);
        }
Ejemplo n.º 3
0
        public void testExamplePg295AIMA2e()
        {
            FOLDomain domain = DomainFactory.weaponsDomain();
            FOLParser parser = new FOLParser(domain);

            Sentence origSentence = parser
                                    .parse("FORALL x ((((American(x) AND Weapon(y)) AND Sells(x, y, z)) AND Hostile(z)) => Criminal(x))");

            CNFConverter cnfConv = new CNFConverter(parser);

            CNF cnf = cnfConv.convertToCNF(origSentence);

            Assert.AreEqual(
                "[~American(x), ~Hostile(z), ~Sells(x,y,z), ~Weapon(y), Criminal(x)]",
                cnf.ToString());
        }
Ejemplo n.º 4
0
 public void testConnectedImplication()
 {
     parser = new FOLParser(DomainFactory.weaponsDomain());
     parser
     .parse("((Missile(m) AND Owns(Nono,m)) => Sells(West , m ,Nono))");
 }
Ejemplo n.º 5
0
 public void setUp()
 {
     collector = new PredicateCollector();
     parser    = new FOLParser(DomainFactory.weaponsDomain());
 }