1 / 26

Objects

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

anoki
Télécharger la présentation

Objects

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. Objects • Objects are at the heart of the Object Oriented Paradigm • What is an object?

  2. 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.

  3. 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

  4. 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.

  5. 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.

  6. 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

  7. 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.

  8. Example • Using the example Birds have wings • a typical semantic net would be

  9. 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

  10. 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.

  11. likes Dog bone Another Example

  12. 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.

  13. 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

  14. 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

  15. Animals Pets Cats Dogs Fido

  16. Labels used in Semantic Nets • Objects and Instances • Both Represented by Nodes linked by an • IS_A link Fido Dog IS_A Instance Object

  17. Labels used in Semantic Nets • Objects and Classes • Both Represented by Nodes linked by an • Subset or a SuperSet link Dog Pets Subset Object Class

  18. SuperSet links • Objects and Classes • Both Represented by Nodes linked by an • SuperSet link Dog Pets Subset Object Class Superset

  19. Relationships, attributes and associations Relationships, attributes and associations Represented by a labelled link between objects etc Fido Black and white colour

  20. Component Parts • Object components • Both Represented by Nodes linked by an • HAP (has as part) link • A dog has a tail Dog Tail HAP Object Object

  21. 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

  22. Inheritance • A dog has a tail and Fido is a dog Dog Tail HAP ISA Object Object Fido

  23. Bigger Example • Exercise • What does the following Semantic net represent

  24. Building subset Purpose Habitation House No. Of Storeys subset brick Bungalow 1 Made_of ISA Colour HAP HAP Roof My House Red walls

  25. 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

  26. 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

More Related