diff --git a/C/arith0.c b/C/arith0.c index 1d31e4e6f..a003d64db 100644 --- a/C/arith0.c +++ b/C/arith0.c @@ -21,6 +21,11 @@ static char SccsId[] = "%W% %G%"; /** @file arith0.c +*/ + +//! @{ + +/** @defgroup arithmetic_operators Arithmetic Functions @ingroup arithmetic diff --git a/C/arrays.c b/C/arrays.c index 75150f319..6dbc2e3e6 100644 --- a/C/arrays.c +++ b/C/arrays.c @@ -17,7 +17,7 @@ /** @defgroup YAPArrays Named Arrays -@ingroup YAPExtensions +@ingroup extensions @{ The YAP system includes experimental support for arrays. The @@ -1050,7 +1050,6 @@ must be an atom (named array). The _Size_ must evaluate to an integer. The _Type_ must be bound to one of types mentioned previously. */ -/// @memberof static_array/3 p_create_static_array( USES_REGS1 ) { Term ti = Deref(ARG2); @@ -1267,7 +1266,6 @@ Reset static array with name _Name_ to its initial value. */ -/// @memberof reset_static_array/1 static Int p_clear_static_array( USES_REGS1 ) { @@ -1307,7 +1305,6 @@ further accesses to the array will return an error. */ -/// @memberof close_static_array/1 static Int p_close_static_array( USES_REGS1 ) { @@ -1370,7 +1367,6 @@ terms (type `term`). */ -/// @memberof mmapped_array/4 static Int p_create_mmapped_array( USES_REGS1 ) { @@ -1684,7 +1680,6 @@ to use the operations on mutable terms. */ -/// @memberof update_array/3 static Int p_assign_static( USES_REGS1 ) { @@ -2179,7 +2174,6 @@ terms. */ -/// @memberof add_to_array_element/4 static Int p_add_to_array_element( USES_REGS1 ) @@ -2413,7 +2407,6 @@ that name. */ -/// @memberof static_array_to_term/2 static Int p_static_array_to_term( USES_REGS1 ) { @@ -2583,7 +2576,6 @@ p_static_array_to_term( USES_REGS1 ) Give the location or memory address for a static array with name _Name_. The result is observed as an integer. */ -/// @memberof static_array_location/2 static Int p_static_array_location( USES_REGS1 ) { diff --git a/C/atomic.c b/C/atomic.c index ba4268ef8..5493d68d0 100644 --- a/C/atomic.c +++ b/C/atomic.c @@ -18,8 +18,8 @@ static char SccsId[] = "%W% %G%"; #endif -/** @defgroup Predicates_on_Atoms Predicates on Atoms -@ingroup YAPBuiltins +/** @addgroup Predicates_on_Atoms Predicates on Atoms + @ingroup YAPChars @{ The following predicates are used to manipulate atoms: diff --git a/C/attvar.c b/C/attvar.c index 27172dcd6..1fad0cbac 100644 --- a/C/attvar.c +++ b/C/attvar.c @@ -28,6 +28,12 @@ static char SccsId[]="%W% %G%"; #define NULL (void *)0 #endif +/** @{ */ + +/** @defgroup Attribute_Variables_Builtins Implementation of Attribute Declarations + @ingroup Attributed_Variables +*/ + #ifdef COROUTINING #define TermVoidAtt TermFoundVar @@ -995,6 +1001,14 @@ p_all_attvars( USES_REGS1 ) } while (TRUE); } +/** @pred attvar( _-Var_) + + + Succeed if _Var_ is an attributed variable. + + + +*/ static Int p_is_attvar( USES_REGS1 ) { @@ -1104,16 +1118,10 @@ void Yap_InitAttVarPreds(void) Yap_InitCPred("all_attvars", 1, p_all_attvars, 0); CurrentModule = OldCurrentModule; Yap_InitCPred("attvar", 1, p_is_attvar, SafePredFlag|TestPredFlag); -/** @pred attvar( _-Var_) - - -Succeed if _Var_ is an attributed variable. - - - - */ Yap_InitCPred("$att_bound", 1, p_attvar_bound, SafePredFlag|TestPredFlag); } +/** @} */ + diff --git a/C/bb.c b/C/bb.c index 1472f1bec..f3285adc2 100644 --- a/C/bb.c +++ b/C/bb.c @@ -20,7 +20,7 @@ static char SccsId[] = "%W% %G%"; /** @defgroup BlackBoard The Blackboard -@ingroup YAPBuiltins +@ingroup builtins @{ YAP implements a blackboard in the style of the SICStus Prolog diff --git a/C/cmppreds.c b/C/cmppreds.c index 700623699..ad85b260a 100644 --- a/C/cmppreds.c +++ b/C/cmppreds.c @@ -19,7 +19,7 @@ /** @defgroup Comparing_Terms Comparing Terms -@ingroup YAPBuiltins +@ingroup builtins The following predicates are used to compare and order terms, using the standard ordering: diff --git a/C/dbase.c b/C/dbase.c index df35664fe..63548d3c5 100644 --- a/C/dbase.c +++ b/C/dbase.c @@ -20,7 +20,7 @@ static char SccsId[] = "%W% %G%"; /** @defgroup Internal_Database Internal Data Base -@ingroup YAPBuiltins +@ingroup builtins @{ Some programs need global information for, e.g. counting or collecting diff --git a/C/eval.c b/C/eval.c index 5eb1667ee..d90da8a83 100644 --- a/C/eval.c +++ b/C/eval.c @@ -18,13 +18,14 @@ static char SccsId[] = "%W% %G%"; #endif -/** - @file eval.c +//! @file eval.c +//! @{ + +/** @defgroup arithmetic_preds Arithmetic Predicates @ingroup arithmetic - @{ */ @@ -200,7 +201,6 @@ BEAM_is(void) #endif /** -@{ @pred is( X:number, + Y:ground) is det This predicate succeeds iff the result of evaluating the expression @@ -246,8 +246,6 @@ p_is( USES_REGS1 ) return Yap_unify_constant(ARG1,out); } -//@} - /** @pred isnan(? X:float) is det @@ -319,7 +317,7 @@ p_isinf( USES_REGS1 ) } /** -@{ @pred logsum(+ Log1:float, + Log2:float, - Out:float ) is det + @pred logsum(+ Log1:float, + Log2:float, - Out:float ) is det True if _Log1_ is the logarithm of the positive number _A1_, _Log2_ is the logarithm of the positive number _A2_, and @@ -400,7 +398,6 @@ p_logsum( USES_REGS1 ) } } -// @} Int Yap_ArithError(yap_error_number type, Term where, char *format,...) @@ -458,9 +455,7 @@ Yap_EvalError(yap_error_number type, Term where, char *format,...) /** - @{ - - @pred between(+ Low:int, + High:int, ? Value:int) is nondet + @pred between(+ Low:int, + High:int, ? Value:int) is nondet _Low_ and _High_ are integers, _High_ \>= _Low_. If _Value_ is an integer, _Low_ =\< _Value_ @@ -603,11 +598,6 @@ init_between( USES_REGS1 ) return cont_between( PASS_REGS1 ); } -/** - * - * @} -*/ - void Yap_InitEval(void) { diff --git a/C/globals.c b/C/globals.c index 9242f995a..b920b83e7 100644 --- a/C/globals.c +++ b/C/globals.c @@ -24,7 +24,7 @@ static char SccsId[] = "%W% %G%"; @file globals.c @defgroup Global_Variables Global Variables -@ingroup YAPBuiltins +@ingroup builtins @{ Global variables are associations between names (atoms) and diff --git a/C/inlines.c b/C/inlines.c index b201896a3..2b1743673 100644 --- a/C/inlines.c +++ b/C/inlines.c @@ -17,7 +17,7 @@ /** @defgroup YAP_Terms Predicates on terms -@ingroup YAPBuiltins +@ingroup builtins @{ diff --git a/C/mavar.c b/C/mavar.c index 02920820e..afd814326 100644 --- a/C/mavar.c +++ b/C/mavar.c @@ -17,7 +17,7 @@ /** @defgroup Term_Modification Term Modification -@ingroup YAPBuiltins +@ingroup builtins @{ It is sometimes useful to change the value of instantiated diff --git a/C/stdpreds.c b/C/stdpreds.c index a78e1d47a..83c12a6f0 100644 --- a/C/stdpreds.c +++ b/C/stdpreds.c @@ -425,7 +425,32 @@ Int show_time(USES_REGS1) /* MORE PRECISION */ } #endif /* BEAM */ +// @{ +/** + @defgroup YAPSetVal + @ingroup Internal_Database + + Maintain a light-weight map where the key is an atom, and the value can be any constant. +*/ + +/** @pred set_value(+ _A_,+ _C_) + + + Associate atom _A_ with constant _C_. + + The `set_value` and `get_value` built-ins give a fast alternative to + the internal data-base. This is a simple form of implementing a global + counter. + + ~~~~~ + read_and_increment_counter(Value) :- + get_value(counter, Value), + Value1 is Value+1, + set_value(counter, Value1). + ~~~~~ + This predicate is YAP specific. +*/ static Int p_setval(USES_REGS1) { /* '$set_value'(+Atom,+Atomic) */ Term t1 = Deref(ARG1), t2 = Deref(ARG2); if (!IsVarTerm(t1) && IsAtomTerm(t1) && @@ -436,6 +461,13 @@ static Int p_setval(USES_REGS1) { /* '$set_value'(+Atom,+Atomic) */ return (FALSE); } +/** @pred get_value(+ _A_,- _V_) + In YAP, atoms can be associated with constants. If one such + association exists for atom _A_, unify the second argument with the + constant. Otherwise, unify _V_ with `[]`. + + This predicate is YAP specific. +*/ static Int p_value(USES_REGS1) { /* '$get_value'(+Atom,?Val) */ Term t1 = Deref(ARG1); if (IsVarTerm(t1)) { @@ -453,7 +485,7 @@ static Int p_values(USES_REGS1) { /* '$values'(Atom,Old,New) */ Term t1 = Deref(ARG1), t3 = Deref(ARG3); if (IsVarTerm(t1)) { - Yap_Error(INSTANTIATION_ERROR, t1, "set_value/2"); + Yap_Error(INSTANTIATION_ERROR, t1, "set_value/2"); return (FALSE); } if (!IsAtomTerm(t1)) { @@ -472,6 +504,9 @@ static Int p_values(USES_REGS1) { /* '$values'(Atom,Old,New) */ return (TRUE); } +//@} + + static Int p_opdec(USES_REGS1) { /* '$opdec'(p,type,atom) */ /* we know the arguments are integer, atom, atom */ Term p = Deref(ARG1), t = Deref(ARG2), at = Deref(ARG3); @@ -1914,42 +1949,9 @@ static Int p_yapor_workers(USES_REGS1) { return FALSE; } void Yap_InitCPreds(void) { /* numerical comparison */ Yap_InitCPred("set_value", 2, p_setval, SafePredFlag | SyncPredFlag); - /** @pred set_value(+ _A_,+ _C_) - - - Associate atom _A_ with constant _C_. - - The `set_value` and `get_value` built-ins give a fast alternative to - the internal data-base. This is a simple form of implementing a global - counter. - - ~~~~~ - read_and_increment_counter(Value) :- - get_value(counter, Value), - Value1 is Value+1, - set_value(counter, Value1). - ~~~~~ - This predicate is YAP specific. - - - - - - */ - Yap_InitCPred("get_value", 2, p_value, + Yap_InitCPred("get_value", 2, p_value, TestPredFlag | SafePredFlag | SyncPredFlag); - /** @pred get_value(+ _A_,- _V_) - - - In YAP, atoms can be associated with constants. If one such - association exists for atom _A_, unify the second argument with the - constant. Otherwise, unify _V_ with `[]`. - - This predicate is YAP specific. - - - */ - Yap_InitCPred("$values", 3, p_values, SafePredFlag | SyncPredFlag); + Yap_InitCPred("$values", 3, p_values, SafePredFlag | SyncPredFlag); /* general purpose */ Yap_InitCPred("$opdec", 4, p_opdec, SafePredFlag | SyncPredFlag); Yap_InitCPred("=..", 2, p_univ, 0); diff --git a/C/sysbits.c b/C/sysbits.c index f3c550905..2c5aed42b 100644 --- a/C/sysbits.c +++ b/C/sysbits.c @@ -18,6 +18,8 @@ static char SccsId[] = "%W% %G%"; #endif +// @{ + /** @addtogroup YAPOS */ @@ -3258,3 +3260,5 @@ rw_lock_voodoo(void) { #endif /* YAPOR || THREADS */ + +//@ diff --git a/C/unify.c b/C/unify.c index c70982c48..f88af1dcc 100644 --- a/C/unify.c +++ b/C/unify.c @@ -15,7 +15,7 @@ * * *************************************************************************/ /** @defgroup Rational_Trees Rational Trees -@ingroup YAPExtensions +@ingroup extensions @{ Prolog unification is not a complete implementation. For efficiency @@ -998,7 +998,7 @@ Yap_InitUnify(void) CACHE_REGS Term cm = CurrentModule; Yap_InitCPred("unify_with_occurs_check", 2, p_ocunify, SafePredFlag); -/** @pred unify_with_occurs_check(?T1,?T2) is iso + /** @pred unify_with_occurs_check(?T1,?T2) is iso Obtain the most general unifier of terms _T1_ and _T2_, if there @@ -1064,3 +1064,5 @@ Yap_TrimTrail(void) #include "trim_trail.h" } + +//! @} diff --git a/H/eval.h b/H/eval.h index e0a34c449..feeccf13f 100644 --- a/H/eval.h +++ b/H/eval.h @@ -19,7 +19,7 @@ @defgroup arithmetic Arithmetic in YAP -@ingroup YAPBuiltins +@ingroup builtins + See @ref arithmetic_preds for the predicates that implement arithment diff --git a/OPTYap/or.structs.h b/OPTYap/or.structs.h index 6e5fac0bd..9af48440d 100644 --- a/OPTYap/or.structs.h +++ b/OPTYap/or.structs.h @@ -15,7 +15,7 @@ /** @defgroup Parallelism Parallelism in YAP -@ingroup YAPExtensions +@ingroup extensions @{ There has been a sizeable amount of work on an or-parallel diff --git a/library/apply.yap b/library/apply.yap index ed66d5867..a608bdb28 100644 --- a/library/apply.yap +++ b/library/apply.yap @@ -1,5 +1,5 @@ /** @defgroup Apply Apply Macros -@ingroup YAPLibrary +@ingroup library @{ This library provides a SWI-compatible set of utilities for applying a diff --git a/library/assoc.yap b/library/assoc.yap index d0d18b101..f907147f0 100644 --- a/library/assoc.yap +++ b/library/assoc.yap @@ -5,7 +5,7 @@ % Note : the keys should be bound, the associated values need not be. /** @defgroup Association_Lists Association Lists -@ingroup YAPLibrary +@ingroup library @{ The following association list manipulation predicates are available diff --git a/library/atts.yap b/library/atts.yap index bab2b56a6..c960b2f31 100644 --- a/library/atts.yap +++ b/library/atts.yap @@ -17,11 +17,12 @@ :- module(attributes, [op(1150, fx, attribute)]). +%% @{ -/** @defgroup Old_Style_Attribute_Declarations SICStus Prolog style Attribute Declarations -@ingroup Attributed_Variables -@{ - +/** + @defgroup Old_Style_Attribute_Declarations SICStus Prolog style Attribute Declarations + @ingroup Attributed_Variables + Old style attribute declarations are activated through loading the library atts . The command @@ -50,12 +51,17 @@ variable. Unification will resume after this call. project_attributes/2 is used from a set of variables into a set of constraints or goals. One application of project_attributes/2 is in the top-level, where it is used to output the set of -floundered constraints at the end of a query. + floundered constraints at the end of a query. +*/ + +%% @} + + +%% @{ /** @defgroup Attribute_Declarations Attribute Declarations @ingroup Old_Style_Attribute_Declarations -@{ - + Attributes are compound terms associated with a variable. Each attribute has a name which is private to the module in which the attribute was defined. Variables may have at most one attribute with a @@ -498,5 +504,5 @@ do_verify_attributes([_|Mods], AttVar, Binding, Goals) :- do_verify_attributes(Mods, AttVar, Binding, Goals). /** -@} + @} */ diff --git a/library/avl.yap b/library/avl.yap index ed3c685ed..356fd2976 100644 --- a/library/avl.yap +++ b/library/avl.yap @@ -17,7 +17,7 @@ /** @defgroup AVL_Trees AVL Trees -@ingroup YAPLibrary +@ingroup library @{ AVL trees are balanced search binary trees. They are named after their diff --git a/library/bhash.yap b/library/bhash.yap index c2c488887..749935a96 100644 --- a/library/bhash.yap +++ b/library/bhash.yap @@ -39,14 +39,14 @@ It relies on dynamic array code. array_default_size(2048). -/** is_b_hash( +Hash ) +/** @pred is_b_hash( +Hash ) Term _Hash_ is a hash table. */ is_b_hash(V) :- var(V), !, fail. is_b_hash(hash(_,_,_,_,_)). -/** b_hash_new( -NewHash ) +/** @pred b_hash_new( -NewHash ) Create a empty hash table _NewHash_, with size 2048 entries. */ @@ -56,7 +56,7 @@ b_hash_new(hash(Keys, Vals, Size, N, _, _)) :- array(Vals, Size), create_mutable(0, N). -/** b_hash_new( -_NewHash_, +_Size_ ) +/** @pred b_hash_new( -_NewHash_, +_Size_ ) Create a empty hash table, with size _Size_ entries. */ @@ -65,7 +65,7 @@ b_hash_new(hash(Keys, Vals, Size, N, _, _), Size) :- array(Vals, Size), create_mutable(0, N). -/** b_hash_new( -_NewHash_, +_Size_, :_Hash_, :_Cmp_ ) +/** @pred b_hash_new( -_NewHash_, +_Size_, :_Hash_, :_Cmp_ ) Create a empty hash table, with size _Size_ entries. _Hash_ defines a partition function, and _Cmp_ defined a comparison function. @@ -75,13 +75,15 @@ b_hash_new(hash(Keys,Vals, Size, N, HashF, CmpF), Size, HashF, CmpF) :- array(Vals, Size), create_mutable(0, N). -/** b_hash_size( +_Hash_, -_Size_ ) +/** + @pred b_hash_size( +_Hash_, -_Size_ ) _Size_ unifies with the size of the hash table _Hash_. */ b_hash_size(hash(_, _, Size, _, _, _), Size). -/** b_hash_size_lookup( +_Key_, ?_Val_, +_Hash_ ) +/** + @pred b_hash_lookup( +_Key_, ?_Val_, +_Hash_ ) Search the ground term _Key_ in table _Hash_ and unify _Val_ with the associated entry. */ @@ -103,7 +105,8 @@ fetch_key(Keys, Index, Size, Key, CmpF, ActualIndex) :- fetch_key(Keys, I1, Size, Key, CmpF, ActualIndex) ). -/** b_hash_update( +_Key_, +_Hash_, +NewVal ) +/** + @pred b_hash_update( +_Key_, +_Hash_, +NewVal ) Update to the value associated with the ground term _Key_ in table _Hash_ to _NewVal_. */ @@ -114,7 +117,8 @@ b_hash_update(Hash, Key, NewVal):- array_element(Vals, ActualIndex, Mutable), update_mutable(NewVal, Mutable). -/** b_hash_update( +_Key_, -_OldVal_, +_Hash_, +NewVal ) +/** + @pred b_hash_update( +_Key_, -_OldVal_, +_Hash_, +NewVal ) Update to the value associated with the ground term _Key_ in table _Hash_ to _NewVal_, and unify _OldVal_ with the current value. */ @@ -153,7 +157,8 @@ find_or_insert(Keys, Index, Size, N, CmpF, Vals, Key, NewVal, Hash, NewHash) :- find_or_insert(Keys, I1, Size, N, CmpF, Vals, Key, NewVal, Hash, NewHash) ). -/** b_hash_insert_new(+_Hash_, +_Key_, _Val_, +_NewHash_ ) +/** + @pred b_hash_insert_new(+_Hash_, +_Key_, _Val_, +_NewHash_ ) Insert the term _Key_-_Val_ in table _Hash_ and unify _NewHash_ with the result. If ground term _Key_ exists, fail. */ @@ -259,7 +264,8 @@ cmp_f(F, A, B) :- cmp_f(F, A, B) :- call(F, A, B). -/** b_hash_to_list(+_Hash_, -_KeyValList_ ) +/** + @pred b_hash_to_list(+_Hash_, -_KeyValList_ ) The term _KeyValList_ unifies with a list containing all terms _Key_-_Val_ in the hash table. */ @@ -268,7 +274,8 @@ b_hash_to_list(hash(Keys, Vals, _, _, _, _), LKeyVals) :- Vals =.. (_.LVs), mklistpairs(LKs, LVs, LKeyVals). -/** b_key_to_list(+_Hash_, -_KeyList_ ) +/** + @pred b_key_to_list(+_Hash_, -_KeyList_ ) The term _KeyList_ unifies with a list containing all keys in the hash table. */ @@ -276,7 +283,8 @@ b_hash_keys_to_list(hash(Keys, _, _, _, _, _), LKeys) :- Keys =.. (_.LKs), mklistels(LKs, LKeys). -/** b_key_to_list(+_Hash_, -_ValList_ ) +/** + @pred b_key_to_list(+_Hash_, -_ValList_ ) The term _`valList_ unifies with a list containing all values in the hash table. */ diff --git a/library/block_diagram.yap b/library/block_diagram.yap index 5c762797f..f35b21198 100644 --- a/library/block_diagram.yap +++ b/library/block_diagram.yap @@ -202,7 +202,7 @@ %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% /** @defgroup Block_Diagram Block Diagram -@ingroup YAPLibrary +@ingroup library @{ This library provides a way of visualizing a prolog program using @@ -232,7 +232,7 @@ parameter(texts((+inf))). parameter(depth((+inf))). parameter(default_ext('.yap')). -/** @pred make_diagram(+inputfilename, +ouputfilename) +/** @pred make_diagram(+Inputfilename, +Ouputfilename) @@ -252,7 +252,7 @@ make_diagram(InputFile, OutputFile):- write('}'), nl, told. -/** @pred make_diagram(+inputfilename, +ouputfilename, +predicate, +depth, +extension) +/** @pred make_diagram(+Inputfilename, +Ouputfilename, +Predicate, +Depth, +Extension) The same as make_diagram/2 but you can define how many of the imported/exporeted predicates will be shown with predicate, and how deep the crawler is allowed to go with depth. The extension is used if the file use module directives do not include a file extension. diff --git a/library/c_alarms.yap b/library/c_alarms.yap index dc528c20c..a983a6f5b 100644 --- a/library/c_alarms.yap +++ b/library/c_alarms.yap @@ -211,7 +211,7 @@ timer_pause/2]). /** @defgroup CAlarms Concurrent Alarms -@ingroup YAPLibrary +@ingroup library @{ This library provides a concurrent signals. To use it use: diff --git a/library/charsio.yap b/library/charsio.yap index ac0c562eb..139b3e3bf 100644 --- a/library/charsio.yap +++ b/library/charsio.yap @@ -33,7 +33,7 @@ ]). /** @defgroup CharsIO Operations on Sequences of Codes. -@ingroup YAPLibrary +@ingroup library Term to sequence of codes conversion, mostly replaced by engine code. */ diff --git a/library/cleanup.yap b/library/cleanup.yap index 1b5d99907..ea83ccda6 100644 --- a/library/cleanup.yap +++ b/library/cleanup.yap @@ -9,7 +9,7 @@ ]). %% @defgroup Cleanup Call Cleanup -% @ingroup YAPLibrary +% @ingroup library % @{ % % call_cleanup/1 and call_cleanup/2 allow predicates to register diff --git a/library/clp/clpfd.pl b/library/clp/clpfd.pl index 44861801d..638c4e5f8 100644 --- a/library/clp/clpfd.pl +++ b/library/clp/clpfd.pl @@ -67,7 +67,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ - +/** To make the predicate terminate if any argument is instantiated, add the (implied) constraint F #\= 0 before the recursive call. Otherwise, the query fac(N, 0) is the only non-terminating case of this kind. diff --git a/library/coinduction.yap b/library/coinduction.yap index 48a03767d..9fe76bacd 100644 --- a/library/coinduction.yap +++ b/library/coinduction.yap @@ -31,7 +31,7 @@ :- use_module(library(error)). /** Co-Logic Programming - @ingroup YAPLibrary + @ingroup library This simple module implements the directive coinductive/1 as described in "Co-Logic Programming: Extending Logic Programming with Coinduction" diff --git a/library/dbqueues.yap b/library/dbqueues.yap index 7744def54..8fa3f1058 100644 --- a/library/dbqueues.yap +++ b/library/dbqueues.yap @@ -1,6 +1,6 @@ /** @defgroup DBQUeue Non-baacktrackable queues in YAP. - @ingroup YAPLibrary + @ingroup library @{ A library to implement queues of NB Terms diff --git a/library/dbusage.yap b/library/dbusage.yap index 3b378840b..e7ea020f9 100644 --- a/library/dbusage.yap +++ b/library/dbusage.yap @@ -1,7 +1,7 @@ /** @defgroup DBUsage Memory Usage in Prolog Data-Base - @ingroup YAPLibrary + @ingroup library @{ This library provides a set of utilities for studying memory usage in YAP. diff --git a/library/dgraphs.yap b/library/dgraphs.yap index 79d494a45..ba2d52af9 100644 --- a/library/dgraphs.yap +++ b/library/dgraphs.yap @@ -5,7 +5,7 @@ /** @defgroup DGraphs Directed Graphs -@ingroup YAPLibrary +@ingroup library @{ The following graph manipulation routines use the red-black tree library diff --git a/library/dialect/swi.yap b/library/dialect/swi.yap index 768b1c13c..6f55682a3 100644 --- a/library/dialect/swi.yap +++ b/library/dialect/swi.yap @@ -2,7 +2,7 @@ % SWI emulation. % written in an on-demand basis. -%% @defgroup SWILibrary Compatibility with SWI-Prolog and Other Prolog systems +%% @defgroup swi Compatibility with SWI-Prolog and Other Prolog systems /** @@ -148,21 +148,9 @@ that concatenated give _A12_. */ + goal_expansion(atom_concat(A,B,C),atomic_concat(A,B,C)). %goal_expansion(arg(A,_,_),_) :- nonvar(A), !, fail. -/** @pred arg(+ _N_,+ _T_, _A_) is iso - - -Succeeds if the argument _N_ of the term _T_ unifies with - _A_. The arguments are numbered from 1 to the arity of the term. - -The current version will generate an error if _T_ or _N_ are -unbound, if _T_ is not a compound term, of if _N_ is not a positive -integer. Note that previous versions of YAP would fail silently -under these errors. - -@} -*/ goal_expansion(arg(A,B,C),genarg(A,B,C)). % make sure we also use diff --git a/library/dialect/swi/fli/blobs.c b/library/dialect/swi/fli/blobs.c index 1d64d06c3..10d56154d 100644 --- a/library/dialect/swi/fli/blobs.c +++ b/library/dialect/swi/fli/blobs.c @@ -16,11 +16,11 @@ *************************************************************************/ /** * - * @file blobs.c + * @{ +* @file blobs.c * * @addtogroup swi-c-interface * - * @{ */ #include @@ -250,7 +250,7 @@ PL_unregister_blob_type(PL_blob_t *type) { fprintf(stderr,"PL_unregister_blob_type not implemented yet\n"); return FALSE; -} +xs} void Yap_install_blobs(void) diff --git a/library/dialect/swi/fli/swi.c b/library/dialect/swi/fli/swi.c index 93636f083..d7db1b3b7 100755 --- a/library/dialect/swi/fli/swi.c +++ b/library/dialect/swi/fli/swi.c @@ -140,9 +140,10 @@ UserCPredicate(char *a, CPredicate def, unsigned long int arity, Term mod, int f CurrentModule = cm; } +//! @{ + /** @defgroup swi-ATOMS Atom Construction * @ingroup swi-c-interface - * @{ * */ @@ -177,11 +178,12 @@ X_API char* PL_atom_nchars(atom_t a, size_t *len) /* SAM check type */ return s; } -/** @} +//! @} + +/** @{ * * @defgroup swi-term_references Term References * @ingroup swi-c-interface - * @{ * */ /** @brief duplicate a term reference @@ -226,14 +228,17 @@ X_API void PL_reset_term_refs(term_t after) } /** @} - * @defgroup swi-term_manipulation Term Manipulation + */ + +//! @{ + +/** @defgroup swi-term_manipulation Term Manipulation * @ingroup swi-c-interface * */ /** * @defgroup swi-get-operations Reading Terms * @ingroup swi-term_manipulation - * @{ * */ /** @brief *name is assigned the name and *arity the arity if term ts, or the operaton fails. @@ -647,10 +652,11 @@ X_API int PL_get_string(term_t t, char **s, size_t *len) * @} * */ +//! @{ /** * @defgroup swi-unify-operations Unifying Terms * @ingroup swi-term_manipulation - * @{ + * */ diff --git a/library/dialect/swi/fli/swi.h b/library/dialect/swi/fli/swi.h index b5372bac3..ddc3b1f2f 100644 --- a/library/dialect/swi/fli/swi.h +++ b/library/dialect/swi/fli/swi.h @@ -9,7 +9,10 @@ *************************************************************************/ /** - @file swi.h + + @{ + + @file swi.h @defgroup swi-c-interface SWI-Prolog Foreign Language Interface @ingroup ChYInterface @@ -30,8 +33,6 @@ * Prolog has all the information necessary to perform its memory management without special precautions * from the C programmer. - @{ - */ void Yap_swi_install(void); void Yap_install_blobs(void); diff --git a/library/exo_interval.yap b/library/exo_interval.yap index 7f81f652c..0fa6e7b68 100644 --- a/library/exo_interval.yap +++ b/library/exo_interval.yap @@ -8,7 +8,7 @@ /** @defgroup Exo_Intervals Exo Intervals -@ingroup YAPLibrary +@ingroup library @{ This package assumes you use exo-compilation, that is, that you loaded diff --git a/library/heaps.yap b/library/heaps.yap index c807be293..84378c96a 100644 --- a/library/heaps.yap +++ b/library/heaps.yap @@ -18,7 +18,7 @@ /** @defgroup Heaps Heaps -@ingroup YAPLibrary +@ingroup library @{ A heap is a labelled binary tree where the key of each node is less than diff --git a/library/lam_mpi.yap b/library/lam_mpi.yap index 1ec5c0020..7a6da46c1 100644 --- a/library/lam_mpi.yap +++ b/library/lam_mpi.yap @@ -4,7 +4,7 @@ /** @defgroup LAM LAM -@ingroup YAPLibrary +@ingroup library @{ This library provides a set of utilities for interfacing with LAM MPI. diff --git a/library/lambda.pl b/library/lambda.pl index fa956aa9c..fdb1fc206 100644 --- a/library/lambda.pl +++ b/library/lambda.pl @@ -41,7 +41,7 @@ official policies, either expressed or implied, of Ulrich Neumerkel. op(201,xfx,+\)]). /** Lambda expressions -@ingroup YAPLibrary +@ingroup library This library provides lambda expressions to simplify higher order programming based on call/N. diff --git a/library/lineutils.yap b/library/lineutils.yap index a067139a2..43d048e16 100644 --- a/library/lineutils.yap +++ b/library/lineutils.yap @@ -20,7 +20,7 @@ ]). /** @defgroup LineUtilities Line Manipulation Utilities -@ingroup YAPLibrary +@ingroup library @{ This package provides a set of useful predicates to manipulate diff --git a/library/lists.yap b/library/lists.yap index ddc93bc2b..9e806f65a 100644 --- a/library/lists.yap +++ b/library/lists.yap @@ -5,7 +5,7 @@ % /** @defgroup Lists List Manipulation -@ingroup YAPLibrary +@ingroup library @{ The following list manipulation routines are available once included diff --git a/library/maplist.yap b/library/maplist.yap index 456da0586..edb019629 100644 --- a/library/maplist.yap +++ b/library/maplist.yap @@ -1,6 +1,7 @@ /** -@defgroup YAPControl Meta- and Control Predicates + @defgroup YAPMapList Meta- and Control Predicates + @ingroup library @{ */ @@ -22,7 +23,7 @@ * @file maplist.yap * * @defgroup maplist Map List and Term Operations - * @ingroup YAPLibrary + * @ingroup library * * This library provides a set of utilities for applying a predicate to * all elements of a list. They allow one to easily perform the most common do-loop constructs in Prolog. diff --git a/library/matlab.yap b/library/matlab.yap index abd845d54..606580918 100644 --- a/library/matlab.yap +++ b/library/matlab.yap @@ -1,6 +1,6 @@ /** @defgroup MATLAB MATLAB Package Interface -@ingroup YAPLibrary +@ingroup library @{ The MathWorks MATLAB is a widely used package for array diff --git a/library/matrix.yap b/library/matrix.yap index c31556b5d..0c382925d 100644 --- a/library/matrix.yap +++ b/library/matrix.yap @@ -16,7 +16,7 @@ *************************************************************************/ /** @defgroup matrix Matrix Library -@ingroup YAPLibrary +@ingroup library @{ This package provides a fast implementation of multi-dimensional diff --git a/library/nb.yap b/library/nb.yap index 947808007..5a4c94c5c 100644 --- a/library/nb.yap +++ b/library/nb.yap @@ -16,7 +16,7 @@ *************************************************************************/ /** @defgroup NonhYBacktrackable_Data_Structures Non-Backtrackable Data Structures -@ingroup YAPLibrary +@ingroup library @{ The following routines implement well-known data-structures using global diff --git a/library/ordsets.yap b/library/ordsets.yap index cf7f7afea..6ce076c9f 100644 --- a/library/ordsets.yap +++ b/library/ordsets.yap @@ -19,7 +19,7 @@ /** @defgroup Ordered_Sets Ordered Sets -@ingroup YAPLibrary +@ingroup library @{ The following ordered set manipulation routines are available once diff --git a/library/prandom.yap b/library/prandom.yap index bba054faa..19963bf0c 100644 --- a/library/prandom.yap +++ b/library/prandom.yap @@ -17,7 +17,7 @@ /** @groupdef PseudoRandom Van Gelder Random Number Generator - @ingroup YAPBuiltins + @ingroup builtins @{ */ diff --git a/library/queues.yap b/library/queues.yap index f32612ac6..b464152e1 100644 --- a/library/queues.yap +++ b/library/queues.yap @@ -7,7 +7,7 @@ % Needs : lib(lists) for append/3. /** @defgroup Queues Queues -@ingroup YAPLibrary +@ingroup library @{ The following queue manipulation routines are available once diff --git a/library/random.yap b/library/random.yap index b8f351cd7..308a7edb3 100644 --- a/library/random.yap +++ b/library/random.yap @@ -23,7 +23,7 @@ % arithmetic. /** @defgroup Pseudo_Random Random Number Generator -@ingroup YAPLibrary +@ingroup library @{ The following random number operations are included with the @@ -55,7 +55,7 @@ integers then _NUMBER_ will also be an integer, otherwise /** @defgroup Pseudo_Random Pseudo Random Number Integer Generator -@ingroup YAPLibrary +@ingroup library @{ The following routines produce random non-negative integers in the range diff --git a/library/rbtrees.yap b/library/rbtrees.yap index 3efb9ac29..bfc284cfd 100644 --- a/library/rbtrees.yap +++ b/library/rbtrees.yap @@ -50,10 +50,13 @@ rb_in/3 ]). -/** @defgroup RedhYBlack_Trees Red-Black Trees -@ingroup YAPLibrary -@{ +%%! @{ +/** + @file rbtrees.yap + @defgroup rbtrees Red-Black Trees + @ingroup library + Red-Black trees are balanced search binary trees. They are named because nodes can be classified as either red or black. The code we include is based on "Introduction to Algorithms", second edition, by Cormen, @@ -109,7 +112,6 @@ rb_new(K,V,t(Nil,black(Nil,K,V,Nil))) :- Nil = black('',_,_,''). %% rb_empty(?T) is semidet. % % Succeeds if T is an empty Red-Black tree. - rb_empty(t(Nil,Nil)) :- Nil = black('',_,_,''). %% rb_lookup(+Key, -Value, +T) is semidet. @@ -1036,7 +1038,6 @@ list_to_rbtree(List, T) :- % % T is the red-black tree corresponding to the mapping in ordered % list L. - ord_list_to_rbtree([], t(Nil,Nil)) :- !, Nil = black('', _, _, ''). ord_list_to_rbtree([K-V], t(Nil,black(Nil,K,V,Nil))) :- !, @@ -1085,10 +1086,9 @@ size(black(L,_,_,R),Sz0,Szf) :- %% is_rbtree(?Term) is semidet. % -% True if Term is a valide Red-Black tree. +% True if Term is a valid Red-Black tree. % % @tbd Catch variables. - is_rbtree(X) :- var(X), !, fail. is_rbtree(t(Nil,Nil)) :- !. @@ -1231,26 +1231,11 @@ build_ntree(X1,X,T0,TF) :- -/** @pred is_rbtree(+ _T_) - -Check whether _T_ is a valid red-black tree. - - -*/ -/** @pred ord_list_to_rbtree(+ _L_, - _T_) - - - _T_ is the red-black tree corresponding to the mapping in ordered -list _L_. - - - - */ /** @pred rb_apply(+ _T_,+ _Key_,+ _G_,- _TN_) -If the value associated with key _Key_ is _Val0_ in _T_, and + If the value associated with key _Key_ is _Val0_ in _T_, and if `call(G,Val0,ValF)` holds, then _TN_ differs from _T_ only in that _Key_ is associated with value _ValF_ in tree _TN_. Fails if it cannot find _Key_ in _T_, or if @@ -1448,7 +1433,8 @@ with _NewVal_. Fails if it cannot find _Key_ in _T_. _Pairs_ is an infix visit of tree _T_, where each element of _Pairs_ is of the form _K_- _Val_. -@} - + */ +%%! @} + diff --git a/library/regexp.yap b/library/regexp.yap index 8c9011b0a..e97c77b1e 100644 --- a/library/regexp.yap +++ b/library/regexp.yap @@ -16,7 +16,7 @@ *************************************************************************/ /** @defgroup RegExp Regular Expressions -@ingroup YAPLibrary +@ingroup library @{ This library includes routines to determine whether a regular expression diff --git a/library/sockets.yap b/library/sockets.yap index 63c32e17a..17e68845e 100644 --- a/library/sockets.yap +++ b/library/sockets.yap @@ -2,7 +2,7 @@ SICStus compatible socket library -@ingroup YAPBuiltins +@ingroup builtins YAP includes a SICStus Prolog compatible socket interface. In YAP-6.3 this uses the `clib` package to emulate the old low level interface that diff --git a/library/splay.yap b/library/splay.yap index 29ce6d586..9134ad23f 100644 --- a/library/splay.yap +++ b/library/splay.yap @@ -16,7 +16,7 @@ *************************************************************************/ /** @defgroup Splay_Trees Splay Trees -@ingroup YAPLibrary +@ingroup library @{ Splay trees are explained in the paper "Self-adjusting Binary Search diff --git a/library/system.yap b/library/system.yap index 53574ab77..3e105ceb5 100644 --- a/library/system.yap +++ b/library/system.yap @@ -16,7 +16,7 @@ *************************************************************************/ /** @defgroup System Calling The Operating System from YAP -@ingroup YAPLibrary +@ingroup library @{ YAP now provides a library of system utilities compatible with the diff --git a/library/terms.yap b/library/terms.yap index da426ecb7..abce1a6a9 100644 --- a/library/terms.yap +++ b/library/terms.yap @@ -15,7 +15,7 @@ * * *************************************************************************/ /** @defgroup Terms Utilities On Terms -@ingroup YAPLibrary +@ingroup library @{ The next routines provide a set of commonly used utilities to manipulate diff --git a/library/timeout.yap b/library/timeout.yap index 98633dbbc..4af9ca5ed 100644 --- a/library/timeout.yap +++ b/library/timeout.yap @@ -21,7 +21,7 @@ /** @defgroup Timeout Calls With Timeout -@ingroup YAPLibrary +@ingroup library @{ The time_out/3 command relies on the alarm/3 built-in to diff --git a/library/trees.yap b/library/trees.yap index f8050801f..efd5700bc 100644 --- a/library/trees.yap +++ b/library/trees.yap @@ -25,7 +25,7 @@ /** @defgroup Trees Updatable Binary Trees -@ingroup YAPLibrary +@ingroup library @{ The following queue manipulation routines are available once diff --git a/library/tries.yap b/library/tries.yap index 1ea2bf96f..08650800f 100644 --- a/library/tries.yap +++ b/library/tries.yap @@ -7,7 +7,7 @@ /** @defgroup Tries Trie DataStructure -@ingroup YAPLibrary +@ingroup library @{ The next routines provide a set of utilities to create and manipulate diff --git a/library/ugraphs.yap b/library/ugraphs.yap index 01bd86d57..03704fa39 100644 --- a/library/ugraphs.yap +++ b/library/ugraphs.yap @@ -10,7 +10,7 @@ /** @defgroup UGraphs Unweighted Graphs -@ingroup YAPLibrary +@ingroup library @{ The following graph manipulation routines are based in code originally diff --git a/library/undgraphs.yap b/library/undgraphs.yap index a6ddf01ea..ede9bc86c 100644 --- a/library/undgraphs.yap +++ b/library/undgraphs.yap @@ -20,7 +20,7 @@ undgraph_min_tree/2]). /** @defgroup UnDGraphs Undirected Graphs -@ingroup YAPLibrary +@ingroup library @{ The following graph manipulation routines use the red-black tree graph diff --git a/misc/sysgraph b/misc/sysgraph index 1f514504b..379122f36 100755 --- a/misc/sysgraph +++ b/misc/sysgraph @@ -1053,30 +1053,44 @@ always_strip_module(M0:A, M0, A). c_links :- open('tmp/foreigns.yap', write, S), - clinks(S). + clinks(S), + fail. +c_links :- + open('tmp/foreigns.c', write, S), + cclinks(S), + fail. clinks(S) :- module_file( F, NM ), - format( S, 'mod( ~q , ~q ). ~n', [NM, F] ), + format( S, 'mod( ~q , ~q ).~n', [NM, F] ), + fail. +clinks(S) :- + system_predicate(C), + functor(C, N, A), + format( S, 'sys ~q/~d.~n', [N, A] ), fail. clinks(S) :- exported( ( Fi0-M:F/A :- Fi1-M1:F1/A ) ), ( M \= M1 -> M \= prolog ; F \= F1 ), - functor(S0, F, A), - S0 =.. [F| Args], - S1 =.. [F1| Args], - numbervars(Args, 0, _), - format( S, '% ~q <- ~q.~n~q:~q :- ~q:~q. ~n', [Fi0, Fi1, M,S0, M1,S1] ), - fail. +% functor(S0, F, A), +% S0 =.. [F| Args], +% S1 =.. [F1| Args], +% numbervars(Args, 0, _), + format( S, '% ~q <- ~q.~n~q:~q imports ~q:~q. ~n', [Fi0, Fi1, M,F/A, M1,F1/A] ), + fail. clinks(S) :- - node( M, F/A, File-Line, c(F)), - functor( S0, F, A), - S0 =.. [F| Args], - S1 =.. [foreign, F| Args], - numbervars(Args, 0, _), - format( S, ' ~a:~d~nforeign(~q , ~q , ~q, ~q ).~n', [File, Line, M:S0, S1, File, Line] ), + close(S). + +cclinks(S) :- + node( M, F/A, File-_Line, c(F)), +% functor( S0, F, A), +% S0 =.. [F| Args], +% S1 =.. [foreign, F| Args], +% numbervars(Args, 0, _), + format( S, '/// @file ~a~n', [File] ), + format( S, '/// @memberof ~a ~a:~a/~d~n', [F, M, F, A] ), fail. -clinks(S) :- +cclinks(S) :- close(S). warn_singletons(_Vars, _Pos). @@ -1088,9 +1102,9 @@ warn_singletons(_Vars, _Pos). % comment( _Pos - Comment) :- skip_blanks(1, Comment, N), - doc( Comment, N ), !, + doc( Comment, N ), format( "%s\n", [Comment] ), - verif + !. comment( _Pos - _Comment). skip_blanks(I, Comment, N) :- @@ -1491,9 +1505,9 @@ add_comments :- add_comments :- listing( open_comment ). -check_comment( Comment, CN, _Line, File ) :- +check_comment( Comment, CN, _Line, _qFile ) :- string_codes( Comment, [_,_,_|C]), - check_groups(0,C,[]), + check_groups(0,_C,[]), check_quotes(0,C,[]), ( append(C0,[0'@,0'},0' ,0'*,0'/,10], C) -> %' @@ -1505,7 +1519,8 @@ check_comment( Comment, CN, _Line, File ) :- check_comment( Comment, Comment, Line, File ) :- format(user_error,'*** bad comment ~a ~d~n~n~s~n~', [File,Line,Comment]). -check_groups(0, +check_groups(0) --> []. + check_quotes( 0 ) --> []. check_quotes( 0 ) --> diff --git a/os/pl-ctype.c b/os/pl-ctype.c index ce22805b5..0fec93358 100644 --- a/os/pl-ctype.c +++ b/os/pl-ctype.c @@ -27,8 +27,8 @@ #include #include "pl-ctype.h" -//! @defgroup YAPChars Character Classification and Manipulation -// @ingroup YAPBuiltins +//! @defgroup YAPCharsC C-code for Character Classification and Manipulation +// @ingroup YAPChars // // This module defines routines to manipulate individual characters. // diff --git a/os/pl-os.c b/os/pl-os.c index e68c9a1eb..eba8df666 100755 --- a/os/pl-os.c +++ b/os/pl-os.c @@ -29,6 +29,8 @@ #include /* this has to appear before pl-incl.h */ #endif +//@{ + /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Solaris has asctime_r() with 3 arguments. Using _POSIX_PTHREAD_SEMANTICS is supposed to give the POSIX standard one. @@ -2826,3 +2828,5 @@ Pause(double t) BeginPredDefs(system) PRED_DEF("shell", 2, shell, 0) EndPredDefs + + // @} diff --git a/packages/ProbLog/problog.yap b/packages/ProbLog/problog.yap index 1be1b8c3d..324b6d52c 100644 --- a/packages/ProbLog/problog.yap +++ b/packages/ProbLog/problog.yap @@ -227,7 +227,7 @@ /** @defgroup ProbLog1 The Leuven ProbLog1 System -@ingroup YAPPackages +@ingroup packages @brief This document is intended as a user guide for the users of ProbLog. ProbLog is a probabilistic Prolog, a probabilistic logic programming language, which is integrated in YAP-Prolog. diff --git a/packages/bdd/bdd.yap b/packages/bdd/bdd.yap index 9701522d5..a15eccc74 100644 --- a/packages/bdd/bdd.yap +++ b/packages/bdd/bdd.yap @@ -1,5 +1,5 @@ /** @defgroup BDDs Binary Decision Diagrams and Friends -@ingroup YAPPackages +@ingroup packages @{ This library provides an interface to the BDD package CUDD. It requires @@ -71,7 +71,7 @@ may include: + `nand( _X_, _Y_)` - negated conjunction@ + negated conjunction + `nor( _X_, _Y_)` @@ -383,3 +383,4 @@ fetch(pp(P,_,_,_)._Tree, -1, N) :- N is 1-P. fetch(pn(P,_,_,_)._Tree, 1, P). fetch(pn(P,_,_,_)._Tree, -1, N) :- N is 1-P. +%% @} diff --git a/packages/gecode/clpfd.yap b/packages/gecode/clpfd.yap index 78f4798ed..9e5a41428 100644 --- a/packages/gecode/clpfd.yap +++ b/packages/gecode/clpfd.yap @@ -186,10 +186,6 @@ larger or equal /** @pred _X_ #\= _Y_ is semidet disequality -*/ -/** @pred all_different( _Vs_ ) - -Verifies whether all elements of a list are different. */ /** @pred labeling( _Opts_, _Xs_) performs labeling, several variable and value selection options are @@ -464,10 +460,15 @@ boolvars( Xs ) :- maplist(lm(0, 1, Map), Xs, NXs), length(Xs, N), NXs := boolvars( Space, N ). + +/** @pred all_different( _Vs_ ) + Verifies whether all elements of a list are different. +*/ all_different( Xs ) :- get_home(Env), check(Xs, NXs), post( all_different( NXs ), Env, _ ). + all_distinct( Xs ) :- get_home(Env), check(Xs, NXs), diff --git a/packages/gecode/gecode4_yap_hand_written.yap b/packages/gecode/gecode4_yap_hand_written.yap index 3540d8327..a9e2d284c 100644 --- a/packages/gecode/gecode4_yap_hand_written.yap +++ b/packages/gecode/gecode4_yap_hand_written.yap @@ -18,7 +18,7 @@ /** @defgroup Gecode Gecode Interface -@ingroup YAPPackages +@ingroup packages @{ diff --git a/packages/python/python.pl b/packages/python/python.pl index 2f08bb643..82881912f 100644 --- a/packages/python/python.pl +++ b/packages/python/python.pl @@ -11,16 +11,6 @@ % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% -/** python - -A C-based Prolog interface to python. - -@author Vitor Santos Costa -@version 0:0:5, 2012/10/8 -@license Perl Artistic License - -*/ - %%% :- module(python, [ @@ -35,7 +25,18 @@ A C-based Prolog interface to python. op(950,yfx,:=), (:=)/2, (:=)/1 - ]). + ]). + +/** python + + A C-based Prolog interface to python. + + @author Vitor Santos Costa + @version 0:0:5, 2012/10/8 + @license Perl Artistic License + +*/ + /************************************************************************************************************ diff --git a/packages/xml/xml_driver.pl b/packages/xml/xml_driver.pl index d054e981a..fa8f5a436 100644 --- a/packages/xml/xml_driver.pl +++ b/packages/xml/xml_driver.pl @@ -1,131 +1,138 @@ -/* xml_driver.pl : Contains xml_parse/[2,3] a bi-directional XML parser written in - * Prolog. - * - * Copyright (C) 2001-2005 Binding Time Limited - * Copyright (C) 2005-2011 John Fletcher - * - * Current Release: $Revision: 3.3 $ - * - * TERMS AND CONDITIONS: - * - * This program is offered free of charge, as unsupported source code. You may - * use it, copy it, distribute it, modify it or sell it without restriction, - * but entirely at your own risk. - * - * xml_parse( {+Controls}, +?Chars, ?+Document ) parses Chars to/from a data - * structure of the form xml(, ). is a list of - * = attributes from the (possibly implicit) XML signature of the - * document. is a (possibly empty) list comprising occurrences of : - * - * pcdata() : Text - * comment() : An xml comment; - * element(,,) : .. encloses - * : if empty - * instructions(, ) : Processing ?>" - * cdata( ) : ]]> - * doctype(, ) : DTD - * - * The conversions are not completely symmetrical, in that weaker XML is - * accepted than can be generated. Specifically, in-bound (Chars -> Document) - * does not require strictly well-formed XML. Document is instantiated to the - * term malformed(Attributes, Content) if Chars does not represent well-formed - * XML. The Content of a malformed/2 structure can contain: - * - * unparsed( ) : Text which has not been parsed - * out_of_context( ) : is not closed - * - * in addition to the standard term types. - * - * Out-bound (Document -> Chars) parsing _does_ require that Document defines - * strictly well-formed XML. If an error is detected a 'domain' exception is - * raised. - * - * The domain exception will attempt to identify the particular sub-term in - * error and the message will show a list of its ancestor elements in the form - * {(id)}* where is the value of any attribute _named_ id. - * - * At this release, the Controls applying to in-bound (Chars -> Document) - * parsing are: - * - * extended_characters() : Use the extended character - * : entities for XHTML (default true) - * - * format() : Strip layouts when no character data - * : appears between elements. - * : (default true) - * - * remove_attribute_prefixes() : Remove namespace prefixes from - * : attributes when it's the same as the - * : prefix of the parent element - * : (default false). - * - * allow_ampersand() : Allow unescaped ampersand - * : characters (&) to occur in PCDATA. - * : (default false). - * - * [ is one of 'true' or 'false'] - * - * For out-bound (Document -> Chars) parsing, the only available option is: - * - * format() : Indent the element content - * : (default true) - * - * Different DCGs for input and output are used because input parsing is - * more flexible than output parsing. Errors in input are recorded as part - * of the data structure. Output parsing throws an exception if the document - * is not well-formed, diagnosis tries to identify the specific culprit term. - */ -xml_parse( Chars, Document ) :- - xml_parse( [], Chars, Document ). - -xml_parse( Controls, Chars, Document ) :- - ( ground( Chars ) -> - xml_to_document( Controls, Chars, Document ) - ; otherwise -> - document_to_xml( Controls, Document, Chars ) - ). - -document_to_xml( Controls, Document, Chars ) :- - ( member( format(false), Controls ) -> - Format = false - ; otherwise -> - Format = true - ), - ( ground( Document ), - document_generation(Format, Document, Chars0, [] ) -> - Chars = Chars0 - ; otherwise -> - xml_fault( Document, [], Culprit, Path, Message ), - xml_exception( Message, Document, Culprit, Path ) - ). - -/* xml_subterm( +XMLTerm, ?Subterm ) unifies Subterm with a sub-term of Term. - * Note that XMLTerm is a sub-term of itself. - */ -xml_subterm( Term, Term ). -xml_subterm( xml(_Attributes, Content), Term ) :- - xml_subterm( Content, Term ). -xml_subterm( [H|T], Term ) :- - ( xml_subterm( H, Term ) - ; xml_subterm( T, Term ) - ). -xml_subterm( element(_Name,_Attributes,Content), Term ) :- - xml_subterm( Content, Term ). -xml_subterm( namespace(_URI,_Prefix,Content), Term ) :- - xml_subterm( Content, Term ). - -/* xml is intended to be a rather modular module: it should be easy to - * build a program that can output XML, but not read it, or vice versa. - * Similarly, you may be happy to dispense with diagnosis once you are - * sure that your code will only try to make valid calls to xml_parse/2. - * - * It is intended that the code should be very portable too. Clearly, - * some small changes will be needed between platforms, but these should - * be limited to xml_utilities. xml_utilities contains most of the shared - * code and most of the potentially non-portable code. - */ -:- ensure_loaded( xml_acquisition ). -:- ensure_loaded( xml_diagnosis ). -:- ensure_loaded( xml_generation ). -:- ensure_loaded( xml_pp ). -:- ensure_loaded( xml_utilities ). +/* xml_driver.pl : Contains xml_parse/[2,3] a bi-directional XML parser written in + * Prolog. + * + * Copyright (C) 2001-2005 Binding Time Limited + * Copyright (C) 2005-2011 John Fletcher + * + * Current Release: $Revision: 3.3 $ + * + * TERMS AND CONDITIONS: + * + * This program is offered free of charge, as unsupported source code. You may + * use it, copy it, distribute it, modify it or sell it without restriction, + * but entirely at your own risk. + * + * xml_parse( {+Controls}, +?Chars, ?+Document ) parses Chars to/from a data + * structure of the form xml(, ). is a list of + * = attributes from the (possibly implicit) XML signature of the + * document. is a (possibly empty) list comprising occurrences of * ~~~ + * pcdata() : Text + * comment() : An xml comment; + * element(,,) : .. encloses + * : if empty + * instructions(, ) : Processing ?>" + * cdata( ) : ]]> + * doctype(, ) : DTD + * ~~~~ + * The conversions are not completely symmetrical, in that weaker XML is + * accepted than can be generated. Specifically, in-bound (Chars -> Document) + * does not require strictly well-formed XML. Document is instantiated to the + * term malformed(Attributes, Content) if Chars does not represent well-formed + * XML. The Content of a malformed/2 structure can contain: + * + * unparsed( ) : Text which has not been parsed + * out_of_context( ) : is not closed + * + * in addition to the standard term types. + * + * Out-bound (Document -> Chars) parsing _does_ require that Document defines + * strictly well-formed XML. If an error is detected a 'domain' exception is + * raised. + * + * The domain exception will attempt to identify the particular sub-term in + * error and the message will show a list of its ancestor elements in the form + * {(id)}* where is the value of any attribute _named_ id. + * + * At this release, the Controls applying to in-bound (Chars -> Document) + * parsing are: + * + * extended_characters() : Use the extended character + * : entities for XHTML (default true) + * + * format() : Strip layouts when no character data + * : appears between elements. + * : (default true) + * + * remove_attribute_prefixes() : Remove namespace prefixes from + * : attributes when it's the same as the + * : prefix of the parent element + * : (default false). + * + * allow_ampersand() : Allow unescaped ampersand + * : characters (&) to occur in PCDATA. + * : (default false). + * + * [ is one of 'true' or 'false'] + * + * For out-bound (Document -> Chars) parsing, the only available option is: + * + * format() : Indent the element content + * : (default true) + * + * Different DCGs for input and output are used because input parsing is + * more flexible than output parsing. Errors in input are recorded as part + * of the data structure. Output parsing throws an exception if the document + * is not well-formed, diagnosis tries to identify the specific culprit term. + */ + +:- module( xml, [xml_parse/2, + xml_parse/3, + document_to_xml/3, + xml_subterm/2 + ]). + +xml_parse( Chars, Document ) :- + xml_parse( [], Chars, Document ). + +xml_parse( Controls, Chars, Document ) :- + ( ground( Chars ) -> + xml_to_document( Controls, Chars, Document ) + ; otherwise -> + document_to_xml( Controls, Document, Chars ) + ). + +document_to_xml( Controls, Document, Chars ) :- + ( member( format(false), Controls ) -> + Format = false + ; otherwise -> + Format = true + ), + ( ground( Document ), + document_generation(Format, Document, Chars0, [] ) -> + Chars = Chars0 + ; otherwise -> + xml_fault( Document, [], Culprit, Path, Message ), + xml_exception( Message, Document, Culprit, Path ) + ). + +/** xml_subterm( +XMLTerm, ?Subterm ) + * unifies Subterm with a sub-term of Term. + * Note that XMLTerm is a sub-term of itself. + */ +xml_subterm( Term, Term ). +xml_subterm( xml(_Attributes, Content), Term ) :- + xml_subterm( Content, Term ). +xml_subterm( [H|T], Term ) :- + ( xml_subterm( H, Term ) + ; xml_subterm( T, Term ) + ). +xml_subterm( element(_Name,_Attributes,Content), Term ) :- + xml_subterm( Content, Term ). +xml_subterm( namespace(_URI,_Prefix,Content), Term ) :- + xml_subterm( Content, Term ). + +/* xml is intended to be a rather modular module: it should be easy to + * build a program that can output XML, but not read it, or vice versa. + * Similarly, you may be happy to dispense with diagnosis once you are + * sure that your code will only try to make valid calls to xml_parse/2. + * + * It is intended that the code should be very portable too. Clearly, + * some small changes will be needed between platforms, but these should + * be limited to xml_utilities. xml_utilities contains most of the shared + * code and most of the potentially non-portable code. + */ +:- ensure_loaded( xml_acquisition ). +:- ensure_loaded( xml_diagnosis ). +:- ensure_loaded( xml_generation ). +:- ensure_loaded( xml_pp ). +:- ensure_loaded( xml_utilities ). diff --git a/packages/yap-lbfgs/lbfgs.pl b/packages/yap-lbfgs/lbfgs.pl index dc8705250..44c9292f6 100644 --- a/packages/yap-lbfgs/lbfgs.pl +++ b/packages/yap-lbfgs/lbfgs.pl @@ -40,7 +40,7 @@ /** @defgroup YAP-LBFGS -@ingroup YAPPackages +@ingroup packages @short What is YAP-LBFGS? YAP-LBFGS is an interface to call libLBFGS, http://www.chokkan.org/software/liblbfgs/, from within YAP. libLBFGS is a C library for Limited-memory diff --git a/pl/absf.yap b/pl/absf.yap index 6a0e054a1..06e8aaaf4 100755 --- a/pl/absf.yap +++ b/pl/absf.yap @@ -8,9 +8,11 @@ * * *************************************************************************/ +%% @{ + /** @defgroup YAPAbsoluteFileName File Name Resolution - @ingroup YAPBuiltins + @ingroup builtins Support for file name resolution through absolute_file_name/3 and friends. These utility built-ins describe a list of directories that @@ -18,9 +20,7 @@ plus user-defined directories, directories based on environment variables and registry information to search for files. - @{ - - **/ + **/ :- system_module( absolute_file_name, [absolute_file_name/2, absolute_file_name/3, diff --git a/pl/arith.yap b/pl/arith.yap index 235e8b45f..ae5e14b6b 100644 --- a/pl/arith.yap +++ b/pl/arith.yap @@ -57,6 +57,8 @@ */ +%% @{ + /** @pred expand_exprs(- _O_,+ _N_) Control term expansion during compilation. diff --git a/pl/arithpreds.yap b/pl/arithpreds.yap index 619d2cf7d..069d349be 100644 --- a/pl/arithpreds.yap +++ b/pl/arithpreds.yap @@ -15,13 +15,14 @@ * * *************************************************************************/ +%% @{ + /** @file arithpreds.yap @addtogroup arithmetic_preds - @{ */ :- system_module(arithmetic_predicates, [ diff --git a/pl/arrays.yap b/pl/arrays.yap index bdbc7d21a..983e62b2d 100644 --- a/pl/arrays.yap +++ b/pl/arrays.yap @@ -15,6 +15,8 @@ * * *************************************************************************/ +%% @{ + /** @addtogroup YAPArrays */ @@ -102,7 +104,4 @@ static_array_properties(Name, Size, Type) :- static_array_properties(Name, Size, Type) :- '$do_error'(type_error(atom,Name),static_array_properties(Name,Size,Type)). - - - - +%% @} \ No newline at end of file diff --git a/pl/atoms.yap b/pl/atoms.yap index ef8ce709e..1999f7eb5 100644 --- a/pl/atoms.yap +++ b/pl/atoms.yap @@ -8,6 +8,8 @@ * * *************************************************************************/ +%% @{ + :- system_module( '$_atoms', [ atom_concat/2, string_concat/2, @@ -17,8 +19,11 @@ :- use_system_module( '$_errors', ['$do_error'/2]). +%% @{ + /** - * @addtogroup Predicates_on_Atoms + * @addtogroup Predicates_on_Atoms + * @ingroup YAPChars * */ diff --git a/pl/attributes.yap b/pl/attributes.yap index 50d9d8c35..1f5e0f213 100644 --- a/pl/attributes.yap +++ b/pl/attributes.yap @@ -1,6 +1,6 @@ /************************************************************************* * * -* YAP Prolog * + * YAP Prolog * * * * Yap Prolog was developed at NCCUP - Universidade do Porto * * * @@ -15,17 +15,22 @@ * * *************************************************************************/ +%% @{ -/** @defgroup Attributed_Variables Attributed Variables -@ingroup YAPExtensions +/** + @file attributes.yap + + @defgroup Attributed_Variables Attributed Variables + @ingroup extensions YAP supports attributed variables, originally developed at OFAI by Christian Holzbaur. Attributes are a means of declaring that an -arbitrary term is a property for a variable. These properties can be + arbitrary term is a property for a variable. These properties can be updated during forward execution. Moreover, the unification algorithm is aware of attributed variables and will call user defined handlers when -trying to unify these variables. + trying to unify these variables. + Attributed variables provide an elegant abstraction over which one can extend Prolog systems. Their main application so far has been in implementing constraint handlers, such as Holzbaur's CLPQR, Fruewirth @@ -42,85 +47,13 @@ work with. Most packages included in YAP that use attributed variables, such as CHR, CLP(FD), and CLP(QR), rely on the SWI-Prolog interface. -@{ + + Old_Style_Attribute_Declarations + + + New_Style_Attribute_Declarations + */ - -/** @defgroup New_Style_Attribute_Declarations hProlog and SWI-Prolog style Attribute Declarations -@ingroup Attributed_Variables -@{ - -The following documentation is taken from the SWI-Prolog manual. - -Binding an attributed variable schedules a goal to be executed at the -first possible opportunity. In the current implementation the hooks are -executed immediately after a successful unification of the clause-head -or successful completion of a foreign language (built-in) predicate. Each -attribute is associated to a module and the hook attr_unify_hook/2 is -executed in this module. The example below realises a very simple and -incomplete finite domain reasoner. - -~~~~~ -:- module(domain, - [ domain/2 % Var, ?Domain - ]). -:- use_module(library(ordsets)). - -domain(X, Dom) :- - var(Dom), !, - get_attr(X, domain, Dom). -domain(X, List) :- - list_to_ord_set(List, Domain), - put_attr(Y, domain, Domain), - X = Y. - -% An attributed variable with attribute value Domain has been -% assigned the value Y - -attr_unify_hook(Domain, Y) :- - ( get_attr(Y, domain, Dom2) - -> ord_intersection(Domain, Dom2, NewDomain), - ( NewDomain == [] - -> fail - ; NewDomain = [Value] - -> Y = Value - ; put_attr(Y, domain, NewDomain) - ) - ; var(Y) - -> put_attr( Y, domain, Domain ) - ; ord_memberchk(Y, Domain) - ). - -% Translate attributes from this module to residual goals - -attribute_goals(X) --> - { get_attr(X, domain, List) }, - [domain(X, List)]. -~~~~~ - -Before explaining the code we give some example queries: - -The predicate `domain/2` fetches (first clause) or assigns -(second clause) the variable a domain, a set of values it can -be unified with. In the second clause first associates the domain -with a fresh variable and then unifies X to this variable to deal -with the possibility that X already has a domain. The -predicate attr_unify_hook/2 is a hook called after a variable with -a domain is assigned a value. In the simple case where the variable -is bound to a concrete value we simply check whether this value is in -the domain. Otherwise we take the intersection of the domains and either -fail if the intersection is empty (first example), simply assign the -value if there is only one value in the intersection (second example) or -assign the intersection as the new domain of the variable (third -example). The nonterminal `attribute_goals/3` is used to translate -remaining attributes to user-readable goals that, when executed, reinstate -these attributes. - -*/ - - - :- module('$attributes', [ delayed_goals/4 ]). @@ -145,6 +78,83 @@ these attributes. woken_att_do/4]). + + + + +/** + @{ + @defgroup New_Style_Attribute_Declarations hProlog and SWI-Prolog style Attribute Declarations + @ingroup Attributed_Variables + + The following documentation is taken from the SWI-Prolog manual. + + Binding an attributed variable schedules a goal to be executed at the + first possible opportunity. In the current implementation the hooks are + executed immediately after a successful unification of the clause-head + or successful completion of a foreign language (built-in) predicate. Each + attribute is associated to a module and the hook attr_unify_hook/2 is + executed in this module. The example below realises a very simple and + incomplete finite domain reasoner. + + ~~~~~ + :- module(domain, + [ domain/2 % Var, ?Domain % + ]). + :- use_module(library(ordsets)). + + domain(X, Dom) :- + var(Dom), !, + get_attr(X, domain, Dom). + domain(X, List) :- + list_to_ord_set(List, Domain), + put_attr(Y, domain, Domain), + X = Y. + + % An attributed variable with attribute value Domain has been % + % assigned the value Y % + + attr_unify_hook(Domain, Y) :- + ( get_attr(Y, domain, Dom2) + -> ord_intersection(Domain, Dom2, NewDomain), + ( NewDomain == [] + -> fail + ; NewDomain = [Value] + -> Y = Value + ; put_attr(Y, domain, NewDomain) + ) + ; var(Y) + -> put_attr( Y, domain, Domain ) + ; ord_memberchk(Y, Domain) + ). + + % Translate attributes from this module to residual goals % + + attribute_goals(X) --> + { get_attr(X, domain, List) }, + [domain(X, List)]. + ~~~~~ + + Before explaining the code we give some example queries: + + The predicate `domain/2` fetches (first clause) or assigns + (second clause) the variable a domain, a set of values it can + be unified with. In the second clause first associates the domain + with a fresh variable and then unifies X to this variable to deal + with the possibility that X already has a domain. The + predicate attr_unify_hook/2 is a hook called after a variable with + a domain is assigned a value. In the simple case where the variable + is bound to a concrete value we simply check whether this value is in + the domain. Otherwise we take the intersection of the domains and either + fail if the intersection is empty (first example), simply assign the + value if there is only one value in the intersection (second example) or + assign the intersection as the new domain of the variable (third + example). The nonterminal `attribute_goals/3` is used to translate + remaining attributes to user-readable goals that, when executed, reinstate + these attributes. + +*/ + :- dynamic attributes:attributed_module/3, attributes:modules_with_attributes/1. /** @pred get_attr(+ _Var_,+ _Module_,- _Value_) diff --git a/pl/boot.yap b/pl/boot.yap index 3e593d98e..2d498eb29 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -15,12 +15,13 @@ * * *************************************************************************/ +%% @{ + /** @defgroup YAPControl Control Predicates -@ingroup YAPBuiltins -@{ - +@ingroup builtins + */ @@ -1529,8 +1530,6 @@ The goal `throw( _Ball_)` throws an exception. Execution is stopped, and the exception is sent to the ancestor goals until reaching a matching catch/3, or until reaching top-level. -@} - */ throw(_Ball) :- % use existing ball @@ -1590,6 +1589,6 @@ log_event( String, Args ) :- log_event( M ). /** -@} + @} */ diff --git a/pl/callcount.yap b/pl/callcount.yap index 0d05d959f..f8be21661 100644 --- a/pl/callcount.yap +++ b/pl/callcount.yap @@ -15,11 +15,11 @@ * * *************************************************************************/ +%% @{ /** @defgroup Profiling Profiling Prolog Programs -@ingroup YAPExtensions -@{ - +@ingroup extensions + YAP includes two profilers. The count profiler keeps information on the number of times a predicate was called. This information can be used to detect what are the most commonly called predicates in the program. The @@ -35,15 +35,11 @@ implementation. */ -/** -@} -*/ - +%% @{ /** @defgroup Call_Counting Counting Calls @ingroup Profiling -@{ - + Predicates compiled with YAP's flag call_counting set to `on` update counters on the numbers of calls and of retries. Counters are actually decreasing counters, so that they can be @@ -63,10 +59,7 @@ The code for the call counters piggybacks on the profiling code. Therefore, activating the call counters also activates the profiling counters. -These are the predicates that access and manipulate the call counters: - - - +These are the predicates that access and manipulate the call counters. */ :- system_module( '$_callcount', [call_count/3, @@ -151,6 +144,7 @@ call_count(Calls, Retries, Both) :- '$check_if_call_count_on'(Calls, A) :- '$do_error'(type_error(integer,Calls),call_count(A)). +%% @} /** @} diff --git a/pl/checker.yap b/pl/checker.yap index 4d64d938f..3b117dea0 100644 --- a/pl/checker.yap +++ b/pl/checker.yap @@ -69,6 +69,8 @@ '$syntax_check_multiple'/2, '$syntax_check_single_var'/2]). +%% @{ + /** @defgroup YAPStyle Checker @@ -113,9 +115,7 @@ By default, style checking is disabled in YAP unless we are in The style_check/1 built-in is now deprecated. Please use `set_prolog_flag/1` instead. -@{ - -**/ + **/ % % A Small style checker for YAP diff --git a/pl/chtypes.yap b/pl/chtypes.yap index 91dc076ee..da1f9e1c5 100644 --- a/pl/chtypes.yap +++ b/pl/chtypes.yap @@ -17,6 +17,12 @@ :- system_module( '$_chtypes', [], []). +/** + * @defgroup YAPChars Sequences of Characters: atoms, strings, lists of codes. + * @ingroup builtins + * +*/ + /* In addition, there is the library library(ctype) providing compatibility to some other Prolog systems. The predicates of this library are defined in terms of code_type/2. diff --git a/pl/consult.yap b/pl/consult.yap index df5aef420..71fbaa604 100644 --- a/pl/consult.yap +++ b/pl/consult.yap @@ -65,9 +65,11 @@ :- use_system_module( '$_preds', ['$current_predicate'/4]). +%% @{ + /** - \defgroup YAPConsulting Loading files into YAP - @ingroup YAPLoading + @defgroup YAPConsulting Loading files into YAP + @ingroup consult We present the main predicates and directives available to load files and to set-up the Prolog environment. We discuss @@ -79,10 +81,9 @@ files and to set-up the Prolog environment. We discuss @{ @defgroup YAPReadFiles The Predicates that Read Source Files -@ingroup YAPConsulting - -@{ +@ingroup consult + */ @@ -947,19 +948,20 @@ source_file(Mod:Pred, FileName) :- SWI-compatible predicate. True if the predicate specified by _ModuleAndPred_ was loaded from file _File_, where _File_ is an absolute path name (see `absolute_file_name/2`). - @} - */ +%% @} + +%% @{ +{ + /** @addtogroup YAPLibraries Library Predicates Library files reside in the library_directory path (set by the `LIBDIR` variable in the Makefile for YAP). Currently, most files in the library are from the Edinburgh Prolog library. - @{ - - */ +*/ prolog_load_context(directory, DirName) :- ( source_location(F, _) -> file_directory_name(F, DirName) ; @@ -1223,15 +1225,15 @@ unload_file( F0 ) :- erase(R), fail. +%% @} + /** -@} + @{ @addtogroup YAPModules -@{ - **/ % @@ -1339,8 +1341,10 @@ account the following observations: @} **/ +%% @{ + /** @defgroup YAPCompilerSettings Directing and Configuring the Compiler - @ingroup YAPConsulting + @ingroup YAPProgramming The YAP system also includes a number of primitives designed to set compiler parameters and to track the state of the compiler. One @@ -1352,7 +1356,6 @@ account the following observations: This section presents a set of built-ins predicates designed to set the environment for the compiler. - @{ */ @@ -1365,8 +1368,6 @@ internal conventions are Unix and this predicates is equivalent to =/2 directory-separator, limit the filename length map dots, except for the last one, onto underscores. -@{ - */ % add_multifile_predicate when we start consult @@ -1495,15 +1496,17 @@ initialization(G,OPT) :- @} */ +%% @{ + + + /** @defgroup Conditional_Compilation Conditional Compilation @ingroup YAPCompilerSettings - @{ - -Conditional compilation builds on the same principle as + Conditional compilation builds on the same principle as term_expansion/2, goal_expansion/2 and the expansion of grammar rules to compile sections of the source-code conditionally. One of the reasons for introducing conditional @@ -1533,12 +1536,9 @@ section_2. section_3. :- else. section_else. -:- endif. + :- endif. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - - -@{ - + */ /** @pred if( : _Goal_) @@ -1687,8 +1687,5 @@ consult_depth(LV) :- '$show_consult_level'(LV). @} @} - - @} - */ diff --git a/pl/corout.yap b/pl/corout.yap index f30095b7b..265030f78 100644 --- a/pl/corout.yap +++ b/pl/corout.yap @@ -16,9 +16,10 @@ *************************************************************************/ -/** @defgroup CohYroutining Co-routining -@ingroup YAPExtensions -@{ +/** + @defgroup CohYroutining Co-routining + @ingroup extensions + @{ Prolog uses a simple left-to-right flow of control. It is sometimes convenient to change this control so that goals will only be executed @@ -119,16 +120,14 @@ The routines in this section fetch or set the entire attribute list of a variables. Use of these predicates is anticipated to be restricted to printing and other special purpose operations. +*/ - - @pred get_attrs(+ _Var_,- _Attributes_) - - +/** + @pred get_attrs(+ _Var_,- _Attributes_) Get all attributes of _Var_. _Attributes_ is a term of the form `att( _Module_, _Value_, _MoreAttributes_)`, where _MoreAttributes_ is `[]` for the last attribute. - */ attribute_goals(Var) --> @@ -162,9 +161,9 @@ remove_when_declarations(Goal, Goal). % % operators defined in this module: % -/** @pred freeze(? _X_,: _G_) - - +/** + @pred freeze(? _X_,: _G_) + Delay execution of goal _G_ until the variable _X_ is bound. @@ -618,5 +617,6 @@ check_first_attvar([_|Vs], V0) :- check_first_attvar(Vs, V0). /** -@} + @} + @} */ diff --git a/pl/debug.yap b/pl/debug.yap index 204c8b761..46267ab22 100644 --- a/pl/debug.yap +++ b/pl/debug.yap @@ -46,7 +46,7 @@ -----------------------------------------------------------------------------*/ /** @defgroup Deb_Preds Debugging Predicates -@ingroup YAPBuiltins +@ingroup builtins @{ The diff --git a/pl/depth_bound.yap b/pl/depth_bound.yap index da3736857..f64fe9ac9 100644 --- a/pl/depth_bound.yap +++ b/pl/depth_bound.yap @@ -18,7 +18,7 @@ /** @defgroup DepthLimited Depth Limited Search -@ingroup YAPExtensions +@ingroup extensions YAP implements various extensions to the default Prolog search. One of the most iseful s restricting the maximum search depth. diff --git a/pl/flags.yap b/pl/flags.yap index b13775f94..72dd877f3 100644 --- a/pl/flags.yap +++ b/pl/flags.yap @@ -27,7 +27,7 @@ yap_flag/3], []). /** @defgroup Flags YAP Execution Flags - @ingroup YAPBuiltins + @ingroup builtins @{ */ diff --git a/pl/grammar.yap b/pl/grammar.yap index 8a9c91629..eac07275d 100644 --- a/pl/grammar.yap +++ b/pl/grammar.yap @@ -18,7 +18,7 @@ /** @defgroup Grammars Grammar Rules -@ingroup YAPBuiltins +@ingroup builtins @{ Grammar rules in Prolog are both a convenient way to express definite diff --git a/pl/init.yap b/pl/init.yap index 83fe792e7..562520a10 100644 --- a/pl/init.yap +++ b/pl/init.yap @@ -14,7 +14,7 @@ * comments: initializing the full prolog system * * * *************************************************************************/ -%% @defgroup YAPBuiltins YAP Built-Ins +%% @defgroup builtins YAP Built-Ins /* diff --git a/pl/load_foreign.yap b/pl/load_foreign.yap index ecc6e9da1..cbf60d219 100644 --- a/pl/load_foreign.yap +++ b/pl/load_foreign.yap @@ -25,7 +25,7 @@ :- use_system_module( '$_modules', ['$do_import'/3]). /** @defgroup LoadForeign Access to Foreign Language Programs -@ingroup YAPBuiltins +@ingroup builtins */ diff --git a/pl/messages.yap b/pl/messages.yap index ec4b00b3e..8da368707 100644 --- a/pl/messages.yap +++ b/pl/messages.yap @@ -16,9 +16,10 @@ * * *************************************************************************/ -/** @defgroup Messages Message Handling -@ingroup YAPControl -@{ +/** + @defgroup Messages Message Handling + @ingroup YAPControl + @{ The interaction between YAP and the user relies on YAP's ability to portray messages. These messages range from prompts to error @@ -679,5 +680,6 @@ pred_arity(H,Name,Arity) :- /** -@} + @} + @} */ diff --git a/pl/modules.yap b/pl/modules.yap index 03cb3ff4d..8a7843e37 100644 --- a/pl/modules.yap +++ b/pl/modules.yap @@ -15,83 +15,11 @@ * * *************************************************************************/ -/** - - @defgroup YAPPackages The YAP packages - - - @defgroup YAPLibrary The YAP Library - - Library files reside in the library_directory path (set by the - `LIBDIR` variable in the Makefile for YAP). Several files in the - library are originally from the public-domain Edinburgh Prolog library. - - + @ref maplist - - + @ref Apply Apply Macros - - + @ref Association_Lists - - + @ref AVL_Trees - - + @ref Exo_Intervals - - + @ref Heaps - - + @ref Lists - - + @ref LineUtilities - - + @ref matrix - - + @ref NonhYBacktrackable_Data_Structures - - + @ref Ordered_Sets - - + @ref Pseudo_Random - - + @ref Queues Queues - - + @ref PseudoRandom - - + @ref RedhYBlack_Trees - - + @ref RegExp - - + @ref Splay_Trees - - + @ref System - - + @ref Terms - - + @ref Tries - - + @ref Cleanup - - + @ref Timeout - - + @ref Trees - - + @ref UGraphs - - + @ref DGraphs - - + @ref UnDGraphs - - + @ref DBUsage - - + @ref lambda - - + @ref clpfd - - + @ref Block_Diagram -*/ - /** \defgroup YAPModules The YAP Module system - @ingroup YAPLoading + @ingroup consult The YAP module system is based on the Quintus/SISCtus module system ˜\cite quintus . In this design, modules are named collections of predicates, @@ -127,7 +55,7 @@ YAP includes a number of libraries and packages, most of them The main mechanism to change the current type-in module is by using the module/2 declaration.This declaration sets the source module when -it starts consulting a file, and resets it at the end. One can set + it starts consulting a file, and resets it at the end. One can set the type-in module permanently by using the built-in `module/1`. \subsection Explicit Naming diff --git a/pl/os.yap b/pl/os.yap index d28fb55ec..2926a14fd 100644 --- a/pl/os.yap +++ b/pl/os.yap @@ -22,10 +22,12 @@ ], [] ). :- use_system_module( '$_errors', ['$do_error'/2]). -/** @defgroup YAPOS Access to Operating System Functionality -@ingroup YAPBuiltins -@{ +%% @{ + +/** @defgroup YAPOS Access to Operating System Functionality +@ingroup builtins + The following built-in predicates allow access to underlying Operating System functionality. diff --git a/pl/preds.yap b/pl/preds.yap index 6f746d73d..d046ac6e2 100644 --- a/pl/preds.yap +++ b/pl/preds.yap @@ -1,6 +1,6 @@ /************************************************************************* * * -* YAP Prolog * + * YAP Prolog * * * * Yap Prolog was developed at NCCUP - Universidade do Porto * * * @@ -16,7 +16,7 @@ *************************************************************************/ /** @defgroup Database Using the Clausal Data Base -@ingroup YAPBuiltins +@ingroup builtins @{ Predicates in YAP may be dynamic or static. By default, when @@ -1167,6 +1167,7 @@ predicate_erased_statistics(P,NCls,Sz,ISz) :- Defines the relation: _P_ is a currently defined predicate whose name is the atom _A_. */ current_predicate(A,T) :- + '$system_module'(M), '$ground_module'(T, M, T0), ( '$current_predicate'(A, M, T0, _) @@ -1187,7 +1188,6 @@ system_predicate(A,T) :- ; '$current_predicate'(A, prolog, T0, Flags) ), - Flags /\ 0x00004000 =\= 0, \+ '$hidden'(A). /** @pred system_predicate( ?_P_ ) diff --git a/pl/protect.yap b/pl/protect.yap index f0057894f..6ef20d749 100755 --- a/pl/protect.yap +++ b/pl/protect.yap @@ -19,6 +19,13 @@ % This protects all code from further changes % and also makes it impossible from some predicates to be seen +'$protect' :- + fail, + '$system_mod'( M ), + '$current_predicate'(A, M, T0, Flags), + NFlags is Flags \/ 0x00004000, + '$flags'(M:T0, Flags, NFlags), + fail. '$protect' :- current_atom(Name), atom_codes(Name,[0'$|_]), @@ -30,8 +37,8 @@ '$protect'. '$hide_predicates'(Name) :- - '$current_predicate'(Name, prolog, P, _), - '$hide_predicate'(P,prolog), + '$current_predicate'(Name, Mod, P, _), + '$hide_predicate'(P,Mod), fail. '$hide_predicates'(_). diff --git a/pl/qly.yap b/pl/qly.yap index b35f2be06..b35e73bb4 100755 --- a/pl/qly.yap +++ b/pl/qly.yap @@ -45,7 +45,7 @@ /** @defgroup YAPSaving Saving and Loading Prolog States -@ingroup YAPLoading +@ingroup consult YAP can save and read images of its current state to files, known as saved states. It is possible to save the entire state or just a module diff --git a/pl/setof.yap b/pl/setof.yap index d49ef5b1e..af0e1d902 100644 --- a/pl/setof.yap +++ b/pl/setof.yap @@ -17,7 +17,7 @@ /** @defgroup Sets Collecting Solutions to a Goal -@ingroup YAPBuiltins +@ingroup builtins @{ When there are several solutions to a goal, if the user wants to collect all diff --git a/pl/tabling.yap b/pl/tabling.yap index 7aa17bbf8..614ad8c37 100644 --- a/pl/tabling.yap +++ b/pl/tabling.yap @@ -17,7 +17,7 @@ :- use_system_module( '$_errors', ['$do_error'/2]). /** @defgroup Tabling Tabling -@ingroup YAPExtensions +@ingroup extensions @{ *YAPTab* is the tabling engine that extends YAP's execution diff --git a/pl/threads.yap b/pl/threads.yap index f680aa368..14c789dd5 100644 --- a/pl/threads.yap +++ b/pl/threads.yap @@ -17,7 +17,7 @@ /** @defgroup Threads Threads - @ingroup YAPExtensions + @ingroup extensions @{ YAP implements a SWI-Prolog compatible multithreading diff --git a/pl/yio.yap b/pl/yio.yap index 0075ea03a..26049cc50 100644 --- a/pl/yio.yap +++ b/pl/yio.yap @@ -55,7 +55,7 @@ :- use_system_module( '$_errors', ['$do_error'/2]). /** @defgroup InputOutput Input/Output Predicates -@ingroup YAPBuiltins +@ingroup builtins Some of the Input/Output predicates described below will in certain conditions provide error messages and abort only if the file_errors flag is set. diff --git a/swi/library/aggregate.pl b/swi/library/aggregate.pl index 627214b0c..b8052a042 100644 --- a/swi/library/aggregate.pl +++ b/swi/library/aggregate.pl @@ -51,7 +51,7 @@ aggregate_all(?,?,0,-). /** Aggregation operators on backtrackable predicates -@ingroup SWILibrary +@ingroup swi This library provides aggregating operators over the solutions of a predicate. The operations are a generalisation of the bagof/3, setof/3 diff --git a/swi/library/base64.pl b/swi/library/base64.pl index 299a143d0..c20ad368f 100644 --- a/swi/library/base64.pl +++ b/swi/library/base64.pl @@ -35,7 +35,7 @@ ]). /** Base64 encoding and decoding -@ingroup SWILibrary +@ingroup swi Prolog-based base64 encoding using DCG rules. Encoding according to rfc2045. For example: diff --git a/swi/library/broadcast.pl b/swi/library/broadcast.pl index 5f2265bdb..38ee14288 100644 --- a/swi/library/broadcast.pl +++ b/swi/library/broadcast.pl @@ -48,7 +48,7 @@ listener/4. /** Event service -@ingroup SWILibrary +@ingroup swi Generic broadcasting service. Broadcasts are made using the predicate broadcast(+Templ). All registered `listeners' will have their goal diff --git a/swi/library/ctypes.pl b/swi/library/ctypes.pl index b4c5e470f..441f0038c 100644 --- a/swi/library/ctypes.pl +++ b/swi/library/ctypes.pl @@ -57,7 +57,7 @@ ]). /** Character code classification -@ingroup SWILibrary +@ingroup swi This file implements the functionality of the corresponding Quintus library based on SWI-Prolog's code_type/2 predicate. Please check the diff --git a/swi/library/date.pl b/swi/library/date.pl index c6be43f4b..a5ca8076e 100644 --- a/swi/library/date.pl +++ b/swi/library/date.pl @@ -37,7 +37,7 @@ ]). /** date time routines -@ingroup SWILibrary +@ingroup swi */ %% date_time_value(?Field:atom, +Struct:datime, -Value) is nondet. diff --git a/swi/library/debug.pl b/swi/library/debug.pl index 522fbfd43..e13b76394 100644 --- a/swi/library/debug.pl +++ b/swi/library/debug.pl @@ -71,7 +71,7 @@ backtrace(N) :- debug_context(thread). /** Print debug messages and test assertions -@ingroup SWILibrary +@ingroup swi This library is a replacement for format/3 for printing debug messages. Messages are assigned a _topic_. By dynamically enabling or disabling diff --git a/swi/library/edit.pl b/swi/library/edit.pl index b08654c74..f6bcadfea 100755 --- a/swi/library/edit.pl +++ b/swi/library/edit.pl @@ -39,7 +39,7 @@ :- set_prolog_flag(generate_debug_info, false). /** Editor interface -@ingroup SWILibrary +@ingroup swi This module implements the generic editor interface. It consists of two extensible parts with little in between. The first part deals with diff --git a/swi/library/error.pl b/swi/library/error.pl index 8b5837b99..c75c5e237 100644 --- a/swi/library/error.pl +++ b/swi/library/error.pl @@ -48,7 +48,7 @@ :- endif. /** Error generating support -@ingroup SWILibrary +@ingroup swi This module provides predicates to simplify error generation and checking. It's implementation is based on a discussion on the SWI-Prolog diff --git a/swi/library/main.pl b/swi/library/main.pl index 670a9a150..82471fbab 100644 --- a/swi/library/main.pl +++ b/swi/library/main.pl @@ -36,7 +36,7 @@ :- use_module(library(lists)). /** Provide entry point for scripts -@ingroup SWILibrary +@ingroup swi This library is intended for supporting PrologScript on Unix using the =|#!|= magic sequence for scripts using commandline options. The entry diff --git a/swi/library/nb_set.pl b/swi/library/nb_set.pl index 6b9e79ab2..df14a3691 100644 --- a/swi/library/nb_set.pl +++ b/swi/library/nb_set.pl @@ -41,7 +41,7 @@ /** Non-backtrackable sets -@ingroup SWILibrary +@ingroup swi This library provides a non-backtrackabe set. It is based on nb_setarg/3. See the SWI-Prolog manual for details. diff --git a/swi/library/occurs.yap b/swi/library/occurs.yap index e57eceb72..181e2a69d 100644 --- a/swi/library/occurs.yap +++ b/swi/library/occurs.yap @@ -29,10 +29,6 @@ the GNU General Public License. */ -/** occur check support -@ingroup SWILibrary -*/ - :- module(occurs, [ contains_term/2, % +SubTerm, +Term contains_var/2, % +SubTerm, +Term @@ -47,6 +43,10 @@ :- use_module(library(arg), [genarg/3]). +/** occur check support + @ingroup swi +*/ + /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - This is a SWI-Prolog implementation of the corresponding Quintus diff --git a/swi/library/operators.pl b/swi/library/operators.pl index 8a3017260..42897b684 100644 --- a/swi/library/operators.pl +++ b/swi/library/operators.pl @@ -40,7 +40,7 @@ /** Manage operators -@ingroup SWILibrary +@ingroup swi Often, one wants to define operators to improve the readibility of some very specific code. Operators in Prolog are global objects and changing diff --git a/swi/library/option.pl b/swi/library/option.pl index 8a7987fb2..f6f32c00d 100644 --- a/swi/library/option.pl +++ b/swi/library/option.pl @@ -40,7 +40,7 @@ :- use_module(library(lists)). /** Option list processing -@ingroup SWILibrary +@ingroup swi The library(option) provides some utilities for processing option lists. Option lists are commonly used as an alternative for many arguments. diff --git a/swi/library/pairs.pl b/swi/library/pairs.pl index 276d93fc5..cf1b21cdf 100644 --- a/swi/library/pairs.pl +++ b/swi/library/pairs.pl @@ -39,7 +39,7 @@ ]). /** Operations on key-value lists -@ingroup SWILibrary +@ingroup swi This module implements common operations on Key-Value lists, also known as _Pairs_. Pairs have great practical value, especially due to diff --git a/swi/library/pio.pl b/swi/library/pio.pl index a24521df1..d1941ba02 100644 --- a/swi/library/pio.pl +++ b/swi/library/pio.pl @@ -31,7 +31,7 @@ :- reexport(pure_input). /** Pure I/O -@ingroup SWILibrary +@ingroup swi This library provides pure list-based I/O processing for Prolog, where the communication to the actual I/O device is performed transparently diff --git a/swi/library/predicate_options.pl b/swi/library/predicate_options.pl index 6b085302e..4c281f2ad 100644 --- a/swi/library/predicate_options.pl +++ b/swi/library/predicate_options.pl @@ -63,7 +63,7 @@ check_predicate_options(:). /** Access and analyse predicate options -@ingroup SWILibrary +@ingroup swi This module provides the developers interface for the directive predicate_options/3. This directive allows us to specify that e.g., diff --git a/swi/library/prolog_clause.pl b/swi/library/prolog_clause.pl index 99e5f61bd..50ef68044 100644 --- a/swi/library/prolog_clause.pl +++ b/swi/library/prolog_clause.pl @@ -52,7 +52,7 @@ make_varnames_hook/5. /** Get detailed source-information about a clause -@ingroup SWILibrary +@ingroup swi This module started life as part of the GUI tracer. As it is generally useful for debugging purposes it has moved to the general Prolog diff --git a/swi/library/prolog_colour.pl b/swi/library/prolog_colour.pl index 39ed2de2e..b033b04ef 100644 --- a/swi/library/prolog_colour.pl +++ b/swi/library/prolog_colour.pl @@ -58,7 +58,7 @@ ]). /** Prolog syntax colouring support. -@ingroup SWILibrary +@ingroup swi This module defines reusable code to colourise Prolog source. diff --git a/swi/library/prolog_source.pl b/swi/library/prolog_source.pl index 4b3993ac8..6503e2d6e 100644 --- a/swi/library/prolog_source.pl +++ b/swi/library/prolog_source.pl @@ -39,7 +39,7 @@ :- use_module(debug). /** Examine Prolog source-files -@ingroup SWILibrary +@ingroup swi The modile prolog_source.pl provides predicates to open, close and read terms from Prolog source-files. This may seem easy, but there are a diff --git a/swi/library/pure_input.pl b/swi/library/pure_input.pl index 8d741231e..20727cdd8 100644 --- a/swi/library/pure_input.pl +++ b/swi/library/pure_input.pl @@ -43,7 +43,7 @@ :- use_module(library(error)). /** Pure Input from files -@ingroup SWILibrary +@ingroup swi This module is part of pio.pl, dealing with _pure_ _input_: processing input streams from the outside world using pure predicates, notably diff --git a/swi/library/quasi_quotations.pl b/swi/library/quasi_quotations.pl index f5976c1bc..56f95c6d9 100644 --- a/swi/library/quasi_quotations.pl +++ b/swi/library/quasi_quotations.pl @@ -38,7 +38,7 @@ :- use_module( library(lists) ). /** Define Quasi Quotation syntax -@ingroup SWILibrary +@ingroup swi Inspired by [Haskell](http://www.haskell.org/haskellwiki/Quasiquotation), SWI-Prolog diff --git a/swi/library/quintus.pl b/swi/library/quintus.pl index 868ce86a7..186ba7722 100644 --- a/swi/library/quintus.pl +++ b/swi/library/quintus.pl @@ -81,7 +81,7 @@ :- use_module(library(lists), [member/2]). /** Quintus compatibility -@ingroup SWILibrary +@ingroup swi This module defines several predicates from the Quintus Prolog libraries. Note that our library structure is totally different. If this diff --git a/swi/library/readutil.pl b/swi/library/readutil.pl index 5018194d6..d617c8261 100644 --- a/swi/library/readutil.pl +++ b/swi/library/readutil.pl @@ -45,7 +45,7 @@ :- use_module(library(error)). /** Read utilities -@ingroup SWILibrary +@ingroup swi This library provides some commonly used reading predicates. As these predicates have proven to be time-critical in some applications we moved diff --git a/swi/library/record.pl b/swi/library/record.pl index 7566ec127..c615bcf6b 100644 --- a/swi/library/record.pl +++ b/swi/library/record.pl @@ -39,7 +39,7 @@ :- use_module(library(lists)). /** Access compound arguments by name -@ingroup SWILibrary +@ingroup swi This module creates a set of predicates to create a default instance, access and modify records represented as a compound term. diff --git a/swi/library/settings.pl b/swi/library/settings.pl index a1d0e5408..6ff4c3ca8 100644 --- a/swi/library/settings.pl +++ b/swi/library/settings.pl @@ -51,7 +51,7 @@ :- use_module(library(option)). /** Setting management -@ingroup SWILibrary +@ingroup swi This library allows management of configuration settings for Prolog applications. Applications define settings in one or multiple files diff --git a/swi/library/shlib.pl b/swi/library/shlib.pl index 6bc9de269..ecae00a4a 100644 --- a/swi/library/shlib.pl +++ b/swi/library/shlib.pl @@ -44,7 +44,7 @@ :- set_prolog_flag(generate_debug_info, false). /** Utility library for loading foreign objects (DLLs, shared objects) -@ingroup SWILibrary +@ingroup swi This section discusses the functionality of the (autoload) library(shlib), providing an interface to manage shared libraries. We diff --git a/swi/library/thread_pool.pl b/swi/library/thread_pool.pl index 4af125030..c115d3434 100644 --- a/swi/library/thread_pool.pl +++ b/swi/library/thread_pool.pl @@ -43,7 +43,7 @@ /** Resource bounded thread management -@ingroup SWILibrary +@ingroup swi The module library(thread_pool) manages threads in pools. A pool defines properties of its member threads and the maximum number of threads that