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
- Library usage:
:- use_package([assertions,basicmodes]). - New operators defined:
?/1 [500,fx], @/1 [500,fx]. - New modes defined:
+/1, -/1, ?/1, @/1, in/1, out/1, go/1, +/2, -/2, ?/2, @/2, in/2, out/2, go/2. - Imports:
- System library modules:
metaprops/meta_props. - Packages:
prelude, nonpure, assertions, metaprops, hiord.
- System library modules:
Documentation on new modes
MODE
+/1:
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
-/1:
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
@/1:
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
in/1:
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
go/1:
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
+/2:
(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
-/2:
(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
@/2:
(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
in/2:
(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
go/2:
(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).