X = <value>if it can prove the goal for a certain X. The user can type the semi-colon (;) or spacebar7On most installations, single-character commands are executed without waiting for the RETURN key. if (s)he wants another solution. Use the return key if you do not want to see more answers. Prolog completes the output with a full stop (.) if the user uses the return key or Prolog knows there are no more answers. If Prolog cannot find (more) answers, it writes false. Finally, Prolog answers using an error message to indicate the query or program contains an error.
?- likes(sam, X). X = dahl ; X = tandoori ; ... X = chips. ?-
Note that the answer written by Prolog is a valid Prolog program that, when executed, produces the same set of answers as the original program.8The SWI-Prolog top level differs in several ways from traditional Prolog top level. The current top level was designed in cooperation with Ulrich Neumerkel.
If properly configured, the predicate edit/1 starts the built-in or user configured editor on the argument. The argument can be anything that can be linked to a location: a file name, predicate name, module name, etc. If the argument resolves to only one location the editor is started on this location, otherwise the user is presented a choice.
If a graphical user interface is available, the editor normally creates a new window and the system prompts for the next command. The user may edit the source file, save it and run make/0 to update any modified source file. If the editor canno