mode(1)

NAME
mode - declare mode of call for predicates that can appear in a hypothesis constructed by Progol.

SYNOPSIS
modeh(RecallNumber,HeadTemplate)? modeb(RecallNumber,BodyLiteralTemplate)?

DESCRIPTION
modeh/2 and modeb/2 describe the `forms' of literals that are allowed in the head and body of a hypothesised clause. RecallNumber specifies an upper bound on the number of successful calls to the predicate specified in the mode declaration. HeadTemplate specifies all legal forms for a head literal in a clause constructed by Progol. BodyLiteralTemplate specifies all legal forms for a body literal in a clause constructed by Progol.

OPTIONS
RecallNumber can be either

a number
    specifying an upper bound number of successful calls to the predicate

*   specifying that the number of successful calls to the predicate is bounded above by some large integer value (currently 100).

HeadTemplate, BodyLiteralTemplate
    are predicate templates of the form

p(ArgSpec, ArgSpec,...)
    where, for each argument ArgSpec is of the form Mode Type or f(ArgSpec, ArgSpec,...) where f is a function symbol. In the former, Mode Type is specified as follows. Mode is one of the following

    +   indicates the argument is an input. That is, in all calls to this predicate, the argument will be bound to a value.

    -   indicates the argument is an output. That is, in all calls to this predicate, the argument will output a term.

    #   indicates that a constant should appear in this argument.

Type
    is the type of the argument. Types are unary predicates defined in the background knowledge, or Prolog built-in functions.

There can be more than one mode of call for each predicate name.

EXAMPLES
Here are some example of specifying modes: modeh(1,mem(+number,[+number|+list]))? modeb(1,mem(+number,+list))? modeb(1,dec(+integer,-integer))? modeb(1,mult(+integer,+integer,-integer))? modeb(1,plus(+integer,+integer,-integer))? modeb(1,+integer=#integer)? modeb(*,has_car(+train,-car))?

SEE ALSO
types