public void setUp() { StandardizeApartIndexicalFactory.flush(); weaponsKB = new FOLKnowledgeBase(DomainFactory.weaponsDomain()); kingsKB = new FOLKnowledgeBase(DomainFactory.kingsDomain()); }
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); }
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()); }
public void testConnectedImplication() { parser = new FOLParser(DomainFactory.weaponsDomain()); parser .parse("((Missile(m) AND Owns(Nono,m)) => Sells(West , m ,Nono))"); }
public void setUp() { collector = new PredicateCollector(); parser = new FOLParser(DomainFactory.weaponsDomain()); }