objects
DESCRIPTION
Objects. Objects are at the heart of the Object Oriented Paradigm What is an object?. Objects. We are surrounded by objects. In this class room there are desks, blackboards, lights , chairs and so on. Each object has specific attributes - PowerPoint PPT PresentationTRANSCRIPT
Objects
• Objects are at the heart of the Object Oriented Paradigm
• What is an object?
Objects
• We are surrounded by objects.• In this class room there are desks,
blackboards, lights , chairs and so on.• Each object has specific attributes• The desk is made of wood. The seat has a
blue cover and so on.
Objects have associations and relationships with each other .
• Objects have associations and relationships with each other .
• Seats have desktops attached.• All are attached to the floor• Seats are adjacent to other seats.• They are oriented in the same way.• Lights are controlled by switches
Object Roles and Functions
• Each Object in the room has a specific role or function or behaviour.
• Seats are to be sat on.• Board is to be written on.• Lights can be turned on and off• Boards can be moved up and down and
seats can be put up and down.
Objects can be classified
• Within the room objects can be grouped into different classes
• For example we could have the furniture objects e.g. chairs, tables, worktop
• We could also have the electrical objects.• Lights, projector, laptop and so on.
The nature of Objects• Clearly Objects constitute a complex multi
faceted concept.• Their definition is dependent on many elements-
their attributes , their behaviour, their classification and as we will see much , much more
• To investigate the nature of objects , it is helpful to consider an important knowledge representation scheme which is the basis for theoretical frameworks of the object oriented paradigm
• This framework is known as semantic networks
Semantic Nets
• Semantic networks are a popular scheme which elegantly reflect these ideas.
• A network consists of nodes repesenting objects, concepts and events and links between the nodes representing their interrelations.
Example
• Using the example Birds have wings • a typical semantic net would be
Origin• The development of semantic networks had its
origins in psychology. Ross Quillian in 1968 designed two semantic network based systems that were intended primariliy as psychological models of associateive memory.
• Semantic Networks quickly found application in AI. B. Raphaels SIR system, also 1968, was one of the first programs to use this type of representation scheme.
• SIR was a question Answering system and could answer questions requiring a variety of simple reasoning tasks and relationships
Meaning of Semantic Nets
• The semantics of net structures however depends solely on the program that manipulates them and there are no fixed conventions about their meaning.
• A wide variety of network based systems have been implemented that use totally different procedures for making inferences.
Another Example
Dog bone
likes
Evolving Features
• While there are no fixed conventions, a number of important features of Semantic nets have emerged , that are widely used.
• These have largely emerged because of the application of Semantic Nets to Object Oriented Theory.
Object Definitions
• The central aspect of the object paradigm is how it defines objects.
• The basic mechanism of representation is the articulation of class hierarchies.
• Instances of Objects exist. In turn Objects belong to classes and these in turn can belong to other classes
Example
• Consider Fido ( who is a dog)• Fido is instance of the object “dog”.• Dogs belong to the class pets, which for
example could also include other classes such as cats.
• Pets in turn belong to a class animals and so on
Fido
Dogs
Pets
Animals
Cats
Labels used in Semantic Nets
• Objects and Instances• Both Represented by Nodes linked by an • IS_A link
Fido DogIS_A
InstanceObject
Labels used in Semantic Nets
• Objects and Classes• Both Represented by Nodes linked by an • Subset or a SuperSet link
Dog PetsSubset
ObjectClass
SuperSet links
• Objects and Classes• Both Represented by Nodes linked by an • SuperSet link
Dog PetsSubset
ObjectClassSuperset
Relationships, attributes and associations
Relationships, attributes and associationsRepresented by a labelled link between
objects etc
Fido Black and white
colour
Component Parts
• Object components• Both Represented by Nodes linked by an • HAP (has as part) link• A dog has a tail
Dog TailHAP
ObjectObject
Inheritance
• Attributes of classes are inherited by subclasses and instances of objects
• Because we know dogs have tails and Fido is a dog we know Fido has a tail since this is inherited from the parent class
Inheritance
• A dog has a tail and Fido is a dog
Dog TailHAP
ObjectObject
Fido
ISA
Bigger Example
• Exercise• What does the following Semantic net
represent
My House
Bungalow
House
Building
Roof
1brick
wallsRed
Habitation
No. Of Storeys
Purpose
Colour HAP HAP
subset
subset
ISAMade_of
Advantages of Semantic Nets
• Easy to visualize – Graphical in nature – easy for humans to interpret
• Expressive power equal to or exceeding that of First Order Predicate Logic
• Formal definitions of semantic networks have been developed for use
• Related knowledge is easily clustered – logically and physically close
• Efficient in space requirements– Objects represented only once– Relationships handled by pointers
• Other schemes are limited to True or False answers where as Semantic Nets are more informative and flexible
• Not limited to only binary representation… can also represent action concepts
Disadvantages of Semantic Nets
• Inheritance (particularly from multiple sources and when exceptions in inheritance are wanted) can cause problems such as conflicts
• Facts placed inappropriately cause problems
• No standards about node and arc values – in spite of the generic formal definitions