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

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

threshold value.<br />

crss(+Names,-Name,+FiringMechanism,-If,-Then,-Vars)<br />

FiringMechanism is one of {repeat,first,last,all} using first will give the same<br />

behaviour as crss/3 .<br />

crss( +Names,-Name,+FiringMechanism,-If,-Then,-Vars,+Threshold )<br />

Threshold is a value for chosing the rule or rules with the best score.<br />

cycle( +Name,+Names,-Newnames )<br />

This is a built-in program for re-organising the rule agenda after each cycle<br />

of the forward chaining engine according to cyclic rotation. It is defined by<br />

the program:<br />

cycle( Name, Names, Newnames ) :-<br />

append( Front, [Name|OldBack], Names ),<br />

append( Front, [Name], NewBack ),<br />

append( OldBack, NewBack, Newnames ).<br />

dereference( +Term,-Value )<br />

This is the kernel of the <strong>flex</strong> run-time procedures. It is used throughout the<br />

system as a means of interpreting <strong>flex</strong> objects. See the earlier chapter<br />

'Interpretation of KSL', for a complete description of the dereferencing<br />

mechanism.<br />

descendant( +Frame,-Descendant )<br />

Descendant is a descendant of Frame in the hierarchy. That is,<br />

Descendant is the Frame itself, or a child frame, or a grandchild frame, or<br />

a great-grandchild frame, etc.<br />

Example<br />

?- descendant( animal, D ).<br />

D = animal<br />

D = mammal<br />

D = whale<br />

D = moby_dick<br />

disable_rules( +Names )<br />

All the rules in the list Names are disabled, and will not be considered for<br />

firing. It is as if they have been temporarily removed from the workspace.<br />

Example<br />

disable_rules( [prescribe_lomotil,fill_B_from_A] ) .

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

Saved successfully!

Ooh no, something went wrong!