2.3 Inductive Logic Programming
2.3.2 Basic Concepts of Inductive Logic Programming
ILP algorithms aim at learning logic programs, i. e. essentially clause sets, often restricted to Prolog style, from examples that are also represented as logic pro-grams. For instance, from positive examples such as member(b, [a,b,c]). and negative examples such as :- member(d, [a,b,c]). the recursive definition of member/2 (2 means that the membership predicate takes two arguments here, i. e. the arity of the member predicate) as given in the preceding section should be learned.
Often, ILP learning tasks thus involve to get from an extensional definition of a so-called target predicate to a more compact intensional definition; in other words, from examples in the form of ground facts to non-ground rules. These rules should then be applicable to unseen examples, for instance, in order to classify them as positive or negative, i. e. belonging to the target concept or not.
Background Knowledge
A distinctive feature of ILP is the usage of background knowledge beside the examples. For instance, the member/2 predicate definition might also be provided as input for learning of other predicates that model aspects of working with lists.
Actually, there are different views on background knowledge to be found in the ILP literature.
Often, all predicate definitions except that for the target predicate are consid-ered to be background knowledge [135]. Occasionally, however, only items that exist independently of the specific learning examples are regarded as background knowledge [108]. Here, “independent” means that the corresponding piece of knowledge is not of concern for one example only, as information about exclusive parts of the example would be, for instance. An example is provided with the original representation of the KRK.illegal learning task, cf. Appendix B.
We adopt to the first view of background knowledge. Further, we take the perspective that ILP methods in a wider sense can include those that learn from multi-relational representations but do not necessarily arrive at knowlege repre-sented in the form of logic programs.
Bias
If the aim is learning logic programs, the hypothesis spaces are usually huge.
In order to successfully search here, an appropriate bias is necessary. Bias may concern the language used as well as search itself. Nedellec and colleagues [92]
further distinguish validation bias from those named before, which is responsible for decisions about when to stop search. We also find other categorizations in the literature, e. g. syntactic bias vs. semantic bias [91]. All the authors agree, however, that it is useful to make bias as explicit as possible, arriving at a declar-ative bias, which is easy to manipulate by the user and even a basis for reasoning about and changing of the bias used in a certain learning situation.
We already introduced a kind of language bias with Horn clauses, which are the basis for Prolog’s facts, rules, and queries.
In Prolog rule bodies, negation is allowed, which is why we deal with program clauses here.
Definition 4 If argument positions for atoms are typed, we arrive at deductive database (DDB) clauses. Typing means that for each argument position, an in-formation is provided which set of values can be associated with those arguments.
Note the resemblance to relational databases in this respect.
Definition 5 Further restrictions can be put on those clauses to arrive at de-ductive hierarchical database (DHDB) clauses, where recursive structures in both predicate and type definitions are not allowed.
Other types of clauses that are frequently used in ILP are the following.
Definition 6 A clause is a constrained clause iff all body variables also occur in the head of the rule.
Definition 7 Determinate clauses have determinate body literals. A literal is determinate iff all “new” variables have a unique binding given the bindings of all the other, the “old” variables. Old variables occur earlier in the clause, i. e.
to the left of the literal in focus. Prolog will have found bindings for those old variables when it comes to considering the current literal.
Binding a variable means here especially substitution with a constant. Thus, determinacy of a literal is given iff there is either (a) exactly one substitution for new variables such that the literal can be derived by the Prolog program given, or (b) no such substitution.
Case (b) is often not emphasized in the literature, but see Nienhuys-Cheng and Wolf [93, p. 335]. Restricting the definition to case (a) would mean that information might be lost, similar to a situation with missing outer joins in rela-tional databases. For further processing, a special constant “?” is often used in ILP systems to indicate an equivalent for the NULL value in RDBs.
2.3. INDUCTIVE LOGIC PROGRAMMING 23
Example 7 Given two target examples described by Prolog ground and unstruc-tured facts: p(1,a). and p(2,b)., further a single background knowledge fact, also ground and unstructured: q(2,c). The Prolog clause p(X,Y) :- q(X,Z). is determi-nate according to our definition, although there is no q literal for the first example in the background knowledge.
With a definition restricted to case (a), the clause would not be considered determinate, and predicate q would be neglected for learning by corresponding systems.
If a body literal uses variables from the head only, apart from new variables, those new variables are defined to have depth 1. If a body literal uses old variables with maximum depth n and introduces new variables, the latter have depth n+1.
A clause is an i-determinate clause if there occur variables in the clause of depth at most i.
Definition 8 A clause is a linked clause iff there is at least one old variable among the arguments of each body literal.
Further kinds of language bias, which are often applied, are restrictions to function-free hypothesis languages and to ground facts for examples, often for background knowledge as well. There were also methods proposed to transform non-ground knowledge into ground facts, cf. hints given by Lavraˇc and Flach [77].
The same authors provide examples for further simple kinds of language bias, e. g.
by restricting the number of literals in clauses, or the number of variables.
Considering search bias, there are many approaches to constructing logic pro-grams from examples. For instance, in a top-down approach, rules are built by successively adding literals. The choice of those literals may be made w. r. t.
certain criteria such as information gain, cf. Section 2.1.
Usually, there is a trade-off to be made here. With a very strict bias, efficiency of learning will be high, but the hypothesis searched for may not be in the chosen language or missed during search. With a more relaxed bias, more hypotheses are in the realms of search, which may then take much longer, though.
Subsumption and Coverage
Further basic concepts in ILP are those of subsumption and coverage.
Subsumption, also called θ-subsumption, refers to a relation between clauses.
For two clauses C and D, C subsumes D if there exists a substitution θ such that Cθ ⊆ D, i. e. every literal in Cθ is also in D. A part of the relevance of subsumption is expressed in the subsumption theorem, cf. details provided by Nienhuys-Cheng and Wolf [93], which states important relationships with logical consequence. Subsumption will also play a role within our approach as presented in the following chapters.
Coverage means the following here. Given a first-order hypothesis containing rules and ground background knowledge B. Then, a ground example e is said to be covered by the hypothesis, if it contains a rule T ← Q with T θ = e and Qθ ⊆ B. This is called extensional coverage by Lavraˇc and Dˇzeroski [76].