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

public class Rules {
	private static List<Fact> rules = new ArrayList<Fact>();

	public Rules() {
	}

	public void addRule(Fact f) {
		rules.add(f);
	}

	public Boolean is(Fact f, List<Term> head) {
		for(Fact rule: rules) {
			if ((rule.equals(f)) && (f.getHead().equals(head))) {
				return true;
			}
		}
		return false;
	}

}

@@ -210,9 +210,9 @@
 lic 
-B
+b
 oole
@@ -244,16 +244,42 @@
 head) %7B%0A
+%09%09boolean result = false;%0A
 %09%09for(Fa
@@ -357,22 +357,188 @@
 ) %7B%0A%09%09%09%09
-return
+Term first = f.getHead().get(0);%0A%09%09%09%09if (first instanceof Variable) %7B%0A%09%09%09%09%09System.out.println(first.getName() + %22 = %22 + rule.getHead().get(0).getName());%0A%09%09%09%09%7D%0A%09%09%09%09result =
  true;%0A%09
@@ -554,21 +554,22 @@
 %09return 
-false
+result
 ;%0A%09%7D%0A%0A%7D%0A

Allow variables when checking rules