The command-line editor

The command-line editor resides at the top-level of the system, and accepts queries from user. A query is a Prolog goal that ends with a new line. It is a tradition that a period is used to terminate a query. In B-Prolog, since queries cannot expand over more than one line, the terminating period can be omitted.

The command-line editor accepts the following editing commands:

^F Move the cursor one position forward.
^B Move the cursor one position backward.
^A Move the cursor to the beginning of the line.
^E Move the cursor to the end of the line.
^D Delete the character under the cursor.
^H Delete the character to the left of the cursor.
^K Delete the characters to the right of the cursor.
^U Delete the whole line.
^P Load the previous query in the buffer.
^N Load the next query in the buffer.

Note that, as mentioned above, the command ^D will halt the system if the line is empty and the cursor is located at the beginning of the line.

Neng-Fa Zhou 2013-01-25