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

spy_fact( ?Name )<br />

Whenever a fact or an exception whose principal functor is Name is either<br />

added to or removed from the workspace, this information is written to the<br />

current output stream.<br />

In particular, if Name is a variable then all fact and exception transactions<br />

will be monitored.<br />

Examples<br />

spy_rule( ?Name )<br />

spy_fact( likes ) .<br />

spy_fact( dislikes ) .<br />

Set a spypoint on the named rule. Whenever the forward chaining engine is<br />

being traced (see spy_chain/0) and Name is considered as a potential rule<br />

to fire, then the conditions associated with that rule are traced by the<br />

debugger.<br />

Example<br />

spy_rule( prescribe_lomotil ) .<br />

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

Set a spypoint on an Attribute of a Frame, such that whenever the slot<br />

is updated the relevant information is displayed in the current output stream.<br />

Examples<br />

spy_slot( habitat, moby_dick ).<br />

spy_slot( _, albino ).<br />

spy_slot( temperature, _ ).<br />

spy_slot( _, _ ).<br />

sub_value( +Slot,+Term )<br />

sub_value/2 can either be used to remove items from lists or to<br />

decrement numbers.<br />

The given Term is first dereferenced down to some Value. The Slot<br />

should either be a compound term of the form @(Attribute,Frame) or<br />

it is the name of a global variable, in which case the name of the frame to be<br />

used is global.<br />

<strong>flex</strong> toolkit

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

Saved successfully!

Ooh no, something went wrong!