Auto Documenter Output for the Example Module
Author(s): Anonymous Author 1, Anonymous Author 2.
This is where general comments on the file go. In this case the file is a library which contains some assertion examples for testing the automatic documentation system.
Usage and interface
- Library usage:
:- use_module(library(example_module)). - Exports:
- Imports:
- Files of module user:
foo. - System library modules:
assertions/native_props, engine/basic_props, lists. - Internal (engine) modules:
term_basic, arithmetic, atomic_basic, basic_props, basiccontrol, data_facts, exceptions, io_aux, io_basic, prolog_flags, streams_basic, system_info, term_compare, term_typing, hiord_rt, debugger_support. - Packages:
prelude, nonpure, assertions, basicmodes, fsyntax, regtypes, hiord, nativeprops.
- Files of module user:
Documentation on exports
tree_of(_1,void). tree_of(T,tree(_1,_2,_3)) :- call(T,_1), tree_of(T,_2), tree_of(T,_3).
list_or_aorb(T,_1) :- list(T,_1). list_or_aorb(_T,_1) :- aorb(_1).
Usage 1:
- The following properties should hold at call time:
(var/1)Arg1 is a free variable.
(gnd/1)Arg2 is ground.
(int/1)Arg2 is an integer. - The following properties should hold upon exit:
(gnd/1)Arg1 is ground.
(int/1)Arg1 is an integer.
(int/1)Arg2 is an integer.
Usage 2:
Non-moded types are best used this way.
The predicate is of type dynamic.
Usage:r(A)
This uses parametric types
- The following properties should hold at call time:
(list/1)A is a list. - The following properties should hold upon exit:
(list/2)A is a list of ints.
(gnd/1)A is ground. - The following properties should hold globally:
(not_fails/1)All the calls of the form r(A) do not fail.
Usage:p(Arg1,Arg2,Arg3,Arg4,A)
- Call and exit should be compatible with:
(int/1)Arg1 is an integer.
(list/2)Arg3 is a list of ints. - The following properties should hold at call time:
(ground/1)Arg2 is currently ground (it contains no variables).
(var/1)Arg4 is a free variable.
(nonvar/1)A is currently a term which is not a free variable. - The following properties should hold upon exit:
(gnd/1)Arg1 is ground.
(ground/1)Arg2 is currently ground (it contains no variables). - The following properties should hold globally:
(not_further_inst/2)Arg3 is not further instantiated.
(steps_lb/2)1+length(A) is a lower bound on the cost of any call of the form p(Arg1,Arg2,Arg3,Arg4,A).
long(L) :- length(L,N), N>100.
Usage:long(L)
L is rather long.
Usage:t(A,B,C,D,E)
This predicate uses modes extensively.
- Call and exit should be compatible with:
(list/1)A is a list.
(list/1)B is a list.
(int/1)C is an integer.
(int/1)D is an integer.
(list/1)E is a list. - The following properties should hold at call time:
(nonvar/1)A is currently a term which is not a free variable.
(var/1)B is a free variable.
(long/1)B is rather long. - The following properties should hold upon exit:
(gnd/1)E is ground.
(gnd/1)C is ground.
(gnd/1)A is ground. - The following properties should hold globally:
(not_further_inst/2)D is not further instantiated.
(not_fails/1)All the calls of the form t(A,B,C,D,E) do not fail.
Usage:s(A)
- The following properties should hold at call time:
(list/1)A is a list. - The following properties should hold upon exit:
(list/1)A is a list.
(gnd/1)A is ground. - The following properties should hold globally:
(not_fails/1)All the calls of the form s(A) do not fail.
Usage 1:q(A)
Foo
- The following properties should hold at call time:
(list/1)A is a list. - The following properties should hold upon exit:
(list/1)A is a list.
(gnd/1)A is ground. - The following properties should hold globally:
(not_fails/1)All the calls of the form q(A) do not fail.
Usage 2:q(A)
Not a bad use at all.
(True) Usage:list(L)
L is a list.
True:list(L)
- The following properties hold globally:
(sideff/2)list(L) is side-effect free.
True:list(L)
- If the following properties hold at call time:
(ground/1)L is currently ground (it contains no variables).
then the following properties hold globally:
(eval/1)list(L) is evaluable at compile-time.
(is_det/1)All calls of the form list(L) are deterministic.
Trust:list(T)
- The following properties hold upon exit:
(list/1)T is a list.
Documentation on multifiles
Usage 1:ISO
This mode is nice.
- The following properties should hold at call time:
(int/1)Arg1 is an integer.
(int/1)Arg2 is an integer.
(var/1)Arg3 is a free variable. - The following properties should hold upon exit:
(int/1)Arg1 is an integer.
(int/1)Arg2 is an integer.
(list/1)Arg3 is a list. - The following properties should hold globally:
(iso/1)Complies with the ISO-Prolog standard.
(not_fails/1)All the calls of the form p(Arg1,Arg2,Arg3) do not fail.
Usage 2:p(Preds,Value,Assoc)
This mode is also nice.
- The following properties should hold at call time:
(var/1)Preds is a free variable.
(var/1)Value is a free variable.
(list/1)Assoc is a list. - The following properties should hold upon exit:
(int/1)Preds is an integer.
(int/1)Value is an integer.
(list/1)Assoc is a list. - The following properties should hold globally:
(not_fails/1)All the calls of the form p(Preds,Value,Assoc) do not fail.
Usage 3:
Just playing around.
- The following properties should hold upon exit:
(list/1)Arg1 is a list.
(int/1)Arg2 is an integer.
(list/1)Arg3 is a list. - The following properties should hold globally:
(not_fails/1)All the calls of the form p(Arg1,Arg2,Arg3) do not fail.
(not_fails/1)All the calls of the form p(Arg1,Arg2,Arg3) do not fail.
The predicate is of type dynamic.
General properties:
True:
- If the following properties hold at call time:
(gnd/1)Arg1 is ground.
(var/1)Arg2 is a free variable.
(var/1)Arg3 is a free variable.
Check:
- The following properties should hold at call time:
(undefined property)foo(Arg1)
(bar/1)Arg2 is an acceptable kind of bar.
(baz/1)baz(Arg3)
Check:
- If the following properties hold at call time:
(int/1)Arg1 is an integer.
(int/1)Arg2 is an integer.
(var/1)Arg3 is a free variable.
then the following properties should hold upon exit:
(int/1)Arg1 is an integer.
(int/1)Arg2 is an integer.
(gnd/1)Arg3 is ground.
Check:
- If the following properties hold at call time:
(int/1)Arg1 is an integer.
(int/1)Arg2 is an integer.
(var/1)Arg3 is a free variable.
then the following properties should hold globally:
(not_fails/1)All the calls of the form p(Arg1,Arg2,Arg3) do not fail.
Documentation on internals
(True) Usage:list(L,T)
L is a list of Ts.
True:list(L,T)
- The following properties hold globally:
(sideff/2)list(L,T) is side-effect free.
True:list(L,T)
- If the following properties hold at call time:
(ground/1)L is currently ground (it contains no variables).
(ground/1)T is currently ground (it contains no variables).
then the following properties hold globally:
(eval/1)list(L,T) is evaluable at compile-time.
Trust:list(X,T)
- The following properties hold upon exit:
(list/1)X is a list.
(Trust) Usage:Num is Expr
Typical way to describe/document an external predicate (e.g., written in C).
- The following properties should hold at call time:
(arithexpression/1)Expr is an arithmetic expression. - The following properties hold upon exit:
(num/1)Num is a number.