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

Dereferencing of KSL Objects<br />

The following table shows the method by which Prolog terms (and thus KSL objects)<br />

are dereferenced.<br />

Term<br />

N<br />

T<br />

Dereferenced Value<br />

Get the current value for global variable N and<br />

dereference it<br />

T, whenever T is an atomic term<br />

[E 1<br />

, … ,E k<br />

] [T 1<br />

, … ,T k<br />

] where each E i<br />

dereferences to T i<br />

or([E 1<br />

, … ,E k<br />

])<br />

Choose some E i<br />

and dereference it to T i<br />

@(A,F) First of all, dereference A and F to A1 and F1,<br />

respectively; then get the current value, the default<br />

value or an inherited value for attribute A1 of frame<br />

F1, and dereference it; during the subsidiary<br />

dereferencing F1 becomes the original frame<br />

its(A)<br />

X : C<br />

O(E l<br />

,E r<br />

)<br />

O(E)<br />

If there is an original frame F then the dereferencing<br />

proceeds as if it were @(A,F), otherwise the structure<br />

its(A) is returned<br />

Execute the condition C and dereference the resulting<br />

instance of X<br />

Dereference the operands down to T l<br />

and T r<br />

; if they<br />

are both numbers then apply the operator, otherwise<br />

return the structure O(T l<br />

,T r<br />

)<br />

Dereference the operand down to T; if it is a number<br />

then apply the operator, otherwise return the structure<br />

O(T)<br />

F(E 1<br />

,…,E k<br />

) Dereference each E i<br />

to some T i<br />

; if it is a defined<br />

function then replace with the right-hand-side of the<br />

definition and continue dereferencing, otherwise return<br />

the structure F(T 1<br />

,…,T k<br />

)<br />

$(E)<br />

E<br />

<strong>flex</strong> toolkit

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

Saved successfully!

Ooh no, something went wrong!