private static void unifierDemo() { FOLParser parser = new FOLParser(DomainFactory.knowsDomain()); Unifier unifier = new Unifier(); IMap <Variable, Term> theta = CollectionFactory.CreateInsertionOrderedMap <Variable, Term>(); Sentence query = parser.parse("Knows(John,x)"); Sentence johnKnowsJane = parser.parse("Knows(y,Mother(y))"); System.Console.WriteLine("------------"); System.Console.WriteLine("Unifier Demo"); System.Console.WriteLine("------------"); IMap <Variable, Term> subst = unifier.unify(query, johnKnowsJane, theta); System.Console.WriteLine("Unify '" + query + "' with '" + johnKnowsJane + "' to get the substitution " + subst + "."); System.Console.WriteLine(""); }
private static void unifierDemo() { FOLParser parser = new FOLParser(DomainFactory.knowsDomain()); Unifier unifier = new Unifier(); var theta = new Dictionary <Variable, Term>(); Sentence query = parser.parse("Knows(John,x)"); Sentence johnKnowsJane = parser.parse("Knows(y,Mother(y))"); System.Console.WriteLine("------------"); System.Console.WriteLine("Unifier Demo"); System.Console.WriteLine("------------"); var subst = unifier.unify(query, johnKnowsJane, theta); System.Console.WriteLine("Unify '" + query + "' with '" + johnKnowsJane + "' to get the substitution " + DictToString(subst) + "."); System.Console.WriteLine(""); }
public void setUp() { parser = new FOLParser(DomainFactory.knowsDomain()); unifier = new Unifier(); theta = CollectionFactory.CreateInsertionOrderedMap <Variable, Term>(); }
public void setUp() { parser = new FOLParser(DomainFactory.knowsDomain()); unifier = new Unifier(); theta = new Dictionary <Variable, Term>(); }