L9_KR_p1
-
Upload
bomezzz-enterprises -
Category
Documents
-
view
221 -
download
0
Transcript of L9_KR_p1
-
8/3/2019 L9_KR_p1
1/38
241-320 Design Architecture and Engineeringfor Intelligent System
Suntorn Witosurapot
Contact Address:Phone: 074 287369 or
Email: [email protected]
November 2010
-
8/3/2019 L9_KR_p1
2/38
Lecture 10:
Knowledge Representationand Reasoning Part 1
( )
-
8/3/2019 L9_KR_p1
3/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1
3
Preview
Our last lectures were all focused on algorithms thatallow 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 thathas more chance to win
etc.
In this lecture, we move our focus from problem-specific agents to knowledge-based agents
-
8/3/2019 L9_KR_p1
4/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 4
Preview (cont.)
Knowledge-based Agents
Can representknowledge
And reasonwith this knowledge,
Can combine general knowledge with currentpercepts 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
-
8/3/2019 L9_KR_p1
5/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 5
Preview: Knowledge bases
Knowledge base = set of sentences in a formal language
Allows an agent to reason about the world, deduce hiddenproperties 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.
-
8/3/2019 L9_KR_p1
6/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 6
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 computer-tractable way (for use by the agent in reasoning)
Reasoning attempts to take this knowledge and drawinferences (e.g. answer queries, determine facts that followfrom the knowledge base, decide what to do, etc.)
-
8/3/2019 L9_KR_p1
7/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 7
Outline
Knowledge vs Data
Knowledge RepresentationSchemes
Logic-based Knowledge Representation Propositions
Propositional Logic
Syntax
Semantics First-order Logic
Conclusion
-
8/3/2019 L9_KR_p1
8/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 8
Information Hierarchy
Data
The raw material of information
Information
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-levelunderstanding
Data
Information
Knowledge
Wisdom
More refined and abstract
-
8/3/2019 L9_KR_p1
9/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 9
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
-
8/3/2019 L9_KR_p1
10/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 10
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??
-
8/3/2019 L9_KR_p1
11/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 11
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 ( )
-
8/3/2019 L9_KR_p1
12/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 12
Syntax vs. Semantics
Syntax () Describes the legal sentences ina knowledge representation language (e.g. in thelanguage of arithmetic expressions x
-
8/3/2019 L9_KR_p1
13/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 13
Outline
Knowledge vs Data
Knowledge Representation Schemes
Logic-based Knowledge Representation Propositions
Propositional Logic
Syntax
Semantics First-order Logic
Conclusion
-
8/3/2019 L9_KR_p1
14/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 14
Knowledges Representation Techniques
There are three basic techniques for representing theacquired knowledge in a knowledge base
1. Logic-based representation ()
(Propositional) Logic
2. Object-based representation ()
Semantic Networks, Frames
3. Rule-based representation () Production Rules
-
8/3/2019 L9_KR_p1
15/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 15
Outline
Knowledge vs Data
Knowledge Representation Schemes
Logic-based Knowledge Representation Propositions
Propositional Logic
Syntax
Semantics First-order Logic
Conclusion
-
8/3/2019 L9_KR_p1
16/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 16
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 ina 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 languagePROLOG (Programming in Logic)
-
8/3/2019 L9_KR_p1
17/38
241-320 Design Architecture &Engineering for Intelligent System
Knowledge Representation andReasoning - part 1 17
What is a Logic?
A logic consists of
1. A formal system for expressing knowledge about adomain consisting of
SyntaxSet of legal sentences (also known asPropositions or)
SemanticsInterpretation of legal sentences
2. A proof system for specifying how we can derivederive new sentences from our existing sentencesIn a knowledge base
-
8/3/2019 L9_KR_p1
18/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 18
Propositions ()
Propositions are entities (facts or non-facts) that canbe 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 (),whereonly one subject and verb are in the sentence.
-
8/3/2019 L9_KR_p1
19/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 19
Propositions () (cont.)
Other propositions (Complex propositionor),where prepsotions are involved to join sentences:
()
()1
4 ()
()
-
8/3/2019 L9_KR_p1
20/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 20
Outline
Knowledge vs Data
Knowledge Representation Schemes
Logic-based Knowledge Representation Propositions
Propositional Logic
Syntax
Semantics First-order Logic
Conclusion
-
8/3/2019 L9_KR_p1
21/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 21
Propositional Logic ()
(T) (F)
Logical Process
()
OutputInput
Facts(
)
Inferences
()
orConclusions
()
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.
Premises()
-
8/3/2019 L9_KR_p1
22/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 22
Propositional Logic ()(cont.)
All humans have 2 eyesJane is a humanTherefore Jane has 2 eyes
All humans have 4 eyesJane is a humanTherefore Jane has 4 eyes
All humans have 2 eyesJane has 2 eyesTherefore Jane is human
No human has 4 eyesJane has 2 eyesTherefore Jane is not human
Both are (logically) correctsentences Both are (logically) incorrectsentences
Which statements are true/false? Which statements are true/false?
-
8/3/2019 L9_KR_p1
23/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 23
Propositional Logic
Often use single letters or symbols to representbasic propositions in reasoning
combine them into more complex sentences using
operators for not, and, or, implies, iff
Propositional connectives():
-
8/3/2019 L9_KR_p1
24/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 24
From English to Propositional Formulae
-
8/3/2019 L9_KR_p1
25/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 25
Improving Readability
-
8/3/2019 L9_KR_p1
26/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 26
Semantics
The semantics of the connectives can be given bytruth tables
One row for each possible assignment of True/Falseto propositional variables
Note:Above Pand Qcan be anysentence,including complex sentences
-
8/3/2019 L9_KR_p1
27/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 27
Limitations of Propositional Logic
Propositional logic is extremely simple, hence it haslimited expressive power and dificult to representstatements 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 andthus causes problems of complexity with inference.
-
8/3/2019 L9_KR_p1
28/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 28
Limitations of Propositional Logic (cont.)
Moreover, This kind of logic can only expresses truthor 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-orderlogic) that allows us to reason about objects, theirproperties and their relations.
-
8/3/2019 L9_KR_p1
29/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 29
Outline
Knowledge vs Data
Knowledge Representation Schemes
Logic-based Knowledge Representation Propositions
Propositional Logic
Syntax
SemanticsFirst-order Logic
Conclusion
-
8/3/2019 L9_KR_p1
30/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 30
First-order Logic
First-order logic furnishes us with a much moreexpressive knowledge representation language thanpropositional logic
We can directly talk about objects, their properties,relations between them, etc.
Here, we will have a quick tour of first-order logic
-
8/3/2019 L9_KR_p1
31/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 31
Syntax of First-order Logic (Predicate logic)
-
8/3/2019 L9_KR_p1
32/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 32
Language of First-Order Logic
-
8/3/2019 L9_KR_p1
33/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 33
Converting English into First-Order Logic
-
8/3/2019 L9_KR_p1
34/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 34
Nested Quantifiers
The order of quantification is very important
-
8/3/2019 L9_KR_p1
35/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 35
Semantics of First-Order Logic
An interpretation is required to give semantics to first-order logic. The truth of any formula depends on theinterpretation.
The interpretation provides, for each:
constant symbol an objectin 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:
-
8/3/2019 L9_KR_p1
36/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 36
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 analysisrepresentation technique.
However, you should know why first-order logic isbetter than propositional logic.
-
8/3/2019 L9_KR_p1
37/38
241-320 Design Architecture &Engineering for Intelligent System Knowledge Representation andReasoning - part 1 37
Conclusion
Due to the ambiguity in natural languages there is aneed to specify knowledge through the use of formallanguages
Not only will these formal languages give us a way to
remove ambiguity but they will also help to providemethods for automating inference
Propositional logicand first-order logic is a move inthis direction for Knowledge representation and
reasoning formalism This means we can draw new conclusions from the
knowledge we have (i.e. we can reason & haveenough to build a knowledge-based agent)
-
8/3/2019 L9_KR_p1
38/38
241 320 Design Architecture & Kno ledge Representation and 38
Reading
5 (Knowledge Representation)
Note:KR