Tải bản đầy đủ (.pdf) (50 trang)

Chapter 3: Representing Knowledge in Computer

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (273.62 KB, 50 trang )

Chapter 3

Representing Knowledge
in Computer
K216 C: Studies on Intelligence
School of Knowledge Science
JAIST
TuBao Ho
1


Outline of chapter 3
1. Introduction



2.
3.
4.
5.
6.

Representing knowledge
Metrics for assessing knowledge
representation schemes

Logic representation
Inference rules
Semantics networks
Frames and Scripts
Decision trees


2


Introduction


declarative knowledge is knowledge about
things





location of JAIST, its transport links
“JAIST is in Tatsunokuchi”, “Hokuriku Railroad Ishikawa
line goes from Nomachi to Tsurugi”

procedural knowledge is knowledge about
how to do things



how to get to JAIST
“Take the Hokuriku Railroad, Ishikawa line to go to
Tsurugi”, “Get on the JAIST shuttle”
3


Introduction



domain-specific knowledge: specific knowledge on a
particular subject
Example: “JAIST shuttle goes from Tsurugi to JAIST”



domain-independent knowledge: general knowledge
that applies throughout our experience
Example: “shuttle bus is a means of transport”



Common sense: common knowledge about the world
that is possessed by every schoolchild. It is evident for
human but not for machine
Example: “Bird can fly”
4


Introduction






In order to make use of knowledge in AI and
intelligent systems we need to get it from the source
(knowledge acquisition) and represent it in a form

usable by the machine
Human knowledge is usually expressed through
language, which cannot be accurately understood by
machine
The representation of knowledge in computer must
therefore be both appropriate for the computer to use
and allow easy and accurate encoding from the source
5


Example of representing knowledge
The “15 game”: two people A and B take turns
selecting numbers from 1 to 9 without replacement.
The person who first has exactly three numbers in his
collection that add up to 15 wins the game



A 5; B 3
A 5, 9; B 3, 1



A 5, 9, 4; B 3, 1, 2



A 5 9 4 6 win!!




(A selects 5; B selects 3)
(A selects 9: B chooses 1 to
prevent A from achieving 15)
(A selects 4; B chooses 2 to
block A)
(A selects 6 and wins with
4+5+6 = 15)
6


Example of representing knowledge


A choosing 5 is equivalent to
putting A’s marker in the ticktack-toe board. Use tick-tack-toe
representation for the “15 game”
A 5; B 3

A 5, 9; B 3, 1

A 5, 9, 4; B 3, 1, 2

A 5 9 4 6 win!!

A

B

A

A
B

B
B

A
A
B

2

9

4
3

6

5
1

A
B

B A

A

A


B

A B
7


Aspects of representation languages
1. The syntax describes the possible configurations that
can constitute sentences




External representation: how sentences are represented on
the printed page
Internal representation: the real representation inside the
computer

2. The semantics determines the fact in the world to
which the sentences refer. Without semantics, a
sentence is just an arrangement of electrons or a
collection of marks on a page
8


Metrics for assessing knowledge
representation schemes



Expressiveness
Handle different types and levels of knowledge



Effectiveness (効果)
Effectiveness is doing the right thing



Efficiency (能率)
Efficiency is doing the thing right



Explicitness
Be able to provide an explanation of its inferences
9


Outline of chapter 3
1. Introduction
2.

Logic representation
2.1
2.2

Propositional logic
Predicate logic


Inference rules
4. Semantics networks
5. Frames and Scripts
6. Decision trees
3.

10


Propositional logic


A proposition is a statement that can
have one of two values: true or false
(known as truth values)
Example: “It is raining” and “I am
hungry” are propositions whose values
depend on the situation at the time



Propositions P and Q can be combined
using operators such as and  (PQ)
and or

 (PQ)

PQ PQ
T

F

P
T

Q
T

T

F

F

T

F

T

F

T

F

F

F


F

True value table

Example: “It is raining” and “I am
hungry”
11


Propositional logic





simple syntax: proposition symbols such as P and
Q with logical values True and False, and
the logical connectives , , , , , and ()
sentences are made by symbols using rules:
- Propositional symbol such as P or Q is a sentence by itself
- Wrapping parentheses around a sentence yields a sentence, e.g.,
(PQ)
- A sentence can be formed by combining simpler sentences with
one of the five logical connectives

12


Propositional logic



(and): A sentence using , such as P  (Q  R), is called a
conjunction (logic); its parts are the conjuncts



(or): A sentence using

, such as A  (P  Q), is a

disjunction of the disjuncts A and (P



 Q)

 Q)  R is called an
implication. Its premise or antecedent is P  Q, and its

(implies): A sentence such as (P

conclusion or consequent is R. Implications are also known as
rules or if-then statements



(equivalent): The sentence (P




(not): A sentence such as

 Q)  (Q  P) is an equivalence

P is called the negation of P;

 is the only connective that operates on a single sentence.

13


Propositional logic
Straightforward semantics: we define it by specifying
the interpretation of the proposition symbols and
constants, and specifying the meanings of the logical
connectives
P
T

Q
T

P

T

F

F


F

T

F

F

F

T

T

F

T

T

F

F

F

T

F


F

T

T

F

PQ PQ
T
T

PQ PQ
T
T

14


Predicate logic




The propositional logic has limitations in its expressive
power and is expanded to the predicate logic by
introducing terms, functions, predicates, and quantifiers
A “predicate” denotes a relationship between objects
- Red(x), a unary relation, is a predicate expression that asserts
that x is red.

- Father(Ichiro, Taro) asserts that Ichiro is the father of Taro.



A predicate can take on a value of true or false when its
variables have assumed specific values
15


Predicate logic


Parametrized propositions give us predicate logic
father(Ichiro, Taro), father(Ichiro, Jiro)
father is the predicate, Ichiro, Taro and Jiro are
parameters



In predicate logic parameters can also include
variables
father(Ichiro, x)
x is a variable that can be instantiated with a value
(name of someone of whom Ichiro is the father)
16


Predicate logic



The universal quantifier (), e.g., x, is the
notation that indicates “for all x”
“all men are animals”: (x)[Man(x)  Animal(x)]



The existential quantifier, “there exists” is
designated by an 
“There is at least one x such that x is greater than zero”
can be represented by (x)(x>0)
“A red object is on top of a green one” can be
represented by (x) (y)[Red(x)  Green(y)  ontop(x,y)]
17


Predicate logic


These quantifiers can be combined in the same expression
“Everyone has a mother” can be expressed as
(x)(y)[(Human(x)  Mother(y, x)]





(x)Q(x) expresses the fact that something has a certain
property without saying which thing has that property
(x)[P(x)  Q(x)] expresses the fact that everything in a
certain class has a certain property without saying what

everything in that class is

18


Semantics in logic representation




to an automatic theorem proving system these
are merely symbols that are to be manipulated.
The system sees no difference between P(x) and
Red(x); the meaning or semantics must be
provided by the user mapping the variables and
functions to things in the problem domain.
The specification of a domain and the associations
between logical symbols and the problem domain
constitute an interpretation or a model of the
logical system.
19


Assessing logic representation









expressive: it allows representation of facts,
relationships between facts and assertions about facts.
It is relatively understandable
effective: new facts can be inferred from old. It is also
amenable to computation through PROLOG
efficient: the use of predicates and variables makes the
representation scheme relatively efficient, although
computational efficiency depends to a degree on the
interpreter being used and the programmer
explicit: explanations and justifications can be provided
by backtracking
20


Outline of chapter 3




Introduction
Logic representation
Inference rules








Representing knowledge by rules
The conditions of rules

Semantics networks
Frames and Scripts
Decision trees
21


Representing knowledge by rules






Inference rules (production rules)
condition  conclusion [condition and action parts]
AB
(if A then B)
if (Primary Exam>700) (live in Kansai)(good at
math)
then (take the entrance exam at the School of
Knowledge Science of JAIST)
if (feel tired)  (has fever)  (sneeze)
then (have a cold)
22



Representing knowledge by rules
Given a true fact “Wind blows”, and the rule
if wind blows then the hooper makes money,
We have a total match of the form
A = true
if A then B
and we can conclude B = true. To check whether a condition part
matches a fact or an expression is called pattern-matching
if height of X > height of Y
then X is taller than Y
height of Ichiro = 1.70m
height of Jiro = 1.75m, X = Jiro, Y = Ichiro
We get the result “Jiro is taller than Ichiro”
23


Using logical expressions
The condition part of a production rule can contain the
usual logical expressions. The following is a sample
condition:
Ex. if the season is june  isobarometric line runs
east to west
then isobarometric line is the line of rainy season
Ex. if the line of rainy season is at the south shore of
Japan  cloud is growing at the south shore of Japan
then the south shore will have heavy rain
24


The conditions of rules



should not write rules that are inconsistent. Rules in
which the condition parts are the same should have the
same action parts
if A then B and if A then B



should not write a production rule that causes a loop
if A then B1
if B1 then B2

if Bn then A
25


×