// Set up the initial set of clauses based on the
// loves animal domain as it contains functions
// new clauses will always be created (i.e. is an
// infinite universe of discourse).
FOLKnowledgeBase kb = new FOLKnowledgeBase(
DomainFactory.lovesAnimalDomain());
kb.tell("FORALL x (FORALL y (Animal(y) => Loves(x, y)) => EXISTS y Loves(y, x))");
kb.tell("FORALL x (EXISTS y (Animal(y) AND Kills(x, y)) => FORALL z NOT(Loves(z, x)))");
kb.tell("FORALL x (Animal(x) => Loves(Jack, x))");
kb.tell("(Kills(Jack, Tuna) OR Kills(Curiosity, Tuna))");
kb.tell("Cat(Tuna)");
kb.tell("FORALL x (Cat(x) => Animal(x))");
Set<Clause> clauses = new LinkedHashSet<Clause>();
clauses.addAll(kb.getAllClauses());
Set<Clause> newClauses = new LinkedHashSet<Clause>();
long maxRunTime = 30 * 1000; // 30 seconds
long finishTime = System.currentTimeMillis() + maxRunTime;
do {