Professional Documents
Culture Documents
Logical Reasoning
Proofs Techniques
Natural Deduction
Resolution
Examples
Evaluation and Design
Inconsistency and Overlap
Simulation and Planning
Premise: p
Conclusion: (p ⁄ q)
Premise: p
Non-Conclusion: (p Ÿ q)
Premises: p, q
Conclusion: (p Ÿ q)
3
Logical Entailment
{p} |= (p ⁄ q)
{p} |# (p Ÿ q)
{p,q} |= (p Ÿ q)
4
Problem
Even without variables, the number of models to be checked
can be exceedingly large. There are, in general, infinitely many
models to check.
5
Natural Deduction
6
Patterns
A pattern is a parameterized expression, i.e. an expression
satisfying the grammatical rules of our language except for
the occurrence of meta-variables (Greek letters) in place of
various subparts of the expression.
Sample Pattern:
j fi (y fi j)
Instance:
p fi (q fi p)
Instance:
(p fi r) fi ((pfiq) fi (p fi r))
7
Rule of Inference
A rule of inference is a rule of reasoning consisting of one
set of sentence patterns, called conditions, and a second
set of sentence patterns, called conclusions.
j fi y
j
y
8
Rule Instances
An instance of a rule of inference is a rule in which all meta-
variables have been consistently replaced by expressions in
such a way that all premises and conclusions are syntactically
legal sentences.
p fi (q fi r) ( p fi q) fi r
p p fi q
q fi r r
9
Logical Rules of Inference
A logical rule of inference is one in which the conditions
in every instance of the rule logically entail the
conclusions.
10
Some Logical Rules of Inference
Modus Ponens (MP) Modus Tolens (MT)
j ÿy
j fi y j fi y
y ÿj
j jŸy
y j
jŸy y
11
Logical Schemata
A logical schema is a sentence pattern all instances are true in
all models.
Sample Pattern:
j fi (y fi j)
Instance:
p fi (q fi p)
Instance:
(p fi r) fi ((pfiq) fi (p fi r))
12
Rules and Schemata
Axiom Schemata as Rules of Inference
j fi (y fi j) j fi (y fi j )
13
Standard Axiom Schemata
II: j fi (y fi j)
ID: (j fi (y fi c)) fi ((j fi y) fi (j fi c))
NE: (ÿj fi y) fi ((ÿj fiÿy) fi j)
QE: (j ¤ y) fi (j fi y)
QE: (j ¤ y) fi (y fi j)
QI: (j fi y) fi ((y fi j) fi (j ¤ y))
RE: (j ‹ y) ¤ (y fi j)
OE: (j ⁄ y) ¤ (ÿj fi y)
AE: (j Ÿ y) ¤ ÿ(ÿj ⁄ ÿy)
UD: "n.(j fi y) fi ("n.j fi"n.y)
UG: j fi "n.j
UI: "n.j fi j[n¨t] where t is free for n in j
!
EE: $n.j(n) ¤ j(t) where t is a new constant
EI: j(t) fi $n.j(n)
14
Standard Proof
A standard proof of a conclusion from a set of premises is a
sequence of sentences containing the conclusion in
which each item is one of the following:
1. A premise
15
Example
16
Example
Everybody loves somebody. Everybody loves a lover. Show
that Jack loves Jill.
1. "x.$y.loves(x,y) Premise
2. "u."v."w.(loves(v,w) fi loves(u,v)) Premise
3. $y.loves(jill,y) UI: 1
4. loves(jill,joe) EI: 3
5. "v."w.(loves(v,w) fi loves(jack,v)) UI: 2
6. "w.(loves(jill,w) fi loves(jack,jill)) UI: 5
7. loves(jill,joe) fi loves(jack,jill) UI: 6
8. loves(jack,jill) MP: 4, 7
17
Example
Whenever p is true, q is true. Whenever q is true, r is true.
Prove that, whenever p is true, r is true.
1. p fi q Premise
2. q fi r Premise
3. (q fi r) fi ( p fi (q fi r)) II
4. p fi (q fi r) MP : 3,2
5. ( p fi (q fi r)) fi (( p fi q) fi (p fi r)) ID
6. ( p fi q) fi ( p fi r) MP : 5, 4
7. p fi r MP : 6,1
18
Provability
A sentence j is provable from a set of sentences D (written as
D |- j) if and only if there is a standard proof of j from D.
19
Soundness and Completeness
Soundness: Our proof system is sound, i.e. if the conclusion is
provable from the premises, then the premises logically entail
the conclusion.
(D |- j) fi (D |= j)
(D |= j) fi (D |- j)
20
Decidability
A class of questions is decidable if and only if there is a
procedure such that, when given as input any question in the
class, the procedure halts and says yes if the answer is positive
and no if the answer is negative.
21
Semidecidability of Logical Entailment
goal
kb
rules
proof <- kb
r <- choose(rules)
p <- choose(proof)
q <- choose(proof)
c <- apply(r,p,q)
proof <- proof|c
22
Non-decidability of Logical Entailment
Note that we have not shown that logical entailment is
decidable. In fact, it can be shown that it is not decidable.
23
Other Proof Systems
Deductive Calculi (forward reasoning):
Standard Proof System
Sequent Calculus (Gentzen)
24
Resolution
25
Overview
26
Algebra
Xavier is three times as old as Yolanda. Xavier's age and
Yolanda's age add up to twelve. How old are Xavier and
Yolanda?
x - 3y = 0
x + y = 12
-4y = -12
y=3
x=9
27
Rule of Inference
Rule of Inference
p1 Ÿ ... Ÿ pk fi q1 ⁄ ... ⁄ ql
r1 Ÿ ... Ÿ rm fi s1 ⁄ ... ⁄ sn
p1 Ÿ ... Ÿ pk Ÿ r1 Ÿ ... Ÿ rm fi q1 ⁄ ... ⁄ ql ⁄ s1 ⁄ ... ⁄ sn
28
Examples
q(a) ‹ p(a) q(a) ‹ p(a) q(a) ‹ p(a)
p(a) ‹ ‹ q(a) r(a) ‹ q(a)
q(a) ‹ ‹ p(a) r(a) ‹ p(a)
q(y) ‹ p(a,y)
p(x,b) ‹ m(x)
???
29
Substititions
A substitution is a finite set of pairs of variables and
terms. The variables together constitute the domain of the
substitution, and the terms are called replacements.
p(x,x,y,z){x¨a,y¨b,v¨b}=p(a,a,b,z)
30
Unification
A substitution s is a unifier for an expression j and an
expression y if and only if js=ys.
p(x,y){x¨a,y¨b,v¨b}=p(a,b)
p(a,v){x¨a,y¨b,v¨b}=p(a,b)
p(x,x)
p(a,b)
31
Resolution
y1⁄ …⁄ yj ‹ yj+1 Ÿ…Ÿy Ÿ… Ÿ ym
j1⁄ …⁄j ⁄ …⁄ jk ‹ jk+1Ÿ…Ÿ jn
(j1 ⁄…⁄y1⁄…⁄y j ⁄… jk ‹yj+1Ÿ…Ÿ jk+1Ÿ…Ÿjn …Ÿym)s
where s is a unifier of j and y
32
Factoring
33
Example
1. m(a) ‹ Premise
2. p(x) ‹ m(x) Premise
3. q(x) ‹ m(x) Premise
4. r(x) ‹ p(x) Ÿ q(x) Premise
5. ‹ r(a) Goal
6. ‹ p(a) Ÿ q(a) 4, 5
7. ‹ m(a) Ÿ q(a) 2, 6
8. ‹ q(a) 1, 7
9. ‹ m(a) 3, 8
10. ‹ 1,9
34
Determining Logical Entailment
To determine whether a set D of sentences logically entails a
closed sentence j, start with D and try to find a proof of j.
35
Example
Show that q(x) ‹ p(x) and p(a) logically entail $z.q(z).
36
Alternate Method
Basic Method: To determine whether a set D of sentences
logically entails a closed sentence j, start with D and try to
find a standard proof of j.
37
Example
Show that q(x) ‹ p(x) and p(a) logically entail $z.q(z).
38
Answer Extraction Method
Alternate Method: To determine whether a set D of sentences
logically entails a closed sentence j, start with D»{j fi goal}
and try to find a formal proof of goal.
39
Example
Given q(x) ‹ p(x) and p(a), find a term t such that q(t) is
true.
40
Example
Given q(x) ‹ p(x) and p(a) and p(b), find a term t such that
q(t) is true.
41
Example
Given q(x) ‹ p(x) and p(a) ⁄ p(b), find a term t such that
q(t) is true.
42
Examples
43
Subsumption
Existing Law:
legal(e,“Owner”) ‹ owner(e,x) Ÿ affiliation(x,cs)
Prospective Law:
legal(e,“Owner”) ‹ owner(e,x) Ÿ office(x,y) Ÿ in(y,gates)
Background Knowledge:
affiliation(x,cs) ‹ office(x,y) Ÿ in(y,gates)
Technique:
Assume conditions hold for arbitrary values of variables.
Prove that conclusion holds.
44
Proof
45
Inconsistency
Existing Law:
legal(e) ‹
owner(e,x) Ÿ location(e,gates104) Ÿ faculty(x)
Prospective Law:
ÿlegal(e) ‹
owner(e,x) Ÿ location(e,gates104) Ÿ ÿaffiliation(x,cs)
Technique:
Assume conditions hold for arbitrary values of variables.
Prove the negation of the conclusion.
46
Proof
47
Blocks World
clear(x) - true of x iff it has no blocks above it.
table(x) - true of x iff it is resting on the table.
on(x,y) - true of x and y iff x is immediately on y.
clear(a)
table(c)
on(a,b)
on(b,c)
48
Laws of Change
true(on(x,y), do(s(x,y),s))‹
true(clear(x),s) Ÿ true(clear(y),s) Ÿ true(table(x),s)
true(on(x,z), do(m(x,y,z),s)) ‹
true(clear(x),s) Ÿ true(on(x,y),s) Ÿ true(clear(z),s)
true(clear(y), do(m(x,y,z),s)) ‹
true(clear(x),s) Ÿ true(on(x,y),s) Ÿ true(clear(z),s)
49
Laws of Inertia
true(clear(u),do(s(x,y),s))‹ true(clear(u),s) Ÿ u≠y
true(table(v),do(s(x,y),s))‹ true(table(v),s) Ÿ v≠x
true(on(u,v),do(s(x,y),s)) ‹ true(on(u,v),s)
true(clear(u),do(u(x,y),s))‹ true(clear(u),s)
true(table(v),do(u(x,y),s))‹ true(table(v),s)
true(on(u,v),do(u(x,y),s)) ‹ true(on(u,v),s) Ÿ u≠x
50
Simulation
Show that the plan u(c,a), s(a,b) results in a state in which a is
on b when executed in a state in which c is on a, b and c are
clear, and a and b are on the table.
1. true(table(a),s1) ‹
2. true(clear(b),s1) ‹
3. true(table(b),s1) ‹
4. true(clear(c),s1) ‹
5. true(on(c,a),s1) ‹
6. goal ‹ true(on(a,b), do(s(a,b),do(u(c,a),s1)))
51
Proof
1. true(table(a),s1) ‹
2. true(clear(b),s1) ‹
3. true(table(b),s1) ‹
4. true(clear(c),s1) ‹
5. true(on(c,a),s1) ‹
6. goal ‹ true(on(a,b), do(s(a,b),do(u(c,a),s1)))
7. goal ‹ true(clear(a), do(u(c,a),s1)) Ÿ
true(clear(b), do(u(c,a),s1)) Ÿ
true(table(a), do(u(c,a),s1))
8. goal ‹ true(clear(c), s1) Ÿ
true(on(c,a), s1) Ÿ
true(clear(b), do(u(c,a),s1)) Ÿ
true(table(a), do(u(c,a),s1))
52
Proof
9. goal ‹ true(clear(b), do(u(c,a),s1)) Ÿ
true(table(a), do(u(c,a),s1))
10. goal ‹ true(clear(b), s1) Ÿ
true(table(a), do(u(c,a),s1))
11. goal ‹ true(table(a), do(u(c,a),s1))
12. goal ‹ true(table(a), s1)
13. goal ‹
53
Planning
Find a plan that results in a state in which a is on b when
executed in a state in which c is on a, b and c are clear, and
a and b are on the table.
1. true(table(a),s1) ‹
2. true(clear(b),s1) ‹
3. true(table(b),s1) ‹
4. true(clear(c),s1) ‹
5. true(on(c,a),s1) ‹
6. goal(s) ‹ true(on(a,b),s)
54
Proof
1. true(table(a),s1) ‹
2. true(clear(b),s1) ‹
3. true(table(b),s1) ‹
4. true(clear(c),s1) ‹
5. true(on(c,a),s1) ‹
6. goal(w) ‹ true(on(a,b),w)
7. goal(do(s(a,b),v) ‹ true(clear(a),v) Ÿ
true(clear(b),v) Ÿ
true(table(a),v)
8. goal(do(s(a,b),do(u(z,a),u)) ‹ true(on(z,a),u) Ÿ
true(on(z,a),u) Ÿ
true(clear(b),do(u(z,a),u))) Ÿ
true(table(a),do(u(z,a),u)))
55
Proof
8. goal(do(s(a,b),do(u(z,a),u)) ‹ true(on(z,a),u) Ÿ
true(clear(z),u) Ÿ
true(clear(b),do(u(z,a),u))) Ÿ
true(table(a),do(u(z,a),u)))
9. goal(do(s(a,b),do(u(c,a),s1)) ‹ true(clear(c),s1) Ÿ
true(clear(b),do(u(c,a),s1))) Ÿ
true(table(a),do(u(c,a),s1)))
11. goal(do(s(a,b),do(u(c,a),s1)) ‹
true(clear(b),do(u(c,a),s1))) Ÿ
true(table(a),do(u(c,a),s1)))
… as before …
n. goal(do(s(a,b),do(u(c,a),s1)) ‹
56
Path Constraints
A path constraint is a constraint on the way in which a goal is
achieved, i.e. the actions or states leading from the initial state
to a goal state.
legal(s1)
legal(do(x,s)) ‹ true(on(x,y),s) Ÿ legal(s)
1. true(table(a),s1) ‹
2. true(clear(b),s1) ‹
3. true(table(b),s1) ‹
4. true(clear(c),s1) ‹
5. true(on(c,a),s1) ‹
6. goal(s) ‹ true(on(a,b),s)
7. legal(s1) ‹
8. legal(do(x,s)) ‹ true(on(x,y),s) Ÿ legal(s)
9. plan(s) ‹ goal(s) Ÿ legal(s)
58
Limitations of Deduction
59
Negation as Failure
Law:
ÿlegal(e,“Ownership”) ‹
owner(e,x) Ÿ location(e,gates104) Ÿ ÿaffiliation(x,cs)
60
Analogical Reasoning
Much legal reasoning is analogy on a current case to a
previous case.
61