SlideShare a Scribd company logo
Module
               8
Other representation
         formalisms
           Version 2 CSE IIT, Kharagpur
Lesson
     20
Frames - I
 Version 2 CSE IIT, Kharagpur
8.4 Frames
Frames are descriptions of conceptual individuals. Frames can exist for ``real'' objects
such as ``The Watergate Hotel'', sets of objects such as ``Hotels'', or more ``abstract''
objects such as ``Cola-Wars'' or ``Watergate''.

A Frame system is a collection of objects. Each object contains a number of slots. A slot
represents an attribute. Each slot has a value. The value of an attribute can be another
object. Each object is like a C struct. The struct has a name and contains a bunch of
named values (which can be pointers)

Frames are essentially defined by their relationships with other frames. Relationships
between frames are represented using slots. If a frame f is in a relationship r to a frame g,
then we put the value g in the r slot of f.

For example, suppose we are describing the following genealogical tree:




The frame describing Adam might look something like:

Adam:
   sex:       Male
   spouse: Beth
   child:     (Charles Donna Ellen)
where sex, spouse, and child are slots. Note that a single slot may hold several values
(e.g. the children of Adam).

The genealogical tree would then be described by (at least) seven frames, describing the
following individuals: Adam, Beth, Charles, Donna, Ellen, Male, and Female.

A frame can be considered just a convenient way to represent a set of predicates applied
to constant symbols (e.g. ground instances of predicates.). For example, the frame above
could be written:

  sex(Adam,Male)
  spouse(Adam,Beth)
  child(Adam,Charles)
  child(Adam,Donna)
  child(Adam,Ellen)




                                                             Version 2 CSE IIT, Kharagpur
More generally, the ground predicate r(f,g) is represented, in a frame based system, by
placing the value g in the r slot of the frame f : r(f,g)




Frames can also be regarded as an extension to Semantic nets. Indeed it is not clear where
the distinction between a semantic net and a frame ends. Semantic nets initially we used
to represent labelled connections between objects. As tasks became more complex the
representation needs to be more structured. The more structured the system it becomes
more beneficial to use frames. A frame is a collection of attributes or slots and associated
values that describe some real world entity. Frames on their own are not particularly
helpful but frame systems are a powerful way of encoding information to support
reasoning. Set theory provides a good basis for understanding frame systems. Each frame
represents:

   •   a class (set), or
   •   an instance (an element of a class).

Consider the example below.


Person

                    isa:                          Mammal

                    Cardinality:

Adult-Male

                   isa:                 Person

                    Cardinality:

Rugby-Player

                    isa:                Adult-Male

                    Cardinality:

                    Height:

                   Weight:



                                                            Version 2 CSE IIT, Kharagpur
Position:

                   Team:

                  Team-Colours:

Back




                   isa:             Rugby-Player

                   Cardinality:

                   Tries:

Mike-Hall

                   instance:                  Back

                   Height:                    6-0

                   Position:                  Centre

                   Team:             Cardiff-RFC

                   Team-Colours:              Black/Blue

Rugby-Team

                   isa:              Team

                   Cardinality:

                   Team-size:                 15

                   Coach:




Here the frames Person, Adult-Male, Rugby-Player and Rugby-Team are all classes and
the frames Robert-Howley and Cardiff-RFC are instances.


                                                       Version 2 CSE IIT, Kharagpur
Note

    •   The isa relation is in fact the subset relation.
    •   The instance relation is in fact element of.
    •   The isa attribute possesses a transitivity property. This implies: Robert-Howley is
        a Back and a Back is a Rugby-Player who in turn is an Adult-Male and also a
        Person.
    •   Both isa and instance have inverses which are called subclasses or all instances.
    •   There are attributes that are associated with the class or set such as cardinality and
        on the other hand there are attributes that are possessed by each member of the
        class or set.

DISTINCTION BETWEN SETS AND INSTANCES
It is important that this distinction is clearly understood.

Cardiff-RFC can be thought of as a set of players or as an instance of a Rugby-Team.

If Cardiff-RFC were a class then

    •   its instances would be players
    •   it could not be a subclass of Rugby-Team otherwise its elements would be
        members of Rugby-Team which we do not want.

Instead we make it a subclass of Rugby-Player and this allows the players to inherit the
correct properties enabling us to let the Cardiff-RFC to inherit information about teams.

This means that Cardiff-RFC is an instance of Rugby-Team.

BUT There is a problem here:

    •   A class is a set and its elements have properties.
    •   We wish to use inheritance to bestow values on its members.
    •   But there are properties that the set or class itself has such as the manager of a
        team.

This is why we need to view Cardiff-RFC as a subset of one class players and an instance
of teams. We seem to have a CATCH 22. Solution: MetaClasses

A metaclass is a special class whose elements are themselves classes.

Now consider our rugby teams as:




                                                               Version 2 CSE IIT, Kharagpur
The basic metaclass is Class, and this allows us to

   •   define classes which are instances of other classes, and (thus)
   •   inherit properties from this class.

Inheritance of default values occurs when one element or class is an instance of a class.




                                                            Version 2 CSE IIT, Kharagpur

More Related Content

More from Avijit Kumar

Lesson 18
Lesson 18Lesson 18
Lesson 18
Avijit Kumar
 
Lesson 19
Lesson 19Lesson 19
Lesson 19
Avijit Kumar
 
Lesson 26
Lesson 26Lesson 26
Lesson 26
Avijit Kumar
 
Lesson 27
Lesson 27Lesson 27
Lesson 27
Avijit Kumar
 
Lesson 29
Lesson 29Lesson 29
Lesson 29
Avijit Kumar
 
Lesson 30
Lesson 30Lesson 30
Lesson 30
Avijit Kumar
 
Lesson 31
Lesson 31Lesson 31
Lesson 31
Avijit Kumar
 
Lesson 32
Lesson 32Lesson 32
Lesson 32
Avijit Kumar
 
Lesson 33
Lesson 33Lesson 33
Lesson 33
Avijit Kumar
 
Lesson 36
Lesson 36Lesson 36
Lesson 36
Avijit Kumar
 
Lesson 35
Lesson 35Lesson 35
Lesson 35
Avijit Kumar
 
Lesson 37
Lesson 37Lesson 37
Lesson 37
Avijit Kumar
 
Lesson 39
Lesson 39Lesson 39
Lesson 39
Avijit Kumar
 
Lesson 38
Lesson 38Lesson 38
Lesson 38
Avijit Kumar
 
Lesson 41
Lesson 41Lesson 41
Lesson 41
Avijit Kumar
 
Lesson 40
Lesson 40Lesson 40
Lesson 40
Avijit Kumar
 

More from Avijit Kumar (16)

Lesson 18
Lesson 18Lesson 18
Lesson 18
 
Lesson 19
Lesson 19Lesson 19
Lesson 19
 
Lesson 26
Lesson 26Lesson 26
Lesson 26
 
Lesson 27
Lesson 27Lesson 27
Lesson 27
 
Lesson 29
Lesson 29Lesson 29
Lesson 29
 
Lesson 30
Lesson 30Lesson 30
Lesson 30
 
Lesson 31
Lesson 31Lesson 31
Lesson 31
 
Lesson 32
Lesson 32Lesson 32
Lesson 32
 
Lesson 33
Lesson 33Lesson 33
Lesson 33
 
Lesson 36
Lesson 36Lesson 36
Lesson 36
 
Lesson 35
Lesson 35Lesson 35
Lesson 35
 
Lesson 37
Lesson 37Lesson 37
Lesson 37
 
Lesson 39
Lesson 39Lesson 39
Lesson 39
 
Lesson 38
Lesson 38Lesson 38
Lesson 38
 
Lesson 41
Lesson 41Lesson 41
Lesson 41
 
Lesson 40
Lesson 40Lesson 40
Lesson 40
 

Recently uploaded

Croatia vs Italy Modric's Last Dance Croatia's UEFA Euro 2024 Journey and Ita...
Croatia vs Italy Modric's Last Dance Croatia's UEFA Euro 2024 Journey and Ita...Croatia vs Italy Modric's Last Dance Croatia's UEFA Euro 2024 Journey and Ita...
Croatia vs Italy Modric's Last Dance Croatia's UEFA Euro 2024 Journey and Ita...
Eticketing.co
 
JORNADA 11 LIGA MURO 2024BASQUETBOL1.pdf
JORNADA 11 LIGA MURO 2024BASQUETBOL1.pdfJORNADA 11 LIGA MURO 2024BASQUETBOL1.pdf
JORNADA 11 LIGA MURO 2024BASQUETBOL1.pdf
Arturo Pacheco Alvarez
 
Poland vs Netherlands UEFA Euro 2024 Poland Battles Injuries Without Lewandow...
Poland vs Netherlands UEFA Euro 2024 Poland Battles Injuries Without Lewandow...Poland vs Netherlands UEFA Euro 2024 Poland Battles Injuries Without Lewandow...
Poland vs Netherlands UEFA Euro 2024 Poland Battles Injuries Without Lewandow...
Eticketing.co
 
Euro 2024 Belgium's Rebirth the New Generation Match the Golden Era.docx
Euro 2024 Belgium's Rebirth the New Generation Match the Golden Era.docxEuro 2024 Belgium's Rebirth the New Generation Match the Golden Era.docx
Euro 2024 Belgium's Rebirth the New Generation Match the Golden Era.docx
Eticketing.co
 
MESH IPL 2024 REport_Wavemaker India.pdf
MESH IPL 2024 REport_Wavemaker India.pdfMESH IPL 2024 REport_Wavemaker India.pdf
MESH IPL 2024 REport_Wavemaker India.pdf
Social Samosa
 
一比一原版(Curtin毕业证)科廷大学毕业证如何办理
一比一原版(Curtin毕业证)科廷大学毕业证如何办理一比一原版(Curtin毕业证)科廷大学毕业证如何办理
一比一原版(Curtin毕业证)科廷大学毕业证如何办理
apobqx
 
The most promising young Players to watch during Euro 2024.docx
The most promising young Players to watch during Euro 2024.docxThe most promising young Players to watch during Euro 2024.docx
The most promising young Players to watch during Euro 2024.docx
Euro Cup 2024 Tickets
 
Croatia's UEFA Euro 2024 Puzzle of Experience versus Youth.docx
Croatia's UEFA Euro 2024 Puzzle of Experience versus Youth.docxCroatia's UEFA Euro 2024 Puzzle of Experience versus Youth.docx
Croatia's UEFA Euro 2024 Puzzle of Experience versus Youth.docx
Euro Cup 2024 Tickets
 
Georgia vs Portugal Georgia UEFA Euro 2024 Squad Khvicha Kvaratskhelia Leads ...
Georgia vs Portugal Georgia UEFA Euro 2024 Squad Khvicha Kvaratskhelia Leads ...Georgia vs Portugal Georgia UEFA Euro 2024 Squad Khvicha Kvaratskhelia Leads ...
Georgia vs Portugal Georgia UEFA Euro 2024 Squad Khvicha Kvaratskhelia Leads ...
Eticketing.co
 
快速制作加拿大西蒙菲莎大学毕业证(sfu毕业证书)硕士学位证书原版一模一样
快速制作加拿大西蒙菲莎大学毕业证(sfu毕业证书)硕士学位证书原版一模一样快速制作加拿大西蒙菲莎大学毕业证(sfu毕业证书)硕士学位证书原版一模一样
快速制作加拿大西蒙菲莎大学毕业证(sfu毕业证书)硕士学位证书原版一模一样
8z10jo1w
 
Belgium vs Slovakia Belgium Euro 2024 Golden Generation Faces Euro Cup Final ...
Belgium vs Slovakia Belgium Euro 2024 Golden Generation Faces Euro Cup Final ...Belgium vs Slovakia Belgium Euro 2024 Golden Generation Faces Euro Cup Final ...
Belgium vs Slovakia Belgium Euro 2024 Golden Generation Faces Euro Cup Final ...
Eticketing.co
 
Turkey UEFA Euro 2024 Journey A Quest for Redemption and Success.docx
Turkey UEFA Euro 2024 Journey A Quest for Redemption and Success.docxTurkey UEFA Euro 2024 Journey A Quest for Redemption and Success.docx
Turkey UEFA Euro 2024 Journey A Quest for Redemption and Success.docx
Eticketing.co
 
Euro 2024 Predictions - Group Stage Outcomes
Euro 2024 Predictions - Group Stage OutcomesEuro 2024 Predictions - Group Stage Outcomes
Euro 2024 Predictions - Group Stage Outcomes
Select Distinct Limited
 
Turkey vs Georgia Tickets: Turkey's Provisional Squad for UEFA Euro 2024, Key...
Turkey vs Georgia Tickets: Turkey's Provisional Squad for UEFA Euro 2024, Key...Turkey vs Georgia Tickets: Turkey's Provisional Squad for UEFA Euro 2024, Key...
Turkey vs Georgia Tickets: Turkey's Provisional Squad for UEFA Euro 2024, Key...
Eticketing.co
 
Turkey vs Georgia Prospects and Challenges in Euro Cup Germany.docx
Turkey vs Georgia Prospects and Challenges in Euro Cup Germany.docxTurkey vs Georgia Prospects and Challenges in Euro Cup Germany.docx
Turkey vs Georgia Prospects and Challenges in Euro Cup Germany.docx
Eticketing.co
 
Switzerland vs Germany At UEFA Euro 2024 the Full squad, preview, match sched...
Switzerland vs Germany At UEFA Euro 2024 the Full squad, preview, match sched...Switzerland vs Germany At UEFA Euro 2024 the Full squad, preview, match sched...
Switzerland vs Germany At UEFA Euro 2024 the Full squad, preview, match sched...
Eticketing.co
 
Sportr pitch deck for our saas based platform
Sportr pitch deck for our saas based platformSportr pitch deck for our saas based platform
Sportr pitch deck for our saas based platform
NathanielMDuncan
 
Georgia vs Portugal Euro Cup 2024 Clash Unites a Nation Amid Turmoil.pdf
Georgia vs Portugal Euro Cup 2024 Clash Unites a Nation Amid Turmoil.pdfGeorgia vs Portugal Euro Cup 2024 Clash Unites a Nation Amid Turmoil.pdf
Georgia vs Portugal Euro Cup 2024 Clash Unites a Nation Amid Turmoil.pdf
Eticketing.co
 
Belgium vs Romania Ultimate Guide to Euro Cup 2024 Tactics, Ticketing, and Qu...
Belgium vs Romania Ultimate Guide to Euro Cup 2024 Tactics, Ticketing, and Qu...Belgium vs Romania Ultimate Guide to Euro Cup 2024 Tactics, Ticketing, and Qu...
Belgium vs Romania Ultimate Guide to Euro Cup 2024 Tactics, Ticketing, and Qu...
Eticketing.co
 
Luciano Spalletti Leads Italy's Transition at UEFA Euro 2024.docx
Luciano Spalletti Leads Italy's Transition at UEFA Euro 2024.docxLuciano Spalletti Leads Italy's Transition at UEFA Euro 2024.docx
Luciano Spalletti Leads Italy's Transition at UEFA Euro 2024.docx
Euro Cup 2024 Tickets
 

Recently uploaded (20)

Croatia vs Italy Modric's Last Dance Croatia's UEFA Euro 2024 Journey and Ita...
Croatia vs Italy Modric's Last Dance Croatia's UEFA Euro 2024 Journey and Ita...Croatia vs Italy Modric's Last Dance Croatia's UEFA Euro 2024 Journey and Ita...
Croatia vs Italy Modric's Last Dance Croatia's UEFA Euro 2024 Journey and Ita...
 
JORNADA 11 LIGA MURO 2024BASQUETBOL1.pdf
JORNADA 11 LIGA MURO 2024BASQUETBOL1.pdfJORNADA 11 LIGA MURO 2024BASQUETBOL1.pdf
JORNADA 11 LIGA MURO 2024BASQUETBOL1.pdf
 
Poland vs Netherlands UEFA Euro 2024 Poland Battles Injuries Without Lewandow...
Poland vs Netherlands UEFA Euro 2024 Poland Battles Injuries Without Lewandow...Poland vs Netherlands UEFA Euro 2024 Poland Battles Injuries Without Lewandow...
Poland vs Netherlands UEFA Euro 2024 Poland Battles Injuries Without Lewandow...
 
Euro 2024 Belgium's Rebirth the New Generation Match the Golden Era.docx
Euro 2024 Belgium's Rebirth the New Generation Match the Golden Era.docxEuro 2024 Belgium's Rebirth the New Generation Match the Golden Era.docx
Euro 2024 Belgium's Rebirth the New Generation Match the Golden Era.docx
 
MESH IPL 2024 REport_Wavemaker India.pdf
MESH IPL 2024 REport_Wavemaker India.pdfMESH IPL 2024 REport_Wavemaker India.pdf
MESH IPL 2024 REport_Wavemaker India.pdf
 
一比一原版(Curtin毕业证)科廷大学毕业证如何办理
一比一原版(Curtin毕业证)科廷大学毕业证如何办理一比一原版(Curtin毕业证)科廷大学毕业证如何办理
一比一原版(Curtin毕业证)科廷大学毕业证如何办理
 
The most promising young Players to watch during Euro 2024.docx
The most promising young Players to watch during Euro 2024.docxThe most promising young Players to watch during Euro 2024.docx
The most promising young Players to watch during Euro 2024.docx
 
Croatia's UEFA Euro 2024 Puzzle of Experience versus Youth.docx
Croatia's UEFA Euro 2024 Puzzle of Experience versus Youth.docxCroatia's UEFA Euro 2024 Puzzle of Experience versus Youth.docx
Croatia's UEFA Euro 2024 Puzzle of Experience versus Youth.docx
 
Georgia vs Portugal Georgia UEFA Euro 2024 Squad Khvicha Kvaratskhelia Leads ...
Georgia vs Portugal Georgia UEFA Euro 2024 Squad Khvicha Kvaratskhelia Leads ...Georgia vs Portugal Georgia UEFA Euro 2024 Squad Khvicha Kvaratskhelia Leads ...
Georgia vs Portugal Georgia UEFA Euro 2024 Squad Khvicha Kvaratskhelia Leads ...
 
快速制作加拿大西蒙菲莎大学毕业证(sfu毕业证书)硕士学位证书原版一模一样
快速制作加拿大西蒙菲莎大学毕业证(sfu毕业证书)硕士学位证书原版一模一样快速制作加拿大西蒙菲莎大学毕业证(sfu毕业证书)硕士学位证书原版一模一样
快速制作加拿大西蒙菲莎大学毕业证(sfu毕业证书)硕士学位证书原版一模一样
 
Belgium vs Slovakia Belgium Euro 2024 Golden Generation Faces Euro Cup Final ...
Belgium vs Slovakia Belgium Euro 2024 Golden Generation Faces Euro Cup Final ...Belgium vs Slovakia Belgium Euro 2024 Golden Generation Faces Euro Cup Final ...
Belgium vs Slovakia Belgium Euro 2024 Golden Generation Faces Euro Cup Final ...
 
Turkey UEFA Euro 2024 Journey A Quest for Redemption and Success.docx
Turkey UEFA Euro 2024 Journey A Quest for Redemption and Success.docxTurkey UEFA Euro 2024 Journey A Quest for Redemption and Success.docx
Turkey UEFA Euro 2024 Journey A Quest for Redemption and Success.docx
 
Euro 2024 Predictions - Group Stage Outcomes
Euro 2024 Predictions - Group Stage OutcomesEuro 2024 Predictions - Group Stage Outcomes
Euro 2024 Predictions - Group Stage Outcomes
 
Turkey vs Georgia Tickets: Turkey's Provisional Squad for UEFA Euro 2024, Key...
Turkey vs Georgia Tickets: Turkey's Provisional Squad for UEFA Euro 2024, Key...Turkey vs Georgia Tickets: Turkey's Provisional Squad for UEFA Euro 2024, Key...
Turkey vs Georgia Tickets: Turkey's Provisional Squad for UEFA Euro 2024, Key...
 
Turkey vs Georgia Prospects and Challenges in Euro Cup Germany.docx
Turkey vs Georgia Prospects and Challenges in Euro Cup Germany.docxTurkey vs Georgia Prospects and Challenges in Euro Cup Germany.docx
Turkey vs Georgia Prospects and Challenges in Euro Cup Germany.docx
 
Switzerland vs Germany At UEFA Euro 2024 the Full squad, preview, match sched...
Switzerland vs Germany At UEFA Euro 2024 the Full squad, preview, match sched...Switzerland vs Germany At UEFA Euro 2024 the Full squad, preview, match sched...
Switzerland vs Germany At UEFA Euro 2024 the Full squad, preview, match sched...
 
Sportr pitch deck for our saas based platform
Sportr pitch deck for our saas based platformSportr pitch deck for our saas based platform
Sportr pitch deck for our saas based platform
 
Georgia vs Portugal Euro Cup 2024 Clash Unites a Nation Amid Turmoil.pdf
Georgia vs Portugal Euro Cup 2024 Clash Unites a Nation Amid Turmoil.pdfGeorgia vs Portugal Euro Cup 2024 Clash Unites a Nation Amid Turmoil.pdf
Georgia vs Portugal Euro Cup 2024 Clash Unites a Nation Amid Turmoil.pdf
 
Belgium vs Romania Ultimate Guide to Euro Cup 2024 Tactics, Ticketing, and Qu...
Belgium vs Romania Ultimate Guide to Euro Cup 2024 Tactics, Ticketing, and Qu...Belgium vs Romania Ultimate Guide to Euro Cup 2024 Tactics, Ticketing, and Qu...
Belgium vs Romania Ultimate Guide to Euro Cup 2024 Tactics, Ticketing, and Qu...
 
Luciano Spalletti Leads Italy's Transition at UEFA Euro 2024.docx
Luciano Spalletti Leads Italy's Transition at UEFA Euro 2024.docxLuciano Spalletti Leads Italy's Transition at UEFA Euro 2024.docx
Luciano Spalletti Leads Italy's Transition at UEFA Euro 2024.docx
 

Lesson 20

  • 1. Module 8 Other representation formalisms Version 2 CSE IIT, Kharagpur
  • 2. Lesson 20 Frames - I Version 2 CSE IIT, Kharagpur
  • 3. 8.4 Frames Frames are descriptions of conceptual individuals. Frames can exist for ``real'' objects such as ``The Watergate Hotel'', sets of objects such as ``Hotels'', or more ``abstract'' objects such as ``Cola-Wars'' or ``Watergate''. A Frame system is a collection of objects. Each object contains a number of slots. A slot represents an attribute. Each slot has a value. The value of an attribute can be another object. Each object is like a C struct. The struct has a name and contains a bunch of named values (which can be pointers) Frames are essentially defined by their relationships with other frames. Relationships between frames are represented using slots. If a frame f is in a relationship r to a frame g, then we put the value g in the r slot of f. For example, suppose we are describing the following genealogical tree: The frame describing Adam might look something like: Adam: sex: Male spouse: Beth child: (Charles Donna Ellen) where sex, spouse, and child are slots. Note that a single slot may hold several values (e.g. the children of Adam). The genealogical tree would then be described by (at least) seven frames, describing the following individuals: Adam, Beth, Charles, Donna, Ellen, Male, and Female. A frame can be considered just a convenient way to represent a set of predicates applied to constant symbols (e.g. ground instances of predicates.). For example, the frame above could be written: sex(Adam,Male) spouse(Adam,Beth) child(Adam,Charles) child(Adam,Donna) child(Adam,Ellen) Version 2 CSE IIT, Kharagpur
  • 4. More generally, the ground predicate r(f,g) is represented, in a frame based system, by placing the value g in the r slot of the frame f : r(f,g) Frames can also be regarded as an extension to Semantic nets. Indeed it is not clear where the distinction between a semantic net and a frame ends. Semantic nets initially we used to represent labelled connections between objects. As tasks became more complex the representation needs to be more structured. The more structured the system it becomes more beneficial to use frames. A frame is a collection of attributes or slots and associated values that describe some real world entity. Frames on their own are not particularly helpful but frame systems are a powerful way of encoding information to support reasoning. Set theory provides a good basis for understanding frame systems. Each frame represents: • a class (set), or • an instance (an element of a class). Consider the example below. Person isa: Mammal Cardinality: Adult-Male isa: Person Cardinality: Rugby-Player isa: Adult-Male Cardinality: Height: Weight: Version 2 CSE IIT, Kharagpur
  • 5. Position: Team: Team-Colours: Back isa: Rugby-Player Cardinality: Tries: Mike-Hall instance: Back Height: 6-0 Position: Centre Team: Cardiff-RFC Team-Colours: Black/Blue Rugby-Team isa: Team Cardinality: Team-size: 15 Coach: Here the frames Person, Adult-Male, Rugby-Player and Rugby-Team are all classes and the frames Robert-Howley and Cardiff-RFC are instances. Version 2 CSE IIT, Kharagpur
  • 6. Note • The isa relation is in fact the subset relation. • The instance relation is in fact element of. • The isa attribute possesses a transitivity property. This implies: Robert-Howley is a Back and a Back is a Rugby-Player who in turn is an Adult-Male and also a Person. • Both isa and instance have inverses which are called subclasses or all instances. • There are attributes that are associated with the class or set such as cardinality and on the other hand there are attributes that are possessed by each member of the class or set. DISTINCTION BETWEN SETS AND INSTANCES It is important that this distinction is clearly understood. Cardiff-RFC can be thought of as a set of players or as an instance of a Rugby-Team. If Cardiff-RFC were a class then • its instances would be players • it could not be a subclass of Rugby-Team otherwise its elements would be members of Rugby-Team which we do not want. Instead we make it a subclass of Rugby-Player and this allows the players to inherit the correct properties enabling us to let the Cardiff-RFC to inherit information about teams. This means that Cardiff-RFC is an instance of Rugby-Team. BUT There is a problem here: • A class is a set and its elements have properties. • We wish to use inheritance to bestow values on its members. • But there are properties that the set or class itself has such as the manager of a team. This is why we need to view Cardiff-RFC as a subset of one class players and an instance of teams. We seem to have a CATCH 22. Solution: MetaClasses A metaclass is a special class whose elements are themselves classes. Now consider our rugby teams as: Version 2 CSE IIT, Kharagpur
  • 7. The basic metaclass is Class, and this allows us to • define classes which are instances of other classes, and (thus) • inherit properties from this class. Inheritance of default values occurs when one element or class is an instance of a class. Version 2 CSE IIT, Kharagpur