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.

9. Flex Predicates 154<br />

spied_chain<br />

?- some_instance( whale, E ).<br />

E = moby_dick<br />

Test whether or not the forward chaining engine has a spypoint set on it.<br />

spied_fact( ?Name )<br />

Test whether or not a spypoint is currently set.<br />

Example<br />

?- spied_fact( X ).<br />

X = dislikes<br />

spied_rule( ?Name )<br />

Test whether or not the named rule currently has a spypoint set on it.<br />

Example<br />

?- spied_rule( prescribe_lomotil ).<br />

no<br />

spied_slot(?Attribute, ?Frame )<br />

Check whether or not a there is a spypoint on the Attribute and Frame.<br />

A call to spied_slot/2 will backtrack through all currently spied slots and<br />

unify Attribute with the name of the attribute and Frame with its frame.<br />

The call fails if there are no current spypoints set.<br />

Example<br />

?- spied_slot( A, F) .<br />

A = habitat, F = moby_dick<br />

etc.<br />

spy_chain<br />

Set a spypoint on the forward chaining engine. Whenever there is a call to<br />

forward_chain/[5,6,7] certain information will be written to the<br />

current output stream. This information relates to the termination criterion<br />

and the selection phase.<br />

Furthermore, if any spypoints have been set on individual rules and those<br />

rules are at some stage considered for selection, the conditions of those rules<br />

will be traced by the debugger.<br />

<strong>flex</strong> toolkit

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

Saved successfully!

Ooh no, something went wrong!