Suppose FOIL's task is to learn the concept grandfather given the relations father and parent. Furthermore, suppose our current Body consists of grandfather ← parent. This can be extended by conjoining Body with any of the literals father, father, parent, or many others – to create this literal, the algorithm must choose both a predicate name and a set of variables for the predicate. If FOIL extends a clause grandfather ← true by conjoining the literal parent, it is introducing the new variable Z. Positive examples now consist of those values <X,Y,Z> such that grandfather is true and parent is true; negative examples are those where grandfather is true but parent is false. On the next iteration of FOIL after parent has been added, the algorithm will consider all combinations of predicate names and variables such that at least one variable in the new literal is present in the existing clause. This results in a very large search space. Several extensions of the FOIL theory have shown that additions to the basic algorithm may reduce this search space, sometimes drastically.
Extensions
The FOCL algorithm extends FOIL in a variety of ways, which affect how FOCL selects literals to test while extending a clause under construction. Constraints on the search space are allowed, as are predicates that are defined on a rule rather than on a set of examples ; most importantly a potentially incorrect hypothesis is allowed as an initial approximation to the predicate to be learned. The main goal of FOCL is to incorporate the methods of explanation-based learning into the empirical methods of FOIL. Even when no additional knowledge is provided to FOCL over FOIL, however, it utilizes an iterative widening search strategy similar to depth-first search: first FOCL attempts to learn a clause by introducing no free variables. If this fails, one additional free variable per failure is allowed until the number of free variables exceeds the maximum used for any predicate.
Constraints
Unlike FOIL, which does not put typing constraints on its variables, FOCL uses typing as an inexpensive way of incorporating a simple form of background knowledge. For example, a predicate livesAt may have types livesAt. Additional predicates may need to be introduced, though – without types, nextDoor could determine whether person X and person Y live next door to each other, or whether two locations are next door to each other. With types, two different predicates nextDoor and nextDoor would need to exist for this functionality to be maintained. However, this typing mechanism eliminates the need for predicates such as isPerson or isLocation, and need not consider livesAt when A and B are defined to be person variables, reducing the search space. Additionally, typing can improve the accuracy of the resulting rule by eliminating from consideration impossible literals such as livesAt which may nevertheless appear to have a high information gain. Rather than implementing trivial predicates such as equals or between, FOCL introduces implicit constraints on variables, further reducing search space. Some predicates must have all variables unique, others must have commutativity is equivalent to adjacent, still others may require that a particular variable be present in the current clause, and many other potential constraints.
Operational rules
Operational rules are those rules which are defined extensionally, or as a list of tuples for which a predicate is true. FOIL allows only operational rules; FOCL extends its knowledge base to allow combinations of rules called non-operational rules as well as partially defined or incorrect rules for robustness. Allowing for partial definitions reduces the amount of work needed as the algorithm need not generate these partial definitions for itself, and the incorrect rules do not add significantly to the work needed since they are discarded if they are not judged to provide positive information gain. Non-operational rules are advantageous as the individual rules which they combine may not provide information gain on their own, but are useful when taken in conjunction. If a literal with the most information gain in an iteration of FOCL is non-operational, it is operationalized and its definition is added to the clause under construction. An operational rule might be the literal lessThan; a non-operational rule might be between ← lessThan, lessThan.
Initial rules
The addition of non-operational rules to the knowledge base increases the size of the space which FOCL must search. Rather than simply providing the algorithm with a target concept, the algorithm takes as input a set of non-operational rules which it tests for correctness and operationalizes for its learned concept. A correct target concept will clearly improve computational time and accuracy, but even an incorrect concept will give the algorithm a basis from which to work and improve accuracy and time.