0% found this document useful (0 votes)
18 views

Tut 4

This document contains a tutorial on artificial intelligence and logic programming. It discusses using propositional logic to answer questions, logic program refutation, representing predicates as graphs, and the truth values of quantified logical formulas.

Uploaded by

Djamen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

Tut 4

This document contains a tutorial on artificial intelligence and logic programming. It discusses using propositional logic to answer questions, logic program refutation, representing predicates as graphs, and the truth values of quantified logical formulas.

Uploaded by

Djamen
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Artificial Intelligence and Logic Programming - Tutorial 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.

I love at least one of the three


If I love Pat, but not Ray, then I also love Quincy
I love both Ray and Quincy or I love neither one
If I love Ray, then I also love Pat

Which of the three do I love?

2∗ . Consider the following logic program P


p(X, Y )←q(X, Y )
q(Y, X)←p(X, X), q(X, Y )
q(X, Z)←q(X, Y ), q(Y, Z)
q(a, X)
Show by refutation that q(b, b) is a logical consequence of this program. Find a model for
this logic program.

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.

4∗ . Let P be the logic program


p(a,b) ←
p(c,b) ←
p(X,Z) ←p(X,Y), p(Y,Z)
p(X,Y) ←p(Y,X)
Demonstrate that the goal ←p(c, a) has a refutation. Now consider the Prolog program
p(a,b).
p(c,b).
p(X,Z) :- p(X,Y), p(Y,Z).
p(X,Y) :- p(Y,X)

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):

(i) ∼∃x Φ(x) ⇐⇒ ∀x ∼Φ(x)


(ii) ∀x Φ(x) ∧ ∀x Ψ(x) ⇐⇒ ∀x (Φ(x) ∧ Ψ(x))
(iii) ∀x Φ(x) ∨ ∀x Ψ(x) ⇐⇒ ∀x (Φ(x) ∨ Ψ(x))
(iv) ∃x Φ(x) ∧ ∃x Ψ(x) ⇐⇒ ∃x (Φ(x) ∧ Ψ(x))

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:

The domain D is the set of integers


The function symbol f represents the successor function f : x → x + 1
The function symbol g represents the product function g(x, y) = x · y
The constants a and b are assigned to 0 and 1, respectively
The predicate symbol p represents binary predicate “>” (that is p(x, y) is true
if x > y)
The predicate symbol q represents unary predicate “is greater than zero” (so,
q(x) is true if x > 0)
The predicate symbol r represents binary predicate “divides” (so, r(x, y) is true
if x divides y)

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)

Assoc. Prof. R. Kozera

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy