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

Examples<br />

Set Membership<br />

its colour is at or above the colour of money<br />

according to { red , blue , white , green }<br />

group fuzzy_ordering<br />

certain, probable, possible, unlikely, impossible .<br />

the likelihood of frost is less than probable<br />

according to fuzzy_ordering<br />

To test set membership, use the KSL keywords<br />

include<br />

includes<br />

included in<br />

does not include<br />

do not include.<br />

Examples<br />

Procedure Calls<br />

the staff include { john and mary }<br />

a surprise is included in the contents of the box<br />

the Rodent`s tail does not include bushy<br />

A condition can be a call to some procedure, either a <strong>flex</strong> relation, a<br />

<strong>flex</strong> action, or a Prolog call (either built-in or user-defined) . It is the means<br />

by which conditions (and thus rules and attached procedures) link into<br />

Prolog's backward chaining execution mode.<br />

Conjunctions and Disjunctions<br />

Conditions may be logically combined using and and or. The precedence<br />

associated with negations, conjunctions and disjunctions (not binds more<br />

tightly than and, which in turn binds more tightly than or) can be<br />

overridden by the introduction of square brackets.<br />

Examples<br />

C is some cat and M is C`s meal<br />

test1 and [ test2( X ) or alpha > 10 ]<br />

not [ test1 and test2 ]<br />

Context Switching<br />

If you wish to use a condition, but the context expects a directive, then the<br />

context can be switched by the use of the word check, optionally followed<br />

by the word that. For example, an action requires directives but a<br />

relation requires conditions.<br />

<strong>flex</strong> toolkit

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

Saved successfully!

Ooh no, something went wrong!