next up previous contents index
Next: Predicate references Up: The Foreign Include File Previous: Unifying data   Contents   Index

Calling Prolog from C

The Prolog engine can be called from C. There are to interfaces for this. For the first, a term is created that could be used as an argument to call1 and next PL_call is used to call Prolog. This system is simple, but does not allow to inspect the different answers to a non-deterministic goal and is relatively slow as the runtime system needs to find the predicate. The other interface is based on PL_open_query, PL_next_solution and PL_cut_query or PL_close_query. This mechanism is more powerful, but also more complicated to use.



Subsections

Dr. Richard Botting 2001-12-12