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.

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

Actions<br />

Relations<br />

0 ).<br />

Actions are represented directly by the corresponding Prolog clause. In<br />

addition, the name of the action is remembered as a clause of<br />

relation/2.<br />

Example<br />

action empty_into( X, Y ) ;<br />

do Y`s contents := Y`s contents + X`s contents<br />

and X`s contents := 0 .<br />

will be represented by the Prolog clauses<br />

relation( empty_into, 2 ) .<br />

empty_into( X, Y ) :-<br />

new_value( @(contents,Y), @(contents,Y) +<br />

@(contents,X) ),<br />

new_value( @(contents,X), 0 ) .<br />

Relations are represented directly by the corresponding Prolog clause. In<br />

addition, the name of the relation is remembered as the relation<br />

relation/2.<br />

Example<br />

Functions<br />

relation sister( X, Y )<br />

if father( X ) = father( Y )<br />

and not male( Y )<br />

and X is not equal to Y .<br />

will be represented by the Prolog clauses<br />

relation(sister,2) .<br />

sister(X,Y) :-<br />

equality(father(X),father(Y)),<br />

not male(Y),<br />

not equality(X,Y) .<br />

Functions are represented by instances of the relation function/3, as<br />

follows.<br />

function( Function, Arguments,Value ).<br />

6<br />

<strong>flex</strong> toolkit

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

Saved successfully!

Ooh no, something went wrong!