The support for calling a Prolog goal from a C program consists of Prolog predicates and C functions. The Prolog predicates allow you to create a saved state, which will be the servant. The C functions are used by your C program to create the Prolog process and communicate with it.
Before a C program can call a Prolog program, you must first create a Prolog saved state in which all the predicates to be called are defined. The saved state must also define the characteristics of the interface to each of the predicates to be called. Once this saved state is created, a C program can call the Prolog predicates by using C API functions. We first describe how to create the Prolog saved state. After that we describe how the C program calls a Prolog predicate.