24.11.2014 Views

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

7. Knowledge Specification Language 75<br />

Set Membership<br />

In a similar way, sets may be incremented or decremented using the<br />

following KSL formats.<br />

include Item(s) in Set<br />

remove Item(s) from Set<br />

Note that if there is no existing current value then it is equivalent to direct<br />

assignment, as above. An attempt to remove an item when there is no<br />

current value will fail.<br />

Examples<br />

New Instances<br />

include lemon_sole in the entree of set_meal<br />

include { fred and mary } in the prizewinners<br />

remove land from the whale`s habitat<br />

remove { david and liz } from the staff<br />

Directives can dynamically create new instances of frames with local<br />

attributes. All other attributes of the parent frame will automatically be<br />

inherited by the instance. The general KSL format is as follows.<br />

Instance is a new Frame<br />

Instance is another Frame<br />

The whose keyword may optionally be used to create or assign values to<br />

local attributes.<br />

Examples<br />

brick8 is another brick<br />

'Tiddles' is another cat whose owner is alexander<br />

plant33 is a new plant whose size is medium<br />

house_2 is a new house whose bedrooms is 4<br />

and whose floors is 2<br />

and whose extras are { garden, garage }<br />

<strong>flex</strong> toolkit

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

Saved successfully!

Ooh no, something went wrong!