Invoking the Simulator

The simulator is invoked by the command
sbprolog bc_file where bc_file
is a byte code file resulting from the compilation of a Prolog program. In almost all cases, the user will wish to interact with the SB-Prolog query evaluator, in which case bc_file will be $readloop, and the command will be
sbprolog Path/$readloop
where Path is the path to the directory containing the command interpreter $readloop. This directory, typically, is modlib (see Section [*] above).

The command interpreter reads in a query typed in by the user, evaluates it and prints the answer(s), repeating this until it encounters an end-of-file (the standard end-of-file character on the system, e.g. ctrl-D), or the user types in end_of_file or halt.

The user should ensure that the the directory containing the executable file sim (typically, the system directory sim: see Section [*] above). is included in the shell variable path; if not, the full path to the simulator will have to be specified.

In general, the simulator may be invoked with a variety of options, as follows:

sbprolog -options bc_file
or
sbprolog -option1 -option2 … -optionn bc_file
The options recognized by the simulator are described in Section [*].

When called with a byte code file bc_file, the simulator begins execution with the first clause in that file. The first clause in such a file, therefore, should be a clause without any arguments in the head (otherwise, the simulator will attempt to dereference argument pointers in the head that are really pointing into deep space, and usually come to a sad end). If the user is executing a file in this manner rather than using the command interpreter, he should also be careful to include the undefined predicate handler, consisting of the predicates `_$interrupt/2 and `_$undefined_pred'/1, which is normally defined in the files modlib/src/$init_sys.P and modlib/src/$readloop. undefined_pred/1 (L)