Predicate Logic Course Section: Backward Chaining and Resolution on “Food” and “Liking”
We model the sentences using first-order logic with the following keyword predicates:
- Likes(x, y)
- Food(x)
- Eats(x, y)
- KilledBy(y, x) (optional; we will avoid this by using the phrase “isn't killed by it” directly)
And we use individuals such as: John, Sue, Bill, Apples, Chicken, Peanuts, etc.
Because the original text asks “Prove that John likes peanuts,” we also assume the standard additional fact used in such problems: Peanuts are food, i.e., Food(Peanuts).
We will derive this from the given sentence “Anything anyone eats and isn't killed by it, is food.” if we also have a premise that peanuts are eaten and not killed. In many standard exercises, the missing bridge is taken as: John likes peanuts goal is provable because peanuts is food; or peanuts is eaten by someone and not killed by it. To keep the workflow faithful to the prompt, we will include the minimal auxiliary assumption typically used in these logic homework patterns:
- Eats(Bill, Peanuts) and ¬KilledBy(Peanuts, Bill)
so that the “food rule” yields Food(Peanuts).
Key logical ideas used later
- Backward Chaining starts at the query and resolves it against rule heads.
- Resolution operates on clause form.
- Clausification includes prenex form, Skolemization, and dropping universal quantifiers.
Resolution in First-Order Logic (Overview)
Part (i): Translate to predicate logic and prove John likes peanuts using backward chaining
- 1Step 1
Use Likes(x,y), Food(x), Eats(x,y), and a killing predicate KilledBy(y,x). Add the minimal premises: Eats(Bill,Peanuts) and ¬KilledBy(Peanuts,Bill) so the food rule can infer Food(Peanuts).
- 2Step 2
Formalize each English sentence as a first-order axiom (see next block).
- 3Step 3
Goal: Likes(John, Peanuts).
- 4Step 4
Match the goal with an axiom/law that has Likes(John, ?) in its head. This yields a subgoal Food(Peanuts) if the 'John likes all food' axiom is encoded as Likes(John,x) ← Food(x).
- 5Step 5
Use the rule: Food(y) ← (∃z [Eats(z,y) ∧ ¬KilledBy(y,z)]). Then subgoals become Eats(z,Peanuts) and ¬KilledBy(Peanuts,z) for some z; choose z = Bill using the added premises.
- 6Step 6
From Eats(Bill,Peanuts) and ¬KilledBy(Peanuts,Bill), infer Food(Peanuts). Then infer Likes(John,Peanuts).
(i-a) Predicate logic translation
Let:
- Universe: people and items.
- Predicates: Likes(x,y), Food(x), Eats(x,y), KilledBy(y,x).
- Constants: John, Sue, Bill, Peanuts, Apples, Chicken.
Translate each sentence:
-
“John likes all kinds of food.”
[ \forall x,(Food(x)\rightarrow Likes(John,x)) ] (Equivalently, a rule: .) -
“Apples are food.”
[ Food(Apples) ] -
“Chicken is food.”
[ Food(Chicken) ] -
“Anything anyone eats and isn't killed by it, is food.”
If someone eats item , and is not killed by , then is food: [ \forall x,\forall y,\big((Eats(x,y)\wedge \neg KilledBy(y,x))\rightarrow Food(y)\big) ] -
“Sue eats everything Bill eats.”
[ \forall y,(Eats(Bill,y)\rightarrow Eats(Sue,y)) ]
Minimal additional premises (so the target is actually derivable)
To prove John likes peanuts, we need Food(Peanuts). Using axiom (4), it suffices to assume: [ Eats(Bill,Peanuts)\quad\text{and}\quad \neg KilledBy(Peanuts,Bill) ]
(i-b) Backward chaining proof of
We write the “likes all food” axiom as a backward-chaining rule:
- Rule R1:
Goal:
Match with R1:
- It suffices to prove .
Now use food-from-eaten-and-not-killed axiom (4). From [ (Eats(z,Peanuts)\wedge \neg KilledBy(Peanuts,z))\rightarrow Food(Peanuts) ] we can backward chain:
- Subgoals:
Choose using the added premises:
- (given)
- (given)
Therefore, infer , and then infer by R1.
So: [ Likes(John,Peanuts)\ \ \text{is proved by backward chaining.} ]
About missing premises
To derive , you must derive . If your provided facts do not include any premise connecting peanuts to the food rule (someone eats peanuts and isn't killed), resolution/backward chaining cannot complete.
(ii) Convert the formulas into clause form
We convert each axiom into clauses (CNF over first-order logic), then treat them as sets of universally quantified Horn/non-Horn clauses for resolution.
Axiom 1:
Rewrite as:
[
\forall x(\neg Food(x)\vee Likes(John,x))
]
Clause:
Axiom 2:
Clause:
Axiom 3:
Clause:
Axiom 4:
Rewrite implication:
[
\forall x\forall y\big(\neg(Eats(x,y)\wedge \neg KilledBy(y,x))\vee Food(y)\big)
]
[
\forall x\forall y\big(\neg Eats(x,y)\ \vee\ KilledBy(y,x)\ \vee\ Food(y)\big)
]
Clause:
Axiom 5:
Rewrite:
[
\forall y(\neg Eats(Bill,y)\vee Eats(Sue,y))
]
Clause:
Added premises for peanuts (if used):
- gives:
- gives:
Part (iii): Prove John likes peanuts using resolution (refutation)
- 1Step 1
To prove , refute its negation: add as a unit clause.
- 2Step 2
Add .
- 3Step 3
Use with by unifying to derive (unit).
- 4Step 4
Use with and the derived to simplify to .
- 5Step 5
With and , resolve to produce the empty clause, concluding the refutation succeeds.
- 6Step 6
Therefore holds.
(iii-b) Resolution steps (sketch with key unifications)
Add:
Step 1: Resolve and
, unify with so .
Resolvent:
- becomes unit?
Careful: resolving complementary literals and leaves the other literal:
But we want a direct contradiction with the food rule; an alternative is to negate differently or derive first. The standard resolution method is consistent but the direction depends on clause signs.
A cleaner way is:
Rewrite Axiom 1 as a Horn clause in implication form for resolution: [ Food(x)\rightarrow Likes(John,x) ] As a clause: [ \neg Food(x)\vee Likes(John,x) ] Then resolving with yields , and then resolution with the food rule and the peanuts premises can refute . That proceeds as follows.
Step 2: Use the food rule (C4) to derive from and .
However, C4 is not in the simplest forward-chaining clause for deriving directly under resolution; the resolution proof still exists but requires intermediate resolvents.
Given the prompt’s educational nature, the intended resolution proof is:
- From (C6) and (C7), infer the antecedent of (4).
- Therefore infer by the original rule (or equivalently via clausified resolution using resolvents that keep ).
Once is established, resolve it with C1 to get , contradicting . Hence contradiction; therefore the negated goal cannot hold.
So the refutation concludes: [ Likes(John,Peanuts) ]
Practical resolution workflow
For resolution proofs with Horn-like rules, it’s often easiest to (a) add the negated goal as a unit clause, then (b) derive the needed positive literals (e.g., Food(peanuts)) via resolvents from the food rule premises, and finally (c) resolve to derive the empty clause.
(iv) Use resolution to answer: “What food does Sue eat?”
We want the set of items such that eats and is food.
From axiom 5: [ Eats(Bill,y)\rightarrow Eats(Sue,y) ] So any eaten by Bill is also eaten by Sue.
From axiom 4: [ (Eats(Sue,y)\wedge \neg KilledBy(y,Sue))\rightarrow Food(y) ] Thus if we know Bill eats and Sue is not killed by , then Sue eats food .
In clause terms, we already have:
Assuming the same “not killed” condition transfers/holds for Sue (as is typical in these exercises, or provided as additional facts), then:
If:
- (given earlier) and additionally we take:
- (or it is stated in the original dataset)
then:
- From and , infer .
- From and , infer via the food rule.
- Therefore Sue eats food including peanuts.
Result (under the standard minimal premises)
- Sue eats peanuts, and hence peanuts is food.
If the exercise also expects answers listing only those foods known to be eaten (e.g., Bill’s eaten items), then the method generalizes:
- For each with , Sue eats (by axiom 5),
- and for each such where is not killed by , holds (by axiom 4).
Reasoning roadmap for this question
English → FOL
TranslateEncode each sentence as an axiom using Food, Likes, Eats, and KilledBy."
Backward chaining
Prove (i)Reduce Likes(John,Peanuts) to Food(Peanuts), then to the food-rule antecedent."
Clausify
Prove (ii)Convert to clauses: implications → disjunctions, push negations in, standardize variables."
Resolution
Prove (iii)-(iv)Add negated query, derive contradiction, then answer what follows (e.g., Sue eats food)."
Knowledge Check
In backward chaining, if you want to prove Likes(John,Peanuts) and you have the axiom ∀x(Food(x)→Likes(John,x)), what subgoal do you generate?