import java.util.List;
import java.util.ArrayList;

public class Test {
	public static void main(String[] args) {
		Atom a = new Atom("Tom");
		List<Term> head = new ArrayList<Term>();
		head.add(a);
		List<Term> head2 = new ArrayList<Term>();
		head2.add(a);
		Atom a2 = new Atom("Tom");
		List<Term> head3 = new ArrayList<Term>();
		head3.add(a2);
		Atom a3 = new Atom("Jerry");
		List<Term> head4 = new ArrayList<Term>();
		head4.add(a3);

		Fact cat = new Fact("cat", head);
		Fact cat2 = new Fact("cat", head3);
		Fact mouse = new Fact("mouse", head4);

		Rules rules = new Rules();
		rules.addRule(cat);
		rules.addRule(mouse);

		test(cat, head);
		test(cat2, head);
		test(cat, head2);
		test(cat2, head2);
		test(cat, head3);
		test(cat2, head3);
		test(cat, head4);
		test(mouse, head4);
		test(mouse, head);
	}

	public static void test(Fact f, List<Term> head) {
		Rules rules = new Rules();
		System.out.println("Is " + head.get(0).getName() + " a " + f.getName() + " ?- " +
				rules.is(f, head));
	}
}

@@ -439,121 +439,529 @@
 3);%0A
-%0A%09%09Fact cat = new Fact(%22cat%22, head);%0A%09%09Fact cat2 = new Fact(%22cat%22, head3);%0A%09%09Fact mouse = new Fact(%22mouse%22, head4
+%09%09Atom a4 = new Atom(%22Micky%22);%0A%09%09List%3CTerm%3E head6 = new ArrayList%3CTerm%3E();%0A%09%09head6.add(a4);%0A%0A%09%09Variable v1 = new Variable(%22X%22);%0A%09%09List%3CTerm%3E head5 = new ArrayList%3CTerm%3E();%0A%09%09head5.add(v1);%0A%09%09Variable v2 = new Variable(%22Y%22);%0A%09%09List%3CTerm%3E head7 = new ArrayList%3CTerm%3E();%0A%09%09head7.add(v2);%0A%0A%09%09Fact cat = new Fact(%22cat%22, head);%0A%09%09Fact cat2 = new Fact(%22cat%22, head3);%0A%09%09Fact mouse = new Fact(%22mouse%22, head4);%0A%09%09Fact mouse3 = new Fact(%22mouse%22, head6);%0A%0A%09%09Fact mouse2 = new Fact(%22mouse%22, head5);%0A%09%09Fact cat3 = new Fact(%22cat%22, head7
 );%0A%0A
@@ -1034,16 +1034,41 @@
 (mouse);
+%0A%09%09rules.addRule(mouse3);
 %0A%0A%09%09test
@@ -1244,16 +1244,69 @@
 , head);
+%0A%0A%09%09rules.is(mouse2, head5);%0A%09%09rules.is(cat3, head7);
 %0A%09%7D%0A%0A%09pu

Add tests for variables