knowledge representation and inference torbjörn lager department of linguistics stockholm...
TRANSCRIPT
Knowledge Representation and Inference
Torbjörn LagerDepartment of LinguisticsStockholm University
Torbjörn Lager 2
Example: Knowledge Representation and Inference in Natural Language and Logic
If John is a man he is happy John is a man Therefore: John is happy
'John is a man' -> 'John is happy' 'John is a man' Therefore: 'John is happy'
P -> Q Modus Ponens P A valid rule of
inference Therefore: Q
Torbjörn Lager 3
Some Terminology
Premises Conclusion Rule of Inference Argument Valid (or 'Invalid') Proof Truth preserving Axiom Theorem Fallacy
Torbjörn Lager 4
Example: Knowledge Representation and Inference in Natural Language and Logic
Every man who whistles is happy John is a man John whistles Therefore: John is happy
x[(man(x) & whistles(x)) happy(x)] man(John) whistles(John) Therefore: happy(John)
Torbjörn Lager 5
Natural Deduction
1. x[(man(x) & whistles(x)) happy(x)] 2. man(john) 3. whistles(john) 5. (man(john) & whistles(john)) happy(john) 1 U.I 6. man(john) & whistles(john) 2,3 Conj
7. happy(john) 5,6 M.P.
8. x[happy(x)] 7¨ E.G.
Torbjörn Lager 6
Automatic Deduction
Automatic Theorem Proving Deduction = Logic + Search
Search Trees
Expressive power and computational tractability
Horn clause logic - a subset of full first-order predicate logic
Torbjörn Lager 7
Example: Knowledge Representation and Inference in Prolog
happy(X) :- man(X), whistles(X).
man(paul).
man(john).
whistles(mary).
whistles(john).
| ?- happy(john).
yes
| ?- happy(X).
X = john
Torbjörn Lager 8
Example: Knowledge Representation and Inference in Prolog (cont'd)
| ?- happy(X).
1 1 Call: happy(_181) ?
2 2 Call: man(_181) ?
2 2 Exit: man(paul) ?
3 2 Call: whistles(paul) ?
3 2 Fail: whistles(paul) ?
2 2 Redo: man(paul) ?
2 2 Exit: man(john) ?
4 2 Call: whistles(john) ?
4 2 Exit: whistles(john) ?
1 1 Exit: happy(john) ?
X = john ?
Torbjörn Lager 9
Example: Knowledge Representation and Inference in Oz
proc {Happy X} {Man X} {Whistles X}end
proc {Man X} choice X = paul [] X = john endend
proc {Whistles X} choice X = mary [] X = john endend
{Browse {Search.base.one Happy}} {Explore.one Happy}