Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall...

36
Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004

Transcript of Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall...

Page 1: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Knowledge Representation & ReasoningLecture #1

UIUC CS 498: Section EA

Professor: Eyal Amir

Fall Semester 2004

Page 2: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Explicit Knowledge Representation

• What is knowledge?

• What applications do you know of knowledge?

• Where do we not need knowledge?

• How do we use knowledge?

Page 3: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Knowledge in Different Forms

• CYC, OpenMind, SUMO – Commonsense

• Ontologies – frame-based, semantic web

• Medical knowledge

• Diseases/symptoms networks

• Dynamic systems

• Specific applications: NLP, Databases

Page 4: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Knowledge Representation and Reasoning (KR&R)

• Advice taker: a paradigm for KR&R– Represent knowledge (with statements)– Add statements when you want to give advice

(control knowledge = statements)– World vs Reasoner (Decision Maker)

Reasoner+

KnowledgeWorld

Sensoryinformation

Actions/Decisions

Page 5: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Knowledge Representation and Reasoning (KR&R)

• Advice taker: a paradigm for KR&R

• Examples:– A robot moving and manipulating the world– An internet agent booking flights for us– A virtual agent in a computer game

Reasoner+

KnowledgeWorld

Sensoryinformation

Actions/Decisions

Page 6: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Reasoning Tasks

• A robot moving and manipulating the world– Track the environment and its body (actions)– Update its knowledge with new information

(sensors & communications)– Make timely decisions– Safe decisions– Take uncertainty into account– Learning and generalizing from knowledge

Page 7: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Example

• A robot moving and manipulating the world

Reasoner+

KnowledgeWorld

Sensoryinformation

Actions/Decisions

ReasoningAlgorithm

KB

Symbols toSensors

TasksMngr

Page 8: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Example Details 1

• A robot moving and manipulating the world

ReasoningAlgorithm

KB

Symbols toSensors

TasksMngr

ReasoningAlgorithm

KB

Symbols toSensors

TasksMngr

Task: Decide on action

Call reasoning algorithmwith query. Examples:- next_action(move_fwd)- next_action(look_door)

Page 9: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Example Details 2

• A robot moving and manipulating the world

ReasoningAlgorithm

KB

Symbols toSensors

TasksMngr

Task: Is the action safe?

Call reasoning algorithmwith query. Examples:- safe_action(move_fwd)- safe_action(look_door,s)

Page 10: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Example Details 3

• A robot moving and manipulating the world

ReasoningAlgorithm

KB

Symbols toSensors

TasksMngr

Task: Track the world

Use reasoning to updateknowledge. Examples:get_KB(result(move_fwd))get_KB(result(arm(10),s))

Page 11: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Example Use of Reasoning 1

• Task: select an action to perform

• Logical KB: (a) Prove that KB entails move_fwd (e.g.,FOL)

(b) Find a model of KB that satisfies move_fwd (e.g., propositional logic)

• Probabilistic KB:– Find the probability of move_fwd (e.g., BNs)– Find an action that gives best utility (MDPs)

Page 12: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Example Use of Reasoning 2

• Task: find cause of error Err

• Logical KB: Abduction: Find an explanation Exp such that KB Exp logically entails Err

• Probabilistic KB:– Find the set of variable assignments that has

maximum posterior probability given Err

Page 13: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Knowledge Representation and Reasoning (KR&R)

• Two agents interacting– Sales and purchase agent– Collaboration to achieve a task– Information agent and user agent

Reasoning Agent 1+

Knowledge Base 1

Agent 2+

Knowledge Base 2Response

Request

Page 14: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Knowledge Representation and Reasoning (KR&R)

• Query answering:– Formal verification of digital circuits– Temporal verification of programs– Prediction and explanation

Human / SoftwareReasoning with

A Knowledge BaseAnswer

Query

Page 15: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Tractability of Reasoning

• More expressive languages require more time to reason with

Expressivity – Tractability tradeoff

• Compact representations not always more efficient for reasoning

• Reasoning with a complete model many times easier than reasoning with general knowledge in the same language

Page 16: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Summary: Why, When, How KR&R

• Reasoning with knowledge is good when we are not sure about knowledge or query.

• The language of KB is determined by the application:– Need for expressive language– Need for fast/accurate response

• Knowledge is entered by hand or learned

• Tasks for reasoning algorithms vary

Page 17: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

In This Course: Representation

• Knowledge Representation Languages– Logic: propositional, First-Order Logic,

Description Logics [, defaults, linear logic]– Probabilities: graphical models (e.g., BNs),

relational-probabilistic models [, causality]

• Specific cases:– Dynamic worlds: logical, probabilistic– Space/Shape: logical, probabilistic– Knowledge about knowledge

Page 18: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

In This Course: Reasoning

• Exact inference:– Fundamental principles– Structure: treewidth [, context-based]

• Approximate inference:– Sampling, variational, lower/upper bounds,…

• Special tasks: – Dynamic worlds: filtering, smoothing,…– Space/Shape: logical, probabilistic– Equality

Page 19: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Course Requirements

• First-order logic (e.g., Models, signature, formulae, literal): [R&N ’03] ch. 8 (lec. #3)

• Probability & Statistics (e.g., Normal distr., Bayes rule): [R&N ’03] ch. 13 (lecture #6)

• Computational complexity (level of CS373)

Page 20: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Course Requirements #2

• Mathematical maturity: proofs, understanding

• Independence: follow beyond your presentation reading to gain depth

• Independence: project will require readings that are not specified

• Independence: search for information instead of thinking it will come to you

Page 21: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Project Selection

• Select from list or suggest your own

• Projects for one or two people

• 12th lec. (Oct 7): Project proposals (~1 pg)

• 18th lec. (Oct 28): Extended proposals (~3-pages)

• 24th lec. (Nov 18): Review of progress (~1 page)

• Final Exam (Dec 16): Projects due

Page 22: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Cheating Policy

• First offense:– Exam: zero on exam– Project/homework: zero + loss of full letter

grade

• Second offense:– In same course: failure– In different course: expulsion

Page 23: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

More Administrativia

• Late HW submission policy: 7 days

• Date/time for midterm ?

• Course grading

• Newsgroup

Page 24: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Next

• Example of (non-traditional) reasoning with first-order logic in a robotics setting

• Reminder of Propositional Logic notation and concepts

Page 25: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Propositional Logic

• Language includes– Prop. symbols– Logical connectives

• Formulas:– Atom– Literal– Formula

• KB: Set of formulas

)()( baba

aa

a

},{ dbcba

Page 26: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Representing Knowledge

• Propositional symbols represent facts under consideration:– there_is_rain, there_are_clouds, door1_open,

robot_in_pos_56_210

• Not propositions: – is_there_rain?– location_of_robot– Dan_Roth

Page 27: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Representing Knowledge

• Knowledge bases are sets of formulae– There_is_rain there_are_clouds– Robot_in_pos_3_1 Position_3_1_empty– Has_drink coffee tea

Page 28: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Knowledge Engineering

• Select a language: set of features

• Examine cases

• Decide on dependencies between features

• Write dependencies formally

• Test

Page 29: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Propositional Logic

• Semantics:– Truth assignments that satisfy KB/formula

)()( baba -a -b

a -b

-a b

a b

Interpretations: I1[a]=FALSE I1[b]=FALSEassign truth values to propositional symbols

I1

I2

I3

I4

Page 30: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Propositional Logic

• Semantics:– Truth assignments that satisfy KB/formula

)()( baba

b a

b -a

-b a

-b -a ╨

Models of f: Interpretations that satisfy f

I1

I2

M1= I3

M2= I4

M1

Page 31: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Propositional Logic

• Semantics:– Truth assignments that satisfy KB/formula

)()( baba ╨

M1

LogicalEntailment

)()( baba ╨

b)()( baba ╨a

)()( baba ╨ab

)()( baba ╨

TRUE

Page 32: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Propositional Logic

• Semantics:– Truth assignments that satisfy KB/formula

LogicalEntailment )()( baba ╨

b

)()( baba ┴

bDeduction(inference)

Page 33: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

More Notations

• Interpretations ~ Models

• Axioms – formulae that are “assumed”

• Signature – the symbols used by a KB

• Theory ~ KB (a set of axioms), or

• Theory ~ the complete set of sentences entailed by the axioms

• Sentence = formula (in prop. logic)

Page 34: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

More Notations

• The value that symbol p takes in model M:

– [[ M ]] p

– pM

– M[p] -- we will primarily use this

• Clauses: {lit1, lit2, lit3,…} or lit1 lit2 lit3...

Page 35: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Summary

• Propositional logic as a language for representing knowledge

• Did not touch on reasoning procedures

• Defined language, signature, models

Page 36: Knowledge Representation & Reasoning Lecture #1 UIUC CS 498: Section EA Professor: Eyal Amir Fall Semester 2004.

Homework

1. Read readings for next time (on website)

2. Make sure you know:1. Completeness theorem for prop. Logic

2. What does soundness mean?

3. Deduction theorem for prop. Logic

4. De-Morgan + Distributive Laws

5. Signatures, formulae, models