Did you know ... Search Documentation:
Pack nan_system_sources -- prolog/nan/system/sources_docs.txt

Answer Sources :: Code docs

Part of Nan.System.Sources (nan/system/sources.pl)

We conform to SWI-Prolog Source Documentation Version 2 [*], except for argument instantiation modes and relative meanings, as detailed in section Predicate documentation.

[*] http://www.swi-prolog.org/pldoc/package/pldoc.html

Predicate documentation

The header of the documentation of a predicate consists of one or more templates, each defining a specific way of calling the predicate:

<template>       ::= <head>['//'] 'is' <determinism> | <head>['//']
<determinism>    ::= 'det' | 'semidet' | 'failure' | 'nondet' | 'multi'
<head>           ::= <functor>'('<args>')' | <functor>
<args>           ::= <argspec>',' <args> | <argspec>
<argspec>        ::= [<instantiation>]<argname>[':'<type>]
<instantiation>  ::= '+' | '-' | '?' | ':' | '@' | '!'
<type>           ::= <term>

The meaning of the determinism modes is:

DeterminismPredicate behaviour
detSucceeds exactly once.
semidetFails or succeeds exactly once.
failureAlways fails.
nondetFails or succeeds one or more times.
multiSucceeds one or more times.

The meaning of the argument instantiation modes is:

InstantiationDirectionArgument requirements
+Input argumentMust satisfy type at call time. May be instantiated further.
-Output argumentMust be unbound at call time. Will satisfy type on exit.
?Output argumentAs - but "steadfast". (With nonvar argument, det becomes semidet, etc.)
:Input argumentAs + but treated as a meta-argument.
@Input argumentAs + but not instantiated further.
!Input argumentAs + but may be modified destructively.

NOTE: The result of calling a predicate with incorrectly instantiated arguments is undefined and may include errors and unexpected behavior.

- Julio P. Di Egidio
- 1.2.0-beta