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 104<br />

question wall_colour<br />

Please choose a colour for your room ;<br />

choose from wall_colours .<br />

The items in a group may be the names of rules, and the group may then be<br />

referenced in a ruleset, or it may be part of a rule network.<br />

Example<br />

group food_rules<br />

ask_for_the_starter, ask_for_the_entree .<br />

ruleset dinner<br />

contains food_rules .<br />

A group may also be an ordered list of items which which may then be used<br />

for comparison purposes (using the KSL keywords according to).<br />

Examples<br />

group fuzzy_ordering<br />

impossible, improbable, possible, probable,<br />

definite.<br />

relation less_likely( A, B )<br />

if A is less than B<br />

according to fuzzy_ordering.<br />

Synonyms<br />

<strong>flex</strong> toolkit<br />

A synonym can be used to make code easier to read by allowing the<br />

replacement of frequently occurring terms or expressions with a mnemonic.<br />

The synonym is textually replaced by its expression when the sentence in<br />

which it occurs is being parsed.<br />

One advantage of synonyms is improved readability; another is that when a<br />

constant value changes it is easier to change it in the synonym declaration<br />

than in every place it might occur in the code.<br />

The basic format of a synonym is:<br />

synonym name_to_replace replacement_expression .<br />

All occurrences of name_to_replace in the KSL sentences following this<br />

declaration will be replaced by the term replacement_expression.<br />

Examples<br />

synonym pi 3.14159.<br />

At compile time all occurrences of pi will be replaced by the number<br />

3.14159 .

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

Saved successfully!

Ooh no, something went wrong!