doc fixes

This commit is contained in:
Vitor Santos Costa 2018-04-23 14:34:52 +01:00
parent dfacbdcfd1
commit f39619b3ef
15 changed files with 1054 additions and 616 deletions

View File

@ -8,10 +8,8 @@
* *
**************************************************************************
* *
* File: arith1.c *
* Last rev: *
* mods: *
* comments: arithmetical expression evaluation *
* File: arith1.c * Last rev:
** mods: * comments: arithmetical expression evaluation *
* *
*************************************************************************/
#ifdef SCCS
@ -109,20 +107,24 @@ static char SccsId[] = "%W% %G%";
- <b>integer( _X_)</b><p> @anchor integer_1_op
If _X_ evaluates to a float, the integer between the value of _X_ and 0 closest to the value of _X_, else if _X_ evaluates to an
integer, the value of _X_.
If _X_ evaluates to a float, the integer between the value of _X_ and 0
closest to the value of _X_, else if _X_ evaluates to an integer, the value of
_X_.
- <b>float( _X_) [ISO]</b><p> @anchor float_1_op
If _X_ evaluates to an integer, the corresponding float, else the float itself.
If _X_ evaluates to an integer, the corresponding float, else the float
itself.
- <b>float_fractional_part( _X_) [ISO]</b><p> @anchor float_fractional_part_1
The fractional part of the floating point number _X_, or `0.0` if _X_ is an integer. In the `iso` language mode, _X_ must be an integer.
The fractional part of the floating point number _X_, or `0.0` if _X_ is
an integer. In the `iso` language mode, _X_ must be an integer.
- <b>float_integer_part( _X_) [ISO]</b><p> @anchor float_integer_part_1
The float giving the integer part of the floating point number _X_, or _X_ if _X_ is an integer. In the `iso` language mode, _X_ must be an integer.
The float giving the integer part of the floating point number _X_, or _X_
if _X_ is an integer. In the `iso` language mode, _X_ must be an integer.
- <b>abs( _X_) [ISO]</b><p> @anchor abs_1
@ -132,7 +134,8 @@ static char SccsId[] = "%W% %G%";
The integer that is the smallest integral value not smaller than _X_.
In `iso` language mode the argument must be a floating point-number and the result is an integer.
In `iso` language mode the argument must be a floating point-number and the
result is an integer.
- <b>floor( _X_) [ISO]</b><p> @anchor floor_1
@ -143,14 +146,19 @@ static char SccsId[] = "%W% %G%";
- <b>round( _X_) [ISO]</b><p> @anchor round_1
The nearest integral value to _X_. If _X_ is equidistant to two integers, it will be rounded to the closest even integral value.
The nearest integral value to _X_. If _X_ is equidistant to two integers,
it will be rounded to the closest even integral value.
In `iso` language mode the argument must be a floating point-number, the result is an integer and it the float is equidistant it is rounded up, that is, to the least integer greater than _X_.
In `iso` language mode the argument must be a floating point-number, the
result is an integer and it the float is equidistant it is rounded up, that is,
to the least integer greater than _X_.
- <b>sign( _X_) [ISO]</b><p> @anchor sign_1
Return 1 if the _X_ evaluates to a positive integer, 0 it if evaluates to 0, and -1 if it evaluates to a negative integer. If _X_
evaluates to a floating-point number return 1.0 for a positive _X_, 0.0 for 0.0, and -1.0 otherwise.
Return 1 if the _X_ evaluates to a positive integer, 0 it if evaluates to
0, and -1 if it evaluates to a negative integer. If _X_ evaluates to a
floating-point number return 1.0 for a positive _X_, 0.0 for 0.0, and -1.0
otherwise.
- <b>truncate( _X_) [ISO]</b><p> @anchor truncate_1
@ -158,13 +166,13 @@ static char SccsId[] = "%W% %G%";
- <b>rational( _X_)</b><p> @anchor rational_1_op
Convert the expression _X_ to a rational number or integer. The function returns the input on integers and rational numbers. For
floating point numbers, the returned rational number exactly represents
the float. As floats cannot exactly represent all decimal numbers the
results may be surprising. In the examples below, doubles can represent
`0.25` and the result is as expected, in contrast to the result of
`rational(0.1)`. The function `rationalize/1` gives a more
intuitive result.
Convert the expression _X_ to a rational number or integer. The function
returns the input on integers and rational numbers. For floating point numbers,
the returned rational number exactly represents the float. As floats cannot
exactly represent all decimal numbers the results may be surprising. In the
examples below, doubles can represent `0.25` and the result is as expected, in
contrast to the result of `rational(0.1)`. The function `rationalize/1` gives a
more intuitive result.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~prolog
?- A is rational(0.25).
@ -176,8 +184,8 @@ A = 3602879701896397 rdiv 36028797018963968
- <b>rationalize( _X_)</b><p> @anchor rationalize_1
Convert the expression _X_ to a rational number or integer. The function is
similar to [rational/1](@ref rational_1), but the result is only accurate within the
rounding error of floating point numbers, generally producing a much
similar to [rational/1](@ref rational_1), but the result is only accurate
within the rounding error of floating point numbers, generally producing a much
smaller denominator.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~prolog
@ -202,7 +210,8 @@ A = 1 rdiv 10
- <b>popcount( _X_)</b><p> @anchor popcount_1
The number of bits set to `1` in the binary representation of the non-negative integer _X_.
The number of bits set to `1` in the binary representation of the
non-negative integer _X_.
- <b>[ _X_]</b><p>
@ -226,17 +235,15 @@ X is Y*10+C-48.
*/
#include "Yap.h"
#include "Yatom.h"
#include "YapHeap.h"
#include "YapEval.h"
#include "YapHeap.h"
#include "Yatom.h"
static Term
float_to_int(Float v USES_REGS)
{
static Term float_to_int(Float v USES_REGS) {
#if USE_GMP
Int i = (Int)v;
if (i-v == 0.0) {
if (i - v == 0.0) {
return MkIntegerTerm(i);
} else {
return Yap_gmp_float_to_big(v);
@ -246,7 +253,7 @@ float_to_int(Float v USES_REGS)
#endif
}
#define RBIG_FL(v) return(float_to_int(v PASS_REGS))
#define RBIG_FL(v) return (float_to_int(v PASS_REGS))
typedef struct init_un_eval {
char *OpName;
@ -263,18 +270,16 @@ typedef struct init_un_eval {
#endif
#if !HAVE_ASINH
#define asinh(F) (log((F)+sqrt((F)*(F)+1)))
#define asinh(F) (log((F) + sqrt((F) * (F) + 1)))
#endif
#if !HAVE_ACOSH
#define acosh(F) (log((F)+sqrt((F)*(F)-1)))
#define acosh(F) (log((F) + sqrt((F) * (F)-1)))
#endif
#if !HAVE_ATANH
#define atanh(F) (log((1+(F))/(1-(F)))/2)
#define atanh(F) (log((1 + (F)) / (1 - (F))) / 2)
#endif
static inline Float
get_float(Term t) {
static inline Float get_float(Term t) {
if (IsFloatTerm(t)) {
return FloatOfTerm(t);
}
@ -296,26 +301,24 @@ get_float(Term t) {
#if HAVE_RINT
#define my_rint(X) rint(X)
#else
static
double my_rint(double x)
{
static double my_rint(double x) {
double y, z;
Int n;
if (x >= 0) {
y = x + 0.5;
z = floor(y);
n = (Int) z;
n = (Int)z;
if (y == z && n % 2)
return(z-1);
return (z - 1);
} else {
y = x - 0.5;
z = ceil(y);
n = (Int) z;
n = (Int)z;
if (y == z && n % 2)
return(z+1);
return (z + 1);
}
return(z);
return (z);
}
#endif
@ -335,27 +338,42 @@ msb(Int inp USES_REGS) /* calculate the most significant bit for an integer */
#elif HAVE_FFSLL
out = ffsll(inp);
#else
if (inp==0)
if (inp == 0)
return 0L;
#if SIZEOF_INT_P == 8
if (inp & ((CELL)0xffffffffLL << 32)) {inp >>= 32; out += 32;}
if (inp & ((CELL)0xffffffffLL << 32)) {
inp >>= 32;
out += 32;
}
#endif
if (inp & ((CELL)0xffffL << 16)) {inp >>= 16; out += 16;}
if (inp & ((CELL)0xffL << 8)) {inp >>= 8; out += 8;}
if (inp & ((CELL)0xfL << 4)) {inp >>= 4; out += 4;}
if (inp & ((CELL)0x3L << 2)) {inp >>= 2; out += 2;}
if (inp & ((CELL)0x1 << 1)) out++;
if (inp & ((CELL)0xffffL << 16)) {
inp >>= 16;
out += 16;
}
if (inp & ((CELL)0xffL << 8)) {
inp >>= 8;
out += 8;
}
if (inp & ((CELL)0xfL << 4)) {
inp >>= 4;
out += 4;
}
if (inp & ((CELL)0x3L << 2)) {
inp >>= 2;
out += 2;
}
if (inp & ((CELL)0x1 << 1))
out++;
#endif
return out;
}
Int
Yap_msb(Int inp USES_REGS) /* calculate the most significant bit for an integer */
Int Yap_msb(
Int inp USES_REGS) /* calculate the most significant bit for an integer */
{
return msb(inp PASS_REGS);
}
static Int
lsb(Int inp USES_REGS) /* calculate the least significant bit for an integer */
{
@ -366,22 +384,38 @@ lsb(Int inp USES_REGS) /* calculate the least significant bit for an integer */
Yap_ArithError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, MkIntegerTerm(inp),
"msb/1 received %d", inp);
}
if (inp==0)
if (inp == 0)
return 0L;
#if SIZEOF_INT_P == 8
if (!(inp & (CELL)0xffffffffLL)) {inp >>= 32; out += 32;}
if (!(inp & (CELL)0xffffffffLL)) {
inp >>= 32;
out += 32;
}
#endif
if (!(inp & (CELL)0xffffL)) {inp >>= 16; out += 16;}
if (!(inp & (CELL)0xffL)) {inp >>= 8; out += 8;}
if (!(inp & (CELL)0xfL)) {inp >>= 4; out += 4;}
if (!(inp & (CELL)0x3L)) {inp >>= 2; out += 2;}
if (!(inp & ((CELL)0x1))) out++;
if (!(inp & (CELL)0xffffL)) {
inp >>= 16;
out += 16;
}
if (!(inp & (CELL)0xffL)) {
inp >>= 8;
out += 8;
}
if (!(inp & (CELL)0xfL)) {
inp >>= 4;
out += 4;
}
if (!(inp & (CELL)0x3L)) {
inp >>= 2;
out += 2;
}
if (!(inp & ((CELL)0x1)))
out++;
return out;
}
static Int
popcount(Int inp USES_REGS) /* calculate the least significant bit for an integer */
static Int popcount(
Int inp USES_REGS) /* calculate the least significant bit for an integer */
{
/* the obvious solution: do it by using binary search */
Int c = 0, j = 0, m = ((CELL)1);
@ -390,33 +424,30 @@ popcount(Int inp USES_REGS) /* calculate the least significant bit for an intege
Yap_ArithError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, MkIntegerTerm(inp),
"popcount/1 received %d", inp);
}
if (inp==0)
if (inp == 0)
return 0L;
for(j=0,c=0; j<sizeof(inp)*8; j++, m<<=1)
{ if ( inp&m )
for (j = 0, c = 0; j < sizeof(inp) * 8; j++, m <<= 1) {
if (inp & m)
c++;
}
return c;
}
static Term
eval1(Int fi, Term t USES_REGS) {
static Term eval1(Int fi, Term t USES_REGS) {
arith1_op f = fi;
switch (f) {
case op_uplus:
return t;
case op_uminus:
switch (ETypeOfTerm(t)) {
case long_int_e:
{
case long_int_e: {
#ifdef USE_GMP
Int i = IntegerOfTerm(t);
if (i == Int_MIN) {
return Yap_gmp_neg_int(i);
}
else
} else
#endif
RINT(-IntegerOfTerm(t));
}
@ -444,8 +475,7 @@ eval1(Int fi, Term t USES_REGS) {
}
case op_exp:
RFLOAT(exp(get_float(t)));
case op_log:
{
case op_log: {
Float dbl = get_float(t);
if (dbl >= 0) {
RFLOAT(log(dbl));
@ -453,8 +483,7 @@ eval1(Int fi, Term t USES_REGS) {
Yap_ArithError(EVALUATION_ERROR_UNDEFINED, t, "log(%f)", dbl);
}
}
case op_log10:
{
case op_log10: {
Float dbl = get_float(t);
if (dbl >= 0) {
RFLOAT(log10(dbl));
@ -462,8 +491,7 @@ eval1(Int fi, Term t USES_REGS) {
Yap_ArithError(EVALUATION_ERROR_UNDEFINED, t, "log10(%f)", dbl);
}
}
case op_sqrt:
{
case op_sqrt: {
Float dbl = get_float(t), out;
out = sqrt(dbl);
#if HAVE_ISNAN
@ -473,44 +501,37 @@ eval1(Int fi, Term t USES_REGS) {
#endif
RFLOAT(out);
}
case op_sin:
{
case op_sin: {
Float dbl = get_float(t), out;
out = sin(dbl);
RFLOAT(out);
}
case op_cos:
{
case op_cos: {
Float dbl = get_float(t), out;
out = cos(dbl);
RFLOAT(out);
}
case op_tan:
{
case op_tan: {
Float dbl = get_float(t), out;
out = tan(dbl);
RFLOAT(out);
}
case op_sinh:
{
case op_sinh: {
Float dbl = get_float(t), out;
out = sinh(dbl);
RFLOAT(out);
}
case op_cosh:
{
case op_cosh: {
Float dbl = get_float(t), out;
out = cosh(dbl);
RFLOAT(out);
}
case op_tanh:
{
case op_tanh: {
Float dbl = get_float(t), out;
out = tanh(dbl);
RFLOAT(out);
}
case op_asin:
{
case op_asin: {
Float dbl, out;
dbl = get_float(t);
@ -522,8 +543,7 @@ eval1(Int fi, Term t USES_REGS) {
#endif
RFLOAT(out);
}
case op_acos:
{
case op_acos: {
Float dbl, out;
dbl = get_float(t);
@ -535,8 +555,7 @@ eval1(Int fi, Term t USES_REGS) {
#endif
RFLOAT(out);
}
case op_atan:
{
case op_atan: {
Float dbl, out;
dbl = get_float(t);
@ -548,8 +567,7 @@ eval1(Int fi, Term t USES_REGS) {
#endif
RFLOAT(out);
}
case op_asinh:
{
case op_asinh: {
Float dbl, out;
dbl = get_float(t);
@ -561,8 +579,7 @@ eval1(Int fi, Term t USES_REGS) {
#endif
RFLOAT(out);
}
case op_acosh:
{
case op_acosh: {
Float dbl, out;
dbl = get_float(t);
@ -574,8 +591,7 @@ eval1(Int fi, Term t USES_REGS) {
#endif
RFLOAT(out);
}
case op_atanh:
{
case op_atanh: {
Float dbl, out;
dbl = get_float(t);
@ -587,8 +603,7 @@ eval1(Int fi, Term t USES_REGS) {
#endif
RFLOAT(out);
}
case op_lgamma:
{
case op_lgamma: {
#if HAVE_LGAMMA
Float dbl;
@ -598,8 +613,7 @@ eval1(Int fi, Term t USES_REGS) {
RERROR();
#endif
}
case op_erf:
{
case op_erf: {
#if HAVE_ERF
Float dbl = get_float(t), out;
out = erf(dbl);
@ -608,8 +622,7 @@ eval1(Int fi, Term t USES_REGS) {
RERROR();
#endif
}
case op_erfc:
{
case op_erfc: {
#if HAVE_ERF
Float dbl = get_float(t), out;
out = erfc(dbl);
@ -626,8 +639,7 @@ eval1(Int fi, Term t USES_REGS) {
ISO only converts from float -> int/big
*/
case op_floor:
{
case op_floor: {
Float dbl;
switch (ETypeOfTerm(t)) {
@ -651,13 +663,13 @@ eval1(Int fi, Term t USES_REGS) {
#if HAVE_ISINF
if (isinf(dbl)) {
Yap_ArithError(EVALUATION_ERROR_INT_OVERFLOW, MkFloatTerm(dbl), "integer\
(%f)",dbl);
(%f)",
dbl);
}
#endif
RBIG_FL(floor(dbl));
}
case op_ceiling:
{
case op_ceiling: {
Float dbl;
switch (ETypeOfTerm(t)) {
case long_int_e:
@ -680,13 +692,13 @@ eval1(Int fi, Term t USES_REGS) {
#if HAVE_ISINF
if (isinf(dbl)) {
Yap_ArithError(EVALUATION_ERROR_INT_OVERFLOW, MkFloatTerm(dbl), "integer\
(%f)",dbl);
(%f)",
dbl);
}
#endif
RBIG_FL(ceil(dbl));
}
case op_round:
{
case op_round: {
Float dbl;
switch (ETypeOfTerm(t)) {
@ -710,14 +722,14 @@ eval1(Int fi, Term t USES_REGS) {
#if HAVE_ISINF
if (isinf(dbl)) {
Yap_ArithError(EVALUATION_ERROR_INT_OVERFLOW, MkFloatTerm(dbl), "integer\
(%f)",dbl);
(%f)",
dbl);
}
#endif
RBIG_FL(my_rint(dbl));
}
case op_truncate:
case op_integer:
{
case op_integer: {
Float dbl;
switch (ETypeOfTerm(t)) {
case long_int_e:
@ -739,7 +751,8 @@ eval1(Int fi, Term t USES_REGS) {
#endif
#if HAVE_ISINF
if (isinf(dbl)) {
Yap_ArithError(EVALUATION_ERROR_INT_OVERFLOW, MkFloatTerm(dbl), "integer (%f)",dbl);
Yap_ArithError(EVALUATION_ERROR_INT_OVERFLOW, MkFloatTerm(dbl),
"integer (%f)", dbl);
}
#endif
if (dbl < 0.0)
@ -842,17 +855,16 @@ eval1(Int fi, Term t USES_REGS) {
switch (ETypeOfTerm(t)) {
case long_int_e:
if (isoLanguageFlag()) { /* iso */
Yap_ArithError(TYPE_ERROR_FLOAT, t, "X is float_fractional_part(%f)", IntegerOfTerm(t));
Yap_ArithError(TYPE_ERROR_FLOAT, t, "X is float_fractional_part(%f)",
IntegerOfTerm(t));
} else {
RFLOAT(0.0);
}
case double_e:
{
case double_e: {
Float dbl;
dbl = FloatOfTerm(t);
RFLOAT(dbl-ceil(dbl));
}
break;
RFLOAT(dbl - ceil(dbl));
} break;
case big_int_e:
#ifdef USE_GMP
return Yap_gmp_float_fractional_part(t);
@ -863,7 +875,8 @@ eval1(Int fi, Term t USES_REGS) {
case op_fintp:
switch (ETypeOfTerm(t)) {
case long_int_e:
Yap_ArithError(TYPE_ERROR_FLOAT, t, "X is float_integer_part(%f)", IntegerOfTerm(t));
Yap_ArithError(TYPE_ERROR_FLOAT, t, "X is float_integer_part(%f)",
IntegerOfTerm(t));
case double_e:
RFLOAT(rint(FloatOfTerm(t)));
break;
@ -876,14 +889,12 @@ eval1(Int fi, Term t USES_REGS) {
}
case op_sign:
switch (ETypeOfTerm(t)) {
case long_int_e:
{
case long_int_e: {
Int x = IntegerOfTerm(t);
RINT((x > 0 ? 1 : (x < 0 ? -1 : 0)));
}
case double_e:
{
case double_e: {
Float dbl = FloatOfTerm(t);
@ -899,7 +910,7 @@ eval1(Int fi, Term t USES_REGS) {
case op_random1:
switch (ETypeOfTerm(t)) {
case long_int_e:
RINT(Yap_random()*IntegerOfTerm(t));
RINT(Yap_random() * IntegerOfTerm(t));
case double_e:
Yap_ArithError(TYPE_ERROR_INTEGER, t, "random(%f)", FloatOfTerm(t));
case big_int_e:
@ -914,14 +925,12 @@ eval1(Int fi, Term t USES_REGS) {
RERROR();
}
Term Yap_eval_unary(Int f, Term t)
{
Term Yap_eval_unary(Int f, Term t) {
CACHE_REGS
return eval1(f,t PASS_REGS);
return eval1(f, t PASS_REGS);
}
static InitUnEntry InitUnTab[] = {
{"+", op_uplus},
static InitUnEntry InitUnTab[] = {{"+", op_uplus},
{"-", op_uminus},
{"\\", op_unot},
{"exp", op_exp},
@ -954,22 +963,15 @@ static InitUnEntry InitUnTab[] = {
{"float_integer_part", op_fintp},
{"sign", op_sign},
{"lgamma", op_lgamma},
{"erf",op_erf},
{"erfc",op_erfc},
{"rational",op_rational},
{"rationalize",op_rationalize},
{"random", op_random1}
};
{"erf", op_erf},
{"erfc", op_erfc},
{"rational", op_rational},
{"rationalize", op_rationalize},
{"random", op_random1}};
Atom
Yap_NameOfUnaryOp(int i)
{
return Yap_LookupAtom(InitUnTab[i].OpName);
}
Atom Yap_NameOfUnaryOp(int i) { return Yap_LookupAtom(InitUnTab[i].OpName); }
static Int
p_unary_is( USES_REGS1 )
{ /* X is Y */
static Int p_unary_is(USES_REGS1) { /* X is Y */
Term t = Deref(ARG2);
Term top;
bool go;
@ -986,7 +988,7 @@ p_unary_is( USES_REGS1 )
i = IntegerOfTerm(t);
tout = eval1(i, top PASS_REGS);
return Yap_unify_constant(ARG1,tout);
return Yap_unify_constant(ARG1, tout);
} else if (IsAtomTerm(t)) {
Atom name = AtomOfTerm(t);
ExpEntry *p;
@ -999,48 +1001,44 @@ p_unary_is( USES_REGS1 )
return FALSE;
}
do {
out= eval1(p->FOfEE, top PASS_REGS);
out = eval1(p->FOfEE, top PASS_REGS);
go = Yap_CheckArithError();
} while(go);
return Yap_unify_constant(ARG1,out);
} while (go);
return Yap_unify_constant(ARG1, out);
}
return false;
}
static Int
p_unary_op_as_integer( USES_REGS1 )
{ /* X is Y */
static Int p_unary_op_as_integer(USES_REGS1) { /* X is Y */
Term t = Deref(ARG1);
if (IsVarTerm(t)) {
Yap_EvalError(INSTANTIATION_ERROR,t, "X is _Y");
return(FALSE);
Yap_EvalError(INSTANTIATION_ERROR, t, "X is _Y");
return (FALSE);
}
if (IsIntTerm(t)) {
return Yap_unify_constant(ARG2,t);
return Yap_unify_constant(ARG2, t);
}
if (IsAtomTerm(t)) {
Atom name = AtomOfTerm(t);
ExpEntry *p;
if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, 1)))) {
return Yap_unify(ARG1,ARG2);
return Yap_unify(ARG1, ARG2);
}
return Yap_unify_constant(ARG2,MkIntTerm(p->FOfEE));
return Yap_unify_constant(ARG2, MkIntTerm(p->FOfEE));
}
return(FALSE);
return (FALSE);
}
void
Yap_InitUnaryExps(void)
{
void Yap_InitUnaryExps(void) {
unsigned int i;
ExpEntry *p;
for (i = 0; i < sizeof(InitUnTab)/sizeof(InitUnEntry); ++i) {
for (i = 0; i < sizeof(InitUnTab) / sizeof(InitUnEntry); ++i) {
AtomEntry *ae = RepAtom(Yap_LookupAtom(InitUnTab[i].OpName));
if (ae == NULL) {
Yap_EvalError(RESOURCE_ERROR_HEAP,TermNil,"at InitUnaryExps");
Yap_EvalError(RESOURCE_ERROR_HEAP, TermNil, "at InitUnaryExps");
return;
}
WRITE_LOCK(ae->ARWLock);
@ -1048,7 +1046,7 @@ Yap_InitUnaryExps(void)
WRITE_UNLOCK(ae->ARWLock);
break;
}
p = (ExpEntry *) Yap_AllocAtomSpace(sizeof(ExpEntry));
p = (ExpEntry *)Yap_AllocAtomSpace(sizeof(ExpEntry));
p->KindOfPE = ExpProperty;
p->ArityOfEE = 1;
p->ENoOfEE = 1;
@ -1057,11 +1055,10 @@ Yap_InitUnaryExps(void)
WRITE_UNLOCK(ae->ARWLock);
}
Yap_InitCPred("is", 3, p_unary_is, TestPredFlag | SafePredFlag);
Yap_InitCPred("$unary_op_as_integer", 2, p_unary_op_as_integer, TestPredFlag|SafePredFlag);}
/* This routine is called from Restore to make sure we have the same arithmetic operators */
int
Yap_ReInitUnaryExps(void)
{
return TRUE;
Yap_InitCPred("$unary_op_as_integer", 2, p_unary_op_as_integer,
TestPredFlag | SafePredFlag);
}
/* This routine is called from Restore to make sure we have the same arithmetic
* operators */
int Yap_ReInitUnaryExps(void) { return TRUE; }

View File

@ -1,4 +1,3 @@
/*************************************************************************
* *
* Yap Prolog *

View File

@ -246,7 +246,7 @@ TCL_SUBST =
# members will be omitted, etc.
# The default value is: NO.
OPTIMIZE_OUTPUT_FOR_C = NO
OPTIMIZE_OUTPUT_FOR_C = YES
# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or
# Python sources only. Doxygen will then generate output that is more tailored

View File

@ -694,7 +694,7 @@ FILE_VERSION_FILTER =
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
# tag is left empty.
LAYOUT_FILE =
LAYOUT_FILE = @CMAKE_SOURCE_DIR@/docs/custom/DoxygenLayout.xml
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
# the reference definitions. This must be a list of .bib files. The .bib
@ -833,7 +833,8 @@ EXCLUDE_SYMLINKS = NO
# exclude all test directories for example use the pattern */test/*
EXCLUDE_PATTERNS = \
@PROJECT_SOURCE_DIR@/packages/gecode/gecode3_yap.cc \
@PROJECT_SOURCE_DIR@/*/bprolog/* \
@PROJECT_SOURCE_DIR@/*/prism/* \
@PROJECT_SOURCE_DIR@/packages/gecode/gecode4_yap.cc \
@PROJECT_SOURCE_DIR@/packages/gecode/gecode3.yap \
@PROJECT_SOURCE_DIR@/packages/gecode/gecode4.yap \
@ -1028,7 +1029,7 @@ VERBATIM_HEADERS = YES
# classes, structs, unions or interfaces.
# The default value is: YES.
ALPHABETICAL_INDEX = YES
ALPHABETICAL_INDEX = NO
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
# which the alphabetical index list will be split.
@ -1410,7 +1411,7 @@ DISABLE_INDEX = NO
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
GENERATE_TREEVIEW = YES
GENERATE_TREEVIEW = NO
# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that
# doxygen will group on one line in the generated HTML documentation.
@ -1598,7 +1599,7 @@ EXTRA_SEARCH_MAPPINGS =
# If the GENERATE_LATEX tag is set to YES, doxygen will generate LaTeX output.
# The default value is: YES.
GENERATE_LATEX = YES
GENERATE_LATEX = NO
# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
@ -1878,7 +1879,7 @@ MAN_LINKS = NOoi9 0
# captures the structure of the code including all documentation.
# The default value is: NO.
GENERATE_XML = YES
GENERATE_XML = NO
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of

View File

@ -6,7 +6,6 @@
main :-
%system('find . \( -name '*.pl' -o -name '*.yap' -o -name '*.c' -o -name '*.h' -o -name '*.cpp' -o -name '*.hh' \) -type f -print | xargs grep '@defgroup\|@ingroup\|@addtogroup\|@{|@}').
file_filter_with_start_end( docs, tmp, add2graph, initgraph, checkgraph).
initgraph(_,_).

View File

@ -0,0 +1,194 @@
<doxygenlayout version="1.0">
<!-- Generated by doxygen 1.8.14 -->
<!-- Navigation index tabs for HTML output -->
<!-- <navindex> -->
<!-- <tab type="mainpage" visible="yes" title=""/> -->
<!-- <tab type="pages" visible="yes" title="" intro=""/> -->
<!-- <tab type="modules" visible="yes" title="" intro=""/> -->
<!-- <tab type="namespaces" visible="yes" title=""> -->
<!-- <tab type="namespacelist" visible="yes" title="" intro=""/> -->
<!-- <tab type="namespacemembers" visible="yes" title="" intro=""/> -->
<!-- </tab> -->
<!-- <tab type="classes" visible="yes" title=""> -->
<!-- <tab type="classlist" visible="yes" title="" intro=""/> -->
<!-- <tab type="classindex" visible="$ALPHABETICAL_INDEX" title=""/> -->
<!-- <tab type="hierarchy" visible="yes" title="" intro=""/> -->
<!-- <tab type="classmembers" visible="yes" title="" intro=""/> -->
<!-- </tab> -->
<!-- <tab type="files" visible="yes" title=""> -->
<!-- <tab type="filelist" visible="yes" title="" intro=""/> -->
<!-- <tab type="globals" visible="yes" title="" intro=""/> -->
<!-- </tab> -->
<!-- <tab type="examples" visible="yes" title="" intro=""/> -->
<!-- </navindex> -->
<!-- Layout definition for a class page -->
<class>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<inheritancegraph visible="$CLASS_GRAPH"/>
<collaborationgraph visible="$COLLABORATION_GRAPH"/>
<memberdecl>
<nestedclasses visible="yes" title=""/>
<publictypes title=""/>
<services title=""/>
<interfaces title=""/>
<publicslots title=""/>
<signals title=""/>
<publicmethods title=""/>
<publicstaticmethods title=""/>
<publicattributes title=""/>
<publicstaticattributes title=""/>
<protectedtypes title=""/>
<protectedslots title=""/>
<protectedmethods title=""/>
<protectedstaticmethods title=""/>
<protectedattributes title=""/>
<protectedstaticattributes title=""/>
<packagetypes title=""/>
<packagemethods title=""/>
<packagestaticmethods title=""/>
<packageattributes title=""/>
<packagestaticattributes title=""/>
<properties title=""/>
<events title=""/>
<privatetypes title=""/>
<privateslots title=""/>
<privatemethods title=""/>
<privatestaticmethods title=""/>
<privateattributes title=""/>
<privatestaticattributes title=""/>
<friends title=""/>
<related title="" subtitle=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<services title=""/>
<interfaces title=""/>
<constructors title=""/>
<functions title=""/>
<related title=""/>
<variables title=""/>
<properties title=""/>
<events title=""/>
</memberdef>
<allmemberslink visible="yes"/>
<usedfiles visible="$SHOW_USED_FILES"/>
<authorsection visible="yes"/>
</class>
<!-- Layout definition for a namespace page -->
<namespace>
<briefdescription visible="yes"/>
<memberdecl>
<nestednamespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<classes visible="yes" title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection visible="yes"/>
</namespace>
<!-- Layout definition for a file page -->
<file>
<briefdescription visible="yes"/>
<includes visible="$SHOW_INCLUDE_FILES"/>
<includegraph visible="$INCLUDE_GRAPH"/>
<includedbygraph visible="$INCLUDED_BY_GRAPH"/>
<sourcelink visible="yes"/>
<memberdecl>
<classes visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<constantgroups visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<functions title=""/>
<variables title=""/>
</memberdef>
<authorsection/>
</file>
<!-- Layout definition for a group page -->
<group>
<briefdescription visible="yes"/>
<groupgraph visible="$GROUP_GRAPHS"/>
<memberdecl>
<nestedgroups visible="yes" title=""/>
<dirs visible="yes" title=""/>
<files visible="yes" title=""/>
<namespaces visible="yes" title=""/>
<classes visible="yes" title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
<membergroups visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
<memberdef>
<pagedocs/>
<inlineclasses title=""/>
<defines title=""/>
<typedefs title=""/>
<enums title=""/>
<enumvalues title=""/>
<functions title=""/>
<variables title=""/>
<signals title=""/>
<publicslots title=""/>
<protectedslots title=""/>
<privateslots title=""/>
<events title=""/>
<properties title=""/>
<friends title=""/>
</memberdef>
<authorsection visible="yes"/>
</group>
<!-- Layout definition for a directory page -->
<directory>
<briefdescription visible="yes"/>
<directorygraph visible="yes"/>
<memberdecl>
<dirs visible="yes"/>
<files visible="yes"/>
</memberdecl>
<detaileddescription title=""/>
</directory>
</doxygenlayout>

View File

@ -1,5 +1,3 @@
* { box-sizing:border-box }
h1, .h1, h2, .h2, h3, .h3{
font-weight: 200 !important;
}
@ -10,12 +8,17 @@ h1, .h1, h2, .h2, h3, .h3{
.adjust-right {
margin-left: 30px !important;
margin-right: 30px !important;
Font-size: 1.15em !important;
font-size: 1.15em !important;
}
.navbar{
border: 0px solid #222 !important;
}
table{
white-space:pre-wrap !important;
}
/*
===========================
*/
/* Sticky footer styles
@ -145,8 +148,8 @@ div.fragment {
}
div.line {
font-family: monospace, fixed;
font-size: 13px;
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 12px;
min-height: 13px;
line-height: 1.0;
text-wrap: unrestricted;
@ -154,7 +157,7 @@ div.line {
white-space: -pre-wrap; /* Opera 4-6 */
white-space: -o-pre-wrap; /* Opera 7 */
white-space: pre-wrap; /* CSS3 */
word-wrap: break-word; /* IE 5.5+ */
word-wrap: normal; /* IE 5.5+ */
text-indent: -53px;
padding-left: 53px;
padding-bottom: 0px;
@ -170,6 +173,9 @@ div.line {
transition-property: background-color, box-shadow;
transition-duration: 0.5s;
}
div.line:hover{
background-color: #FBFF00;
}
div.line.glow {
background-color: cyan;
@ -180,16 +186,21 @@ div.line.glow {
span.lineno {
padding-right: 4px;
text-align: right;
border-right: 2px solid #0F0;
background-color: #E8E8E8;
color:rgba(0,0,0,0.3);
border-right: 1px solid #EEE;
border-left: 1px solid #EEE;
background-color: #FFF;
white-space: pre;
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace ;
}
span.lineno a {
background-color: #D8D8D8;
background-color: #FAFAFA;
cursor:pointer;
}
span.lineno a:hover {
background-color: #C8C8C8;
background-color: #EFE200;
color: #1e1e1e;
}
div.groupHeader {
@ -256,3 +267,104 @@ blockquote {
padding: 0 12px 0 16px;
}
/*---------------- Search Box */
#search-box {
margin: 10px 0px;
}
#search-box .close {
display: none;
position: absolute;
right: 0px;
padding: 6px 12px;
z-index: 5;
}
/*---------------- Search results window */
#search-results-window {
display: none;
}
iframe#MSearchResults {
width: 100%;
height: 15em;
}
.SRChildren {
padding-left: 3ex; padding-bottom: .5em
}
.SRPage .SRChildren {
display: none;
}
a.SRScope {
display: block;
}
a.SRSymbol:focus, a.SRSymbol:active,
a.SRScope:focus, a.SRScope:active {
text-decoration: underline;
}
span.SRScope {
padding-left: 4px;
}
.SRResult {
display: none;
}
/* class and file list */
.directory .icona,
.directory .arrow {
height: auto;
}
.directory .icona .icon {
height: 16px;
}
.directory .icondoc {
background-position: 0px 0px;
height: 20px;
}
.directory .iconfopen {
background-position: 0px 0px;
}
.directory td.entry {
padding: 7px 8px 6px 8px;
}
.table > tbody > tr > td.memSeparator {
line-height: 0;
.table-hover;
}
.memItemLeft, .memTemplItemLeft {
white-space: normal;
}
/* enumerations */
.panel-body thead > tr {
background-color: #e0e0e0;
}
/* todo lists */
.todoname,
.todoname a {
font-weight: bold;
}
/* Class title */
.summary {
margin-top: 25px;
}
.page-header {
margin: 20px 0px !important;
}
.page-header .title {
display: inline-block;
}
.page-header .pull-right {
margin-top: 0.3em;
margin-left: 0.5em;
}
.page-header .label {
font-size: 50%;
}

View File

@ -4,7 +4,6 @@ $( document ).ready(function() {
$("div.title").addClass("h1");
$('li > a[href="index.html"] > span').before("<i class='fa fa-cog'></i> ");
$('li > a[href="index.html"] > span').text("BioGears");
$('li > a[href="modules.html"] > span').before("<i class='fa fa-square'></i> ");
$('li > a[href="namespaces.html"] > span').before("<i class='fa fa-bars'></i> ");
$('li > a[href="annotated.html"] > span').before("<i class='fa fa-list-ul'></i> ");
@ -14,7 +13,7 @@ $( document ).ready(function() {
$('li > a[href="functions_func.html"] > span').before("<i class='fa fa-list'></i> ");
$('li > a[href="functions_vars.html"] > span').before("<i class='fa fa-list'></i> ");
$('li > a[href="functions_enum.html"] > span').before("<i class='fa fa-list'></i> ");
$('li > a[href="functions_YapEval.html"] > span').before("<i class='fa fa-list'></i> ");
$('li > a[href="functions_eval.html"] > span').before("<i class='fa fa-list'></i> ");
$('img[src="ftv2ns.png"]').replaceWith('<span class="label label-danger">N</span> ');
$('img[src="ftv2cl.png"]').replaceWith('<span class="label label-danger">C</span> ');
@ -27,7 +26,7 @@ $( document ).ready(function() {
$("#nav-path > ul").addClass("breadcrumb");
$("table.params").addClass("table");
$("div.ingroups").wrapInner("<small></small>");
$("div.ingroups").wrapInner("<span class='text-nowrap'></span>");
$("div.levels").css("margin", "0.5em");
$("div.levels > span").addClass("btn btn-default btn-xs");
$("div.levels > span").css("margin-right", "0.25em");
@ -54,10 +53,8 @@ $( document ).ready(function() {
$("div.ttname a").css("color", 'white');
$("div.ttdef,div.ttdoc,div.ttdeci").addClass("panel-body");
$('#MSearchBox').parent().remove();
$('div.fragment.well div.line:first').css('margin-top', '15px');
$('div.fragment.well div.line:last').css('margin-bottom', '15px');
$('div.fragment.well div.line:first').css('margin-top', '2px');
$('div.fragment.well div.line:last').css('margin-bottom', '2px');
$('table.doxtable').removeClass('doxtable').addClass('table table-striped table-bordered').each(function(){
$(this).prepend('<thead></thead>');
@ -80,6 +77,11 @@ $( document ).ready(function() {
$(this).siblings('.memItemLeft').attr('align', 'left');
});
$('table.memberdecls').find('.memTemplItemRight').each(function(){
$(this).contents().appendTo($(this).siblings('.memTemplItemLeft'));
$(this).siblings('.memTemplItemLeft').attr('align', 'left');
});
function getOriginalWidthOfImg(img_element) {
var t = new Image();
t.src = (img_element.getAttribute ? img_element.getAttribute("src") : false) || img_element.src;
@ -91,6 +93,147 @@ $( document ).ready(function() {
$(this).css('width', '100%');
});
/* responsive search box */
$('#MSearchBox').parent().remove();
var nav_container = $('<div class="row"></div>');
$('#navrow1').parent().prepend(nav_container);
var left_nav = $('<div class="col-md-9"></div>');
for (i = 0; i < 6; i++) {
var navrow = $('#navrow' + i + ' > ul.tablist').detach();
left_nav.append(navrow);
$('#navrow' + i).remove();
}
var right_nav = $('<div class="col-md-3"></div>').append('\
<div id="search-box" class="input-group">\
<div class="input-group-btn">\
<button aria-expanded="false" type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">\
<span class="glyphicon glyphicon-search"></span> <span class="caret"></span>\
</button>\
<ul class="dropdown-menu">\
</ul>\
</div>\
<button id="search-close" type="button" class="close" aria-label="Close"><span aria-hidden="true">&times;</span></button>\
<input id="search-field" class="form-control" accesskey="S" onkeydown="searchBox.OnSearchFieldChange(event);" placeholder="Search ..." type="text">\
</div>');
$(nav_container).append(left_nav);
$(nav_container).append(right_nav);
$('#MSearchSelectWindow .SelectionMark').remove();
var search_selectors = $('#MSearchSelectWindow .SelectItem');
for (var i = 0; i < search_selectors.length; i += 1) {
var element_a = $('<a href="#"></a>').text($(search_selectors[i]).text());
element_a.click(function(){
$('#search-box .dropdown-menu li').removeClass('active');
$(this).parent().addClass('active');
searchBox.OnSelectItem($('#search-box li a').index(this));
searchBox.Search();
return false;
});
var element = $('<li></li>').append(element_a);
$('#search-box .dropdown-menu').append(element);
}
$('#MSearchSelectWindow').remove();
$('#search-box .close').click(function (){
searchBox.CloseResultsWindow();
});
$('body').append('<div id="MSearchClose"></div>');
$('body').append('<div id="MSearchBox"></div>');
$('body').append('<div id="MSearchSelectWindow"></div>');
searchBox.searchLabel = '';
searchBox.DOMSearchField = function() {
return document.getElementById("search-field");
}
searchBox.DOMSearchClose = function(){
return document.getElementById("search-close");
}
/* search results */
var results_iframe = $('#MSearchResults').detach();
$('#MSearchResultsWindow')
.attr('id', 'search-results-window')
.addClass('panel panel-default')
.append(
'<div class="panel-heading">\
<h3 class="panel-title">Search Results</h3>\
</div>\
<div class="panel-body"></div>'
);
$('#search-results-window .panel-body').append(results_iframe);
searchBox.DOMPopupSearchResultsWindow = function() {
return document.getElementById("search-results-window");
}
function update_search_results_window() {
$('#search-results-window').removeClass('panel-default panel-success panel-warning panel-danger')
var status = $('#MSearchResults').contents().find('.SRStatus:visible');
if (status.length > 0) {
switch(status.attr('id')) {
case 'Loading':
case 'Searching':
$('#search-results-window').addClass('panel-warning');
break;
case 'NoMatches':
$('#search-results-window').addClass('panel-danger');
break;
default:
$('#search-results-window').addClass('panel-default');
}
} else {
$('#search-results-window').addClass('panel-success');
}
}
$('#MSearchResults').load(function() {
$('#MSearchResults').contents().find('link[href="search.css"]').attr('href','../doxygen.css');
$('#MSearchResults').contents().find('head').append(
'<link href="../customdoxygen.css" rel="stylesheet" type="text/css">');
update_search_results_window();
// detect status changes (only for search with external search backend)
var observer = new MutationObserver(function(mutations) {
update_search_results_window();
});
var config = { attributes: true};
var targets = $('#MSearchResults').contents().find('.SRStatus');
for (i = 0; i < targets.length; i++) {
observer.observe(targets[i], config);
}
});
/* enumerations */
$('table.fieldtable').removeClass('fieldtable').addClass('table table-striped table-bordered').each(function(){
$(this).prepend('<thead></thead>');
$(this).find('tbody > tr:first').prependTo($(this).find('thead'));
$(this).find('td > span.success').parent().addClass('success');
$(this).find('td > span.warning').parent().addClass('warning');
$(this).find('td > span.danger').parent().addClass('danger');
});
/* todo list */
var todoelements = $('.contents > .textblock > dl.reflist > dt, .contents > .textblock > dl.reflist > dd');
for (var i = 0; i < todoelements.length; i += 2) {
$('.contents > .textblock').append(
'<div class="panel panel-default active">'
+ "<div class=\"panel-heading todoname\">" + $(todoelements[i]).html() + "</div>"
+ "<div class=\"panel-body\">" + $(todoelements[i+1]).html() + "</div>"
+ '</div>');
}
$('.contents > .textblock > dl').remove();
$(".memitem").removeClass('memitem');
$(".memproto").removeClass('memproto');
$(".memdoc").removeClass('memdoc');
@ -118,4 +261,11 @@ $( document ).ready(function() {
$(this).siblings('.memItemRight').remove();
}
});
$('td.memTemplItemLeft').each(function(){
if($(this).siblings('.memTemplItemRight').html()=="") {
$(this).attr('colspan', 2);
$(this).siblings('.memTemplItemRight').remove();
}
});
searchBox.CloseResultsWindow();
});

View File

@ -1,14 +1,14 @@
<!-- HTML footer for doxygen 1.8.8-->
<!-- start footer part -->
<!--BEGIN GENERATE_TREEVIEW-->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
$navpath
<li class="footer">$generatedby
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
</ul>
</div>
<!-- <div id="nav-path" class="navpath"><\!-- id is needed for treeview function! -\-> -->
<!-- <ul> -->
<!-- $navpath -->
<!-- <li class="footer">$generatedby -->
<!-- <a href="http://www.doxygen.org/index.html"> -->
<!-- <img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> $doxygenversion </li> -->
<!-- </ul> -->
<!-- </div> -->
<!--END GENERATE_TREEVIEW-->
</div>
</div>

View File

@ -3,81 +3,99 @@
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- For Mobile Devices -->
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta name="generator" content="Doxygen $doxygenversion"/
<script type="text/javascript" src="$relpathd^jquery-3.2.1.js"></script>
<!-- Bootstrap CSS -->
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="$relpath^dynsections.js"></script>
$treeview
$search
$mathjax
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<meta name="generator" content="Doxygen $doxygenversion"/>
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
<!--<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>-->
$extrastylesheet
<link rel="stylesheet" href="$relpath^bootstrap.min.css">
<script src="$relpath^bootstrap.min.js"></script>
<!-- $treeview -->
<!-- $search -->
$mathjax
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
<script type="text/javascript" src="$relpath^doxy-boot.js"></script>
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
.sidebar-nav {
padding: 9px 0;
}
@media (max-width: 980px) {
/* Enable use of floated navbar text */
.navbar-text.pull-right {
float: none;
padding-left: 5px;
padding-right: 5px;
}
}
</style>
<!-- <link href="$relpath^assets/css/bootstrap-responsive.css" rel="stylesheet"> -->
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="../assets/js/html5shiv.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="$relpath^assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href=" $relpath^assets/ico/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72" href="$relpath^assets/ico/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed" href="$relpath^assets/ico/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="$relpath^assets/ico/favicon.png">
</head>
<body>
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<!-- this div, it is closed by doxygen! -->
<div id="titlearea">
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<a class="navbar-brand" href="#">$projectname $projectnumber</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<a class="brand" href="#">Project name</a>
<div class="nav-collapse collapse">
<p class="navbar-text pull-right">
Logged in as <a href="#" class="navbar-link">Username</a>
</p>
<ul class="nav">
<li class="active"><a href="#">Home</a></li>
<li><a href="#about">About</a></li>
<li><a href="#contact">Contact</a></li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid"> <div class="col-sm-12 panel panel-default" style="padding-bottom: 15px;">
<div style="margin-bottom: 15px;">
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
</li>
<li class="nav-item">
<a class="nav-link" href="#">Link</a>
</li>
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Dropdown
</a>
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</li>
<li class="nav-item">
<a class="nav-link disabled" href="#">Disabled</a>
</li>
</ul>
<form class="form-inline my-2 my-lg-0">
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
</form>
</div>
</nav> <!--BEGIN TITLEAREA-->
<!-- <table cellspacing="0" cellpadding="0"> -->
<!-- <tbody> -->
<!-- <tr style="height: 56px;"> -->
<!-- <\!--BEGIN PROJECT_LOGO-\-> -->
<!-- <td id="projectlogo"><img alt="Logo" src="$relpath^$projectlogo"/></td> -->
<!-- <\!--END PROJECT_LOGO-\-> -->
<!-- <\!--BEGIN PROJECT_NAME-\-> -->
<!-- <td id="projectalign" style="padding-left: 0.5em;"> -->
<!-- <div id="projectname">$projectname -->
<!-- <\!--BEGIN PROJECT_NUMBER-\->&#160;<span id="projectnumber">$projectnumber</span><\!--END PROJECT_NUMBER-\-> -->
<!-- </div> -->
<!-- <\!--BEGIN PROJECT_BRIEF-\-><div id="projectbrief">$projectbrief</div><\!--END PROJECT_BRIEF-\-> -->
<!-- </td> -->
<!-- <\!--END PROJECT_NAME-\-> -->
<!-- <\!--BEGIN !PROJECT_NAME-\-> -->
<!-- <\!--BEGIN PROJECT_BRIEF-\-> -->
<!-- <td style="padding-left: 0.5em;"> -->
<!-- <div id="projectbrief">$projectbrief</div> -->
<!-- </td> -->
<!-- <\!--END PROJECT_BRIEF-\-> -->
<!-- <\!--END !PROJECT_NAME-\-> -->
<!-- <\!--BEGIN DISABLE_INDEX-\-> -->
<!-- <\!--BEGIN SEARCHENGINE-\-> -->
<!-- <td>$Search</td> -->
<!-- <\!--END SEARCHENGINE-\-> -->
<!-- <\!--END DISABLE_INDEX-\-> -->
<!-- </tr> -->
<!-- </tbody> -->
<!-- </table> -->
</div>
<!--END TITLEAREA-->
<!-- end header part -->

View File

@ -1,6 +1,6 @@
Installing YAP {#install}
Installing YAP {#INSTALL}
++++++++
### Downloading YAP {#download}

View File

@ -5,7 +5,7 @@
![The YAP Logo](docs/icons/yap_128x128x32.png)
</center>
NOTE: this version of YAP is still experimental, documentation may be missing or brout of date.
NOTE: this version of YAP is still experimental, documentation may be missing or out of date.
## Introduction

View File

@ -1,4 +1,3 @@
#include "sysbits.h"
#if HAVE_SIGINFO_H

View File

@ -300,9 +300,10 @@ be lost.
'$execute_nonstop'(G,Mod).
'$trace'([Mod|G]) :-
CP is '$last_choice_pt',
'$trace_query'(G, Mod, CP, G, EG),
gated_call(
'$debugger_input',
'$trace_query'(G, Mod, CP, not_expanded),
EG,
E,
'$continue_debugging'(E)
).
@ -388,81 +389,48 @@ be lost.
'$trace_meta_call'( G, M, CP ) :-
'$trace_query'(G, M, CP, not_expanded ).
'$trace_query'(G, M, CP, G, EG ),
call(EG).
%% @pred '$trace_query'( +G, +M, +CP, +Expanded)
%
% debug a complex query
%
'$trace_query'(V, M, CP, _) :-
'$creep',
!,
'$call'(V,M,V,CP).
'$trace_query'(V, M, CP, _) :-
var(V), !,
'$trace_query'(call(V), M, CP, _).
'$trace_query'(!, _, CP, _) :-
!,
'$$cut_by'(CP).
'$trace_query'('$cut_by'(M), _, _, _) :-
!,
'$$cut_by'(M).
'$trace_query'('$$cut_by'(M), _, _, _) :-
!,
'$$cut_by'(M).
'$trace_query'(true, _, _, _) :- !.
%'$trace_query'(fail, _, _, _) :- !, fail.
'$trace_query'(M:G, _, CP, Expanded) :-
'$trace_query'(V, M, CP, _, '$trace'([M|V],CP)) :-
var(V), !.
'$trace_query'(!, _, CP, _, '$$cut_by'(CP)) :-
!.
'$trace_query'('$cut_by'(M), _, _, _, '$$cut_by'(M)) :-
!.
'$trace_query'('$$cut_by'(M), _, _, _, '$$cut_by'(M)) :-
!.
'$trace_query'(true, _, _, _, true) :- !.
'$trace_query'(fail, _, _, _, '$trace'(fail)) :- !.
'$trace_query'(M:G, _, CP,S, Expanded) :-
!,
'$yap_strip_module'(M:G, M0, G0),
'$trace_query'(G0, M0, CP, Expanded ).
'$trace_query'((A,B), M, CP, Expanded) :- !,
'$trace_query'(A, M, CP, Expanded),
'$trace_query'(B, M, CP, Expanded).
'$trace_query'((T->A;B), M, CP, Expanded) :- !,
( '$trace_query'(T, M, CP, Expanded) -> '$trace_query'(A, M, CP, Expanded)
;
'$trace_query'(B, M, CP, Expanded)
).
'$trace_query'((T->A|B), M, CP, Expanded) :- !,
(
'$trace_query'(T, M, CP, Expanded)
->
'$trace_query'(A, M, CP, Expanded)
;
'$trace_query'(B, M, CP, Expanded)
).
'$trace_query'((T->A), M, CP, Expanded) :- !,
( '$trace_query'(T, M, CP, Expanded) -> '$trace_query'(A, M, CP, Expanded) ).
'$trace_query'((A;B), M, CP, Expanded) :- !,
(
'$trace_query'(A, M, CP, Expanded)
;
'$trace_query'(B, M, CP, Expanded)
).
'$trace_query'((A|B), M, CP, Expanded) :- !,
(
'$trace_query'(A, M, CP, Expanded )
;
'$trace_query'(B, M, CP, Expanded )
).
'$trace_query'((\+G), M, CP, Expanded) :- !,
\+ '$trace_query'(G, M, CP, Expanded).
'$trace_query'((not(G)), M, CP, Expanded) :- !,
\+ '$trace_query'(G, M, CP, Expanded).
'$trace_query'(once(G), M, CP, Expanded) :- !,
once( '$trace_query'(G, M, CP, Expanded) ).
'$trace_query'(ignore(G), M, CP, Expanded) :- !,
ignore( '$trace_query'(G, M, CP, Expanded) ).
'$trace_query'(G, M, _CP, _) :-
'$trace_query'(G0, M0, CP,S, Expanded ).
'$trace_query'((A,B), M, CP, S, (EA,EB)) :- !,
'$trace_query'(A, M, CP, S, EA),
'$trace_query'(B, M, CP, S, EB).
'$trace_query'((A->B), M, CP, S, (EA->EB)) :- !,
'$trace_query'(A, M, CP, S, EA),
'$trace_query'(B, M, CP, S, EB).
'$trace_query'((A;B), M, CP, S, (EA;EB)) :- !,
'$trace_query'(A, M, CP, S, EA),
'$trace_query'(B, M, CP, S, EB).
'$trace_query'((A|B), M, CP, S, (EA|EB)) :- !,
'$trace_query'(A, M, CP, S, EA),
'$trace_query'((\+ A), M, CP, S, (\+ EA)) :- !,
'$trace_query'(A, M, CP, S, EA).
'$trace_query'(G, M, _CP, _, (
% spy a literal
'$id_goal'(L),
catch(
'$trace_goal'(G, M, L, H),
E,
'$re_trace_query'(E, G, M, L, H)
).
))).
%% @pred $trace_goal( +Goal, +Module, +CallId, +CallInfo)
%%
@ -605,7 +573,8 @@ be lost.
CP is '$last_choice_pt',
clause(M:G, Cl, _),
'$retry_clause'(GoalNumber, G, M, Info, X),
'$trace_query'(Cl, M, CP, expanded).
'$trace_query'(Cl, M, CP, Cl, ECl),
'$execute0'(ECl,M).
'$creep_step'(GoalNumber, G, M, Info) :-
X=marker(_,M,G),

View File

@ -832,7 +832,7 @@ gated_call(Setup, Goal, Catcher, Cleanup) :-
Task0 = cleanup( All, Catcher, Cleanup, Tag, true, CP0),
TaskF = cleanup( All, Catcher, Cleanup, Tag, false, CP0),
'$tag_cleanup'(CP0, Task0),
'$execute_nonstop'( Goal ),
call( Goal ),
'$cleanup_on_exit'(CP0, TaskF).