favorite(P -> C)to ask for the favorite color C of P.
A predicate is described by rules. For example, the predicate favorite could have been defined by the following rules:
'rule' favorite (jim -> red) 'rule' favorite (julia -> blue) 'rule' favorite (jane -> red) 'rule' favorite (john -> yellow)An item like favorite (jim -> red) here is called a rule heading (rule bodies, here empty, are discussed later).
An invocation
favorite (julia -> C)would define the variable C as blue because the second rule defines the output blue for the input julia.
A predicate may have input and output parameters. The input parameters come first, the output parameters being separated by an arrow. Here is a predicate with no output parameters:
IsJimsColor(Val)with rule
'rule' IsJimsColor(red)and one with no input parameters:
JimsColor(-> Val)with rule
'rule' JimsColor(-> red)If a list of input or output parameters is supplied, a comma is used to separate the members.