Programming in XPCE/Prolog: Section C.5

## C.5 Prolog

As we have seen in section 2, activating XPCE is done by providing the user with access to XPCE's message passing primitives. Near the end of section 2 we briefly explained how control is passed from XPCE to Prolog. The predefined object @prolog is (the only) instance of class host. Any message sent to this instance will be mapped on a Prolog goal and given to the Prolog system as a query: the selector of the method will be used as a predicate name. The arguments will be translated from XPCE data-types to their corresponding Prolog data-types according to the transformation rules described in section D.

The relation between XPCE and Prolog is described in detail in chapter 6. Examples can be found throughout this manual.

Figure 43 shows the data- and control-flow between XPCE and Prolog. The lines with arrows indicate data-flow in the direction of the arrow. The dotted ellipse with arrows indicates the flow of control.

Figure 43 : Data and Control flow in XPCE/Prolog