Handouts today: the graded second assignments.
The substitution that unifies the two loves literals is a set of two bindings: { y := x, z := mother(x) }forall x loves(x,mother(x))
forall y,z loves(y,z) -> likes(y,z)
Applying the substitution S is usually written using postfix notation. The equation pS = qS says that after applying S to p and to q, the results are syntactically identical. Terminology: we say that S unifies p and q, or that S is a unifying substitution for p and q.
There is a standard algorithm that given two sentences, finds their unique most general unifying substitution. Notes:
The substitution that unifies two terms can have size exponential in the size of the input terms. For example, consider unifying A = P( f(a,a) g(u,u) h(v,v) i(w,w) ) and B = P(u,v,w,x). The unifying substitution is
{ u := f(a,a)What this example shows is that the usual notation for writing down terms should be avoided. Good data structures for implementing unification and resolution are beyond the scope of this course.
v := g(f(a,a),f(a,a))
w := h( g(f(a,a),f(a,a)), g(f(a,a),f(a,a)) )
x := ... }
Definition: A control strategy for resolution is complete if its use preserves refutation-completeness, i.e. if false can be proved, it can be proved while respecting the strategy.
If a policy allows only a finite number of possible resolutions, then theorem-proving always terminates in bounded time. In this case completeness must fail because it would contradict the fact that FOL is only semi-decidable, and not decidable.
Any policy that places a fixed upper bound on the length of the clauses that may be used in a proof only allows a finite number of resolutions, hence is incomplete. This means that allowing axioms to be used multiple times is not enough to preserve completeness.
Unit resolution is the policy that at least one parent of each resolution step must be a unit clause, i.e. a single literal. Unit resolution is what we called unit propagation when discussing the DPLL algorithm for propositional satisfiability.
Under unit resolution the conclusion of each resolution step is shorter than its non-unit parent, so unit resolution must be incomplete. For example, it fails to derive false from these four clauses:
Input resolution is the policy that at least one parent of each resolution step must be in the original knowledge base, or part of the negated goal. The eats(jo,fish) proof from last week is an example of input resolution.{ P v Q ~P v Q P v ~Q ~P v ~Q }
This strategy is not complete either, but it can be efficient. It fails on the same example as unit resolution. (Just assume that any one of the four clauses is the negated goal.)
Both unit resolution and input resolution are complete when all clauses are Horn clauses. A Horn clause is a clause with at most one positive literal.
Unit preference is the heuristic of prioritizing resolutions
where one parent is a unit clause. This heuristic does not
actually eliminate any resolutions. It can be used in combination
with other strategies that do, without changing their completeness or
incompleteness
Usually, the set of support consists of the clauses obtained by negating the goal, plus all descendants of these clauses. Intuitively, with this strategy, the goal "supports" each resolution, at least indirectly, so each resolution is relevant to obtaining a contradiction.
Theorem: This choice of the supporting set yields a complete
strategy if the original knowledge base is consistent.
Proof idea: In this case we'll never obtain a contradiction without
using the negated goal somehow.
Note that the set of support increases at each step of the proof because each descendant of the original set of support (i.e. the clauses making up the negated goal) is added to the set of support.
Set-of-support resolution works effectively on the dolphin example. Given this knowledge base:
To prove that there exists someone who is intelligent but can't read, we refute that "intelligent implies can read," that is we prove false from that. Starting with the negated goal ~i(z) v r(z) the proof is:Those who can read are literate: ~r(x) v l(x)
Dolphins are not literate: ~d(y) v ~l(y)
Some dolphins are intelligent: d(a)
i(a)
Notice that at each step of the proof, from top to bottom, the set of support strategy gave us only one choice about which resolution to perform next, given the heuristic of always using the clause proved most recently.~i(z) v r(z) i(a)
------------------------
r(a) ~r(x) v l(x)
--------------------------------
l(a) ~d(y) v ~l(y)
---------------------------------
~d(a) d(a)
--------------
false