Вы находитесь на странице: 1из 38

241-320 Design Architecture and Engineering for Intelligent System Suntorn Witosurapot

Contact Address: Phone: 074 287369 or Email: wsuntorn@coe.psu.ac.th

November 2010

Lecture 10:
Knowledge Representation and Reasoning Part 1 ( )

Preview
Our last lectures were all focused on algorithms that allow you to develop smart software Smart = intelligence, e.g. Find optimal solutions according to given scenario Find the shortest path Suggest on step to proceed in adversrial game that has more chance to win etc. In this lecture, we move our focus from problemspecific agents to knowledge-based agents
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

Preview (cont.)
Knowledge-based Agents
Can represent knowledge And reason with this knowledge, Can combine general knowledge with current percepts to infer hidden aspects of the current state Q: How is this different from the knowledge used by problem-specific agents? more general more flexible
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

Preview: Knowledge bases

Knowledge base = set of sentences in a formal language Allows an agent to reason about the world, deduce hidden properties and determine appropriate actions. Example: KB = { Somchai comes to the party;
If Somsri comes to the party then Somying comes; If Somsri doesn't come then Somchai won't come to the party } Agent should be able to deduce that .... Somying comes to the party.
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

Preview: Knowledge representation (KR)


Any agent can be described on different levels:
Knowledge level (knowledge possessed by agent) Logical level (algorithms for manipulating knowledge) Implementation level (how algorithms are implemented)

Knowledge Representation is concerned with expressing knowledge explicitly in a computertractable way (for use by the agent in reasoning) Reasoning attempts to take this knowledge and draw inferences (e.g. answer queries, determine facts that follow
from the knowledge base, decide what to do, etc.)

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

Outline
Knowledge vs Data Knowledge Representation Schemes Logic-based Knowledge Representation
Propositions Propositional Logic
Syntax Semantics

First-order Logic Conclusion


241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

Information Hierarchy
More refined and abstract

Data
The raw material of information

Information
Wisdom Knowledge Information Data Data organized and presented in a particular manner

Knowledge
Justified true belief Information that can be acted upon

Wisdom
Distilled and integrated knowledge Demonstrative of high-level understanding
Knowledge Representation and Reasoning - part 1

241-320 Design Architecture & Engineering for Intelligent System

An Example
Data 98.6 F, 99.5 F, 100.3 F, 101 F, Information Hourly body temperature: 98.6 F, 99.5 F, 100.3 F, 101 F, Knowledge If you have a temperature above 100 F, you most likely have a fever Wisdom If you dont feel well, go see a doctor
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

Why do we need formal languages for KR?


RECALL: Knowledge base = set of sentences in a formal language

Consider an English sentence like: The boy saw a girl with a telescope - 2 possible meanings:
- . . - . .

Also: I heard about him at school (structural ambiguity) - What are 2 possible meanings??
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

10

Why do we need formal languages for KR? (cont.)


Natural languages exhibit ambiguity Ambiguity makes it difficult for us to to understand what is the intended meaning of certain phrases and sentences, and also to make inferences
This is why it does have Symbolic logic () to support the ambiguity of the natural language a syntactically unambigious knowledge representation language through the means of Symbol ( )
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

11

Syntax vs. Semantics


Syntax () Describes the legal sentences in a knowledge representation language (e.g. in the language of arithmetic expressions x < 4) Semantics () Refers to the meaning of sentences. Semantics refers to a sentences relationship to the real world or to some model of the world. Semantic properties of sentences include truth and falsity (e.g. x < 4 is true when x is a strictly smaller number than 4 and false otherwise).
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

12

Outline
Knowledge vs Data Knowledge Representation Schemes Logic-based Knowledge Representation
Propositions Propositional Logic
Syntax Semantics

First-order Logic Conclusion


241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

13

Knowledges Representation Techniques


There are three basic techniques for representing the acquired knowledge in a knowledge base 1. Logic-based representation () (Propositional) Logic 2. Object-based representation () Semantic Networks, Frames 3. Rule-based representation () Production Rules

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

14

Outline
Knowledge vs Data Knowledge Representation Schemes Logic-based Knowledge Representation
Propositions Propositional Logic
Syntax Semantics

First-order Logic Conclusion


241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

15

Logic-based Knowledge Representation


Logic (): (T) (F) Can be used as a formal language for representing information such that conclusions can be drawn

This logical-based approach represents knowledge in a declarative, static way (i.e. as the form of sentence) so that they can be used and determined later This is the basis of the programming language PROLOG (Programming in Logic)

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

16

What is a Logic?
A logic consists of 1. A formal system for expressing knowledge about a domain consisting of Syntax Set of legal sentences (also known as Propositions or ) Semantics Interpretation of legal sentences 2. A proof system for specifying how we can derive derive new sentences from our existing sentences In a knowledge base

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

17

Propositions ()
Propositions are entities (facts or non-facts) that can be true or false ( ) Propositions are expressed using ordinary declarative sentences
e.g. the sentence expresses the proposition () that . Is this proposition true? () 4 () These are called Single Proposition (), where only one subject and verb are in the sentence.
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

18

Propositions () (cont.)
Other propositions (Complex proposition or ), where prepsotions are involved to join sentences:

() ()
1
()

4 ()

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

19

Outline
Knowledge vs Data Knowledge Representation Schemes Logic-based Knowledge Representation
Propositions Propositional Logic
Syntax Semantics

First-order Logic Conclusion


241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

20

Propositional Logic ()
(T) (F)

Input
Premises ()

Output

Inferences

Logical Process

()
or Conclusions

() Facts ( ) ( ) Example of the propositions using a simple deductive process Statement A = The mail carrier comes on Monday through Friday. Statement B = Today is Sunday. Conclusion C = The mail carrier will not come today.
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

21

Propositional Logic ()
(cont.)
All humans have 2 eyes Jane is a human Therefore Jane has 2 eyes All humans have 4 eyes Jane is a human Therefore Jane has 4 eyes Both are (logically) correct sentences
Which statements are true/false?

All humans have 2 eyes Jane has 2 eyes Therefore Jane is human No human has 4 eyes Jane has 2 eyes Therefore Jane is not human Both are (logically) incorrect sentences
Which statements are true/false?

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

22

Propositional Logic
Often use single letters or symbols to represent basic propositions in reasoning combine them into more complex sentences using operators for not, and, or, implies, iff Propositional connectives ():

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

23

From English to Propositional Formulae

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

24

Improving Readability

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

25

Semantics
The semantics of the connectives can be given by truth tables

One row for each possible assignment of True/False to propositional variables Note: Above P and Q can be any sentence, including complex sentences
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

26

Limitations of Propositional Logic


Propositional logic is extremely simple, hence it has limited expressive power and dificult to represent statements concerning objects and relations. Example: How do we use propositional logic to represent a general statement { }
To do so we would need to have a separate proposition for each person living on Earth claiming that she or he is moral. {_, _, _, and so on} This results in a huge number of separate propositions and thus causes problems of complexity with inference.

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

27

Limitations of Propositional Logic (cont.)


Moreover, This kind of logic can only expresses truth or falsehood of a sentence. So, it can not help us to express relationships between objects, e.g. Father(Bob,BobJr) So, we need a more expressive logic (like First-order logic) that allows us to reason about objects, their properties and their relations.

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

28

Outline
Knowledge vs Data Knowledge Representation Schemes Logic-based Knowledge Representation
Propositions Propositional Logic
Syntax Semantics

First-order Logic Conclusion


241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

29

First-order Logic
First-order logic furnishes us with a much more expressive knowledge representation language than propositional logic We can directly talk about objects, their properties, relations between them, etc. Here, we will have a quick tour of first-order logic

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

30

Syntax of First-order Logic (Predicate logic)

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

31

Language of First-Order Logic

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

32

Converting English into First-Order Logic

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

33

Nested Quantifiers
The order of quantification is very important

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

34

Semantics of First-Order Logic


An interpretation is required to give semantics to firstorder logic. The truth of any formula depends on the interpretation. The interpretation provides, for each:
constant symbol an object in the domain function symbols a function from domain tuples to the domain predicate symbol a relation over the domain (a set of tuples)

Then we define:

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

35

A note to students
Dont worry much if you are about to getting confuse about new terms, symbols & semantic interpretation. We wont go deeper in details of first-order logic as it has been introduced as an example of an analysis representation technique. However, you should know why first-order logic is better than propositional logic.

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

36

Conclusion
Due to the ambiguity in natural languages there is a need to specify knowledge through the use of formal languages Not only will these formal languages give us a way to remove ambiguity but they will also help to provide methods for automating inference Propositional logic and first-order logic is a move in this direction for Knowledge representation and reasoning formalism This means we can draw new conclusions from the knowledge we have (i.e. we can reason & have enough to build a knowledge-based agent)
241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

37

Reading 5 (Knowledge Representation)


Note: KR

241-320 Design Architecture & Engineering for Intelligent System

Knowledge Representation and Reasoning - part 1

38

Вам также может понравиться