@Test public void test3() throws SymbolFormatException, GdlFormatException { Substitution s = null; Gdl a, b; a = GdlFactory.create("(role ?p)"); b = GdlFactory.create("(role white)"); s = Unification.unify((GdlSentence) a, (GdlSentence) b); assertEquals("test", s.toString(), "{?p=white}"); }
@Test public void test2() throws SymbolFormatException, GdlFormatException { Substitution s = null; Gdl a, b; a = GdlFactory.create("(fact ?x)"); b = GdlFactory.create("(fact ?y)"); s = Unification.unify((GdlSentence) a, (GdlSentence) b); assertEquals("test", s.toString(), "{?x=?y}"); }
@Test public void test4() throws SymbolFormatException, GdlFormatException { Substitution s = null; Gdl a, b; a = GdlFactory.create("(f1 ?x 3 ?y)"); b = GdlFactory.create("(f1 (f2 ?y (f3 ?z (f4 (f5 ?y 42) 1 ?z) 7)) ?z a)"); s = Unification.unify((GdlSentence) a, (GdlSentence) b); assertEquals( "test", s.toString(), "{?z=3, ?y=a, ?x=( f2 a ( f3 3 ( f4 ( f5 a 42 ) 1 3 ) 7 ) )}"); }