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.

8. Run-Time Interpretation of KSL 115<br />

Watchdogs<br />

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

Watchdogs are mapped onto clauses of the relation watchdog/6, as<br />

follows.<br />

watchdog( Watchdog,<br />

Attribute,<br />

Frame,<br />

Context,<br />

Check,<br />

Action ).<br />

Example<br />

watchdog security_check<br />

when the contents of account are requested<br />

then check user`s classification is above 7.<br />

will be represented by the Prolog assertion<br />

watchdog( security_check,<br />

contents,<br />

account,<br />

true,<br />

comparison( >, @(classification,user), 7)<br />

fail ).<br />

Production Rules<br />

Rules are mapped onto instances of the relation rule/5, as follows.<br />

rule( Rule,<br />

Conditions,<br />

Action,<br />

Explanation,<br />

Score ).<br />

Example<br />

rule prescribe_lomotil<br />

if the patient complains of diarrhoea and<br />

the patient does not suffer from liver_disorder<br />

and the patient is not pregnant<br />

then I advise the patient to take lomotil<br />

browse file medical7 .<br />

will be represented by the Prolog assertion<br />

rule( prescribe_lomotil,<br />

( prove(complains(patient,diarrhoea)),<br />

disprove(suffers(patient,liver_complaints)),<br />

disprove(pregnant(patient)) ),<br />

take(patient,lomotil),<br />

browse(medical7),

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

Saved successfully!

Ooh no, something went wrong!