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
Input value in argument.

(True) 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
No input value in argument.

(True) Usage:-A

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

MODE
Unspecified argument.

MODE
No output value in argument.

(True) Usage:@A

  • The following properties are added globally:
    (basic_props:not_further_inst/2)A is not further instantiated.

MODE
Input argument.

(True) 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).

MODE
Output argument.

(True) 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).

MODE
Ground output (input/output argument).

(True) Usage:go(A)

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

MODE

(True) 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

(True) 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:var/1)A is a free variable.

MODE

(True) Usage:A?X

  • Call and exit are compatible with:
    (meta_props:call/2)A has property X.

MODE

(True) Usage:@(A,X)

  • Call and exit are compatible with:
    (meta_props:call/2)A has property X.
  • The following properties are added globally:
    (basic_props:not_further_inst/2)A is not further instantiated.

MODE

(True) 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).

MODE

(True) 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).

MODE

(True) 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).