Frame-based expert systems
5.3 Inheritance in frame-based systems
Inheritance is an essential feature of frame-based systems. Inheritance can be defined as the process by which all characteristics of a class-frame are assumed by the instance-frame.
A common use of inheritance is to impose default features on all instance- frames. We can create just one class-frame that contains generic characteristics of some object or concept, and then obtain several instance-frames without encoding the class-level characteristics.
A hierarchical arrangement of a frame-based system can be viewed as a tree that is turned over. The highest level of abstraction is represented at the top by the root of the tree. Branches below the root illustrate lower levels of abstraction, and leaves at the bottom appear as instance-frames. Each frame inherits characteristics of all related frames at the higher levels.
Figure 5.5 shows a hierarchy of frames representing zero-emission (ZE) vehicles. The root, ZE vehicle, has three branches: Electric vehicle, Solar vehicle
Figure 5.4 Three types of relationships among objects: (a) generalisation; (b) aggregation; (c) association
Figure 5.5 One-parent inheritance in the zero-emission vehicle structure
139 INHERITANCE IN FRAME-BASED SYSTEMS
andMuscle vehicle. Let us now follow just one branch, theElectric vehiclebranch. It is subdivided intoCar,MotorcycleandScooter. Then Carbranches intoSedan,
VanandTruck, and finally, the leaf, the instance-frameFord Ecostar, appears at the bottom. The instanceFord Ecostarinherits all the characteristics of itsparent frame.
The instance Ford Ecostarindeed has only one parent, the class-frameVan. Furthermore, in Figure 5.5, any frame except the root frameZE vehiclehas only one parent. In this type of structure, each frame inherits knowledge from its parent, grandparent, great-grandparent, etc.
Can a frame have more than one parent?
In many problems, it is quite natural to represent objects relating to different worlds. For example, we may wish to create a class of muscle-solar-electric vehicles. In such vehicles, people can pedal, while an electric drive system is used to travel uphill, and solar panels assist in recharging batteries for the electric system. Thus, the frame Muscle-Solar-Electric vehicle should combine specific properties of three classes, Muscle vehicle, Solar vehicle and Electric vehicle. The only requirement for multiple parent inheritance is that attributes of all parents must be uniquely specified.
In frame-based systems, several classes can use the same attribute names. However, when we use multiple inheritance, all parents must have unique attribute names. If we want, for example to create a child class Muscle-Solar- Electric vehiclerelated to parentsMuscle vehicle,Solar vehicleandElectric vehicle, we must get rid of such properties asWeightandTop speedin the parent classes. Only then can we create the child class. In other words, to create multiple inheritance we must reconsider an entire structure of our system, as can be seen in Figure 5.6. In frame-based systems, inheritance means code reuse, and the job of the knowledge engineer is to group similar classes together and reuse common code. The most important advantage of inheritance is the conceptual simplification, which is achieved by reducing the number of independent and specific features in the expert system.
Are there any disadvantages?
As is so often the case, much of the appealing simplicity of ideas behind the frame-based systems has been lost in the implementation stage. Brachman and Levesque (1985) argue that if we allow unrestrained overwriting of inherited properties, it may become impossible to represent either definitive statements (such as ‘all squares are equilateral rectangles’) or contingent universal con- ditions (such as ‘all the squares on Kasimir Malevich’s paintings are either black, red or white’). In general, frame-based systems cannot distinguish between essential properties(those that an instance must have in order to be considered a member of a class) andaccidental properties(those that all the instances of a class just happen to have). Instances inherit alltypicalproperties, and because those properties can be overwritten anywhere in the frame hierarchy it may become impossible to construct composite concepts when using multiple inheritance.
This appears to undermine the whole idea of the frame knowledge representa- tion. However, frames offer us a powerful tool for combining declarative and procedural knowledge, although they leave the knowledge engineer with dif- ficult decisions to make about the hierarchical structure of the system and its inheritance paths. Appeals to so-called ‘typical’ properties do not always work, because they may lead us to unexpected results. Thus, although we may use frames to represent the fact that an ostrich is a bird, it is certainly not a typical bird, in the way that an eagle is. Frame-based expert systems, such as Level5 Object, provide no safeguards against creating incoherent structures. However, Figure 5.6 Multiple inheritance
141 INHERITANCE IN FRAME-BASED SYSTEMS
such systems do provide data and control structures that are more suited for the simulation of human reasoning than any conventional programming language. Furthermore, to combine the power of both techniques of knowledge repres- entation – rules and frames – modern frame-based expert systems use rules for interaction with information contained in the frames.