Body conversion converts a goal of the form X where X is a variable, into a goal of the form call(X). And goals which are not of the form X where X is a callable are rejected by this conversion. Body conversion is in effect when clauses are asserted, either dynamically or statically. The effect can be seen by the following example. In the static rule for the predicate p/0 the variable X will be wrapped via a call/1:Example
p :- q(X), X.
Body conversion is also in effect when goals are executed, either directly or deferred via me-ta-arguments. The body conversion can be switched off via the flag sys_body_convert. The flag only affects the body conversion for the Prolog session queries, for the Prolog text clauses and for the Prolog text directives. The dynamic clause assertions and the deferred meta-arguments are not affected by the flag, these places will still do body conversion.
The body conversion is table driven. The meta-predicate declarations and determine how arguments are traversed. The predicate properties sys_body/0 and sys_rule/0 will indicate that the meta-predicates should be traversed during body conversion respectively rule conversion. To facilitate the declaration the predicate sys_neutral_predicate/1 allows defining dictionary entries that are not yet completely defined.
The following body conversion predicates are provided: