コード例 #1
0
 @Test
 public void test6() throws SymbolFormatException, GdlFormatException {
   Substitution s = null;
   Gdl a, b;
   a = GdlFactory.create("(move ?x 1)");
   b = GdlFactory.create("(fact a 1)");
   s = Unification.unify((GdlSentence) a, (GdlSentence) b);
   assertTrue(s == null);
 }
コード例 #2
0
 @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}");
 }
コード例 #3
0
 @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}");
 }
コード例 #4
0
 @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 ) )}");
 }