Classical Prolog modes

Author(s): Manuel Hermenegildo.

This file defines a number of very simple “modes” which are frequently useful in programs. These correspond to the modes used in classical Prolog texts with some simple addtions. Note that some of these modes use the same symbol as one of the ISO-modes (see ISO-Prolog modes) but with subtly different meaning.

Usage and interface

Documentation on new modes

MODE+/1
Input value in argument.

Usage:+A

  • The following properties are added at call time:
    (term_typing:nonvar/1)A is currently a term which is not a free variable.

MODE-/1
No input value in argument.

Usage:-A

  • The following properties are added at call time:
    (term_typing:var/1)A is a free variable.

MODE?/1
Unspecified argument.

MODE@/1
No output value in argument.

Usage:@(A)

MODEin/1
Input argument.

Usage:in(A)

  • The following properties are added at call time:
    (term_typing:ground/1)A is currently ground (it contains no variables).
  • The following properties are added upon exit:
    (term_typing:ground/1)A is currently ground (it contains no variables).

MODEout/1
Output argument.

Usage:out(A)

  • The following properties are added at call time:
    (term_typing:var/1)A is a free variable.
  • The following properties are added upon exit:
    (term_typing:ground/1)A is currently ground (it contains no variables).

MODEgo/1
Ground output (input/output argument).

Usage:go(A)

  • The following properties are added upon exit:
    (term_typing:ground/1)A is currently ground (it contains no variables).

MODE+/2

Usage:A+X

  • Call and exit are compatible with:
    (meta_props:call/2)A has property X.
  • The following properties are added at call time:
    (term_typing:nonvar/1)A is currently a term which is not a free variable.

MODE-/2

Usage:A-X

MODE?/2

Usage:?(A,X)

MODE@/2

Usage:@(A,X)

MODEin/2

Usage:in(A,X)

  • Call and exit are compatible with:
    (meta_props:call/2)A has property X.
  • The following properties are added at call time:
    (term_typing:ground/1)A is currently ground (it contains no variables).
  • The following properties are added upon exit:
    (term_typing:ground/1)A is currently ground (it contains no variables).

MODEout/2

Usage:out(A,X)

  • Call and exit are compatible with:
    (meta_props:call/2)A has property X.
  • The following properties are added at call time:
    (term_typing:var/1)A is a free variable.
  • The following properties are added upon exit:
    (term_typing:ground/1)A is currently ground (it contains no variables).

MODEgo/2

Usage:go(A,X)

  • Call and exit are compatible with:
    (meta_props:call/2)A has property X.
  • The following properties are added upon exit:
    (term_typing:ground/1)A is currently ground (it contains no variables).