24.11.2014 Views

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

flex Expert System Toolkit - LPIS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

9. Flex Predicates 130<br />

Examples<br />

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

forward_chain( fcfs,<br />

true,<br />

prescription_made,<br />

fixed,<br />

prescription_rule_group ) .<br />

forward_chain( crss,<br />

misfire,<br />

fail,<br />

once,<br />

all ) .<br />

forward_chain( +Selection,+Misfire,+Termination,+Update,+Agenda,-Sequence )<br />

forward_chain/6 behaves exactly as forward_chain/5, except that<br />

an additional piece of information is returned: Sequence is the list of rule<br />

names which were actually fired during the forward chaining session.<br />

forward_chain(+Selection,+Misfire,+Termn,+Update,+Agenda,-Sequence,-Result)<br />

forward_chain/7 behaves exactly as forward_chain/6, except that<br />

an additional piece of information, the Result, is returned.<br />

There are two situations in which the forward chaining can terminate, and<br />

the Result parameter reflects this.<br />

0 The Termination criterion was eventually satisfied.<br />

1 A situation was reached in which no rules could be selected.<br />

front( +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. It brings the most recently fired rule to the<br />

front of the agenda, and is defined by the program:<br />

front( Name, Names, [Name|Newnames]) :-<br />

once( Name, Names, Newnames ).<br />

inclusion( +List,+Term )<br />

The Term and all of the members of the List are first of all dereferenced.<br />

If Term is itself a list, then a check is made that all of its members are also<br />

members of the dereferenced List. Otherwise, the dereferenced Term is a<br />

member of the dereferenced List.<br />

Examples<br />

?- inclusion( [a,b,c,d,e], [c,e,c] ).

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

Saved successfully!

Ooh no, something went wrong!