Back to practice exercises.
1: Background Reading
2: Learning Goals
 Represent a simple domain using Datalog.
 Create Datalog interpretations.
 Verify whether an interpretation is a model of a Datalog knowledge base.
3: Directed Questions
 Is the expression in(building, Adam) ground? [solution]
 How many terms are in the following definite clause? uffish(vorpal, tulgey)←slithy ∧burbled(Borogrove,raths). [solution]
 Given a variable assignment ρ and a constant mapping φ, can you always generate a mapping from each variable to a constant? [solution]
4: Exercise: Rockpaperscissors
In case you don't know how to play rockpaperscissors, please read over the game play description provided by Wikipedia. Consider the following representation of rockpaperscissors:
 constants: r, p, s
 predicate symbols: beats
 D={rock, paper, scissors}
 φ(r) = rock, φ(p) = paper, φ(s) = scissors
The knowledge base is defined by:
 beats(r,s).
 beats(s,p).
 beats(p,r).
 Create an interpretation that is a model of the knowledge base and corresponds to the rules of rockpaperscissors. Assume that "beats(X,Y)" means that X beats Y in a rockpaperscissors game. [solution]
 Create an interpretation that is a model of the knowledge base but does not correspond to the rules of rockpaperscissors. [solution]
 Create an interpretation that is a not a model of the knowledge base. [solution]
 How many interpretations are there which satisfy the representation of rockpaperscissors given above? [solution]
 Of the possible interpretations, how many are models of the knowledge base? [solution]
 Consider the following rule: "beats(X,Z) ← beats(X,Y) ∧ beats(Y,Z)". Is this rule consistent with the knowledge base? If not, modify the head of the rule to make it consistent. Is this rule true in the intended interpretation? If not, modify the head of the rule to make it true in the intended interpretation. [solution]
5: Learning Goals Revisited
 Represent a simple domain using Datalog.
 Create Datalog interpretations.
 Verify whether an interpretation is a model of a Datalog knowledge base.
