ASSOCIATIVE NETS AND FRAME SYSTEMS Network Representations If L is - - PowerPoint PPT Presentation

associative nets and frame systems
SMART_READER_LITE
LIVE PREVIEW

ASSOCIATIVE NETS AND FRAME SYSTEMS Network Representations If L is - - PowerPoint PPT Presentation

ASSOCIATIVE NETS AND FRAME SYSTEMS Network Representations If L is a set of labeled links and N is a set of nodes, then a network is any subset of NLN, where the order of the triples is material. Lecture 4 Associative Nets & Frames


slide-1
SLIDE 1

Lecture 4 Associative Nets & Frames 1

ASSOCIATIVE NETS AND FRAME SYSTEMS

Network Representations

If L is a set of labeled links and N is a set of nodes, then a network is any subset of N×L×N, where the order of the triples is material.

slide-2
SLIDE 2

Lecture 4 Associative Nets & Frames 2

Associationist Theories of Meaning

Associationist theories define the meaning of an

  • bject in terms of a network of associations

with other objects in a mind or a knowledge base. e.g. through experience we associate the concept

  • f snow with other concepts such as cold,

white, snowman, slippery and ice.

slide-3
SLIDE 3

Lecture 4 Associative Nets & Frames 3

Network Representation of properties

  • f snow and ice

ice hard clear

hardness temperature

soft slippery white cold snow snowman

made of texture color temperature color

slide-4
SLIDE 4

Lecture 4 Associative Nets & Frames 4

Implementing Network Representation in CLIPS

CLIPS> (deftemplate net ;network representation (slot name (type SYMBOL) ) (slot color (type SYMBOL) ) (slot temperature (type SYMBOL) ) (slot texture (type SYMBOL) ) (slot hardness (type SYMBOL) ) ) CLIPS> (deffacts things ;defining two things (net (name snow) (color white) (temperature cold) (texture slippery) (hardness soft)) (net (name ice) (color clear) (texture slippery) (temperature cold) (hardness hard)))

slide-5
SLIDE 5

Lecture 4 Associative Nets & Frames 5

Implementing Network Representation in CLIPS (contd.)

;Associating snow with something else which is also cold CLIPS> (defrule association (net (name snow) (temperature cold)) (net (name ?Y&~snow) (temperature cold)) => (printout t "snow reminds me of " ?Y crlf))

slide-6
SLIDE 6

Lecture 4 Associative Nets & Frames 6

Implementing Network Representation in CLIPS (contd.)

CLIPS> (watch facts) CLIPS> (watch rules) CLIPS> (reset) ==> f-0 (initial-fact) ==> f-1 (net (name snow) (color white) (temperature cold) (texture slipper) (hardness soft) ==> f-2 (net (name ice) (color clear) (temperature cold) (texture slippery) (hardness hard) CLIPS> (run) FIRE 1 association: f-1, f-2 snow reminds me of ice

slide-7
SLIDE 7

Lecture 4 Associative Nets & Frames 7

Semantic Network by Collins & Quillian

can has has is a FISH can is a BIRD ANIMAL Fly Wings Feathers Breathe Skin Sing Yellow CANARY can is Sing Tall OSTRICH cannot is Move has can is a is a

slide-8
SLIDE 8

Lecture 4 Associative Nets & Frames 8

Human Information Storage and Response Time

1.5 1.4 1.3 1.2 1.1 1.0 0.9 Response Time (sec) A canary is a bird A canary can sing “Complexity” of sentence A canary has skin A canary can fly A canary is a canary A canary is an animal

slide-9
SLIDE 9

Lecture 4 Associative Nets & Frames 9

Implementing Semantic Nets in CLIPS

CLIPS> (deftemplate species (slot node (type SYMBOL) ) (slot is-a (type SYMBOL) ) (multislot is (type SYMBOL) ) (multislot has (type SYMBOL) ) (multislot can (type SYMBOL) ) (multislot cannot (type SYMBOL) ) ) CLIPS> (deffacts biology (species (node canary) (is-a bird) (is yellow) (can fly) ) (species (node ostrich) (is tall) (cannot fly) (is-a bird) ) (species (node bird) (is-a animal) (can fly) (has wings feather) ) (species (node fish) (is-a animal) ) (species (node animal) (can breathe move) (has bones skin) ) )

slide-10
SLIDE 10

Lecture 4 Associative Nets & Frames 10

Implementing Semantic Nets in CLIPS (contd.)

CLIPS> (defrule link1 (declare (salience 10)) (species (node ?X)(is-a ?Y&~nil)) => (printout t "A " ?X " is a " ?Y crlf)) CLIPS> (defrule link2 (declare (salience 5)) (species (node ?X) (is-a ?Y)) (species (node ?Y) (is-a ?Z&~nil)) => (printout t "A " ?X " is a " ?Z crlf))

slide-11
SLIDE 11

Lecture 4 Associative Nets & Frames 11

Implementing Semantic Nets in CLIPS (contd.)

CLIPS> (defrule link3 (species (node ?X) (is-a ?Y)) (species (node ?Y) (is-a ?Z)) (species (node ?Z) (has $?W)) => (printout t "A " ?X " has " (implode$ ?W) crlf))

slide-12
SLIDE 12

Lecture 4 Associative Nets & Frames 12

Implementing Semantic Nets in CLIPS (contd.)

CLIPS> (reset) CLIPS> (run) A fish is a animal A bird is a animal A ostrich is a bird A canary is a bird A canary is a animal A ostrich is a animal A ostrich has bones skin A canary has bones skin

slide-13
SLIDE 13

Lecture 4 Associative Nets & Frames 13

Semantic Nets for Natural Language

The word “give” has the following associated roles: a donor, a recipient and an object given.

give person person thing

recipient donor

  • bject
slide-14
SLIDE 14

Lecture 4 Associative Nets & Frames 14

An Instance of a Semantic Net

give-1 john mary book

recipient donor

  • bject

Knowledge derived from “John gave Mary a book”.

slide-15
SLIDE 15

Lecture 4 Associative Nets & Frames 15

Natural Language Grammar Rules

S NP VP

; S=Sentence, NP=Noun Phrase, VP=Verb Phrase

NP Proper_Noun | Article Noun | Noun VP VP PP

; PP=Prepositional Phrase

VP Verb NP PP Prep NP Proper_Noun Sarah Noun chair | glue Article the Prep with

slide-16
SLIDE 16

Lecture 4 Associative Nets & Frames 16

Natural Language Parsing

S NP VP Proper_Noun Sarah VP PP Verb NP Prep NP Article Noun fixed the chair with glue

Syntactic Analysis:

slide-17
SLIDE 17

Lecture 4 Associative Nets & Frames 17

Case Frame for English Verbs

Semantic Analysis: Knowledge representation for “Sarah fixed the chair with glue”

fix past chair glue sarah time

  • bject

instrument agent

slide-18
SLIDE 18

Lecture 4 Associative Nets & Frames 18

CLIPS Template for Case Frame

CLIPS> (deftemplate case (slot verb (type SYMBOL) ) (slot agent (type SYMBOL)) (slot object (type SYMBOL) ) (slot time (type SYMBOL) ) (slot instrument (type SYMBOL) ) )

slide-19
SLIDE 19

Lecture 4 Associative Nets & Frames 19

Structured Representations

  • Organizing knowledge into a structure called

frame.

  • A frame may be viewed as a data structure

used to represent well-understood stereotyped situations

  • Example: birds as prototypical objects with a

general property that most birds can fly though there are exceptions.

slide-20
SLIDE 20

Lecture 4 Associative Nets & Frames 20

Frame Systems

A frame system attempts to integrate

– Declarative notions about objects and events and their properties, and – Procedural notions about how to retrieve information and achieve goals.

slide-21
SLIDE 21

Lecture 4 Associative Nets & Frames 21

A Frame

Name: Name-1 Attribute-1: value-1 Attribute-2: procedure-1 . . . . . Attribute-n: value-m Attribute-3: procedure-2 Slots Fillers (procedures are sometimes known as demons)

slide-22
SLIDE 22

Lecture 4 Associative Nets & Frames 22

Hierarchy of Frames

  • Frames are typically arranged in a hierarchy in

which “lower” frames can inherit values from “higher” frames in the hierarchy.

  • Properties and procedures for “higher” frames

are more or less fixed whereas “lower” frames may be filled with more contingent information.

slide-23
SLIDE 23

Lecture 4 Associative Nets & Frames 23

Links in a Frame System

  • Instances − Classes
  • Classes - Superclasses

Machine Computer SunA SunFire Superclass Class Instances

slide-24
SLIDE 24

Lecture 4 Associative Nets & Frames 24

Inheritance System of Birds

bird superclass: vertebrate reproduction: lay_eggs covering: feathers can fly: T scavenger superclass: bird diet: (garbage carrion) sparrow superclass: songbird habitat: north america songbird superclass: bird diet: (bugs seeds) canary superclass: songbird habitat: tropical tweety instance of: canary fightless bird superclass: bird can fly: nil penguin superclass: flightless_bird habitat: south pole diet: fish

  • pus

instance of: penguin

slide-25
SLIDE 25

Lecture 4 Associative Nets & Frames 25

Hierarchical Representation for Geometric Figures of Land

Each node in the hierarchy consists of a structure with the following format: NAME: Number of Sides: Length of Sides: Size of Angles: Area: Price of Land:

Polygon Quadrilateral Trapezium Parallelogram Rectangle Square

slide-26
SLIDE 26

Lecture 4 Associative Nets & Frames 26

Defaults and Demons

Some of the slots in “Polygon” may have the following fillers: Number of Sides: 4 (default) Area: compute_area (IF-NEEDED demon) Price=compute_price(Area) (IF-ADDED demon) Price: receives value from above when Area is added or updated.

slide-27
SLIDE 27

Lecture 4 Associative Nets & Frames 27

Implementing Frames in CLIPS

CLIPS> (defclass polygon (is-a USER) ) CLIPS> (defclass quadrilateral (is-a polygon) ) CLIPS> (defclass trapezium (is-a quadrilateral) ) CLIPS> (defclass parallelogram (is-a trapezium) ) CLIPS> (defclass rectangle (is-a trapezium) ) CLIPS> (defclass square (is-a rectangle) )

slide-28
SLIDE 28

Lecture 4 Associative Nets & Frames 28

Abstract and Concrete Classes

CLIPS> (defclass polygon (is-a USER) (role abstract) (slot no_of_sides (default 4) ) ) CLIPS> (defclass quadrilateral (is-a polygon) (role concrete) ) Concrete classes can generate instances while abstract classes will not.

slide-29
SLIDE 29

Lecture 4 Associative Nets & Frames 29

Defining a demon

CLIPS> (defmessage-handler polygon sides ( ) ?self: no-of-sides) CLIPS> (definstances geometry (square-one of square) ) CLIPS> (send [square-one] sides) 4

slide-30
SLIDE 30

Lecture 4 Associative Nets & Frames 30

Multiple Inheritance in Heterarchical Representation

Polygon Regular Polygon Triangle Isosceles Triangle Equilateral Triangle Quadrilateral Rectangle Square There is no ambiguity if “Square” inherits different information from “Regular Polygon” and “Rectangle”. The same applies to “Equilateral Triangle”

slide-31
SLIDE 31

Lecture 4 Associative Nets & Frames 31

Conflicting Defaults among Frames

Person Quaker Republican Republican Quaker

(defclass person (is-a USER) ) (defclass quaker (is-a person) ) (defclass republican (is-a person) ) (defclass republican-quaker (is-a republican quaker) (role concrete) )

slide-32
SLIDE 32

Lecture 4 Associative Nets & Frames 32

Effect of Class Precedence

CLIPS> (defmessage-handler quaker speak ( ) (printout t crlf “Peace”) ) CLIPS> (defmessage-handle republican speak ( ) (printout t crlf “War”) ) CLIPS> (definstance people (richard of republican-quaker) ) CLIPS> (send [richard] speak) War