doc support

This commit is contained in:
Vítor Santos Costa 2015-01-04 23:58:23 +00:00
parent a87f1040ac
commit 3164ed2d61
124 changed files with 625 additions and 645 deletions

View File

@ -21,6 +21,11 @@ static char SccsId[] = "%W% %G%";
/**
@file arith0.c
*/
//! @{
/**
@defgroup arithmetic_operators Arithmetic Functions
@ingroup arithmetic

View File

@ -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 )
{

View File

@ -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:

View File

@ -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);
}
/** @} */

2
C/bb.c
View File

@ -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

View File

@ -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:

View File

@ -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

View File

@ -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)
{

View File

@ -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

View File

@ -17,7 +17,7 @@
/** @defgroup YAP_Terms Predicates on terms
@ingroup YAPBuiltins
@ingroup builtins
@{

View File

@ -17,7 +17,7 @@
/** @defgroup Term_Modification Term Modification
@ingroup YAPBuiltins
@ingroup builtins
@{
It is sometimes useful to change the value of instantiated

View File

@ -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);

View File

@ -18,6 +18,8 @@
static char SccsId[] = "%W% %G%";
#endif
// @{
/**
@addtogroup YAPOS
*/
@ -3258,3 +3260,5 @@ rw_lock_voodoo(void) {
#endif /* YAPOR || THREADS */
//@

View File

@ -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"
}
//! @}

View File

@ -19,7 +19,7 @@
@defgroup arithmetic Arithmetic in YAP
@ingroup YAPBuiltins
@ingroup builtins
+ See @ref arithmetic_preds for the predicates that implement arithment

View File

@ -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

View File

@ -1,5 +1,5 @@
/** @defgroup Apply Apply Macros
@ingroup YAPLibrary
@ingroup library
@{
This library provides a SWI-compatible set of utilities for applying a

View File

@ -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

View File

@ -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 <tt>atts</tt> . The command
@ -50,12 +51,17 @@ variable. Unification will resume after this call.
<tt>project_attributes/2</tt> is used from a set of variables into a set of
constraints or goals. One application of <tt>project_attributes/2</tt> 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 <em>name</em> which is <em>private</em> 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).
/**
@}
@}
*/

View File

@ -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

View File

@ -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.
*/

View File

@ -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.

View File

@ -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:

View File

@ -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.
*/

View File

@ -9,7 +9,7 @@
]).
%% @defgroup Cleanup Call Cleanup
% @ingroup YAPLibrary
% @ingroup library
% @{
%
% <tt>call_cleanup/1</tt> and <tt>call_cleanup/2</tt> allow predicates to register

View File

@ -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.

View File

@ -31,7 +31,7 @@
:- use_module(library(error)).
/** <module> 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"

View File

@ -1,6 +1,6 @@
/**
@defgroup DBQUeue Non-baacktrackable queues in YAP.
@ingroup YAPLibrary
@ingroup library
@{
A library to implement queues of NB Terms

View File

@ -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.

View File

@ -5,7 +5,7 @@
/** @defgroup DGraphs Directed Graphs
@ingroup YAPLibrary
@ingroup library
@{
The following graph manipulation routines use the red-black tree library

View File

@ -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

View File

@ -16,11 +16,11 @@
*************************************************************************/
/**
*
* @file blobs.c
* @{
* @file blobs.c
*
* @addtogroup swi-c-interface
*
* @{
*/
#include <Yap.h>
@ -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)

View File

@ -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
* @{
* */

View File

@ -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);

View File

@ -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

View File

@ -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

View File

@ -4,7 +4,7 @@
/** @defgroup LAM LAM
@ingroup YAPLibrary
@ingroup library
@{
This library provides a set of utilities for interfacing with LAM MPI.

View File

@ -41,7 +41,7 @@ official policies, either expressed or implied, of Ulrich Neumerkel.
op(201,xfx,+\)]).
/** <module> Lambda expressions
@ingroup YAPLibrary
@ingroup library
This library provides lambda expressions to simplify higher order
programming based on call/N.

View File

@ -20,7 +20,7 @@
]).
/** @defgroup LineUtilities Line Manipulation Utilities
@ingroup YAPLibrary
@ingroup library
@{
This package provides a set of useful predicates to manipulate

View File

@ -5,7 +5,7 @@
%
/** @defgroup Lists List Manipulation
@ingroup YAPLibrary
@ingroup library
@{
The following list manipulation routines are available once included

View File

@ -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.

View File

@ -1,6 +1,6 @@
/** @defgroup MATLAB MATLAB Package Interface
@ingroup YAPLibrary
@ingroup library
@{
The MathWorks MATLAB is a widely used package for array

View File

@ -16,7 +16,7 @@
*************************************************************************/
/** @defgroup matrix Matrix Library
@ingroup YAPLibrary
@ingroup library
@{
This package provides a fast implementation of multi-dimensional

View File

@ -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

View File

@ -19,7 +19,7 @@
/** @defgroup Ordered_Sets Ordered Sets
@ingroup YAPLibrary
@ingroup library
@{
The following ordered set manipulation routines are available once

View File

@ -17,7 +17,7 @@
/**
@groupdef PseudoRandom Van Gelder Random Number Generator
@ingroup YAPBuiltins
@ingroup builtins
@{
*/

View File

@ -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

View File

@ -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

View File

@ -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_.
@}
*/
%%! @}

View File

@ -16,7 +16,7 @@
*************************************************************************/
/** @defgroup RegExp Regular Expressions
@ingroup YAPLibrary
@ingroup library
@{
This library includes routines to determine whether a regular expression

View File

@ -2,7 +2,7 @@
<module> 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

View File

@ -16,7 +16,7 @@
*************************************************************************/
/** @defgroup Splay_Trees Splay Trees
@ingroup YAPLibrary
@ingroup library
@{
Splay trees are explained in the paper "Self-adjusting Binary Search

View File

@ -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

View File

@ -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

View File

@ -21,7 +21,7 @@
/** @defgroup Timeout Calls With Timeout
@ingroup YAPLibrary
@ingroup library
@{
The <tt>time_out/3</tt> command relies on the <tt>alarm/3</tt> built-in to

View File

@ -25,7 +25,7 @@
/** @defgroup Trees Updatable Binary Trees
@ingroup YAPLibrary
@ingroup library
@{
The following queue manipulation routines are available once

View File

@ -7,7 +7,7 @@
/** @defgroup Tries Trie DataStructure
@ingroup YAPLibrary
@ingroup library
@{
The next routines provide a set of utilities to create and manipulate

View File

@ -10,7 +10,7 @@
/** @defgroup UGraphs Unweighted Graphs
@ingroup YAPLibrary
@ingroup library
@{
The following graph manipulation routines are based in code originally

View File

@ -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

View File

@ -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 ) -->

View File

@ -27,8 +27,8 @@
#include <ctype.h>
#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.
//

View File

@ -29,6 +29,8 @@
#include <os2.h> /* 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
// @}

View File

@ -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.

View File

@ -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.
%% @}

View File

@ -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),

View File

@ -18,7 +18,7 @@
/** @defgroup Gecode Gecode Interface
@ingroup YAPPackages
@ingroup packages
@{

View File

@ -11,16 +11,6 @@
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
/** <module> 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
]).
]).
/** <module> python
A C-based Prolog interface to python.
@author Vitor Santos Costa
@version 0:0:5, 2012/10/8
@license Perl Artistic License
*/
/************************************************************************************************************

View File

@ -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(<atts>, <content>). <atts> is a list of
* <atom>=<string> attributes from the (possibly implicit) XML signature of the
* document. <content> is a (possibly empty) list comprising occurrences of :
*
* pcdata(<string>) : Text
* comment(<string>) : An xml comment;
* element(<tag>,<atts>,<content>) : <tag>..</tag> encloses <content>
* : <tag /> if empty
* instructions(<atom>, <string>) : Processing <? <atom> <params> ?>"
* cdata( <string> ) : <![CDATA[ <string> ]]>
* doctype(<atom>, <doctype id>) : DTD <!DOCTYPE .. >
*
* 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( <string> ) : Text which has not been parsed
* out_of_context( <tag> ) : <tag> 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
* <tag>{(id)}* where <id> is the value of any attribute _named_ id.
*
* At this release, the Controls applying to in-bound (Chars -> Document)
* parsing are:
*
* extended_characters(<bool>) : Use the extended character
* : entities for XHTML (default true)
*
* format(<bool>) : Strip layouts when no character data
* : appears between elements.
* : (default true)
*
* remove_attribute_prefixes(<bool>) : Remove namespace prefixes from
* : attributes when it's the same as the
* : prefix of the parent element
* : (default false).
*
* allow_ampersand(<bool>) : Allow unescaped ampersand
* : characters (&) to occur in PCDATA.
* : (default false).
*
* [<bool> is one of 'true' or 'false']
*
* For out-bound (Document -> Chars) parsing, the only available option is:
*
* format(<Bool>) : 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(<atts>, <content>). <atts> is a list of
* <atom>=<string> attributes from the (possibly implicit) XML signature of the
* document. <content> is a (possibly empty) list comprising occurrences of * ~~~
* pcdata(<string>) : Text
* comment(<string>) : An xml comment;
* element(<tag>,<atts>,<content>) : <tag>..</tag> encloses <content>
* : <tag /> if empty
* instructions(<atom>, <string>) : Processing <? <atom> <params> ?>"
* cdata( <string> ) : <![CDATA[ <string> ]]>
* doctype(<atom>, <doctype id>) : DTD <!DOCTYPE .. >
* ~~~~
* 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( <string> ) : Text which has not been parsed
* out_of_context( <tag> ) : <tag> 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
* <tag>{(id)}* where <id> is the value of any attribute _named_ id.
*
* At this release, the Controls applying to in-bound (Chars -> Document)
* parsing are:
*
* extended_characters(<bool>) : Use the extended character
* : entities for XHTML (default true)
*
* format(<bool>) : Strip layouts when no character data
* : appears between elements.
* : (default true)
*
* remove_attribute_prefixes(<bool>) : Remove namespace prefixes from
* : attributes when it's the same as the
* : prefix of the parent element
* : (default false).
*
* allow_ampersand(<bool>) : Allow unescaped ampersand
* : characters (&) to occur in PCDATA.
* : (default false).
*
* [<bool> is one of 'true' or 'false']
*
* For out-bound (Document -> Chars) parsing, the only available option is:
*
* format(<Bool>) : 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 ).

View File

@ -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

View File

@ -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,

View File

@ -57,6 +57,8 @@
*/
%% @{
/** @pred expand_exprs(- _O_,+ _N_)
Control term expansion during compilation.

View File

@ -15,13 +15,14 @@
* *
*************************************************************************/
%% @{
/**
@file arithpreds.yap
@addtogroup arithmetic_preds
@{
*/
:- system_module(arithmetic_predicates, [

View File

@ -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)).
%% @}

View File

@ -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
*
*/

View File

@ -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 <em>domain</em>, 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 <em>domain</em>, 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_)

View File

@ -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 ).
/**
@}
@}
*/

View File

@ -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)).
%% @}
/**
@}

View File

@ -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

View File

@ -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.

View File

@ -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).
@}
@}
@}
*/

View File

@ -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).
/**
@}
@}
@}
*/

View File

@ -46,7 +46,7 @@
-----------------------------------------------------------------------------*/
/** @defgroup Deb_Preds Debugging Predicates
@ingroup YAPBuiltins
@ingroup builtins
@{
The

View File

@ -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.

View File

@ -27,7 +27,7 @@
yap_flag/3], []).
/** @defgroup Flags YAP Execution Flags
@ingroup YAPBuiltins
@ingroup builtins
@{
*/

View File

@ -18,7 +18,7 @@
/**
@defgroup Grammars Grammar Rules
@ingroup YAPBuiltins
@ingroup builtins
@{
Grammar rules in Prolog are both a convenient way to express definite

View File

@ -14,7 +14,7 @@
* comments: initializing the full prolog system *
* *
*************************************************************************/
%% @defgroup YAPBuiltins YAP Built-Ins
%% @defgroup builtins YAP Built-Ins
/*

View File

@ -25,7 +25,7 @@
:- use_system_module( '$_modules', ['$do_import'/3]).
/** @defgroup LoadForeign Access to Foreign Language Programs
@ingroup YAPBuiltins
@ingroup builtins
*/

View File

@ -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) :-
/**
@}
@}
@}
*/

View File

@ -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

View File

@ -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.

View File

@ -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_ )

View File

@ -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'(_).

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -17,7 +17,7 @@
/**
@defgroup Threads Threads
@ingroup YAPExtensions
@ingroup extensions
@{
YAP implements a SWI-Prolog compatible multithreading

View File

@ -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.

View File

@ -51,7 +51,7 @@
aggregate_all(?,?,0,-).
/** <module> 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

View File

@ -35,7 +35,7 @@
]).
/** <module> Base64 encoding and decoding
@ingroup SWILibrary
@ingroup swi
Prolog-based base64 encoding using DCG rules. Encoding according to
rfc2045. For example:

View File

@ -48,7 +48,7 @@
listener/4.
/** <module> Event service
@ingroup SWILibrary
@ingroup swi
Generic broadcasting service. Broadcasts are made using the predicate
broadcast(+Templ). All registered `listeners' will have their goal

Some files were not shown because too many files have changed in this diff Show More