You are on page 1of 4

Answers for proposed exercises as practice for Mid2 exam.

Propositional Logic

7.4 In all cases, the question can be resolved easily by referring to the definition of entailment.
a. False |= True is true because False has no models and hence entails every sentence
AND because True is true in all models and hence is entailed by every sentence.
b. True |= False is false.
c. (A ∧ B) |= (A ⇔B) is true because the left-hand side has exactly one model that is
one of the two models of the right-hand side.
d. A ⇔B |= A ∨ B is false because one of the models of A ⇔B has both A and B
false, which does not satisfy A ∨ B.
e. A ⇔B |= ¬A ∨ B is true because the RHS is A ⇒ B, one of the conjuncts in the
definition of A ⇔B.
f. (A∨ B) ∧ (¬C ∨ ¬D∨ E) |= (A ∨ B ∨ C) ∧ (B ∧ C ∧ D ⇒ E) is true. The RHS is
equivalent to (A ∨ B ∨ C) ∧ (¬B ∨ ¬C ∨ ¬D ∨ E); so both conjuncts of the LHS are
weakened on the RHS by the addition of disjuncts, allowing more models.
g. (A∨ B)∧ (¬C ∨ ¬D∨ E) |= (A∨ B)∧ (¬D∨ E) is false; removing a disjunct allows
fewer models.
h. (A ∨ B) ∧ ¬(A ⇒ B) is satisfiable; model has A and ¬B.
i. (A ∧ B) ⇒ C |= (A ⇒ C) ∨ (B ⇒ C) is true because the RHS is false only
when both disjuncts are false, i.e., when A and B are true and C is false, in which case the LHS is also false.
This may seem counterintuitive, and would not hold if ⇒ is
interpreted as “causes.”
j. (C ∨ (¬A∧ ¬B)) ≡ ((A ⇒ C)∧ (B ⇒ C)) is true; proof by truth table enumeration,
or by application of distributivity (Fig 7.11).
k. (A ⇔B) ∧ (¬A ∨ B) is satisfiable; RHS is entailed by LHS so models are those of
A ⇔B.
l. (A ⇔B) ⇔C does have the same number of models as (A ⇔B); half the
models of (A ⇔B) satisfy (A ⇔B) ⇔C, as do half the non-models, and there
are the same numbers of models and non-models.

7.10
a. Valid.
b. Neither.
c. Neither.
d. Valid.
e. Valid.
f. Valid.
g. Neither.

7.17
a. A simple truth table has eight rows, and shows that the sentence is true for all models
and hence valid.
b. For the left-hand side we have:
(Food ⇒ Party) ∨ (Drinks ⇒ Party)
(¬Food ∨ Party) ∨ (¬Drinks ∨ Party)
(¬Food ∨ Party ∨ ¬Drinks ∨ Party)
(¬Food ∨ ¬Drinks ∨ Party)
and for the right-hand side we have
(Food ∧ Drinks) ⇒ Party
¬(Food ∧ Drinks) ∨ Party
(¬Food ∨ ¬Drinks) ∨ Party
(¬Food ∨ ¬Drinks ∨ Party)
The two sides are identical in CNF, and hence the original sentence is of the form
P ⇒ P, which is valid for any P.
c. To prove that a sentence is valid, prove that its negation is unsatisfiable. I.e., negate
it, convert to CNF, use resolution to prove a contradiction. We can use the above CNF
result for the LHS.
¬[[(Food ⇒ Party) ∨ (Drinks ⇒ Party)] ⇒ [(Food ∧ Drinks) ⇒ Party]]
[(Food ⇒ Party) ∨ (Drinks ⇒ Party)] ∧ ¬[(Food ∧ Drinks) ⇒ Party]
(¬Food ∨ ¬Drinks ∨ Party) ∧ Food ∧ Drinks ∧ ¬Party
Each of the three unit clauses resolves in turn against the first clause, leaving an empty
clause.

7.19 The CNF representations are as follows:


S1: (¬A ∨ C ∨ E) ∧ (¬C ∨ A) ∧ (¬E ∨ A).
S2: (¬E ∨ D).
S3: (¬B ∨ ¬F ∨ ¬C).
S4: (¬E ∨ C).
S5: (¬C ∨ F).
S6: (¬C ∨ B).

7.25
a. St+1 ⇔[(St ∧ at) ∨ (¬St ∧ bt)].
b. Because the agent can do exactly one action, we know that bt ≡ ¬at so we replace bt
throughout. We obtain four clauses:
1: (¬St+1 ∨ St ∨ ¬at)
2: (¬St+1 ∨ ¬St ∨ at)
3: (St+1 ∨ ¬St ∨ ¬at)
4: (St+1 ∨ St ∨ at)
c. The goal is (¬St ∧ at) ⇒ ¬St+1. Negated, this becomes three clauses: 5: ¬St; 6: at;
7: St+1. Resolving 5, 6, 7 against 1, we obtain the empty clause.

FOL

8.4 ∃ x, y x ≠y ∧ ∀ z x=z ∨ y =z stipulates that there are exactly two objects.

8.6 Validity in first-order logic requires truth in all possible models:


a. (∃ x x=x) ⇒ (∀ y ∃ z y =z).
Valid. The LHS is valid by itself—in standard FOL, every model has at least one object;
hence, the whole sentence is valid iff the RHS is valid. (Otherwise, we can find a model
where the LHS is true and the RHS is false.) The RHS is valid because for every value
of y in any given model, there is a z—namely, the value of y itself—that is identical to
y.
b. ∀ x P(x) ∨ ¬P(x).
Valid. For any relation denoted by P, every object x is either in the relation or not in it.
c. ∀ x Smart (x) ∨ (x=x).
Valid. In every model, every object satisfies x=x, so the disjunction is satisfied regardless
of whether x is smart.
8.9
a. O(E, S) ∨ O(E,L).
b. O(J,A) ∧ ∃ p p ≠A ∧ O(J, p).
c. ∀ p O(p, S) ⇒ O(p,D).
d. ¬∃ p C(J, p) ∧ O(p,L).
e. ∃ p B(p,E) ∧ O(p,L).
f. ∃ p O(p,L) ∧ ∀ q C(q, p) ⇒ O(q,D).
g. ∀ p O(p, S) ⇒ ∃ q O(q,L) ∧ C(p, q).

8.10
a. Every cat loves its mother or father.
(i) ∀ x Cat (x) ⇒ Loves(x,Mother (x) ∨ Father (x)).
(2) Syntactically invalid. Cannot have a disjunction inside a term.
(ii) ∀ x ¬Cat(x) ∨ Loves(x,Mother (x)) ∨ Loves(x,Father (x)).
(1) Correct. (Rewrite as implication with disjunctive consequence.)
(iii) ∀ x Cat (x) ∧ (Loves(x,Mother (x)) ∨ Loves(x,Father (x))).
(3) Incorrect. Use of ∧ with ∀ means that everything is asserted to be a cat.
b. Every dog who loves one of its brothers is happy.
(i) ∀ x Dog(x) ∧ (∃ y Brother (y, x) ∧ Loves(x, y)) ⇒ Happy(x).
(1) Correct.
(ii) ∀ x, y Dog(x) ∧ Brother (y, x) ∧ Loves(x, y) ⇒ Happy(x).
(1) Correct. Logically equivalent to (i).
(iii) ∀ x Dog(x) ∧ [∀ y Brother (y, x) ⇔Loves(x, y)] ⇒ Happy(x).
(3) Incorrect. States that dogs are happy if they love all of, and only, their brothers.
c. No dog bites a child of its owner.
(i) ∀ x Dog(x) ⇒ ¬Bites(x,Child(Owner (x))).
(3) Incorrect. Uses Child as a function instead of a relation.
(ii) ¬∃ x, y Dog(x) ∧ Child(y,Owner (x)) ∧ Bites(x, y).
(1) Correct.
(iii) ∀ x Dog(x) ⇒ (∀ y Child(y,Owner (x)) ⇒ ¬Bites(x, y)).
(1) Correct. Logically equivalent to (ii).
(iv) ¬∃ x Dog(x) ⇒ (∃ y Child(y,Owner (x)) ∧ Bites(x, y)).
(3) Incorrect. Uses ⇒ with ∃ .
d. Everyone’s zip code within a state has the same first digit.
(i) ∀ x, s, z1 [State(s) ∧ LivesIn(x, s) ∧ Zip(x)=z1] ⇒
[∀ y, z2 LivesIn(y, s) ∧ Zip(y)=z2 ⇒ Digit(1, z1)=Digit(1, z2)].
(1) Correct.
(ii) ∀ x, s [State(s) ∧ LivesIn(x, s) ∧ ∃ z1 Zip(x)=z1] ⇒
[∀ y, z2 LivesIn(y, s) ∧ Zip(y)=z2 ∧ Digit(1, z1)=Digit(1, z2)].
(2) Syntactically invalid. Uses z1 outside scope of its quantifier. Also uses ∧ as
the main connective in the universally quantified RHS.
(iii) ∀ x, y, s State(s)∧ LivesIn(x, s)∧ LivesIn(y, s) ⇒ Digit(1, Zip(x)=Zip(y)).
(2) Syntactically invalid. Cannot use equality within a term.
(iv) ∀ x, y, s State(s) ∧ LivesIn(x, s) ∧ LivesIn(y, s) ⇒
Digit(1, Zip(x))=Digit(1, Zip(y)).
(1) Correct. Since Zip is a function, there is no need to define additional variables
to name the zip codes.

8.11
a. People who speak the same language understand each other.
b. Suppose that an extended interpretation with x → A and y → B satisfy
SpeaksLanguage(x, l) ∧ SpeaksLanguage(y, l)
for some l. Then from the second sentence we can conclude Understands (A,B). The
extended interpretation with x → B and y → A also must satisfy
SpeaksLanguage(x, l) ∧ SpeaksLanguage(y, l) ,
allowing us to conclude Understands(B,A). Hence, whenever the second sentence
holds, the first holds.
c. Let Understands(x, y) mean that x understands y, and let Friend(x, y) mean that x
is a friend of y.
(i) It is not completely clear if the English sentence is referring to mutual understanding
and mutual friendship, but let us assume that is what is intended:
∀ x, y Understands(x, y)∧ Understands(y, x) ⇒ (Friend(x, y)∧ Friend(y, x)).
(ii) ∀ x, y, z Friend(x, y) ∧ Friend(y, z) ⇒ Friend(x, z).

Inference in FOL

9.4 This is an easy exercise to check that the student understands unification.
a. {x/A, y/B, z/B} (or some permutation of this).
b. No unifier (x cannot bind to both A and B).
c. {y/John, x/Jerry}.
d. No unifier (because the occurs-check prevents unification of y with Father(y)).

9.6 We use a very simple ontology to make the examples easier:


a. Horse(x) ⇒ Mammal(x)
Cow(x) ⇒ Mammal(x)
Pig(x) ⇒ Mammal(x).
b. Offspring(x, y) ∧ Horse(y) ⇒ Horse(x).
c. Horse(Bluebeard).
d. Parent(Bluebeard,Charlie).
e. Offspring(x, y) ⇒ Parent(y, x)
Parent(x, y) ⇒ Offspring(y, x).
(Note we couldn’t do Offspring(x, y) ⇔Parent(y, x) because that is not in the form
expected by Generalized Modus Ponens.)
f. Mammal(x) ⇒ Parent(G(x), x) (here G is a Skolem function).

You might also like