next up previous contents
Next: Tracing Up: An Example Previous: Consulting a file   Contents

Posing a goal

To get Prolog to do some computation, you need to issue a goal. Type

|?- grandmother(liz, Who).

Type this exactly, including the capital W and the final full-stop, and, hit <return>. Prolog will respond:1

 Who = harry

Next, type a semi-colon followed by <return>. Prolog will respond

Who = wills

Again, type a semi-colon followed by <return>. Prolog will respond:

no

This means that you have now received all the responses to the goal that Prolog can compute on the basis of the information supplied in your program file.



Steve Harlow 2001-11-12