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 144<br />
one of the following:<br />
text(M) Display the canned text given by the list of words M.<br />
file(F)<br />
none<br />
Browse through the file F starting at the topic Name.<br />
There is no explanation available for the question.<br />
Examples<br />
<strong>flex</strong> toolkit<br />
new_question( name_of_applicant,<br />
['Please',enter,your,full,name],<br />
input(name),<br />
text(['No',name,means,no,benefit,!]) )<br />
new_question( starter,<br />
['Please',choose,a,starter,for,your,meal],<br />
single([pate,soup,melon]), none )<br />
new_question( dessert,<br />
['Please',choose,a,dessert,for,your,meal],<br />
multiple(dessert),<br />
file(the_complete_irish_cook) )<br />
new_relation( +Name,+Arity )<br />
Record the Name and Arity of a <strong>flex</strong> relation. This information is used<br />
when initialising the workspace.<br />
Example<br />
new_relation( parent, 2 ) .<br />
new_rule( +Name,+Conditions,+Action,+Explanation,+Score )<br />
Add a new rule to the current workspace. The rule is accessed through its<br />
Name.<br />
The Conditions (a Prolog call or calls) give the context under which the<br />
rule is fireable.<br />
The Action ( a Prolog call or calls) represent the actual firing mechanism of<br />
the rule.<br />
Explanation is used when explaining the rule to a user. It is one of the<br />
following:<br />
text(M) Echo the list M purely as some canned text to be displayed.<br />
file(F) Browse file F starting at the topic Name.<br />
Score is any Prolog term which evaluates via the dereferencing mechanism<br />
(see dereference/2) to a number. The Score parameter is used within