From 2dc4d66bb9f24a1d3f9b80cf3bbdc41835ea61f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Tue, 6 May 2014 13:58:08 +0100 Subject: [PATCH] doc --- C/arith0.c | 18 ++++++++++++- H/eval.h | 68 +++++++++++++++++++++++++++++++++++++++++++++++++ docs/doxygen.rc | 2 +- 3 files changed, 86 insertions(+), 2 deletions(-) diff --git a/C/arith0.c b/C/arith0.c index 3ce6122cb..72685ad3c 100644 --- a/C/arith0.c +++ b/C/arith0.c @@ -24,7 +24,23 @@ static char SccsId[] = "%W% %G%"; @defgroup arithmetic_operators Arithmetic Functions @ingroup arithmetic - YAP implements several arithmetic functions. Arithmetic expressions + YAP implements several arithmetic functions, they are defined as + fields in three enumerations, such that there is one enumeration + per each different arity: + + - #arith0_op defines constants and arity 0 arithmetic functions + + @copydoc #arith0_op + + - #arith1_op defines single argument arithmetic functions + + @copydoc #arith1_op + + - #arith2_op defines binary arithmetic functions + + @copydoc #arith2_op + + Arithmetic expressions in YAP may use the following operators: - pi [ISO]

@anchor pi_0 diff --git a/H/eval.h b/H/eval.h index fff67560b..fcec9c0e2 100644 --- a/H/eval.h +++ b/H/eval.h @@ -127,10 +127,39 @@ exceptions: #define PLMAXINT Int_MAX #define PLMININT Int_MIN +/** + * @addtogroup arithmetic_operators + * @enum arith0_op constant operators + * @brief specifies the available unary arithmetic operators +*/ typedef enum { + /** pi [ISO] + + An approximation to the value of pi, that is, the ratio of a circle's circumference to its diameter. + * + */ op_pi, + /** e + + Euler's number, the base of the natural logarithms. + * + */ op_e, + /** epsilon + + The difference between the float `1.0` and the next largest floating point number. + * + */ op_epsilon, + /** inf + + Infinity according to the IEEE Floating-Point standard. Note that evaluating this term will generate a domain error in the `iso` language mode. Also note that + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.prolog} + * ?- +inf =:= -inf. + * false. + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + */ op_inf, op_nan, op_random, @@ -144,10 +173,44 @@ typedef enum { op_stackfree } arith0_op; +/** + * @addtogroup arithmetic_operators + * @enum arith1_op unary operators + * @brief specifies the available unary arithmetic operators + */ typedef enum { + /** \+ _X_: the value of _X_. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.prolog} + * X =:= +X. + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ op_uplus, + /** \- _X_: the complement of _X_. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.prolog} + * 0-X =:= -X. + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ + */ op_uminus, + /** \\ _X_, The bitwise negation of _X_. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.prolog} + * \X /\ X =:= =:= 0. + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * Note that the number of bits of an integer is at least the size in bitsof a Prolog term cell. + */ op_unot, + /** \\ _X_, The bitwise negation of _X_. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.prolog} + * \X /\ X =:= =:= 0. + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * Note that the number of bits of an integer is at least the size in bitsof a Prolog term cell. + */ op_exp, op_log, op_log10, @@ -185,6 +248,11 @@ typedef enum { op_random1 } arith1_op; +/** + * @addtogroup arithmetic_operators + * @enum arith2_op binary operators + * @brief specifies the available unary arithmetic operators + */ typedef enum { op_plus, op_minus, diff --git a/docs/doxygen.rc b/docs/doxygen.rc index 3dcb32612..6a30e7d4f 100644 --- a/docs/doxygen.rc +++ b/docs/doxygen.rc @@ -760,7 +760,7 @@ WARN_LOGFILE = # spaces. # Note: If this tag is empty the current directory is searched. -INPUT = docs/yap.md pl/absf.yap C/cmppreds.c C/eval.c H/eval.h C/arith0.c C/arith1.c C/arith2.c pl/arithpreds.yap +INPUT = docs/yap.md pl/absf.yap C/cmppreds.c C/eval.c H/eval.h C/arith0.c C/arith1.c C/arith2.c pl/arithpreds.yap CXX # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses