Automated
Theorem Proving: Exercise 4
Reiner Hähnle and Antonio Flores
Solution Discussion: 20th June, 2014
Problem 1 Formalisation
Below you find two logic puzzles. Please provide if necessary the solution of the puzzles and for each of them a formula
in first-order logic for which is valid if and only if the solution of the puzzle is correct.
Problem 1.1 The murderer is always the butler, or?
Lady Irene lives in a house on a small island together with her nephew Marc and her butler John. They are the
only inhabitants of the house. One day Irene was found brutally killed.
Interrogations and social science helped to establish the following facts: A murder always hates his victim, and
is never richer than the victim. But no one hates everyone. Lady Irene was also a very difficult person to live
with and hated everyone except the butler. The butler hates at least everyone who was hated by Irene and in
particular everyone not richer than Irene. Marc hates no one hated by Irene.
Who killed Irene?
Hint: The correct formalisation uses an implicit assumption not mentioned explicitly here as it is implied by
common sense when using natural language.
Problem 1.2 Animal’s World
Wolves, foxes, birds, caterpillars, and snails are animals, and there are some of each of them. Also there are
some grains, and grains are plants. Every animal either likes to eat plants or animals much smaller than itself
that like to eat some plants. Caterpillars and snails are much smaller than birds, which are much smaller than
foxes, which in turn are much smaller than wolves. Wolves do not like to eat foxes or grains, while birds like to
eat caterpillars but not snails. Caterpillars and snails like to eat some plants.
Therefore there is an animal that likes to eat a grain eating animal.
Problem 1.3 Verification
Install leanCop(http://www.leancop.de) on your machine and try to prove your formalisations. The installation requires one of several prolog interpreters eclipse (not he IDE), swi-prolog or
Use the following input format as described in the readme file:
f ( < fol_formula > ) .
in which < fol_formula > is a first-order formula built from Prolog terms (atomic formulae), the logical connectives ’∼’
(negation), ’;’ (disjunction), ’,’ (conjunction), ’=>’ (implication), ’<=>’ (equivalence), and the logical quantifiers ’al l X :’
(universal) and ’ex X :’ (existential) where X is a Prolog variable.
For example the formula (p ∧ (∀x)(p → q(x))) → q(a) becomes
f( ((p , all X:(p=>q(X))) => q(a)) ).
If the problem file contains equality (’=’) all equality axioms are automatically added. You do not need to declare function
symbols, but can just use them directly, e.g.
f( ((p , ex X: g(x) = a, all X:(p=>q(g(X)))) => q(a)) ).
1
Problem 2 First-Order Resolution
Problem 2.1
Prove the unsatisfiability of the following clause sets using resolution:
a) {{¬ f (x), ¬g(x), i(x)}, {¬ f (x), ¬h(x), i(x)}, {¬i(x), ¬h(x), j(x)}{¬k(x), h(x)}, { f (a)}, {k(a)}, {¬ j(a)}}
b) {{ f (a)}, {¬g(a)}, {¬ f (x), h(x)}{¬ j(x), ¬i(x), f (x)}, {¬h(x), g(x), ¬h( y), ¬i( y)}, { j(b)}, {i(b)}}
Problem 2.2
Prove that the following theorem from set theory is correct using resolution:
(∀x)(∀ y)((x ⊆ y ∧ y ⊆ x) → x = y)
using the following axiomatization (you only need those) for subset and equality
• (∀x)(∀ y)(x ⊆ y ↔ (∀u)(u ∈ x → u ∈ y))
• (∀x)(∀ y)(x = y ↔ (∀u)(u ∈ x ↔ u ∈ y))
Hint: Do not forget that resolution proves unsatisfiability.
Problem 3 Inductive Model construction
given the clause set:
S = {{¬ f , ¬g, i}, {¬ f , ¬h, i}, {¬i, ¬h, j}{¬k, h}, { f }, {k}, {¬ j}}
And the following order over the literals:
f < g <h<i < j <k
Construct IC and εC for each C ∈ S .
Which clauses are productive? Which are counter-examples of the defined model IS ?
Problem 4 Completeness of Basic Ground Resolution
Prove the following lemma (assuming the definition of IS as given in the lecture):
Lemma.
a) All clauses in a ground clause set S with a positive maximal literal are satisfied by IS .
b) If D0 D are clauses in S and I D ∪ ε D 6|= D0 , then IS 6|= D0 .
Problem 5 Soundness of First-Order Resolution
Prove that the first-order binary resolution rule is sound, i.e., if clauses C , D are true in a model M, then any of their
resolvents is true in M as well.
Problem 6 Completeness of First-Order Resolution
Prove the lifting lemma for first-order resolution derivations:
Lemma. Let C , D, E be new instances of clauses in S .
If Eτ is a ground resolvent (factor) of ground clause(s) Cτ, Dτ then there is a first-order resolvent (factor) Eσ of instances
of C , D with Eσρ = Eτ for a suitable ρ .
2
© Copyright 2026 Paperzz