> :=?; @H0n@f@DTimes Symboln0 @H0n@fPDSymbolSymboln0 @H0n@f`DCourier Newln0 @H0n@fpDArial Unicode MS0 @H0n@f"
`.
@n?" dd@ @@`` =5

_(
8*/0`DTimes New Roman@XYjXDArialNew Roman@XYjX DWingdingsRoman@XYjX0DEuclid Symboln@XYjX@DTimes Symboln@XYjXPDSymbolSymboln@XYjX`DCourier Newln@XYjXpDArial Unicode MS@XYjX"
`.
@n?" dd@ @@`` =5

!0e0eA@A5%8c8c
?1d0u0@Ty2 NP'p<'p@A)BCDE?@8rʚ;2Nʚ;g4hdhd4X@Pppp@<4!d!dP g@<4ddddP g@<4BdBdP @nx___PPTMac11R@f hnamd`
Arial&Monotype Typography hnamd`
Arial&Monotype Typography hnamd`
Arial&Monotype Typography hnamd`
Arial&Monotype Typography hnamd`
Arial&Monotype Typography (namd Symbol*33ff v___PPT9XP8h___PPT2001D<4X@?%&M7Artificial Intelligence 7. Making Deductive InferencesHCourse V231
Department of Computing
Imperial College, London
Jeremy Gow(I>
Automating Deductive Reasoning`Aims of automated deduction
Deduce new knowledge from old
Prove/disprove some open conjectures
Theorem proving
Search for a path from axioms to theorem statement
Operators are (sound) inference rules
Applications:
Agents that use deductive inference
Mechanising and automating mathematics
Verifying hardware and software specifications
The semantic webCYCAhInference RulesA entails B iff
B is true when A is true
Any model of A is a model of B
Then this is a sound inference rule
A
B
Axioms C D & Z Theorem
Each step is application of inference rule
Theorem is entailed by the axioms8$!M8( 7Tautologies8S: (X(YZ))((XY) (XZ))
Show that no matter what truth values for X, Y and Z
The statement S is always true
Columns 7 and 8 are always the same~" Z5" Z(" Z$" Z5($t(<Inference with TautologiesPQ QP is obviously true
Regardless of meaning or truth values of P and Q
This is contentfree and a tautology
One way to define a rule of inference:
We can replace PQ with QP, and vice versa
They are true for same models
Replacing one for other preserves soundnessV(v$
f Equivalence RulesA and B are logically equivalent (write A B)
Same models for each
Can replace any instance of A with an instance of B without affecting models
Formalised as rewrite rule A B
Also B A
Must avoid looping A B A B ...
Choose one direction, or always loopcheck
Rewrite rules used for inference
Showing theorem and axioms are equivalent
Preprocessing theorem/axioms into a particular formatJ/b!\!`
b,!`Y(!Commutativity & AssociativityCommutativity
PQ QP
PQ QP
PQ QP
Associativity
(PQ)R P(QR)
(PQ)R P(QR)8$(
"Distributivity of Connectivest and over or and or over and :
P (Q R) (P Q) (P R)
P (Q R) (P Q) (P R)
Over implication
P (Q R) (P Q) (P R)
P (Q R) (P Q) (P R)<!DD! >0!34#Double NegationHave to be careful in English
I m not not hungry
Does not (necessarily) mean: I m hungry
But double negations can always be removed
P P
Humans would not write this
But it may appear in during agent s inference?,
.?& .,L$ @De Morgan s Law & ContrapositiondDe Morgan s Law (refers to either)
(P Q) P Q
(P Q) P Q
Contraposition: imagine the opposite is true
P Q Q P
Often useful in mathematics proof
#,"#
, ">,R/&Other Equivalences(Remove implication or equivalence (very useful)
P Q P Q
P Q (P Q) (Q P)
Reduce to truth value
P P False
P P True0!0 'An Example Deductionx(P Q) (P Q)
Show that this sentence is false
Show that this rewrites to False
This proves the negation
See notes for solution (or do as exercise)
Is this easier than a truth table?":N":N(
Propositional Inference RulesvRewrite rules are good for bidirectional search
But we don t need equivalence, just entailment
Classic example
All men are mortal, socrates is a man
Therefore: Socrates is mortal
This is an instance of an inference rule
Known as Modus Ponens (Aristotle)
AB, A
B
Above line: what we know, below: what we can deduce0/D)"
40/D)
<,8)Soundness of Modus Ponens>Every model of top sentences is a model of the bottom sentence*AndElimination & IntroductionTAndElimination:
A1 A2 & An
Ai
[1 i n]
AndIntroduction:
A1, A2, & , An
A1 A2 & An
The sentences may be from different places
Selected from the databaseB ,
++!OrIntroduction & Unit ResolutionOrintroduction
Ai
A1 A2 & An
[1 i n]
Unit resolution
(A B) B
A
Basis for resolution theorem proving
See next two lectures
DZZZZZ%ZZZ$,FirstOrder Inference Rules:Propositional inference rules (inc. equivs)
Can all be used in firstorder inference
Firstorder inference more complicated
Soundness depends on concept of models
Potentially infinite models, can t use a truth table
Sentences contain quantifiers
Need the notion of ground substitution,)N5',)N5$Substitution & InstantiationFOL sentences have quantified variables
Substitute into a variable by assigning a particular value
Replace with given term, remove quantifier
Instantiation (grounding) is a kind of substitution
Must substitute a ground term
Example: "X."Y.likes(X,Y) becomes likes(tony, george)
We write:
Subst({X/tony, Y/george}, likes(X,Y)) = likes(tony,george)(f4A;([
' ;!6.Universal Elimination
/Existential EliminationGiven a sentence, A
Containing an existentially quantified variable, V
Then we can replace V by any constant, k
As long as k is not mentioned anywhere else
$V.A
Subst({V/k}, A)
For the sake of argument, let s call it&
ZZZZZ)ZZ\(60Existential IntroductionGiven a sentence, A
And a variable, V, which is not used in A
Then any ground term, g, in A can be substituted by V
As long as g does not appear in A also
A
$V. Subst({g/V},A)
Exercise: find sentence where V is in A
Such that this inference rule is not sound`'(+6'(+>B^(51Chains of InferenceRemember the problem we re trying to solve
Search for a path from axioms, A, to theorem, T
Three approaches
Forward chaining
Backward chaining
Proof by contradiction
Specification of a search problem:
Representation of states (firstorder logic sentences)
Initial state (depends...)
Operators (inference rules, including equivalences)
Goal state (depends...)+0:#+0:#2Forward ChainingTDeduce new facts from axioms
Deduce new facts from these, etc.,&
Hopefully end up deducing the theorem statement
Can take a long time: not using the goal to direct searchFZ$ZjZ$j3Backward Chaining
Start with the theorem state and work backwards
Hope to end up at the axioms
Each step asks: given the state that I m at...
Which operator could have been applied to which state to produce the state (sentence) I m at
No problem when using equivalences
Can also use a bidirectional search (from both ends)
Difficult when using general inference rules
Many possible ways to invert operators
0ZZ/Z]Z#Z5ZZ(Z0/]#5(4Proof By Contradiction" Reductio ad absurdum
Assume theorem is false
then show that the assumption contradicts the axioms
which proves that the theorem is true
Add negated theorem to the set of axioms
See if we can deduce the False sentence
Advantage: using the theorem statement from start
Can look to see how close we are to the false statement
Possibilities for a heuristic search!
Basis for resolution theorem proving/[)*28&%/[)*28&% 52Example: using the Otter resolution theorem prover,Input to Otter:
set(auto).
formula_list(usable).
all x (man(x)>mortal(x)). % For all x, if x is a man then x is mortal
man(socrates). % Socrates is a man
mortal(socrates). % Socrates is immortal (note: negated)
end_of_list.
Output from Otter:
 PROOF 
1 [] man(x)mortal(x).
2 [] mortal(socrates).
3 [] man(socrates).
4 [hyper,3,1] mortal(socrates).
5 [binary,4.1,2.1] $F.
 end of proof  Nz ` 3ffffƍ` 3f3fff̙3ff̙` ______` 3f33>?" dZ@$?lKd@
l@
P`lA n?" dd@ @@``PT @ ` `p>>$
(
<T
"h
s*"h
s*""
<`uG0*"p`
@
6u "@t
T Click to edit Master title style!
!$
0u "@t
RClick to edit Master text styles
Second level
Third level
Fourth level
Fifth level!
S
`@u
??" @t
D*
`u
??":Z t
D*
`u
??"5t
H*^T
"n"
0G"r
B
T??B
s*h ? 3f3fff̙3ff̙ Capsules 3(
6u"@
@ "
<uG0*"pp
@
<u "4
W#Click to edit Master subtitle style$
$lT
"n"
B
0G"Rr
T??"L
`u
??" @
H*
``u
??"
D*
`p
??"x
H*
`.
??"NnR
T Click to edit Master title style!
!B
s*h ? 3f3fff̙3ff̙`8(
0 P
$
>*
0 $
@*
6 `P $
>*
6 ` $
@*H
0h ? ̙3380___PPT10.
`` ??
7true
Z??@ Z
Z
?
`
??Z
7true
Z??Z@ Z
Z
@
`
??Z
7true
Z??Z@
A
`??
7true
Z??@
B
``??
7true
Z??@
C
`
??
8false
Z?? @0e0eA@A5%8c8c
?1
D
`
??
7true
Z?? @ *
*
E
``I??*
8false
Z??* @ *
*
F
`I??*
8false
Z??* @
G
`J??
7true
Z?? @ Z
Z
H
`@K??Z
7true
Z??Z @ Z
Z
I
`L??Z
7true
Z??Z @
J
`L??
7true
Z?? @
K
`M??
7true
Z?? @
L
`@N??
8false
Z?? @
M
`O??
8false
Z?? @ *
*
N
`O?? *
7true
Z?? *@ *
*
O
`P??*
8false
Z??* @
P
`@Q??
7true
Z?? @ Z
Z
Q
`R?? Z
7true
Z?? Z@ Z
Z
R
`R??Z
7true
Z??Z @
S
`S??
7true
Z?? @
T
`@T??
7true
Z?? @ &
&
U
`??&
8false
Z??&@ &
&
V
`??&
8false
Z??&@ *&
*&
W
`??*&
8false
Z??*&@ *&
*&
X
`??*&
8false
Z??*&@ &
&
Y
`??&
7true
Z??&@ Z&
Z&
Z
`@??Z&
7true
Z??Z&@ Z&
Z&
[
`??Z&
7true
Z??Z&@ &
&
\
`??&
7true
Z??&@ &
&
]
`??&
7true
Z??&
Z??(r
S@@
< 0
H
0h ? 3f3fff̙3ff̙
( '
'
l
C0(@
l
C(@
H
0h ? 3f3fff̙3ff̙
$(
r
S@
r
S
H
0h ? 3f3fff̙3ff̙
$(
r
S@
r
S@0pP
H
0h ? 3f3fff̙3ff̙
$(
r
S@
r
S`@
H
0h ? 3f3fff̙3ff̙
$(
r
S`@
r
S`@P
H
0h ? 3f3fff̙3ff̙
$(
r
S@
r
S@
H
0h ? 3f3fff̙3ff̙
$(
r
S@
r
S
H
0h ? 3f3fff̙3ff̙
$(
r
S@
r
S0@`
H
0h ? 3f3fff̙3ff̙n
(
r
S@
r
SpP
B
ZD??
H
0h ? 3f3fff̙3ff̙
JB0)ܬ(
r
S0@
r
S`p
f
L
۬#"& \
Ѭ
Zp
??L
MFalse @`
Ϭ
Z
??
MFalse @`
ͬ
Z
??
MFalse @`
ˬ
T0??
LTrue @`
ɬ
Z
??
vTop: AB, A ,
@`
Z
??L
LTrue @`
Z`
?? L
LTrue @`
Z
?? L
MFalse @`
Z
??L
MFalse @`
Z@
??
LTrue @`
Z
?? 
LTrue @`
Z
?? 
LTrue @`
Z
??
MFalse @`
Z@
??
MFalse @`
Z
??
MFalse @`
Z
??
MFalse @`
Z
??
LTrue @`
T@??
LTrue @`
T??
LTrue @`
T??
LTrue @`
T??
LTrue @`
Z>
??
Q Bottom: B
@`
Z0>
??
ZAB" @`
Z?
??
IB @`
Zp@
??
IA @`B
Zo??
B
T1??B
T1??B
T1??B
T1??B
Zo??LLB
Zo??
LB
T1??
LB
T1??
LB
T1??
LB
¬
Zo??
LB
ʬ
T1??
LH
0h ? 3f3fff̙3ff̙
@8(
r
SA@
r
SA@
B
ZD?? 0B
ZD??00H
0h ? 3f3fff̙3ff̙
P8(
r
SB@
r
SPB@
B
ZD?? B
ZD??
H
0h ? 3f3fff̙3ff̙
`$(
r
SC@
r
SpC@
H
0h ? 3f3fff̙3ff̙
p$(
r
SD@
r
SD0
H
0h ? 3f3fff̙3ff̙
nf
(
r
S͞@
0̞ 0P
bGiven a sentence, A
Containing a universally quantified variable V
Then we can replace V by any ground term g
"V.A
Subst({V/g}, A)
Remember to remove quantifier
Not as complicated as it looks:
"X likes(X, ice_cream) becomes likes(ben,ice_cream)0lKZZ0
KZ0lKZ8lKZ?0lKZ40"KZZ>0,srB
ZD??
0
H
0h ? 3f3fff̙3ff̙n
(
r
SΞ@
r
SPϞ@
B
ZD??P
`H
0h ? 3f3fff̙3ff̙n
(
r
SϞ@
r
SО@
B
ZD??0 0H
0h ? 3f3fff̙3ff̙
$(
r
SО@
r
S0ў@
H
0h ? 3f3fff̙3ff̙
;3+,(
r
SӞ@
r
SҞ
fpӞ??
` @
BA1$
fӞ??
@
BA2$
fԞ??
@@
BA3$
Z??
Z??
Z??
Z??
Z??0
Z??
P@
Z??
p @
Z??
@@
Z??
`@
Z??
@
Z??
@
f՞??
@
>
Z??
0@
Z??
P@
Z??@
fP՞??p
1TB
@
`D??@ B
`D??@
B
@
`D??@P
`B
`D??@``B
`D??@`B
@
`D??p@B
`D??p0B
@
`D??pPP
B
`D??PPP
B
!
`D??P` P
B
"@
`D?? P
B
#
`D??
P
B
$@
`D??
P
B
%@
`D??
P
B
&
`D??
P
B
'
`D??PP
B
(
`D?? P
B
)
`D??pP
B
*@
`D??pPB
+
`D??p@0B
,@
`D??p`H
0h ? 3f3fff̙3ff̙
$(
r
Sמ@
r
S0מ@P
H
0h ? 3f3fff̙3ff̙
$(
r
SG@
r
SPH`@
H
0h ? 3f3fff̙3ff̙
$(
r
SPE@
r
SpF@
H
0h ? 3f3fff̙3ff̙cxp^RЀ3ÿlHbP@AL
G@;b`B&V}nfҭfvv}vff֭vfvvfvfvv}ffvfvvfɻff'OyA\OYܥҷȑOұf͑AܥfܑAұܥyf.Q3g33Ե33ggDD333YQyݝ3ωD33D3ϝ3yg33333y3DQ3DD3yDQ3ygD3nKff}fffvfͭffދfnvv}fֻfvfnfff淧,vff֭vnvf淧ffvfnܝf'O\Oy.O..OAfp@yAO͘OfOOyfQ3D3DD3Q333DD33]3]3D33D33Q3333D]g33(3DQ3D33ݤQ33DQQ33D333f!fޭffvvfff}fffnff}ffnfffvffff,}ffڭ}ff}}ffffffvff}ff}ՁyfOD3nf/OfD3fnɁɁӁӁ+̧̧̧̧̧̧̧̧̧Lffffffffffffffffsffffffffffffffffffffffffffffyffffffffffffffffffffffffffs f ffffffffffff fffffffffffmffffffffffffffffffff̧̧̧̧̧=ffffffffffffffffffffffffffffffāffffffffffffffffffffffffffffffffffffffffffffffff
fffffff fffff
ffffffffffffffffff fffff
fffffffffffffffffffffffffffffffffffffffffff4ffffff̧̧̧̧Offffffffffffffffffffffffffffffffffffffffffff
ff
fffffffffffffffffffffff
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff4ffffff̧̧̧̧7̣3_ft̢3f̢3Gfu̢3?fo5̢3]f̢3f%:̹3af̧̧̧(ffffmffffffffffffffffffffs
fffffffffff
fffffffffffaffffffffffffffffffffgffffffffffffffffffff̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧̧Deductive InferencesAutomating Deductive ReasoningInference RulesTautologiesInference with TautologiesEquivalence RulesCommutativity & AssociativityDistributivity of ConnectivesDouble Negation!De Morgans Law & ContrapositionOther EquivalencesAn Example DeductionPropositional Inference RulesSoundness of Modus Ponens AndElimination & Introduction"OrIntroduction & Unit ResolutionFirstOrder Inference RulesSubstitution & Insta<4!d!dgʚ;<4ddddgʚ;<4BdBdʚ;^~___PPT9`X@h___PPT2001D<4X`___PPTMac11:@N (namd Symbol33ff (namd Symbol33ff alNew Roman@XYjX DWingdingsRoman@XYjX0DEuclid Symboln@XYjX@DTimes Symboln@XYjXPDSymbolSymboln@XYjX`DCourier Newln@XYjXpDArial Unicode MS@XYjX"
`.
@n?" dd@ @@`` =5

!0e0eA@A5%8c8c
?1d0u0@Ty2 NP'p<'p@A)BCDE?@8rʚ;2Nʚ;g4hdhd4X@Pppp@<4!d!dP g@<4ddddP g@<4BdBdP @nx___PPTMac11R@f hnamd`
Arial&Monotype Typography hnamd`
Arial&Monotype Typography hnamd`
Arial&Monotype Typography hnamd`
Arial&Monotype Typography hnamd`
Arial&Monotype Typography (namd Symbol*33ff v___PPT9XP8h___PPT2001D<4X@?%&M7Artificial Intelligence 7. Making Deductive InferencesHCourse V231
Department of Computing
Imperial College, London
Jeremy Gow(I>
Automating Deductive Reasoning`Aims of automated deduction
Deduce new knowledge from old
Prove/disprove some open conjectures
Theorem proving
Search for a path from axioms to theorem statement
Operators are (sound) inference rules
Applications:
Agents that use deductive inference
Mechanising and automating mathematics
Verifying hardware and software specifications
The semantic webCYCAhInference RulesA entails B iff
B is true when A is true
Any model of A is a model of B
Then this is a sound inference rule
A
B
Axioms C D & Z Theorem
Each step is application of inference rule
Theorem is entailed by the axioms8$!M8( 7Tautologies8S: (X(YZ))((XY) (XZ))
Show that no matter what truth values for X, Y and Z
The statement S is always true
Columns 7 and 8 are always the same~" Z5" Z(" Z$" Z5($t(<Inference with TautologiesPQ QP is obviously true
Regardless of meaning or truth values of P and Q
This is contentfree and a tautology
One way to define a rule of inference:
We can replace PQ with QP, and vice versa
They are true for same models
Replacing one for other preserves soundnessV(v$
f Equivalence RulesA and B are logically equivalent (write A B)
Same models for each
Can replace any instance of A with an instance of B without affecting models
Formalised as rewrite rule A B
Also B A
Must avoid looping A B A B ...
Choose one direction, or always loopcheck
Rewrite rules used for inference
Showing theorem and axioms are equivalent
Preprocessing theorem/axioms into a particular formatJ/b!\!`
b,!`Y(!Commutativity & AssociativityCommutativity
PQ QP
PQ QP
PQ QP
Associativity
(PQ)R P(QR)
(PQ)R P(QR)8$(
"Distributivity of Connectivest and over or and or over and :
P (Q R) (P Q) (P R)
P (Q R) (P Q) (P R)
Over implication
P (Q R) (P Q) (P R)
P (Q R) (P Q) (P R)<!DD! >0!34#Double NegationHave to be careful in English
I m not not hungry
Does not (necessarily) mean: I m hungry
But double negations can always be removed
P P
Humans would not write this
But it may appear in during agent s inference?,
.?& .,L$ @De Morgan s Law & ContrapositiondDe Morgan s Law (refers to either)
(P Q) P Q
(P Q) P Q
Contraposition: imagine the opposite is true
P Q Q P
Often useful in mathematics proof
#,"#
, ">,R/&Other Equivalences(Remove implication or equivalence (very useful)
P Q P Q
P Q (P Q) (Q P)
Reduce to truth value
P P False
P P True0!0 'An Example Deductionx(P Q) (P Q)
Show that this sentence is false
Show that this rewrites to False
This proves the negation
See notes for solution (or do as exercise)
Is this easier than a truth table?":N":N(
Propositional Inference RulesvRewrite rules are good for bidirectional search
But we don t need equivalence, just entailment
Classic example
All men are mortal, socrates is a man
Therefore: Socrates is mortal
This is an instance of an inference rule
Known as Modus Ponens (Aristotle)
AB, A
B
Above line: what we know, below: what we can deduce0/D)"
40/D)
<,8)Soundness of Modus Ponens>Every model of top sentences is a model of the bottom sentence*AndElimination & IntroductionTAndElimination:
A1 A2 & An
Ai
[1 i n]
AndIntroduction:
A1, A2, & , An
A1 A2 & An
The sentences may be from different places
Selected from the databaseB ,
++!OrIntroduction & Unit ResolutionOrintroduction
Ai
A1 A2 & An
[1 i n]
Unit resolution
(A B) B
A
Basis for resolution theorem proving
See next two lectures
DZZZZZ%ZZZ$,FirstOrder Inference Rules:Propos (namd Symbol33ff (namd Symbol33ff itional inference rules (inc. equivs)
Can all be used in firstorder inference
Firstorder inference more complicated
Soundness depends on concept of models
Potentially infinite models, can t use a truth table
Sentences contain quantifiers
Need the notion of ground substitution,)N5',)N5$Substitution & InstantiationFOL sentences have quantified variables
Substitute into a variable by assigning a particular value
Replace with given term, remove quantifier
Instantiation (grounding) is a kind of substitution
Must substitute a ground term
Example: "X."Y.likes(X,Y) becomes likes(tony, george)
We write:
Subst({X/tony, Y/george}, likes(X,Y)) = likes(tony,george)(f4A;([
' ;!6.Universal Elimination
/Existential EliminationGiven a sentence, A
Containing an existentially quantified variable, V
Then we can replace V by any constant, k
As long as k is not mentioned anywhere else
$V.A
Subst({V/k}, A)
For the sake of argument, let s call it&
ZZZZZ)ZZ\(60Existential IntroductionGiven a sentence, A
And a variable, V, which is not used in A
Then any ground term, g, in A can be substituted by V
As long as g does not appear in A also
A
$V. Subst({g/V},A)
Exercise: find sentence where V is in A
Such that this inference rule is not sound`'(+6'(+>B^(51Chains of InferenceRemember the problem we re trying to solve
Search for a path from axioms, A, to theorem, T
Three approaches
Forward chaining
Backward chaining
Proof by contradiction
Specification of a search problem:
Representation of states (firstorder logic sentences)
Initial state (depends...)
Operators (inference rules, including equivalences)
Goal state (depends...)+0:#+0:#2Forward ChainingTDeduce new facts from axioms
Deduce new facts from these, etc.,&
Hopefully end up deducing the theorem statement
Can take a long time: not using the goal to direct searchFZ$ZjZ$j3Backward Chaining
Start with the theorem state and work backwards
Hope to end up at the axioms
Each step asks: given the state that I m at...
Which operator could have been applied to which state to produce the state (sentence) I m at
No problem when using equivalences
Can also use a bidirectional search (from both ends)
Difficult when using general inference rules
Many possible ways to invert operators
0ZZ/Z]Z#Z5ZZ(Z0/]#5(4Proof By Contradiction" Reductio ad absurdum
Assume theorem is false
then show that the assumption contradicts the axioms
which proves that the theorem is true
Add negated theorem to the set of axioms
See if we can deduce the False sentence
Advantage: using the theorem statement from start
Can look to see how close we are to the false statement
Possibilities for a heuristic search!
Basis for resolution theorem proving/[)*28&%/[)*28&% 52Example: using the Otter resolution theorem prover,Input to Otter:
set(auto).
formula_list(usable).
all x (man(x)>mortal(x)). % For all x, if x is a man then x is mortal
man(socrates). % Socrates is a man
mortal(socrates). % Socrates is immortal (note: negated)
end_of_list.
Output from Otter:
 PROOF 
1 [] man(x)mortal(x).
2 [] mortal(socrates).
3 [] man(socrates).
4 [hyper,3,1] mortal(socrates).
5 [binary,4.1,2.1] $F.
 end of proof  NrJw &w_<^(
8*/0`DTimes New Roman0 @H0n@fDArialNew Roman0 @H0n@f DWingdingsRoman0 @H0n@f0DEuclid Symboln0RdO)}QPowerPoint Document(8SummaryInformation('DocumentSummaryInformation8T !"#$%&'()*+,./0123456789r
!"#$%&'()*+,./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqstuvwxyz{}~Current UserD
ntiationUniversal EliminationExistential EliminationExistential IntroductionChains of InferenceForward ChainingBackward ChainingProof By Contradiction3Example: using the Otter resolution theorem proverFonts UsedDesign Template
Slide Titles$_r8"Simon ColtonSimon Colton(namd Symbol33ff (namd Symbol*33ff ?%M7Artificial Intelligence 7. Making Deductive InferencesHCourse V231
Department of Computing
Imperial College, London
Jeremy Gow(I>
Automating Deductive Reasoning`Aims of automated deduction
Deduce new knowledge from old
Prove/disprove some open conjectures
Theorem proving
Search for a path from axioms to theorem statement
Operators are (sound) inference rules
Applications:
Agents that use deductive inference
Mechanising and automating mathematics
Verifying hardware and software specifications
The semantic webCYCAh Inference RulesA entails B iff
B is true when A is true
Any model of A is a model of B
Then this is a sound inference rule
A
B
Axioms C D & Z Theorem
Each step is application of inference rule
Theorem is entailed by the axioms8$!M8( $$ ((,,7Tautologies8S: (X(YZ))((XY) (XZ))
Show that no matter what truth values for X, Y and Z
The statement S is always true
Columns 7 and 8 are always the same~" Z5" Z(" Z$" Z5($t(<Inference with TautologiesPQ QP is obviously true
Regardless of meaning or truth values of P and Q
This is contentfree and a tautology
One way to define a rule of inference:
We can replace PQ with QP, and vice versa
They are true for same models
Replacing one for other preserves soundnessV(v$
$$((,,f00 Equivalence RulesA and B are logically equivalent (write A B)
Same models for each
Can replace any instance of A with an instance of B without affecting models
Formalised as rewrite rule A B
Also B A
Must avoid looping A B A B ...
Choose one direction, or always loopcheck
Rewrite rules used for inference
Showing theorem and axioms are equivalent
Preprocessing theorem/axioms into a particular formatZ/b!\!`
$$b((,,004488<<,!`Y(!Commutativity & AssociativityCommutativity
PQ QP
PQ QP
PQ QP
Associativity
(PQ)R P(QR)
(PQ)R P(QR)Z$( $$(( ,,004488<<
$$"Distributivity of Connectivest and over or and or over and :
P (Q R) (P Q) (P R)
P (Q R) (P Q) (P R)
Over implication
P (Q R) (P Q) (P R)
P (Q R) (P Q) (P R)h!DD! $$((,,004488<< $$((,,004488<< $$((,,00 4488<<>0!34#Double NegationHave to be careful in English
I m not not hungry
Does not (necessarily) mean: I m hungry
But double negations can always be removed
P P
Humans would not write this
But it may appear in during agent s inference?,
.?& .$$,L$ @De Morgan s Law & ContrapositiondDe Morgan s Law (refers to either)
(P Q) P Q
(P Q) P Q
Contraposition: imagine the opposite is true
P Q Q P
Often useful in mathematics proof
#,"#
,$$((,, 00"4488<<>,R/&Other Equivalences(Remove implication or equivalence (very useful)
P Q P Q
P Q (P Q) (Q P)
Reduce to truth value
P P False
P P True0!0 $$ ((,, 00'An Example Deductionx(P Q) (P Q)
Show that this sentence is false
Show that this rewrites to False
This proves the negation
See notes for solution (or do as exercise)
Is this easier than a truth table?":N": N$$(
Propositional Inference RulesvRewrite rules are good for bidirectional search
But we don t need equivalence, just entailment
Classic example
All men are mortal, socrates is a man
Therefore: Socrates is mortal
This is an instance of an inference rule
Known as Modus Ponens (Aristotle)
AB, A
B
Above line: what we know, below: what we can deduce0/D)"
40/D)
$$<((,8)Soundness of Modus Ponens>Every model of top sentences is a model of the bottom sentence*AndElimination & IntroductionTAndElimination:
A1 A2 & An
Ai
[1 i n]
AndIntroduction:
A1, A2, & , An
A1 A2 & An
The sentences may be from different places
Selected from the database> ,
$$((,
,004
488<<
$$((,,004488<<++!OrIntroduction & Unit ResolutionOrintroduction
Ai
A1 A2 & An
[1 i n]
Unit resolution
(A B) , B
A
Basis for resolution theorem proving
See next two lectures
BZZZZZ%ZZZ $$((,,004488<<$GC,FirstOrder Inference Rules:Propositional inference rules (inc. equivs)
Can all be used in firstorder inference
Firstorder inference more complicated
Soundness depends on concept of models
Potentially infinite models, can t use a truth table
Sentences contain quantifiers
Need the notion of ground substitution,)N5',)N5$Substitution & InstantiationFOL sentences have quantified variables
Substitute into a variable by assigning a particular value
Replace with given term, remove quantifier
Instantiation (grounding) is a kind of substitution
Must substitute a ground term
Example: "X."Y.likes(X,Y) becomes likes(tony, george)
We write:
Subst({X/tony, Y/george}, likes(X,Y)) = likes(tony,george)(f4A;([
'  ;$$!6.Universal Elimination
/Existential EliminationGiven a sentence, A
Containing an existentially quantified variable, V
Then we can replace V by any constant, k
As long as k is not mentioned anywhere else
$V.A
Subst({V/k}, A)
For the sake of argument, let s call it&
ZZZZZ)ZZ\(60Existential IntroductionGiven a sentence, A
And a variable, V, which is not used in A
Then any ground term, g, in A can be substituted by V
As long as g does not appear in A also
A
$V. Subst({g/V},A)
Exercise: find sentence where V is in A
Such that this inference rule is not sound`'(+6'( +$$>B^(51Chains of InferenceRemember the problem we re trying to solve
Search for a path from axioms, A, to theorem, T
Three approaches
Forward chaining
Backward chaining
Proof by contradiction
Specification of a search problem:
Representation of states (firstorder logic sentences)
Initial state (depends...)
Operators (inference rules, including equivalences)
Goal state (depends...)+0:#+0:#2Forward ChainingTDeduce new facts from axioms
Deduce new facts from these, etc.,&
Hopefully end up deducing the theorem statement
Can take a long time: not using the goal to direct searchFZ$ZjZ$j3Backward Chaining
Start with the theorem state and work backwards
Hope to end up at the axioms
Each step asks: given the state that I m at...
Which operator could have been applied to which state to produce the state (sentence) I m at
No problem when using equivalences
Can also use a bidirectional search (from both ends)
Difficult when using general inference rules
Many possible ways to invert operators
0ZZ/Z]Z#Z5ZZ(Z0/]#5(4Proof By Contradiction" Reductio ad absurdum
Assume theorem is false
then show that the assumption contradicts the axioms
which proves that the theorem is true
Add negated theorem to the set of axioms
See if we can deduce the False sentence
Advantage: using the theorem statement from start
Can look to see how close we are to the false statement
Possibilities for a heuristic search!
Basis for resolution theorem proving/[)*28&%/[)*28&% 52Example: using the Otter resolution theorem prover,Input to Otter:
set(auto).
formula_list(usable).
all x (man(x)>mortal(x)). % For all x, if x is a man then x is mortal
man(socrates). % Socrates is a man
mortal(socrates). % Socrates is immortal (note: negated)
end_of_list.
Output from Otter:
 PROOF 
1 [] man(x)mortal(x).
2 [] mortal(socrates).
3 [] man(socrates).
4 [hyper,3,1] mortal(socrates).
5 [binary,4.1,2.1] $F.
 end of proof  N
8(
r
SPS$@
r
SS$@
B
ZD?? B
ZD??
H
0h ? 3f3fff̙3ff̙r+Z5s oZ8<0RdO)9wQPowerPoint Document(8SummaryInformation('DocumentSummaryInformation8T !"#$%&'()*+,./0123456789<Current UserD
ntiationUniversal EliminationExistential EliminationExistential IntroductionChains of InferenceForward ChainingBackward ChainingProof By Contradiction3Example: using the Otter resolution theorem proverFonts UsedDesign Template
Slide Titles$_r8YSimon ColtonSimon Colton>