24.11.2014 Views

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

2. Frames and Inheritance 26<br />

Universal Defaults<br />

Flex supports the notion of universal default values. These are default<br />

values which may be inherited by any frame in the hierarchy.<br />

For example, in a system representing physical objects the notion of weight<br />

is universal. It is the product of the object's volume and density.<br />

Rather than have a weight slot in each frame of the hierarchy, it would be<br />

more sensible to have a single global definition of weight which is universally<br />

accessible.<br />

This is accomplished by having a special frame called root, which is always<br />

considered when inheriting values. The inheritance algorithm can be<br />

directed to visit the root frame either before or after visiting any ancestor<br />

frames.<br />

Singular Versus Multiple Inheritance ?<br />

Whenever a frame system allows for values to be inherited, there is the<br />

possibility for alternative answers according to where the inheritance comes<br />

from. This is in many ways similar to Prolog itself, which allows for<br />

alternative answers to the same query.<br />

The plurality of inheritance within <strong>flex</strong> can either be singular (the default)<br />

or multiple. In both cases the search stops as soon as the first value is<br />

found.<br />

For singular inheritance there is a commitment to this first value, and no<br />

others will ever be considered.<br />

For multiple inheritance, however, alternative values can be obtained by<br />

backtracking using the inheritance algorithm, which is a Prolog program.<br />

In reality, the singular inheritance algorithm is the same as the multiple<br />

inheritance algorithm except that it terminates with a cut (!) to avoid any<br />

potential backtracking.<br />

Frame Relationships<br />

In its default setting, the only relationship between frames is the AKO (akind-of)<br />

hierarchy which defines how values are to be inherited. In general,<br />

though, it would be of great benefit to be able to define other relationships<br />

between frames, such as all tigers can hunt humans.<br />

<strong>flex</strong> toolkit

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!