1 / 11

Frames:

Frames:. Organizing Knowledge Networks More Compactly. Motivations. Semantic nets good for inheritance. Networks can get big and messy. Script technology is useful when everything happens according to the script, stereotype. When something unexpected happens, the script becomes unstable.

sinjin
Télécharger la présentation

Frames:

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Frames: Organizing Knowledge Networks More Compactly

  2. Motivations • Semantic nets good for inheritance. • Networks can get big and messy. • Script technology is useful when everything happens according to the script, stereotype. • When something unexpected happens, the script becomes unstable. • AI representation technology, frame, is sometimes used instead for these more volatile situations.

  3. Objectives • Script for family staying in a hotel • Frames • Slots • Prolog implementations

  4. Script: Family stay in a hotel • We can attempt to write a script for a family of 7 to stay in a hotel overnight. • Roles: family, porter (door attendant), luggage handler, receptionist, room maid, housekeeper, concierge (assists guests with local info), … • Props: lobby, room, beds, bathroom, telephone, light switches, TV, … • Scenes: arrival, take care of luggage, check in, go to room, … sleep, … check out. • Script technology is useful when everything happens according to the script. • For a family with 5 kids to stay in a hotel, invariably someone is NOT going to follow the script. • When something unexpected happens, the script becomes unstable. • AI technology, frame, is sometimes used instead in these more volatile situations.

  5. Hotel framework • Part of a frame description of a hotel room. • “Specialization of” indicates a pointer to a superclass frame slot

  6. Slots Frames: an object has named slots with • values • procedures • links to other frames Slots • filled in as information becomes available • loosely correspond to relations in a conceptual graph Advantage: it is clearer the main object is a dog Easier to indicate hierarchies via inheritance (from animal) Accessories point to collar and bowl frames Procedural info can be attached e.g. how to calculate default values such as 4 legs. e.g. deductions based on marital status, number of children,...

  7. Frame slots • A frame is a set of slots (similar to a set of fields in a class in OO) • The slots may contain the following information

  8. Single bit adder with carry Addends In XOR Sum Out Carry In Carry Out AND

  9. Frame Representation of C1 C1 Instance-Of: Circuit Input: C1-Addend1 C1-Addend2 C1-Carry-In Output: C1-Sum C1-Carry-Out Gate: X1 X2 A1 A2 O1 X1 Instance-Of: Xor-Gate Input1: X1-Input1 Input2: X1-Input2 Output: X1-Output X1-Input1 Instance-Of: Terminal Connected-To: C1-Addend1 ...

  10. Prolog implementation frame arguments: 1. frame id 2. isa 3. list of properties 4. list of defaults frame( name(bird), isa(animal), [travel(flies),feathers], [] ). frame( name(penguin), isa(bird), [color(brown)], [travel(walks)] ). frame( name(canary), isa(bird), [color(yellow),call(sing)], [size(small)] ). frame( name(tweety), isa(canary), [], [color(white)] ). getP(Object,Prop) :- frame( name(Object), _, List_of_properties, _ ), member(Prop,List_of_properties). getP(Object,Prop) :- frame( name(Object), _, _, List_of_defaults ), member(Prop, List_of_defaults). getP(Object,Prop) :- frame( name(Object), isa(Parent), _, _ ), getP(Parent, Prop). ?- getP(canary,color(yellow)). More? Yes ?- getP(canary,color(brown)). No ?- getP(tweety,color(brown)). No ?- getP(tweety,color(yellow)). More? Yes ?- getP(tweety,Prop). Prop = color(white) ; Prop = color(yellow) ; Prop = call(sing) ; Prop = size(small) ; Prop = travel(flies) ; Prop = feathers ; No

  11. Conclusion • AI representations: • Semantic networks • Scripts • Frames • Led to object-oriented programming philosophy, e.g., Java programming language. • Frames can organize knowledge more structurally and flexibly.

More Related