knowledge representation and inference torbjörn lager department of linguistics stockholm...

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

Upload: fiona-laufer

Post on 14-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

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

Knowledge Representation and Inference

Torbjörn LagerDepartment of LinguisticsStockholm University

Page 2: Knowledge Representation and Inference Torbjörn Lager Department of Linguistics Stockholm 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

Page 3: Knowledge Representation and Inference Torbjörn Lager Department of Linguistics Stockholm University

Torbjörn Lager 3

Some Terminology

Premises Conclusion Rule of Inference Argument Valid (or 'Invalid') Proof Truth preserving Axiom Theorem Fallacy

Page 4: Knowledge Representation and Inference Torbjörn Lager Department of Linguistics Stockholm University

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)

Page 5: Knowledge Representation and Inference Torbjörn Lager Department of Linguistics Stockholm University

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.

Page 6: Knowledge Representation and Inference Torbjörn Lager Department of Linguistics Stockholm University

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

Page 7: Knowledge Representation and Inference Torbjörn Lager Department of Linguistics Stockholm University

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

Page 8: Knowledge Representation and Inference Torbjörn Lager Department of Linguistics Stockholm University

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 ?

Page 9: Knowledge Representation and Inference Torbjörn Lager Department of Linguistics Stockholm University

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}