You are on page 1of 3

Subject : AI

Dr. Yasser Fouad

Logic Sheet

1. Convert the following English sentences into first-order predicate calculus


i) Someone in Madison likes pizza.
ii) Everyone who likes ham also likes cheese.
iii) Fido is always either sleeping or barking.
iv) Except for BillG, for every person there exists someone richer.
v) Mary is tall and Bill is not.
vi) Some dogs are tiny.
vii) All of Picasso’s paintings are valuable.
viii) All the houses near Sue’s house are either large or old (or both).
ix) Brothers are siblings.
x) ‘Sibling’ is symmetric.
xi) One’s mother is one’s female parent.
xii) A first cousin is a child of a parent’s sibling.

2. Use the following rule based to give an example of application of one


inference mechanism. Facts A and b are initially given:
IF A THEN E
IF A AND B THEN C
IF C THEN D
IF D THEN G
IF E AND D THEN F

3. Consider a domain where the individuals are people and languages. Let L be
the first-order language with the following primitives:
S(X,L) --- Person X speaks language L.
C(X,Y) --- Persons X and Y can communicate.
I(W,X,Y) --- Person W can serve as an interpreter between persons X and Y.
J, P,E, F --- Constants: Joe, Pierre, English, and French respectively.
a) Express the following statements in L:

i. Joe speaks English. ii Pierre speaks French.

iii. If X and Y both speak L, then X and Y can communicate.


iv. If W can communicate both with X and with Y, then W can serve as an interpreter
between X and Y.

v. For any two languages L and M, there is someone who speaks both L and M.

vi. There is someone who can interpret between Joe and Pierre.

Show how (vi) can be proven from (i)---(v) using backward-chaining resolution.

4. Below we have a simple rule-based system for selecting a holiday. In this system
the goals are the available holiday destinations and a forward-chaining inference
mechanism is to be used. If rule inference is to continue until all possible goals
are derived show the order in which goals will be derived. Consider that conflict
resolution gives priority to most recently instantiated rules first and to rules with
most complex premise after that.
Goals: NileCruise, Majorca, Crete, DivingAustralia, BallyBunnion
Available Facts: SpanishSpeaking, Budget, Nightlife,SunSeaSand
R1 If Budget and SunSeaSand and Nightlife Then SunPackage
R2 If Budget and SunSeaSand Then BallyBunnion
R3 If MoneyNoObject Then LongHaul
R4 If Adventure and LongHaul and SunSeaSand Then DivingAustralia
R5 If NightLife and SunPackage Then Majorca and Crete
R6 If NightLife and SunPackage and SpanishSpeaking Then Majorca
R7 If Culture and MoneyNoObject Then NileCruise

5. Consider the following sentences:


• Hassan likes all kinds of food. • Apples are food.
• Chicken is food. • Anything anyone eats and isn’t killed by is food.
• Mona eats peanuts and is still alive. • Ahmed eats everything Bill eats.
(a) Represent these sentences in first order logic.
(b) Convert the negation of the statement “What food does Ahmed eat” to logic form.
(c) Answer this question “What food does Ahmed eat” using resolution and answer
extraction.

6. Translate this sentence into first order predicate logic:

“An elephant is happy if all its children can fly”

Use these predicates:

happy(x) is read as “x is happy” fly(x) is read as “x can fly”


child(x,y) is read as “x is a child of y” elephant(x) is read as “x is an elephant”
7. formalize the somewhat sentence “Men who are pirated have beards” using the
following
Man (x): x is a man
Pirate (x): x is a pirate
Beard (x): x is a beard
Has (x, y): x has y
8. 8. Translate into first order logic the sentence “Everyone’s DNA is unique and is
derived from their parents’ DNA.” You must specify the precise intended
meaning of your vocabulary terms

You might also like