Presentation is loading. Please wait.

Presentation is loading. Please wait.

Knowledge Representation and Inference Torbjörn Lager Department of Linguistics Stockholm University.

Similar presentations


Presentation on theme: "Knowledge Representation and Inference Torbjörn Lager Department of Linguistics Stockholm University."— Presentation transcript:

1 Knowledge Representation and Inference Torbjörn Lager Department of Linguistics Stockholm University

2 Torbjörn Lager 2 Example: Knowledge Representation and Inference in Natural Language and Logic yIf John is a man he is happy yJohn is a man yTherefore: John is happy y'John is a man' -> 'John is happy' y'John is a man' yTherefore: 'John is happy'  P -> Q Modus Ponens  P A valid rule of inference yTherefore: Q

3 Torbjörn Lager 3 Some Terminology yPremises yConclusion yRule of Inference yArgument yValid (or 'Invalid') yProof yTruth preserving yAxiom yTheorem yFallacy

4 Torbjörn Lager 4 Example: Knowledge Representation and Inference in Natural Language and Logic yEvery man who whistles is happy yJohn is a man yJohn whistles yTherefore: John is happy y  x[(man(x) & whistles(x))  happy(x)] yman(John) ywhistles(John) yTherefore: happy(John)

5 Torbjörn Lager 5 Natural Deduction y1.  x[(man(x) & whistles(x))  happy(x)] y2. man(john) y3. whistles(john) y5. (man(john) & whistles(john))  happy(john)1 U.I y6. man(john) & whistles(john)2,3 Conj y7. happy(john)5,6 M.P. y8.  x[happy(x)] 7¨ E.G.

6 Torbjörn Lager 6 Automatic Deduction zAutomatic Theorem Proving zDeduction = Logic + Search zSearch Trees zExpressive power and computational tractability zHorn clause logic - a subset of full first-order predicate logic

7 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

8 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 ?

9 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 end proc {Whistles X} choice X = mary [] X = john end {Browse {Search.base.one Happy}} {Explore.one Happy}


Download ppt "Knowledge Representation and Inference Torbjörn Lager Department of Linguistics Stockholm University."

Similar presentations


Ads by Google