The Mode of an argument

ISO Prolog defines modes for arguments as follows:
+
The argument shall be instantiated.
@
The argument shall remain unaltered. Unless the argument is a compound term this is the same as the mode   +.
-
The argument shall be a variable that will be instantiated if the goal succeeds.
?
The argument shall be instantiated or a variable. The ISO standard requires that
  1. if the argument is instantiated, and
  2. the type of the instantiated argument is not that required by the template of the predicate
then an error is to be raised.
:
The argument is a meta argument that is subject to module qualifcation when the predicate is called. The mode * is used in metapredicate mode indicators to denote that an argument is not a meta-argument

Templates

A template specifies the mode and type of each argument of a predicate. The types used in th estandard are as follows:

atom -- an atom
atom_or_atom_list -- an atom or a list of atoms
atomic -- an atomic term
byte -- a byte
callable_term
character -- a one char atom
character_code -- a character code
character_code_list -- a list of character codes
character_list -- a list of characters
clause
close_options -- a list of close options
compound_term
evaluable -- an expression
flag -- a flag
head of a clause
in_byte a byte or -1
in_character a one char atom or the atom end_of_file
in_character_code -- a character code or -1
integer
io_mode -- an input output mode
list
nonvar -- an atomic term or a compound term
number
operator_specifier -- one of the atoms xf, yf, xfx, xfy, yfx, fx, fy
predicate_indicator
read_options_list a read options list
source_sink
stream
stream_options -- a list of stream_options
stream_or_alias -- a stream or an alias
stream_position -- a steam position
stream_property -- a stream property
term
write_options_list -- a write options list



Author: J.P.E. Hodgson
Inria Rocquencourt
78153 Le Chesnay Cedex
France

Saint Joseph's University
Philadelphia PA 19131
USA


Last Changed: 1999/03/09