next up previous
Next: Non-deterministic Foreign Predicates Up: The Foreign Include Previous: The Foreign Include

Argument Passing and Control

If Prolog encounters a foreign predicate at run time it will call a function specified in the predicate definition of the foreign predicate. The arguments (1, ..., arity) pass the Prolog arguments to the goal as Prolog terms. Foreign functions should be declared of type foreign_t. Deterministic foreign functions have two alternatives to return control back to Prolog:

void
PL_succeed
  Succeed deterministically. PL_succeed is defined as ``return TRUE''.
void
PL_fail
  Fail and start Prolog backtracking. PL_fail is defined as ``return FALSE''.





Passani Luca
Tue Nov 14 08:58:33 MET 1995