The C function initialize_bprolog returns BP_ERROR if the B-Prolog system cannot be initialized, e.g., the environment variable BPDIR is not set. The C functions bp_call_string, bp_call_term, and bp_next_solution return BP_ERROR if any exception is raised by the Prolog program.
In the current version of JIPL, the methods Plc.exec and Plc.call returns boolean and thus cannot tell whether or not an exception has occurred in the Prolog execution. Your program must take the responsibility to inform Java of any exceptions raised in Prolog. To do so, the Prolog program should catch all exceptions and set appropriate member variables of the Java object that started the Prolog program. After Plc.exec or Plc.call returns, the Java program can check the member variables to see whether exceptions have occurred.
Neng-Fa Zhou 2011-05-12