mappings between facts and representationsvt282rt3116/vt282... · 2015-10-13 ·...

Post on 12-Jul-2020

1 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

Mappings between Facts and Representations

Artificial Intelligence,McGraw-Hill ©1991 -78- Rich/Knight, Chapter4

Eight Declarative KR Structures

" Predicate logic

" Production rules

" Nonmonotonic systems

" Statistical reasoning systems

" Semantic nets

" Frames

" Conceptual dependency

" Scripts

" CYC

Artificial Intelligence, McGraw-Hill ©1991 -248- Rich/Knight, Chapter 1

Procedural Knowledge as Rules

If: ninth inning, andscore is close, andless than 2 outs, andfirst base is vacant, andbatter is better hitter than next batter,

Then: walk the batter,

Artificial Intelligence,McGraw-Hill©1991 -88- Rich/Knight, Chapter 4

Using LISP Code to Define a Value

Baseball-Player

Isa : Adult-Male

bats : (lambda (x)(prog ()

Ll(cond ((caddr x) (return (caddr x)))

(t (setq x (eval (cadr x)))(cond (x (go Ll))

(t (return nil]

height: 6-1

bat-avg : .252

Artificial Intelligence,McGraw-Hill ©1991 -87- Rich/Knight, Chapter4

Inferential Knowledge

V* : Ball{x) AFly(x) AFair(x) AInfield-Catchable (x) AOccupied-Base{Firsi) AOccupied-Base(Second) A(Gtota < 2) A-i[Lm^-Dnv^(;c) V Attempted-Bunt(x)]

—» Infield-Fly(x)

Vx9<y : Batter{x) Abatted{x, y) AInfield-Fly(y)

—> Out(x)

ArtificialIntelligence,McGraw-Hill©1991 -86- Rich/Knight, Chapter4

Viewing a Node as a Frame

Baseball-PlayerIsa : Adult-Malebats : (EQUAL handed)height : 6-1batting-average : .252

Artificial Intelligence,McGraw-Hill ©1991 -84- Rich/Knight, Chapter4

InheritableKnowledge

Artificial Intelligence, McGraw-Hill ©1991

I

A Predicate Logic Example

1. Marcus was a man.

2. Marcus was a Pompeian

3. All Pompeians were Romans

4. Caesar was aruler

5. All Romans were either loyal to Caesar orhated him.

6. Everyone is loyal to someone.

7. People only try to assassinate rulers theyare not loyal to.

8. Marcus tried to assassinate Caesar.

Artificial Intelligence,McGraw-Hill ©1991 -102- Rich/Knight, Chapter 5

I

A Predicate Logic Example

1. Marcus was a man.man(Marcus)

2. Marcus was a PompeianPompeian(Marcus)

3. All Pompeians were Romans.Vjc : Pompeian(x) —> Roman(x)

4. Caesar was a rulerruler{Caesar)

5. All Romans were either loyal to Caesar or hated him.\/x : Roman(x) —► loyaltoix, Caesar) V hate(x, Caesar)

6. Everyone is loyal to someone.Vx : 3y : loyalto{x^ y)

7. People only try to assassinate rulers they aren't loyal toVjc : Vy : person(x) A ruleriy) A tryassassinate(x, y)

—► -^loyalto{x 1 y)8. Marcus tried to assassinate Caesar,

tryassassinate(Marcus, Caesar)

9. All men are peopleVjc : manix) —> person(x)

Artificial Intelligence, McGraw-Hill ©1991 -103- Rich/Knight, Chapter 5

An Attempt to Prove -^loyalto(Marcus, Caesar)

-^loyaltoiMarcus, Caesar)t (7, substitution)

person{Marcus) Aruler{Caesar) Atryassassinate(Marcus, Caesar)

T (4)person{Marcus) Atryassassinate{Marcus 1 Caesar)

T (8)person(Marcus)

T (9)man(Marcus)

T (1)nil

ArtificialIntelligence, McGraw-Hill ©1991 -104- Rkh/Knight, Chapter 5

A Resolution ProofAxioms in clause form:1. man(Marcus)2. Pompeian(Marcus)3. V Romanix\)4. ruler(Caesar)5. -ißomanix:) V loyaltoixi, Caesar) V hate(x 2, Caesar)6. l()yalto(X},f/{x}))7. -ww/Kxi) V ->rulcr{y\) V -itryassassinate(X4.x\ ) V loyalto(x4, vi )8. tryassassinate(Marcus,Caesar)

(a)

Prove: hate(Marcus\ Caesar) -ihateiMarcus, Caesar) 5

Marcus/x'23 ißoman(Marcus) V loyalto(Marcus< Caesar)

Marcus/x\->Pompeian(Marcus) V loyalto(Marcus, Caesar) 2

V ~->tryassassinate(Marcus.Caesar)

Artificial Intelligence,McGraw-Hill©1991 -127- Rich/Knight, Chapter5

A Semantic Network

Artificial Intelligence,McGraw-Hill ©1991 -209- Rkh/Knight, Chapter9

A Simplified Frame System

Personisa : Mammalcardinality :* handed :

6,000,000,000Right

Adult-Maleisa :cardinality :

* height :

Person2,000,000,0005-10

ML-Baseball-PlayerIsa : Adult-Malecardinality : 624* height : 6-1* bats : equal to handed* batting-average : .252* team :

* uniform-color :

Artificial Intelligence,McGraw-Hill©1991 -214- Rich/Knight,Chapter 9

A Simplified Frame System (Cont'd)

Fielderisa : ML-Baseball-Playercardinality : 376* batting-average : .262

Pee-Wee-Reeseinstance :height :bats :batting-average :team :

Fielder5-10Right.309Brooklyn-DodgersBlueuniform-color :

ML-Baseball-Teamisa :cardinality :

* team-size :

* manager :

Team2624

Artificial Intelligence,McGraw-Hill ©1991 -215- Rich/Knight, Chapter 9

Representing Relationships among Classes

ML-Baseball-Playeris-covered-by : {Pitcher,

Catcher,Fielder],{American-Leaguer,National-Leaguer}

PitcherML-Baseball-Player{Catcher, Fielder}

Isa :mutually-disjoint-with

ArtificialIntelligence,McGraw-Hill ©1991 -220- Rich/Knight, Chapter9

Slots as Full-Fledged Objects

We want to be able to represent and use the following prop-erties of slots (attributes orrelations):

" The classes to which the attribute can be attached.

" Constraints on either the type or the value ofthe attribute

" A value that all instances of a class must have by thedefinition of the class.

" A default value for the attribute

" Rules for inheriting values for the attribute

" Rules for computing a value separately from inheritance

" An inverse attribute.

" Whether the slot is single-valued or multivalued.

Artificial Intelligence, McGraw-Hill ©1991 -222- Rich/Knight, Chapter 9

Representing Slots as Frames, II

SlotClassClass

Isa :instance :* domain :* range :* range-constraint* definition :

* default :* transfers-through* to-compute :* inverse :* single-valued :

managerinstance :domain :range :

SfofML-Baseball-TeamPerson

range-constraintdefault :

Ax (experience x.manager)

inverse : manager-ofTRUEsingle-valued :

Artificial Intelligence, McGraw-Hill©1991 -224- Rich/Knight, Chapter9

Associating Defaults with Slots

batting-averageinstance : Slotdomain :range :range-constraintdefault :single-valued :

fielder-batting-averageinstance :isa :domain :range :range-constraint :default :single-valued :

Slotbatting-averageFielder

Artificial Intelligence,McGraw-Hill ©1991 -227- Rich/Knight, Chapter9

ML-Baseball-PlayerNumberAx (0 < < 1).252TRUE

NumberAx (0 < < 1).262TRUE

Algorithm: Property Inheritance

Toretrieve a value V for attribute A of an instance object O1 . Find Oin the knowledge base.

2. If there is a value there for the attribute A, report that value.

3. Otherwise, see if there is a value for the attribute instance.If not, then fail.

4. Otherwise, move to the node corresponding to that valueand look for a value for the attribute A. If one is found,report it.

5. Otherwise, do until there is no value for the isa attribute oruntil an answer is found:

(a) Get the value of the isa attribute and move to that node.(b) See if there is a value for the attribute A. If there is,

report it.

Artificial Intelligence,McGraw-Hill ©1991 -85- Rich/Knight, Chapter4

A Simple Conceptual Dependency Representation

where the symbols have the following meanings:

" Arrows indicate direction of dependency.

" Double arrow indicates two way link between actor andaction.

" p indicates past tense

" ATRANS is one of the primitive acts used by the theory.It indicates transfer of possession.

" o indicates the object case relation.

" R indicates the recipient case relation.

Artificial Intelligence,McGraw-Hill ©1991 -236- Rich/Knight, Chapter 10

CD Primitive Actions

ATRANS Transfer of an abstract relationship (e.g., give)PTRANS Transfer of the physical location of an object (e.g.,

go)

PROPEL Application of physical force to an object (e.g.,push)

MOVE Movement of a body part by its owner (e.g., kick)

GRASP Grasping of an object by an actor (e.g., clutch)INGEST Ingestion of an object by an animal (e.g., eat)EXPEL Expulsion of something from the body of an animal

(e.g., cry)

MTRANS Transfer of mental information (e.g., tell)

MBUILD Building new information out of old (e.g., decide)

SPEAK Production of sounds (e.g., say)

ATTEND Focusing of a sense organ toward a stimulus (e.g.,listen)

The Dependencies of CD

4. nice

vvgIfPoss-byJohn „

PAPPoPP

5.

John <=> PROPEL «°- cart

PP tobook

v JohnJohn <=> INGEST*-1- 1>

. to Vice cream I o

ACT^Q8.

Johnran.

Johnis tall.

Johnis a doctor.

Anice boy.

John's dog.

Johnpushedthe cart.

John took thebook from Mary

John ate icecream witha spoon.

Johnfertilizedthe field.

Theplants grew.

Bill shotBob.

12. Johnranyesterday.

13. While goinghome, I sawa frog.

eyes

I heard a frogin the woods.

1. pp <=> ACT John <=> PTRANS

2. PP WPA John V-V height (> average)PP^^ Pi john doctor

PP boyt t

6* ACT +°- PP

n RH^PP yt£v Rr^John7. ACT JohnV=> ATRANS

spoon

9- ACT^j JohnVV PTRANS*~~L,,"-^PP to

fertilizer

Ir\

' I—* PA » i—► size > x10. pp^_^ plantsPA size = x* v 0 Rr"* Bob

(a) <=> (b) <=> Bill <=> PROPEL^ bullet *l

<£> Bob^ health(-10)

yesterday

John <=> PTRANS

I<^PTRAJNS<-^l<-^f~* °me

I <=>MTRANS *■£■ frog «"^£tPP woods

14. $<=> <=>MTRANS 4-°- frog <-^T*°?

■—Cears

The CD Representation of a Threat

"Bill threatened John with a broken nose."

John Bill

I Poss-byt Bill nose < JohnP o -f> <ffrBill <^ MTRANS«

I do - brokeno

John <£z> believe * ,John <z^> do9

cf

Bill <^ do jIft

>

nose brokenPoss-by

John

Artificial Intelligence,McGraw-Hill©1991 -242- Rich/Knight, Chapter 10

The Restaurant Script

L

top related