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 return 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 about any exceptions that are raised in Prolog. In order to do so, the Prolog program should catch all exceptions, and should set the 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 2013-01-25