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

disprove( +Goal )<br />

enable_rules<br />

Dereference each of the arguments of the Goal and then try to disprove it.<br />

If there is a Prolog program for the Goal, then that program is run together<br />

with negation-as-failure. Otherwise, the workspace is searched for a<br />

matching exception (see new_exception/1), or a check is made that<br />

there are no matching facts (see new_fact/1).<br />

Example<br />

?- disprove( X=or([a,b,c]) ).<br />

no<br />

?- disprove( likes( X, Y) ).<br />

X = mary, Y = fred<br />

Re-enable all rules which have previously been disabled.<br />

enable_rules( +Names )<br />

Re-enable all of the rules in Names which may have been previously disabled<br />

(see disable_rules/1). They can now be considered as potential rules to<br />

fire.<br />

Example<br />

enable_rules( [fill_B_from_A] )<br />

equality( +Term1,+Term2 )<br />

The two terms are dereferenced and the resulting terms equated. If the<br />

equate fails (or there is backtracking into equality/2) then alternative<br />

dereferenced values will be equated.<br />

Example<br />

?- equality( pressure, high ).<br />

no<br />

?- equality( temperature, 2*50 ).<br />

yes<br />

?- equality( X, or([a,b,c]) ).<br />

X = a<br />

X = b<br />

X = c<br />

<strong>flex</strong> toolkit

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

Saved successfully!

Ooh no, something went wrong!