Assignment On PL FOL
Assignment On PL FOL
Q1. If a Unicorn is Mythical, then it is immortal, but if it is not mythical, then it is a mortal mammal. If
the unicorn is either immortal or a mammal, then it is horned. The unicorn is magical if it is horned.
Q2. According to some political pundits, a person who is radical (R) is electable (E) if he/she is
conservative (C), but otherwise is not electable.
(i) (R ∧ E) ⇐⇒ C
(ii) R ⇒ (E ⇐⇒ C)
a. Determine, using enumeration, whether this sentence is valid, satisfiable (but not valid), or
unsatisfiable.
b. Convert the left-hand and right-hand sides of the main implication into CNF, showing each step,
and explain how the results confirm your answer to (a).
Q4.
( PersonInFrontOfCar ⇒ Brake )
∧ ( Policecar ⇒ Policeman )
∧ ( Snow ⇒ Slippery )
∧ ( Slippery ⇒ ¬Dry )
∧ ( RedLight ⇒ Brake )
∧ ( Winter ⇒ Snow )
a. False |= True.
b. True |= False.
c. (A ∧ B) |= (A ⇔ B).
d. A ⇔ B |= A ∨ B.
e. A ⇔ B |= ¬A ∨ B.
f. (A ∧ B) ⇒ C |= (A ⇒ C) ∨ (B ⇒ C).
k. (A ⇔ B) ∧ (¬A ∨ B) is satisfiable.
Q6. Consider a vocabulary with only four propositions, A, B, C, and D. How many models
a. B ∨ C.
c. (A ⇒ B) ∧ A∧ ¬B ∧ C ∧ D.
Q7. Decide whether each of the following sentences is valid, unsatisfiable, or neither. Verify
your decisions using truth tables or the equivalence rules of Figure 7.11 (page 249).
a. Smoke ⇒ Smoke
b. Smoke ⇒ Fire
S1: A ⇔ (B ∨ E).
S2: E ⇒ D.
S3: C ∧ F ⇒ ¬B.
S4: E ⇒ B.
S5: B ⇒ F.
S6: B ⇒ C
Assignment – FOL: try a minimum of 5 and 8.9 from the problems below.
8.4 Write down a logical sentence such that every world in which it is true contains
exactly one object.
8.9 This exercise uses the function MapColor and predicates In(x, y), Borders(x,
y), and Country(x), whose arguments are geographical regions, along with
constant symbols for various regions. In each of the following we give an English
sentence and a number of candidate logical expressions. For each of the logical
expressions, state whether it (1) correctly expresses the English sentence; (2) is
syntactically invalid and therefore meaningless; or (3) is syntactically valid but
does not express the meaning of the English sentence.
a. We can write diagnostic rules leading DIAGNOSTIC RULE from observed effects to
hidden causes. For finding pits, the obvious diagnostic rules say that if a square
is breezy, some adjacent square must contain a pit; and if a square is not breezy,
then no adjacent square contains a pit. Write these two rules in first-order logic
and show that their conjunction is logically equivalent to the given Equation
b. We can write causal rules leading from cause to effect. One obvious causal
rule is that a pit causes all adjacent squares to be breezy. Write this rule in first-
order logic, explain why it is incomplete compared to the given Equation, and
supply the missing axiom.
A typical family tree. The symbol “ ” connects spouses and arrows point to
children.
8.17 Explain what is wrong with the following proposed definition of adjacent
squares in the wumpus world:
∀ x, y Adjacent ([x, y], [x + 1, y]) ∧ Adjacent ([x, y], [x, y + 1]) .
8.18 Write out the axioms required for reasoning about the wumpus’s location,
using a constant symbol Wumpus and a binary predicate At(Wumpus, Location).
Remember that there is only one wumpus.
8.19 Assuming predicates Parent(p, q) and Female(p) and constants Joan and
Kevin, with the obvious meanings, express each of the following sentences in
first-order logic. (You may use the abbreviation ∃1 to mean “there exists exactly
one.”)
a. Joan has a daughter (possibly more than one, and possibly sons as well).
b. Joan has exactly one daughter (but may have sons as well).
c. Joan has exactly one child, a daughter.
d. Joan and Kevin have exactly one child together.
e. Joan has at least one child with Kevin, and no children with anyone else.
8.23 For each of the following sentences in English, decide if the accompanying
first-order logic sentence is a good translation. If not, explain why not and correct
it. (Some sentences may have more than one error!)
a. No two people have the same social security number.
¬∃ x, y, n Person(x) ∧ Person(y) ⇒ [HasSS#(x, n) ∧ HasSS#(y, n)].
b. John’s social security number is the same as Mary’s.
∃ n HasSS#(John, n) ∧ HasSS#(Mary, n).
c. Everyone’s social security number has nine digits.
∀ x, n Person(x) ⇒ [HasSS#(x, n) ∧ Digits(n, 9)].
d. Rewrite each of the above (uncorrected) sentences using a function symbol
SS#instead
of the predicate HasSS#.
8.25 Write a general set of facts and axioms to represent the assertion
“Wellington heard about Napoleon’s death” and to correctly answer the question
“Did Napoleon hear about Wellington’s death?”
8.27 Obtain a passport application for your country, identify the rules
determining eligibility
for a passport, and translate them into first-order logic,
9.4 For each pair of atomic sentences, give the most general unifier if it exists:
a. P(A,B,B), P(x, y, z).
b. Q(y,G(A,B)), Q(G(x, x), y).
c. Older(Father (y), y), Older (Father (x), John).
d. Knows(Father (y), y), Knows(x, x).
9.6 Write down logical representations for the following sentences, suitable for
use with Generalized Modus Ponens:
a. Horses, cows, and pigs are mammals.
b. An offspring of a horse is a horse.
c. Bluebeard is a horse.
d. Bluebeard is Charlie’s parent.
e. Offspring and parent are inverse relations.
f. Every mammal has a parent.
9.10 A popular children’s riddle is “Brothers and sisters have I none, but that
man’s father is my father’s son.” Use the rules of the family domain (Section
8.3.2 on page 301) to show who that man is. You may apply any of the inference
methods described in this chapter. Why do you think that this riddle is difficult?
9.13 In this exercise, use the sentences you wrote in Exercise 9.6 to answer a
question by
using a backward-chaining algorithm.
a. Draw the proof tree generated by an exhaustive backward-chaining algorithm
for the
query ∃ h Horse(h), where clauses are matched in the order given.
b. What do you notice about this domain?
c. How many solutions for h actually follow from your sentences?
d. Can you think of a way to find all of them? (Hint: See Smith et al. (1986).)
Problem:
problem:
The law says that it is a crime for an American to sell weapons to hostile nations. The
country Nono, an enemy of America, has some missiles, and all of its missiles were sold
to it by Colonel West, who is American. prove that West is a criminal.
9.19 Suppose a knowledge base contains just the following first-order Horn
clauses:
Ancestor(Mother(x), x)
Ancestor(x, y) ∧ Ancestor(y, z) ⇒ Ancestor(x, z)
Consider a forward chaining algorithm that, on the jth iteration, terminates if the
KB contains a sentence that unifies with the query, else adds to the KB every
atomic sentence that can be inferred from the sentences already in the KB after
iteration j − 1.
a. For each of the following queries, say whether the algorithm will (1) give an
answer (if so, write down that answer); or (2) terminate with no answer; or (3)
never terminate.
(i) Ancestor(Mother(y), John)
(ii) Ancestor(Mother(Mother(y)), John)
(iii) Ancestor(Mother(Mother(Mother(y))),Mother(y))
(iv) Ancestor(Mother(John),Mother(Mother(John)))
b. Can a resolution algorithm prove the sentence ¬Ancestor(John,John) from the
original knowledge base? Explain how, or why not.
c. Suppose we add the assertion that ¬(Mother(x)=x) and augment the resolution
algorithm with inference rules for equality. Now what is the answer to (b)?
9.20 Let L be the first-order language with a single predicate S(p, q), meaning “p
shaves q.” Assume a domain of people.
a. Consider the sentence “There exists a person P who shaves every one who
does not shave themselves, and only people that do not shave themselves.”
Express this in L.
b. Convert the sentence in (a) to clausal form.
c. Construct a resolution proof to show that the clauses in (b) are inherently
inconsistent.
(Note: you do not need any additional axioms.)
9.21 How can resolution be used to show that a sentence is valid? Unsatisfiable?
9.23 From “Horses are animals,” it follows that “The head of a horse is the head
of an
animal.” Demonstrate that this inference is valid by carrying out the following
steps:
a. Translate the premise and the conclusion into the language of first-order logic.
Use three predicates: HeadOf (h, x) (meaning “h is the head of x”), Horse(x), and
Animal (x).
b. Negate the conclusion, and convert the premise and the negated conclusion
into conjunctive normal form.
c. Use resolution to show that the conclusion follows from the premise.