Tut 4
Tut 4
1. Use propositional logic to answer the following question. The following statements about
Pat, Ray and Quincy are all true. Do NOT attempt to use predicate logic to answer this
question.
3∗ . A binary predicate p/2 can be thought of as a directed graph G p , where the vertices of
the graph Gp is the domain of p and there is a directed edge between vertices x and y if
and only if p(x, y) is true. Describe, or draw this graph for the following predicates.
Domain = Z, p(x, y) is true if y = x + 1
Domain = the digits {0, 1, . . . , 9} and p(x, y) is true if the two digit number xy
is prime (here xy refers to the juxtaposition of x and y)
This representation of a predicate can often be useful in thinking about whether certain
sentences are valid or not. Consider the sentence ∀x ∃y p(x, y). Explain in graph theoretic
terms what this is saying about the graph G p , and therefore show that there is some
interpretation for this sentence which is not a model.
1
Explain what the result of the following query will be, and why.
?- p(c,a).
5. Which of the formulae are true and which are false (justify it):
6∗ . Let L be the first order language with constant symbols a and b, function symbols f /1
and g/2, and predicate symbols p/2, q/1 and r/2. Consider the following interpretation of
L:
For each of the following formula write out the English meaning of the sentence, and find
its truth value:
∀x r(b, x)
∀x r(x, a)
∀x p(f (x), x)
q(x)←p(x, a)
p(a, b)←p(a, g(x, x))
r(x, y)← ∼p(x, y)
∀x ∃y p(x, y)