next up previous contents index
Next: Controlling Style of Inference Up: Special Forms Previous: Calling Lisp from Algernon

Interacting with the User

Obsolete. Write a user interface in Lisp and call it using :test, :bind, or :branch.

(:show  term)

Shows the contents of the frame referred to by term.

(:ask  predicate)

Asks user for a value for predicate. If predicate is ground then Algernon simply asks the user if predicate is true. If the user answers yes then the predicate is asserted and the :ask succeeds. If the user answers no then Algernon concludes the negation of the predicate and the :ask fails. If the predicate is not ground then Algernon asks for a value for the variable in the predicate. If the slot of the predicate is typed to hold values from a set, and the members of the set are known, then Algernon requires the user to enter a value in the set.

In applications making extensive use of :ask it may be useful to define a set of ``ask-slots''  using something like the following path:

((:taxonomy (slots (ask-slots)))
 (:srules ask-slots
  ((?r ?x ?y) <- (:ask (?r ?x ?y)))))
One could then define the slot age as an ask slot using the path:
((:slot age (things nil))
 (isa (:slot age) ask-slots))
This says that the slot age can appear in any frame which is a member of the set things (but the elements in the slot are not typed   -- this allows us to put numbers in the slot without having to create a frame for each number), and that age is an ask-slot. The effect of this path will be that if an age relation is queried, and no value is known, then the user will be queried for a value.

Micheal S. Hewett
Tue Oct 29 11:15:33 CST 1996