To enter Prolog code at the terminal, type [user]. or compile(user). in response to the top level prompt. (The closing bracket must be followed by a ``full stop'' just like any other query.) The system then displays the compiler prompt (which is a blank by default) and waits for a sequence of Prolog clauses. Each of the clauses is terminated by a fullstop. (If the fullstop is omitted the system just sits waiting, because it supposes the clause is not terminated. If you omit the stop by accident simply type it in on the following line, and then proceed to type in the program clauses, each followed by a full stop and carriage return.) To return to the top level prompt, type ^D or enter the atom end_of_file.
The two predicates father/2 and ancestor/2 are now compiled and can be used.[eclipse 1]: [user]. father(abraham, isaac). father(isaac, jacob). father(jacob, joseph). ancestor(X, Y) :- father(X, Y). ancestor(X, Y) :- ancestor(X, Z), ancestor(Z, Y). ^D user compiled traceable 516 bytes in 0.00 seconds yes. [eclipse 2]: