doc support
This commit is contained in:
parent
a87f1040ac
commit
3164ed2d61
@ -21,6 +21,11 @@ static char SccsId[] = "%W% %G%";
|
|||||||
/**
|
/**
|
||||||
@file arith0.c
|
@file arith0.c
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
//! @{
|
||||||
|
|
||||||
|
/**
|
||||||
@defgroup arithmetic_operators Arithmetic Functions
|
@defgroup arithmetic_operators Arithmetic Functions
|
||||||
@ingroup arithmetic
|
@ingroup arithmetic
|
||||||
|
|
||||||
|
10
C/arrays.c
10
C/arrays.c
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/** @defgroup YAPArrays Named Arrays
|
/** @defgroup YAPArrays Named Arrays
|
||||||
@ingroup YAPExtensions
|
@ingroup extensions
|
||||||
@{
|
@{
|
||||||
|
|
||||||
The YAP system includes experimental support for arrays. The
|
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
|
integer. The _Type_ must be bound to one of types mentioned
|
||||||
previously.
|
previously.
|
||||||
*/
|
*/
|
||||||
/// @memberof static_array/3
|
|
||||||
p_create_static_array( USES_REGS1 )
|
p_create_static_array( USES_REGS1 )
|
||||||
{
|
{
|
||||||
Term ti = Deref(ARG2);
|
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
|
static Int
|
||||||
p_clear_static_array( USES_REGS1 )
|
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
|
static Int
|
||||||
p_close_static_array( USES_REGS1 )
|
p_close_static_array( USES_REGS1 )
|
||||||
{
|
{
|
||||||
@ -1370,7 +1367,6 @@ terms (type `term`).
|
|||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
/// @memberof mmapped_array/4
|
|
||||||
static Int
|
static Int
|
||||||
p_create_mmapped_array( USES_REGS1 )
|
p_create_mmapped_array( USES_REGS1 )
|
||||||
{
|
{
|
||||||
@ -1684,7 +1680,6 @@ to use the operations on mutable terms.
|
|||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
/// @memberof update_array/3
|
|
||||||
static Int
|
static Int
|
||||||
p_assign_static( USES_REGS1 )
|
p_assign_static( USES_REGS1 )
|
||||||
{
|
{
|
||||||
@ -2179,7 +2174,6 @@ terms.
|
|||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
/// @memberof add_to_array_element/4
|
|
||||||
|
|
||||||
static Int
|
static Int
|
||||||
p_add_to_array_element( USES_REGS1 )
|
p_add_to_array_element( USES_REGS1 )
|
||||||
@ -2413,7 +2407,6 @@ that name.
|
|||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
/// @memberof static_array_to_term/2
|
|
||||||
static Int
|
static Int
|
||||||
p_static_array_to_term( USES_REGS1 )
|
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
|
Give the location or memory address for a static array with name
|
||||||
_Name_. The result is observed as an integer.
|
_Name_. The result is observed as an integer.
|
||||||
*/
|
*/
|
||||||
/// @memberof static_array_location/2
|
|
||||||
static Int
|
static Int
|
||||||
p_static_array_location( USES_REGS1 )
|
p_static_array_location( USES_REGS1 )
|
||||||
{
|
{
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
static char SccsId[] = "%W% %G%";
|
static char SccsId[] = "%W% %G%";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** @defgroup Predicates_on_Atoms Predicates on Atoms
|
/** @addgroup Predicates_on_Atoms Predicates on Atoms
|
||||||
@ingroup YAPBuiltins
|
@ingroup YAPChars
|
||||||
@{
|
@{
|
||||||
|
|
||||||
The following predicates are used to manipulate atoms:
|
The following predicates are used to manipulate atoms:
|
||||||
|
24
C/attvar.c
24
C/attvar.c
@ -28,6 +28,12 @@ static char SccsId[]="%W% %G%";
|
|||||||
#define NULL (void *)0
|
#define NULL (void *)0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/** @{ */
|
||||||
|
|
||||||
|
/** @defgroup Attribute_Variables_Builtins Implementation of Attribute Declarations
|
||||||
|
@ingroup Attributed_Variables
|
||||||
|
*/
|
||||||
|
|
||||||
#ifdef COROUTINING
|
#ifdef COROUTINING
|
||||||
|
|
||||||
#define TermVoidAtt TermFoundVar
|
#define TermVoidAtt TermFoundVar
|
||||||
@ -995,6 +1001,14 @@ p_all_attvars( USES_REGS1 )
|
|||||||
} while (TRUE);
|
} while (TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** @pred attvar( _-Var_)
|
||||||
|
|
||||||
|
|
||||||
|
Succeed if _Var_ is an attributed variable.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
static Int
|
static Int
|
||||||
p_is_attvar( USES_REGS1 )
|
p_is_attvar( USES_REGS1 )
|
||||||
{
|
{
|
||||||
@ -1104,16 +1118,10 @@ void Yap_InitAttVarPreds(void)
|
|||||||
Yap_InitCPred("all_attvars", 1, p_all_attvars, 0);
|
Yap_InitCPred("all_attvars", 1, p_all_attvars, 0);
|
||||||
CurrentModule = OldCurrentModule;
|
CurrentModule = OldCurrentModule;
|
||||||
Yap_InitCPred("attvar", 1, p_is_attvar, SafePredFlag|TestPredFlag);
|
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);
|
Yap_InitCPred("$att_bound", 1, p_attvar_bound, SafePredFlag|TestPredFlag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/** @} */
|
||||||
|
|
||||||
|
2
C/bb.c
2
C/bb.c
@ -20,7 +20,7 @@ static char SccsId[] = "%W% %G%";
|
|||||||
|
|
||||||
|
|
||||||
/** @defgroup BlackBoard The Blackboard
|
/** @defgroup BlackBoard The Blackboard
|
||||||
@ingroup YAPBuiltins
|
@ingroup builtins
|
||||||
@{
|
@{
|
||||||
|
|
||||||
YAP implements a blackboard in the style of the SICStus Prolog
|
YAP implements a blackboard in the style of the SICStus Prolog
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/** @defgroup Comparing_Terms Comparing Terms
|
/** @defgroup Comparing_Terms Comparing Terms
|
||||||
@ingroup YAPBuiltins
|
@ingroup builtins
|
||||||
|
|
||||||
The following predicates are used to compare and order terms, using the
|
The following predicates are used to compare and order terms, using the
|
||||||
standard ordering:
|
standard ordering:
|
||||||
|
@ -20,7 +20,7 @@ static char SccsId[] = "%W% %G%";
|
|||||||
|
|
||||||
|
|
||||||
/** @defgroup Internal_Database Internal Data Base
|
/** @defgroup Internal_Database Internal Data Base
|
||||||
@ingroup YAPBuiltins
|
@ingroup builtins
|
||||||
@{
|
@{
|
||||||
|
|
||||||
Some programs need global information for, e.g. counting or collecting
|
Some programs need global information for, e.g. counting or collecting
|
||||||
|
22
C/eval.c
22
C/eval.c
@ -18,13 +18,14 @@
|
|||||||
static char SccsId[] = "%W% %G%";
|
static char SccsId[] = "%W% %G%";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
//! @file eval.c
|
||||||
@file eval.c
|
|
||||||
|
|
||||||
|
//! @{
|
||||||
|
|
||||||
|
/**
|
||||||
@defgroup arithmetic_preds Arithmetic Predicates
|
@defgroup arithmetic_preds Arithmetic Predicates
|
||||||
@ingroup arithmetic
|
@ingroup arithmetic
|
||||||
|
|
||||||
@{
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
@ -200,7 +201,6 @@ BEAM_is(void)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@{
|
|
||||||
@pred is( X:number, + Y:ground) is det
|
@pred is( X:number, + Y:ground) is det
|
||||||
|
|
||||||
This predicate succeeds iff the result of evaluating the expression
|
This predicate succeeds iff the result of evaluating the expression
|
||||||
@ -246,8 +246,6 @@ p_is( USES_REGS1 )
|
|||||||
return Yap_unify_constant(ARG1,out);
|
return Yap_unify_constant(ARG1,out);
|
||||||
}
|
}
|
||||||
|
|
||||||
//@}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@pred isnan(? X:float) is det
|
@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_,
|
True if _Log1_ is the logarithm of the positive number _A1_,
|
||||||
_Log2_ is the logarithm of the positive number _A2_, and
|
_Log2_ is the logarithm of the positive number _A2_, and
|
||||||
@ -400,7 +398,6 @@ p_logsum( USES_REGS1 )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// @}
|
|
||||||
|
|
||||||
Int
|
Int
|
||||||
Yap_ArithError(yap_error_number type, Term where, char *format,...)
|
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
|
_Low_ and _High_ are integers, _High_ \>= _Low_. If
|
||||||
_Value_ is an integer, _Low_ =\< _Value_
|
_Value_ is an integer, _Low_ =\< _Value_
|
||||||
@ -603,11 +598,6 @@ init_between( USES_REGS1 )
|
|||||||
return cont_between( PASS_REGS1 );
|
return cont_between( PASS_REGS1 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @}
|
|
||||||
*/
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Yap_InitEval(void)
|
Yap_InitEval(void)
|
||||||
{
|
{
|
||||||
|
@ -24,7 +24,7 @@ static char SccsId[] = "%W% %G%";
|
|||||||
@file globals.c
|
@file globals.c
|
||||||
|
|
||||||
@defgroup Global_Variables Global Variables
|
@defgroup Global_Variables Global Variables
|
||||||
@ingroup YAPBuiltins
|
@ingroup builtins
|
||||||
@{
|
@{
|
||||||
|
|
||||||
Global variables are associations between names (atoms) and
|
Global variables are associations between names (atoms) and
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/** @defgroup YAP_Terms Predicates on terms
|
/** @defgroup YAP_Terms Predicates on terms
|
||||||
@ingroup YAPBuiltins
|
@ingroup builtins
|
||||||
@{
|
@{
|
||||||
|
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
/** @defgroup Term_Modification Term Modification
|
/** @defgroup Term_Modification Term Modification
|
||||||
@ingroup YAPBuiltins
|
@ingroup builtins
|
||||||
@{
|
@{
|
||||||
|
|
||||||
It is sometimes useful to change the value of instantiated
|
It is sometimes useful to change the value of instantiated
|
||||||
|
74
C/stdpreds.c
74
C/stdpreds.c
@ -425,7 +425,32 @@ Int show_time(USES_REGS1) /* MORE PRECISION */
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif /* BEAM */
|
#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) */
|
static Int p_setval(USES_REGS1) { /* '$set_value'(+Atom,+Atomic) */
|
||||||
Term t1 = Deref(ARG1), t2 = Deref(ARG2);
|
Term t1 = Deref(ARG1), t2 = Deref(ARG2);
|
||||||
if (!IsVarTerm(t1) && IsAtomTerm(t1) &&
|
if (!IsVarTerm(t1) && IsAtomTerm(t1) &&
|
||||||
@ -436,6 +461,13 @@ static Int p_setval(USES_REGS1) { /* '$set_value'(+Atom,+Atomic) */
|
|||||||
return (FALSE);
|
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) */
|
static Int p_value(USES_REGS1) { /* '$get_value'(+Atom,?Val) */
|
||||||
Term t1 = Deref(ARG1);
|
Term t1 = Deref(ARG1);
|
||||||
if (IsVarTerm(t1)) {
|
if (IsVarTerm(t1)) {
|
||||||
@ -453,7 +485,7 @@ static Int p_values(USES_REGS1) { /* '$values'(Atom,Old,New) */
|
|||||||
Term t1 = Deref(ARG1), t3 = Deref(ARG3);
|
Term t1 = Deref(ARG1), t3 = Deref(ARG3);
|
||||||
|
|
||||||
if (IsVarTerm(t1)) {
|
if (IsVarTerm(t1)) {
|
||||||
Yap_Error(INSTANTIATION_ERROR, t1, "set_value/2");
|
|