diff --git a/C/atomic.c b/C/atomic.c
index a7447c58d..4fb14bb92 100755
--- a/C/atomic.c
+++ b/C/atomic.c
@@ -18,11 +18,14 @@
static char SccsId[] = "%W% %G%";
#endif
-/** @addgroup Predicates_on_Atoms Predicates on Atoms and Strings
- @ingroup YAPChars
-@{
+/**
+ * @file atomic.c
+ *
+ * @defgroup Predicates_on_Atoms Predicates on Atoms and Strings
+ * @ingroup builtins
+ * @{
-The following predicates are used to manipulate atoms:
+@brief The following predicates are used to manipulate atoms, strings, lists of codes and lists of chars:
\toc
diff --git a/C/attvar.c b/C/attvar.c
index dbb5e39dd..09bcbe8c3 100644
--- a/C/attvar.c
+++ b/C/attvar.c
@@ -1,4 +1,4 @@
-0/*************************************************************************
+/*************************************************************************
* *
* YAP Prolog *
* *
@@ -28,11 +28,11 @@ static char SccsId[] = "%W% %G%";
#define NULL (void *)0
#endif
-/**
+/**
@file attvar.c
- @{
@defgroup AttributeVariables_Builtins Implementation of Attribute Declarations
- @ingroup AttributeVariables
+ @{
+ @ingroup attributes
*/
#ifdef COROUTINING
diff --git a/C/c_interface.c b/C/c_interface.c
index fcee1057e..53e99c6ca 100755
--- a/C/c_interface.c
+++ b/C/c_interface.c
@@ -17,7 +17,9 @@
*************************************************************************/
/**
-@file c_interface.c
+ * @file c_interface.c
+ *
+ * @addtogroup ChYInterface
*/
#ifndef C_INTERFACE_C
@@ -175,11 +177,6 @@ X_API void YAP_SlotsToArgs(int HowMany, YAP_handle_t slot);
/// @}
-/**
-@addtogroup c-interface
-@{
-*/
-
static arity_t current_arity(void) {
CACHE_REGS
if (P && PREVOP(P, Osbpp)->opc == Yap_opcode(_call_usercpred)) {
diff --git a/C/init.c b/C/init.c
index 29b29de81..e024e4e50 100755
--- a/C/init.c
+++ b/C/init.c
@@ -103,7 +103,7 @@ void *YAP_save;
/**
@defgroup Operators Summary of YAP Predefined Operators
-@ingroup Syntax
+@ingroup YAPSyntax
@{
The Prolog syntax caters for operators of three main kinds:
diff --git a/C/parser.c b/C/parser.c
index 0ab33b69b..1ae196775 100755
--- a/C/parser.c
+++ b/C/parser.c
@@ -20,17 +20,14 @@ static char SccsId[] = "%W% %G%";
/**
-@defgroup YAPSyntax YAP Syntax
-@ingroup YAPProgramming
-@{
+@addtogroup YAPSyntax
-We will describe the syntax of YAP at two levels. We first will
describe the syntax for Prolog terms. In a second level we describe
the \a tokens from which Prolog \a terms are
built.
@defgroup Formal_Syntax Syntax of Terms
-@ingroup Syntax
+@ingroup YAPSyntax
@{
Below, we describe the syntax of YAP terms from the different
diff --git a/C/scanner.c b/C/scanner.c
index 0b3b2570c..c5bde12e0 100755
--- a/C/scanner.c
+++ b/C/scanner.c
@@ -35,7 +35,7 @@
/**
@defgroup Formal_Syntax Syntax of Terms
-@ingroup Syntax
+@ingroup YAPSyntax
@{
diff --git a/C/utilpreds.c b/C/utilpreds.c
index e537d93a9..0f629a59f 100644
--- a/C/utilpreds.c
+++ b/C/utilpreds.c
@@ -17,7 +17,8 @@
#ifdef SCCS
static char SccsId[] = "@(#)utilpreds.c 1.3";
#endif
-/** @addtogroup YAP_Terms
+/**
+ * @addtogroup Terms
*/
@@ -99,7 +100,7 @@ copy_complex_term(CELL *pt0, CELL *pt0_end, int share, int newattvs, CELL *ptf,
/* If this is newer than the current term, just reuse */
*ptf++ = d0;
continue;
- }
+ }
*ptf = AbsPair(HR);
ptf++;
#ifdef RATIONAL_TREES
@@ -143,7 +144,7 @@ copy_complex_term(CELL *pt0, CELL *pt0_end, int share, int newattvs, CELL *ptf,
/* If this is newer than the current term, just reuse */
*ptf++ = d0;
continue;
- }
+ }
f = (Functor)(*ap2);
if (IsExtensionFunctor(f)) {
@@ -235,15 +236,15 @@ copy_complex_term(CELL *pt0, CELL *pt0_end, int share, int newattvs, CELL *ptf,
derefa_body(d0, ptd0, copy_term_unk, copy_term_nvar);
ground = FALSE;
- if (ptd0 >= HLow && ptd0 < HR) {
+ if (ptd0 >= HLow && ptd0 < HR) {
/* we have already found this cell */
*ptf++ = (CELL) ptd0;
- } else
+ } else
#if COROUTINING
if (newattvs && IsAttachedTerm((CELL)ptd0)) {
/* if unbound, call the standard copy term routine */
struct cp_frame *bp;
-
+
CELL new;
bp = to_visit;
@@ -484,7 +485,7 @@ CopyTerm(Term inp, UInt arity, int share, int newattvs USES_REGS) {
return tf;
}
}
-
+
Term
Yap_CopyTerm(Term inp) {
CACHE_REGS
@@ -497,27 +498,27 @@ Yap_CopyTermNoShare(Term inp) {
return CopyTerm(inp, 0, FALSE, FALSE PASS_REGS);
}
-static Int
+static Int
p_copy_term( USES_REGS1 ) /* copy term t to a new instance */
{
- Term t = CopyTerm(ARG1, 2, TRUE, TRUE PASS_REGS);
+ Term t = CopyTerm(ARG1, 2, TRUE, TRUE PASS_REGS);
if (t == 0L)
return FALSE;
/* be careful, there may be a stack shift here */
return Yap_unify(ARG2,t);
}
-static Int
+static Int
p_duplicate_term( USES_REGS1 ) /* copy term t to a new instance */
{
- Term t = CopyTerm(ARG1, 2, FALSE, TRUE PASS_REGS);
+ Term t = CopyTerm(ARG1, 2, FALSE, TRUE PASS_REGS);
if (t == 0L)
return FALSE;
/* be careful, there may be a stack shift here */
return Yap_unify(ARG2,t);
}
-static Int
+static Int
p_copy_term_no_delays( USES_REGS1 ) /* copy term t to a new instance */
{
Term t = CopyTerm(ARG1, 2, TRUE, FALSE PASS_REGS);
@@ -544,7 +545,7 @@ add_to_list( Term *out_e, Term v, Term t USES_REGS)
ta[0] = v;
ta[1] = t;
*out_e = tv = MkPairTerm(Yap_MkApplTerm( FunctorEq, 2, ta ), TermNil);
- return RepPair(tv)+1;
+ return RepPair(tv)+1;
}
static int
@@ -585,11 +586,11 @@ break_rationals_complex_term(CELL *pt0, CELL *pt0_end, CELL *ptf, Term *of, Term
if (!IsVarTerm(*newp)) {
Term v = (CELL)newp, t = *newp;
RESET_VARIABLE(newp);
- of = add_to_list( of, v, t PASS_REGS);
+ of = add_to_list( of, v, t PASS_REGS);
}
*ptf++ = (CELL)newp;
continue;
- }
+ }
new = (CELL)ptf;
*ptf++ = AbsPair(HR);
if (pt0 < pt0_end) {
@@ -620,8 +621,8 @@ break_rationals_complex_term(CELL *pt0, CELL *pt0_end, CELL *ptf, Term *of, Term
}
if (IsVarTerm(first = ap2[1]) && (newp = (CELL*)first) && newp >= HB && newp < HR) {
goto found_term;
- }
- // new
+ }
+ // new
/* store the terms to visit */
new = (CELL)ptf;
*ptf++ = AbsAppl(HR);
@@ -737,9 +738,9 @@ BreakRational(Term inp, UInt arity, Term *of, Term oi USES_REGS) {
return Hi[0];
}
}
-
+
static Int
-p_break_rational( USES_REGS1 )
+p_break_rational( USES_REGS1 )
{
Term tf;
return Yap_unify(ARG2, BreakRational(ARG1, 4, &tf, ARG4 PASS_REGS)) &&
@@ -748,7 +749,7 @@ p_break_rational( USES_REGS1 )
static Int
-p_break_rational3( USES_REGS1 )
+p_break_rational3( USES_REGS1 )
{
Term tf;
return Yap_unify(ARG2, BreakRational(ARG1, 4, &tf, TermNil PASS_REGS)) &&
@@ -756,7 +757,7 @@ p_break_rational3( USES_REGS1 )
}
-/*
+/*
FAST EXPORT ROUTINE. Export a Prolog term to something like:
CELL 0: offset for start of term
@@ -789,15 +790,15 @@ CELL *AdjustSize(CELL *x, char *buf)
}
/* export an atom from the symbol table to a buffer */
-static inline
+static inline
Atom export_atom(Atom at, char **hpp, char *buf, size_t len)
-{
+{
char *ptr, *p0;
size_t sz;
ptr = *hpp;
ptr = (char *)AdjustSize((CELL*)ptr, buf);
-
+
p0 = ptr;
*ptr++ = 0;
sz = strlen(RepAtom(at)->StrOfAE);
@@ -809,7 +810,7 @@ Atom export_atom(Atom at, char **hpp, char *buf, size_t len)
}
/* place a buffer: first arity then the atom */
-static inline
+static inline
Functor export_functor(Functor f, char **hpp, char *buf, size_t len)
{
CELL *hptr = AdjustSize((CELL *)*hpp, buf);
@@ -844,7 +845,7 @@ export_term_to_buffer(Term inpt, char *buf, char *bptr, CELL *t0 , CELL *tf, siz
if (buf + len < (char *)((CELL *)td + (tf-t0))) {
return FALSE;
}
- memcpy((void *)td, (void *)t0, (tf-t0)* sizeof(CELL));
+ memcpy((void *)td, (void *)t0, (tf-t0)* sizeof(CELL));
bf[0] = (td-buf);
bf[1] = (tf-t0);
bf[2] = inpt;
@@ -880,7 +881,7 @@ export_complex_term(Term tf, CELL *pt0, CELL *pt0_end, char * buf, size_t len0,
/* If this is newer than the current term, just reuse */
*ptf++ = d0;
continue;
- }
+ }
*ptf = AbsPair(CellDifH(HR,HLow));
ptf++;
#ifdef RATIONAL_TREES
@@ -923,7 +924,7 @@ export_complex_term(Term tf, CELL *pt0, CELL *pt0_end, char * buf, size_t len0,
/* If this is newer than the current term, just reuse */
*ptf++ = d0;
continue;
- }
+ }
f = (Functor)(*ap2);
*ptf++ = AbsAppl(CellDifH(HR,HLow));
@@ -1002,7 +1003,7 @@ export_complex_term(Term tf, CELL *pt0, CELL *pt0_end, char * buf, size_t len0,
export_derefa_body(d0, ptd0, export_term_unk, export_term_nvar);
ground = FALSE;
- if (ptd0 < CellDifH(HR,HLow)) {
+ if (ptd0 < CellDifH(HR,HLow)) {
/* we have already found this cell */
*ptf++ = (CELL) ptd0;
} else {
@@ -1148,7 +1149,7 @@ ExportTerm(Term inp, char * buf, size_t len, UInt arity, int newattvs USES_REGS)
} while ((Int)res < 0);
return res;
}
-
+
size_t
Yap_ExportTerm(Term inp, char * buf, size_t len, UInt arity) {
CACHE_REGS
@@ -1176,7 +1177,7 @@ addAtom(Atom t, char *buf)
static UInt
FetchFunctor(CELL *pt, char *buf)
{
- CELL *ptr = (CELL *)(buf+(*pt-1));
+ CELL *ptr = (CELL *)(buf+(*pt-1));
// do arity first
UInt arity = *ptr++;
Atom name, at;
@@ -1227,7 +1228,7 @@ import_compound(CELL *hp, char *abase, char *buf, CELL *amax)
ar = FetchFunctor(hp, buf);
for (i=1; i<=ar; i++) {
amax = import_arg(hp+i, abase, buf, amax);
- }
+ }
return amax;
}
@@ -1269,7 +1270,7 @@ Yap_ImportTerm(char * buf) {
} else {
tret = AbsPair(HR);
import_pair(HR, (char *)HR, buf, HR);
- }
+ }
HR += sz;
return tret;
}
@@ -1306,7 +1307,7 @@ p_import_term( USES_REGS1 )
if (!export_buf)
return FALSE;
Int out = Yap_unify(ARG2,Yap_ImportTerm(export_buf));
- return out;
+ return out;
}
static Int
@@ -1316,7 +1317,7 @@ p_kill_exported_term( USES_REGS1 )
if (!export_buf)
return FALSE;
free(export_buf);
- return TRUE;
+ return TRUE;
}
@@ -1390,7 +1391,7 @@ static Term vars_in_complex_term(register CELL *pt0, register CELL *pt0_end, Ter
}
continue;
}
-
+
derefa_body(d0, ptd0, vars_in_term_unk, vars_in_term_nvar);
/* do or pt2 are unbound */
@@ -1402,7 +1403,7 @@ static Term vars_in_complex_term(register CELL *pt0, register CELL *pt0_end, Ter
HR[1] = AbsPair(HR+2);
HR += 2;
HR[-2] = (CELL)ptd0;
- /* next make sure noone will see this as a variable again */
+ /* next make sure noone will see this as a variable again */
if (TR > (tr_fr_ptr)LOCAL_TrailTop - 256) {
/* Trail overflow */
if (!Yap_growtrail((TR-TR0)*sizeof(tr_fr_ptr *), TRUE)) {
@@ -1456,7 +1457,7 @@ static Term vars_in_complex_term(register CELL *pt0, register CELL *pt0_end, Ter
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return 0L;
-
+
aux_overflow:
LOCAL_Error_Size = (to_visit-to_visit0)*sizeof(CELL **);
#ifdef RATIONAL_TREES
@@ -1471,7 +1472,7 @@ static Term vars_in_complex_term(register CELL *pt0, register CELL *pt0_end, Ter
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return 0L;
-
+
global_overflow:
#ifdef RATIONAL_TREES
while (to_visit > to_visit0) {
@@ -1486,7 +1487,7 @@ static Term vars_in_complex_term(register CELL *pt0, register CELL *pt0_end, Ter
LOCAL_Error_TYPE = RESOURCE_ERROR_STACK;
LOCAL_Error_Size = (ASP-HR)*sizeof(CELL);
return 0L;
-
+
}
static int
@@ -1494,7 +1495,7 @@ expand_vts( int args USES_REGS )
{
UInt expand = LOCAL_Error_Size;
yap_error_number yap_errno = LOCAL_Error_TYPE;
-
+
LOCAL_Error_Size = 0;
LOCAL_Error_TYPE = YAP_NO_ERROR;
if (yap_errno == RESOURCE_ERROR_TRAIL) {
@@ -1517,13 +1518,13 @@ expand_vts( int args USES_REGS )
}
return TRUE;
}
-
-static Int
+
+static Int
p_variables_in_term( USES_REGS1 ) /* variables in term t */
{
Term out, inp;
int count;
-
+
restart:
count = 0;
@@ -1554,7 +1555,7 @@ p_variables_in_term( USES_REGS1 ) /* variables in term t */
RESET_VARIABLE(HR-1);
Yap_unify((CELL)(HR-2),ARG1);
Yap_unify((CELL)(HR-1),ARG2);
- } else if (IsPrimitiveTerm(t))
+ } else if (IsPrimitiveTerm(t))
out = ARG2;
else if (IsPairTerm(t)) {
out = vars_in_complex_term(RepPair(t)-1,
@@ -1576,7 +1577,7 @@ p_variables_in_term( USES_REGS1 ) /* variables in term t */
}
-static Int
+static Int
p_term_variables( USES_REGS1 ) /* variables in term t */
{
Term out;
@@ -1726,13 +1727,13 @@ static Term attvars_in_complex_term(register CELL *pt0, register CELL *pt0_end,
}
continue;
}
-
+
derefa_body(d0, ptd0, attvars_in_term_unk, attvars_in_term_nvar);
if (IsAttVar(ptd0)) {
/* do or pt2 are unbound */
*ptd0 = TermNil;
- /* next make sure noone will see this as a variable again */
+ /* next make sure noone will see this as a variable again */
if (TR > (tr_fr_ptr)LOCAL_TrailTop - 256) {
/* Trail overflow */
if (!Yap_growtrail((TR-TR0)*sizeof(tr_fr_ptr *), TRUE)) {
@@ -1813,7 +1814,7 @@ static Term attvars_in_complex_term(register CELL *pt0, register CELL *pt0_end,
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return 0L;
-
+
aux_overflow:
LOCAL_Error_Size = (to_visit-to_visit0)*sizeof(CELL **);
#ifdef RATIONAL_TREES
@@ -1828,7 +1829,7 @@ static Term attvars_in_complex_term(register CELL *pt0, register CELL *pt0_end,
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return 0L;
-
+
global_overflow:
#ifdef RATIONAL_TREES
while (to_visit > to_visit0) {
@@ -1843,10 +1844,10 @@ static Term attvars_in_complex_term(register CELL *pt0, register CELL *pt0_end,
LOCAL_Error_TYPE = RESOURCE_ERROR_STACK;
LOCAL_Error_Size = (ASP-HR)*sizeof(CELL);
return 0L;
-
+
}
-static Int
+static Int
p_term_attvars( USES_REGS1 ) /* variables in term t */
{
Term out;
@@ -1876,7 +1877,7 @@ p_term_attvars( USES_REGS1 ) /* variables in term t */
return Yap_unify(ARG2,out);
}
-static Int
+static Int
p_term_variables3( USES_REGS1 ) /* variables in term t */
{
Term out;
@@ -2045,7 +2046,7 @@ static Term vars_within_complex_term(register CELL *pt0, register CELL *pt0_end,
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return 0L;
-
+
aux_overflow:
LOCAL_Error_Size = (to_visit-to_visit0)*sizeof(CELL **);
#ifdef RATIONAL_TREES
@@ -2060,7 +2061,7 @@ static Term vars_within_complex_term(register CELL *pt0, register CELL *pt0_end,
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return 0L;
-
+
global_overflow:
#ifdef RATIONAL_TREES
while (to_visit > to_visit0) {
@@ -2075,10 +2076,10 @@ static Term vars_within_complex_term(register CELL *pt0, register CELL *pt0_end,
LOCAL_Error_TYPE = RESOURCE_ERROR_STACK;
LOCAL_Error_Size = (ASP-HR)*sizeof(CELL);
return 0L;
-
+
}
-static Int
+static Int
p_variables_within_term( USES_REGS1 ) /* variables within term t */
{
Term out;
@@ -2089,7 +2090,7 @@ p_variables_within_term( USES_REGS1 ) /* variables within term t */
out = vars_within_complex_term(VarOfTerm(t)-1,
VarOfTerm(t), Deref(ARG1) PASS_REGS);
- } else if (IsPrimitiveTerm(t))
+ } else if (IsPrimitiveTerm(t))
out = TermNil;
else if (IsPairTerm(t)) {
out = vars_within_complex_term(RepPair(t)-1,
@@ -2203,7 +2204,7 @@ static Term new_vars_in_complex_term(register CELL *pt0, register CELL *pt0_end,
HR[1] = AbsPair(HR+2);
HR += 2;
HR[-2] = (CELL)ptd0;
- /* next make sure noone will see this as a variable again */
+ /* next make sure noone will see this as a variable again */
if (TR > (tr_fr_ptr)LOCAL_TrailTop - 256) {
/* Trail overflow */
if (!Yap_growtrail((TR-TR0)*sizeof(tr_fr_ptr *), TRUE)) {
@@ -2250,7 +2251,7 @@ static Term new_vars_in_complex_term(register CELL *pt0, register CELL *pt0_end,
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return 0L;
-
+
aux_overflow:
LOCAL_Error_Size = (to_visit-to_visit0)*sizeof(CELL **);
#ifdef RATIONAL_TREES
@@ -2265,7 +2266,7 @@ static Term new_vars_in_complex_term(register CELL *pt0, register CELL *pt0_end,
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return 0L;
-
+
global_overflow:
#ifdef RATIONAL_TREES
while (to_visit > to_visit0) {
@@ -2280,10 +2281,10 @@ static Term new_vars_in_complex_term(register CELL *pt0, register CELL *pt0_end,
LOCAL_Error_TYPE = RESOURCE_ERROR_STACK;
LOCAL_Error_Size = (ASP-HR)*sizeof(CELL);
return 0L;
-
+
}
-static Int
+static Int
p_new_variables_in_term( USES_REGS1 ) /* variables within term t */
{
Term out;
@@ -2294,7 +2295,7 @@ p_new_variables_in_term( USES_REGS1 ) /* variables within term t */
out = new_vars_in_complex_term(VarOfTerm(t)-1,
VarOfTerm(t), Deref(ARG1) PASS_REGS);
- } else if (IsPrimitiveTerm(t))
+ } else if (IsPrimitiveTerm(t))
out = TermNil;
else if (IsPairTerm(t)) {
out = new_vars_in_complex_term(RepPair(t)-1,
@@ -2392,7 +2393,7 @@ static Term free_vars_in_complex_term(register CELL *pt0, register CELL *pt0_end
}
HR[0] = (CELL)ptd0;
HR ++;
- /* next make sure noone will see this as a variable again */
+ /* next make sure noone will see this as a variable again */
if (TR > (tr_fr_ptr)LOCAL_TrailTop - 256) {
/* Trail overflow */
if (!Yap_growtrail((TR-TR0)*sizeof(tr_fr_ptr *), TRUE)) {
@@ -2439,7 +2440,7 @@ static Term free_vars_in_complex_term(register CELL *pt0, register CELL *pt0_end
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return 0L;
-
+
aux_overflow:
LOCAL_Error_Size = (to_visit-to_visit0)*sizeof(CELL **);
#ifdef RATIONAL_TREES
@@ -2454,7 +2455,7 @@ static Term free_vars_in_complex_term(register CELL *pt0, register CELL *pt0_end
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return 0L;
-
+
global_overflow:
#ifdef RATIONAL_TREES
while (to_visit > to_visit0) {
@@ -2469,7 +2470,7 @@ static Term free_vars_in_complex_term(register CELL *pt0, register CELL *pt0_end
LOCAL_Error_TYPE = RESOURCE_ERROR_STACK;
LOCAL_Error_Size = (ASP-HR)*sizeof(CELL);
return 0L;
-
+
}
static Term bind_vars_in_complex_term(register CELL *pt0, register CELL *pt0_end, tr_fr_ptr TR0 USES_REGS)
@@ -2543,7 +2544,7 @@ static Term bind_vars_in_complex_term(register CELL *pt0, register CELL *pt0_end
derefa_body(d0, ptd0, vars_within_term_unk, vars_within_term_nvar);
/* do or pt2 are unbound */
*ptd0 = TermFoundVar;
- /* next make sure noone will see this as a variable again */
+ /* next make sure noone will see this as a variable again */
if (TR > (tr_fr_ptr)LOCAL_TrailTop - 256) {
/* Trail overflow */
if (!Yap_growtrail((TR-TR0)*sizeof(tr_fr_ptr *), TRUE)) {
@@ -2584,7 +2585,7 @@ static Term bind_vars_in_complex_term(register CELL *pt0, register CELL *pt0_end
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return 0L;
-
+
aux_overflow:
LOCAL_Error_Size = (to_visit-to_visit0)*sizeof(CELL **);
#ifdef RATIONAL_TREES
@@ -2599,10 +2600,10 @@ static Term bind_vars_in_complex_term(register CELL *pt0, register CELL *pt0_end
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return 0L;
-
+
}
-static Int
+static Int
p_free_variables_in_term( USES_REGS1 ) /* variables within term t */
{
Term out;
@@ -2610,7 +2611,7 @@ p_free_variables_in_term( USES_REGS1 ) /* variables within term t */
Term found_module = 0L;
do {
- tr_fr_ptr TR0 = TR;
+ tr_fr_ptr TR0 = TR;
t = t0 = Deref(ARG1);
while (!IsVarTerm(t) && IsApplTerm(t)) {
@@ -2639,7 +2640,7 @@ p_free_variables_in_term( USES_REGS1 ) /* variables within term t */
out = free_vars_in_complex_term(VarOfTerm(t)-1,
VarOfTerm(t), TR0 PASS_REGS);
- } else if (IsPrimitiveTerm(t))
+ } else if (IsPrimitiveTerm(t))
out = TermNil;
else if (IsPairTerm(t)) {
out = free_vars_in_complex_term(RepPair(t)-1,
@@ -2748,12 +2749,12 @@ static Term non_singletons_in_complex_term(register CELL *pt0, register CELL *pt
}
continue;
}
-
+
derefa_body(d0, ptd0, vars_in_term_unk, vars_in_term_nvar);
/* do or pt2 are unbound */
*ptd0 = TermFoundVar;
- /* next make sure we can recover the variable again */
+ /* next make sure we can recover the variable again */
TrailTerm(TR++) = (CELL)ptd0;
}
/* Do we still have compound terms to visit */
@@ -2796,13 +2797,13 @@ static Term non_singletons_in_complex_term(register CELL *pt0, register CELL *pt
}
return 0L;
}
-
-static Int
+
+static Int
p_non_singletons_in_term( USES_REGS1 ) /* non_singletons in term t */
{
Term t;
Term out;
-
+
while (TRUE) {
t = Deref(ARG1);
if (IsVarTerm(t)) {
@@ -2825,7 +2826,7 @@ p_non_singletons_in_term( USES_REGS1 ) /* non_singletons in term t */
return FALSE;
}
}
- }
+ }
}
static Int ground_complex_term(register CELL *pt0, register CELL *pt0_end USES_REGS)
@@ -2897,7 +2898,7 @@ static Int ground_complex_term(register CELL *pt0, register CELL *pt0_end USES_R
}
continue;
}
-
+
derefa_body(d0, ptd0, vars_in_term_unk, vars_in_term_nvar);
#ifdef RATIONAL_TREES
@@ -2937,7 +2938,7 @@ static Int ground_complex_term(register CELL *pt0, register CELL *pt0_end USES_R
#endif
return -1;
}
-
+
bool Yap_IsGroundTerm(Term t)
{
CACHE_REGS
@@ -2955,7 +2956,7 @@ bool Yap_IsGroundTerm(Term t)
}
} else {
Functor fun = FunctorOfTerm(t);
-
+
if (IsExtensionFunctor(fun))
return TRUE;
else if ((out = ground_complex_term(RepAppl(t),
@@ -2969,13 +2970,13 @@ bool Yap_IsGroundTerm(Term t)
if (!Yap_ExpandPreAllocCodeSpace(0, NULL, TRUE)) {
Yap_Error(RESOURCE_ERROR_AUXILIARY_STACK, ARG1, "overflow in ground");
return false;
- }
+ }
t = *--HR;
}
}
}
-static Int
+static Int
p_ground( USES_REGS1 ) /* ground(+T) */
{
return Yap_IsGroundTerm(Deref(ARG1));
@@ -3078,7 +3079,7 @@ static Int sz_ground_complex_term(register CELL *pt0, register CELL *pt0_end, in
}
continue;
}
-
+
derefa_body(d0, ptd0, vars_in_term_unk, vars_in_term_nvar);
if (!ground)
@@ -3139,10 +3140,10 @@ Yap_SizeGroundTerm(Term t, int ground)
} else {
int sz = 0;
Functor fun = FunctorOfTerm(t);
-
+
if (IsExtensionFunctor(fun))
return 1+ SizeOfExtension(t);
-
+
sz = sz_ground_complex_term(RepAppl(t),
RepAppl(t)+
ArityOfFunctor(fun),
@@ -3150,7 +3151,7 @@ Yap_SizeGroundTerm(Term t, int ground)
if (sz <= 0)
return sz;
return 1+ArityOfFunctor(fun)+sz;
- }
+ }
}
static Int var_in_complex_term(register CELL *pt0,
@@ -3226,7 +3227,7 @@ static Int var_in_complex_term(register CELL *pt0,
}
continue;
}
-
+
deref_body(d0, ptd0, var_in_term_unk, var_in_term_nvar);
if ((CELL)ptd0 == v) { /* we found it */
@@ -3242,7 +3243,7 @@ static Int var_in_complex_term(register CELL *pt0,
}
/* do or pt2 are unbound */
*ptd0 = TermNil;
- /* next make sure noone will see this as a variable again */
+ /* next make sure noone will see this as a variable again */
TrailTerm(TR++) = (CELL)ptd0;
}
/* Do we still have compound terms to visit */
@@ -3281,8 +3282,8 @@ static Int var_in_complex_term(register CELL *pt0,
#endif
return -1;
}
-
-static Int
+
+static Int
var_in_term(Term v, Term t USES_REGS) /* variables in term t */
{
@@ -3343,8 +3344,8 @@ MurmurHashNeutral2 ( const void * key, int len, unsigned int seed )
k |= data[2] << 16;
k |= data[3] << 24;
- k *= m;
- k ^= k >> r;
+ k *= m;
+ k ^= k >> r;
k *= m;
h *= m;
@@ -3353,7 +3354,7 @@ MurmurHashNeutral2 ( const void * key, int len, unsigned int seed )
data += 4;
len -= 4;
}
-
+
switch(len)
{
case 3: h ^= data[2] << 16;
@@ -3367,7 +3368,7 @@ MurmurHashNeutral2 ( const void * key, int len, unsigned int seed )
h ^= h >> 15;
return h;
-}
+}
static CELL *
addAtomToHash(CELL *st, Atom at)
@@ -3458,7 +3459,7 @@ hash_complex_term(register CELL *pt0,
CELL fc = (CELL)f;
switch(fc) {
-
+
case (CELL)FunctorDBRef:
*st++ = fc;
break;
@@ -3473,7 +3474,7 @@ hash_complex_term(register CELL *pt0,
case (CELL)FunctorBigInt:
{
CELL *pt = RepAppl(d0);
- Int sz =
+ Int sz =
sizeof(MP_INT)+1+
(((MP_INT *)(pt+2))->_mp_alloc*sizeof(mp_limb_t));
@@ -3517,7 +3518,7 @@ hash_complex_term(register CELL *pt0,
}
continue;
}
-
+
deref_body(d0, ptd0, hash_complex_unk, hash_complex_nvar);
if (!variant)
@@ -3554,7 +3555,7 @@ hash_complex_term(register CELL *pt0,
}
return (CELL *) -2;
}
-
+
Int
Yap_TermHash(Term t, Int size, Int depth, int variant)
{
@@ -3568,7 +3569,7 @@ Yap_TermHash(Term t, Int size, Int depth, int variant)
if (!Yap_ExpandPreAllocCodeSpace(0, NULL, TRUE)) {
Yap_Error(RESOURCE_ERROR_AUXILIARY_STACK, ARG1, "overflow in term_hash");
return FALSE;
- }
+ }
t1 = Deref(ARG1);
} else if(ar == (CELL *)-2) {
if (!Yap_gcl((ASP-HR)*sizeof(CELL), 0, ENV, gc_P(P,CP))) {
@@ -3625,7 +3626,7 @@ p_term_hash( USES_REGS1 )
if (!Yap_ExpandPreAllocCodeSpace(0, NULL, TRUE)) {
Yap_Error(RESOURCE_ERROR_AUXILIARY_STACK, ARG1, "overflow in term_hash");
return FALSE;
- }
+ }
t1 = Deref(ARG1);
} else if(ar == (CELL *)-2) {
if (!Yap_gcl((ASP-HR)*sizeof(CELL), 4, ENV, gc_P(P,CP))) {
@@ -3683,7 +3684,7 @@ p_instantiated_term_hash( USES_REGS1 )
if (!Yap_ExpandPreAllocCodeSpace(0, NULL, TRUE)) {
Yap_Error(RESOURCE_ERROR_AUXILIARY_STACK, ARG1, "overflow in term_hash");
return FALSE;
- }
+ }
t1 = Deref(ARG1);
} else if(ar == (CELL *)-2) {
if (!Yap_gcl((ASP-HR)*sizeof(CELL), 4, ENV, gc_P(P,CP))) {
@@ -3710,7 +3711,7 @@ static int variant_complex(register CELL *pt0, register CELL *pt0_end, register
register CELL **to_visit = (CELL **)ASP;
/* make sure that unification always forces trailing */
HBREG = HR;
-
+
loop:
while (pt0 < pt0_end) {
@@ -3892,7 +3893,7 @@ static int variant_complex(register CELL *pt0, register CELL *pt0_end, register
static bool
is_variant(Term t1, Term t2, int parity USES_REGS)
-{
+{
int out;
if (t1 == t2)
@@ -3943,13 +3944,13 @@ is_variant(Term t1, Term t2, int parity USES_REGS)
}
bool
-Yap_Variant(Term t1, Term t2)
+Yap_Variant(Term t1, Term t2)
{
CACHE_REGS
return is_variant(t1, t2, 0 PASS_REGS);
}
-static Int
+static Int
p_variant( USES_REGS1 ) /* variant terms t1 and t2 */
{
return is_variant(Deref(ARG1), Deref(ARG2), 2 PASS_REGS);
@@ -4011,7 +4012,7 @@ static int subsumes_complex(register CELL *pt0, register CELL *pt0_end, register
/* generate a new binding */
CELL *pt0 = VarOfTerm(d0);
Term new = MkVarTerm();
-
+
Bind_Global(pt0, new);
if (d0 != d1) { /* avoid loops */
Bind_Global(VarOfTerm(new), d1);
@@ -4165,7 +4166,7 @@ static int subsumes_complex(register CELL *pt0, register CELL *pt0_end, register
return FALSE;
}
-static Int
+static Int
p_subsumes( USES_REGS1 ) /* subsumes terms t1 and t2 */
{
Term t1 = Deref(ARG1);
@@ -4230,7 +4231,7 @@ static int term_subsumer_complex(register CELL *pt0, register CELL *pt0_end, reg
} else if (IsVarTerm(d0)) {
CELL *match, *omatch = NULL;
- match = VarOfTerm(d0);
+ match = VarOfTerm(d0);
if (match >= HB) {
while (match >= HB) {
/* chained to a sequence */
@@ -4431,10 +4432,10 @@ static int term_subsumer_complex(register CELL *pt0, register CELL *pt0_end, reg
}
-static Int
+static Int
p_term_subsumer( USES_REGS1 ) /* term_subsumer terms t1 and t2 */
{
- int out = 0;
+ int out = 0;
while (out != 1) {
Term t1 = Deref(ARG1);
@@ -4491,7 +4492,7 @@ p_term_subsumer( USES_REGS1 ) /* term_subsumer terms t1 and t2 */
if (!Yap_growtrail(0, FALSE)) {
Yap_Error(RESOURCE_ERROR_TRAIL, TermNil, "in term_subsumer");
return FALSE;
- }
+ }
}
}
}
@@ -4658,11 +4659,11 @@ static Int numbervars_in_complex_term(register CELL *pt0, register CELL *pt0_end
}
continue;
}
-
+
derefa_body(d0, ptd0, vars_in_term_unk, vars_in_term_nvar);
/* do or pt2 are unbound */
- if (singles)
+ if (singles)
*ptd0 = numbervar_singleton( PASS_REGS1 );
else
*ptd0 = numbervar(numbv++ PASS_REGS);
@@ -4670,7 +4671,7 @@ static Int numbervars_in_complex_term(register CELL *pt0, register CELL *pt0_end
if (HR+1024 > ASP) {
goto global_overflow;
}
- /* next make sure noone will see this as a variable again */
+ /* next make sure noone will see this as a variable again */
if (TR > (tr_fr_ptr)LOCAL_TrailTop - 256) {
/* Trail overflow */
if (!Yap_growtrail((TR-TR0)*sizeof(tr_fr_ptr *), TRUE)) {
@@ -4716,7 +4717,7 @@ static Int numbervars_in_complex_term(register CELL *pt0, register CELL *pt0_end
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return numbv-1;
-
+
aux_overflow:
LOCAL_Error_Size = (to_visit-to_visit0)*sizeof(CELL **);
#ifdef RATIONAL_TREES
@@ -4731,7 +4732,7 @@ static Int numbervars_in_complex_term(register CELL *pt0, register CELL *pt0_end
Yap_ReleasePreAllocCodeSpace((ADDR)to_visit0);
HR = InitialH;
return numbv-1;
-
+
global_overflow:
#ifdef RATIONAL_TREES
while (to_visit > to_visit0) {
@@ -4746,17 +4747,17 @@ static Int numbervars_in_complex_term(register CELL *pt0, register CELL *pt0_end
LOCAL_Error_TYPE = RESOURCE_ERROR_STACK;
LOCAL_Error_Size = (ASP-HR)*sizeof(CELL);
return numbv-1;
-
+
}
-Int
+Int
Yap_NumberVars( Term inp, Int numbv, bool handle_singles ) /*
* numbervariables in term t */
{
CACHE_REGS
Int out;
Term t;
-
+
restart:
t = Deref(inp);
if (IsVarTerm(t)) {
@@ -4836,7 +4837,7 @@ unnumber_complex_term(CELL *pt0, CELL *pt0_end, CELL *ptf, CELL *HLow, int share
/* If this is newer than the current term, just reuse */
*ptf++ = d0;
continue;
- }
+ }
*ptf = AbsPair(HR);
ptf++;
#ifdef RATIONAL_TREES
@@ -4880,7 +4881,7 @@ unnumber_complex_term(CELL *pt0, CELL *pt0_end, CELL *ptf, CELL *HLow, int share
/* If this is newer than the current term, just reuse */
*ptf++ = d0;
continue;
- }
+ }
f = (Functor)(*ap2);
if (IsExtensionFunctor(f)) {
@@ -5107,7 +5108,7 @@ UnnumberTerm(Term inp, UInt arity, int share USES_REGS) {
return tf;
}
}
-
+
Term
Yap_UnNumberTerm(Term inp, int share) {
CACHE_REGS
@@ -5140,7 +5141,7 @@ Yap_SkipList(Term *l, Term **tailp)
}
lam++;
length++;
- l = RepPair(*l)+1;
+ l = RepPair(*l)+1;
do_derefa(v,l,derefa2_unk,derefa2_nonvar);
} while ( *l != *s && IsPairTerm(*l) );
}
@@ -5150,7 +5151,7 @@ Yap_SkipList(Term *l, Term **tailp)
}
-static Int
+static Int
p_skip_list( USES_REGS1 ) {
Term *tail;
Int len = Yap_SkipList(XREGS+2, &tail);
@@ -5159,7 +5160,7 @@ p_skip_list( USES_REGS1 ) {
Yap_unify(*tail, ARG3);
}
-static Int
+static Int
p_skip_list4( USES_REGS1 ) {
Term *tail;
Int len, len1 = -1;
@@ -5209,7 +5210,7 @@ p_free_arguments( USES_REGS1 )
Functor f = FunctorOfTerm(t);
UInt i, ar;
Int ret = TRUE;
-
+
if (IsExtensionFunctor(f))
return TRUE;
ar = ArityOfFunctor(f);
@@ -5268,7 +5269,7 @@ void Yap_InitUtilCPreds(void)
CACHE_REGS
Term cm = CurrentModule;
Yap_InitCPred("copy_term", 2, p_copy_term, 0);
-/** @pred copy_term(? _TI_,- _TF_) is iso
+/** @pred copy_term(? _TI_,- _TF_) is iso
Term _TF_ is a variant of the original term _TI_, such that for
@@ -5281,10 +5282,10 @@ in term _TF_. Notice that:
If you do not want any sharing to occur please use
duplicate_term/2.
-
+
*/
Yap_InitCPred("duplicate_term", 2, p_duplicate_term, 0);
-/** @pred duplicate_term(? _TI_,- _TF_)
+/** @pred duplicate_term(? _TI_,- _TF_)
Term _TF_ is a variant of the original term _TI_, such that
@@ -5295,10 +5296,10 @@ in _TI_ are also duplicated.
Also refer to copy_term/2.
-
+
*/
Yap_InitCPred("copy_term_nat", 2, p_copy_term_no_delays, 0);
-/** @pred copy_term_nat(? _TI_,- _TF_)
+/** @pred copy_term_nat(? _TI_,- _TF_)
As copy_term/2. Attributes however, are not copied but replaced
@@ -5309,18 +5310,18 @@ by fresh variables.
*/
Yap_InitCPred("ground", 1, p_ground, SafePredFlag);
-/** @pred ground( _T_) is iso
+/** @pred ground( _T_) is iso
Succeeds if there are no free variables in the term _T_.
-
+
*/
Yap_InitCPred("$variables_in_term", 3, p_variables_in_term, 0);
Yap_InitCPred("$free_variables_in_term", 3, p_free_variables_in_term, 0);
Yap_InitCPred("$non_singletons_in_term", 3, p_non_singletons_in_term, 0);
Yap_InitCPred("term_variables", 2, p_term_variables, 0);
-/** @pred term_variables(? _Term_, - _Variables_) is iso
+/** @pred term_variables(? _Term_, - _Variables_) is iso
@@ -5328,23 +5329,23 @@ Unify _Variables_ with the list of all variables of term
_Term_. The variables occur in the order of their first
appearance when traversing the term depth-first, left-to-right.
-
+
*/
Yap_InitCPred("term_variables", 3, p_term_variables3, 0);
Yap_InitCPred("term_attvars", 2, p_term_attvars, 0);
-/** @pred term_attvars(+ _Term_,- _AttVars_)
+/** @pred term_attvars(+ _Term_,- _AttVars_)
_AttVars_ is a list of all attributed variables in _Term_ and
its attributes. I.e., term_attvars/2 works recursively through
attributes. This predicate is Cycle-safe.
-
+
*/
Yap_InitCPred("is_list", 1, p_is_list, SafePredFlag|TestPredFlag);
Yap_InitCPred("$is_list_or_partial_list", 1, p_is_list_or_partial_list, SafePredFlag|TestPredFlag);
Yap_InitCPred("rational_term_to_tree", 4, p_break_rational, 0);
-/** @pred rational_term_to_tree(? _TI_,- _TF_, ?SubTerms, ?MoreSubterms)
+/** @pred rational_term_to_tree(? _TI_,- _TF_, ?SubTerms, ?MoreSubterms)
The term _TF_ is a forest representation (without cycles and repeated
@@ -5353,33 +5354,33 @@ difference list _SubTerms_-_MoreSubterms_ stores terms of the form
_V=T_, where _V_ is a new variable occuring in _TF_, and _T_ is a copy
of a sub-term from _TI_.
-
+
*/
Yap_InitCPred("term_factorized", 3, p_break_rational3, 0);
-/** @pred term_factorized(? _TI_,- _TF_, ?SubTerms)
+/** @pred term_factorized(? _TI_,- _TF_, ?SubTerms)
Similar to rational_term_to_tree/4, but _SubTerms_ is a proper list.
-
+
*/
Yap_InitCPred("=@=", 2, p_variant, 0);
Yap_InitCPred("numbervars", 3, p_numbervars, 0);
-/** @pred numbervars( _T_,+ _N1_,- _Nn_)
+/** @pred numbervars( _T_,+ _N1_,- _Nn_)
Instantiates each variable in term _T_ to a term of the form:
`$VAR( _I_)`, with _I_ increasing from _N1_ to _Nn_.
-
+
*/
Yap_InitCPred("unnumbervars", 2, p_unnumbervars, 0);
-/** @pred unnumbervars( _T_,+ _NT_)
+/** @pred unnumbervars( _T_,+ _NT_)
Replace every `$VAR( _I_)` by a free variable.
-
+
*/
/* use this carefully */
Yap_InitCPred("$skip_list", 3, p_skip_list, SafePredFlag|TestPredFlag);
@@ -5405,4 +5406,3 @@ Replace every `$VAR( _I_)` by a free variable.
Yap_InitCPred("dum", 1, camacho_dum, SafePredFlag);
#endif
}
-
diff --git a/H/YapFlags.h b/H/YapFlags.h
index 81869b5b6..d16dbe9bb 100644
--- a/H/YapFlags.h
+++ b/H/YapFlags.h
@@ -17,7 +17,7 @@
/** @file YapFlags.h
- @ingroup Flags
+ @addtogroup Flags
*/
#ifndef YAP_FLAGS_H
diff --git a/H/YapGFlagInfo.h b/H/YapGFlagInfo.h
index 84e7a2e92..2575880cb 100644
--- a/H/YapGFlagInfo.h
+++ b/H/YapGFlagInfo.h
@@ -17,25 +17,24 @@
/** @file YapGFlagInfo.h
- @ingroup Flags
+ @addtogroup YAPFlags
*/
-/** @pred yap_flag(? _Param_,? _Value_)
+/** @pred yap_flag( ?Param, ?Value)
Set or read system properties for _Param_:
+ @enum YapGFlag Prolog
+ @Brief global flag:
+
*/
-/// `address_bits`
-///
-/// Number of address bits in the machine, either 64 or 32 bits.
-YAP_FLAG(ADDRESS_BITS_FLAG, "address_bits", false, nat, BITNESS, NULL)
-, /** `address_bits`
- Number of address bits in the machine, either 64 or 32 bits */
- YAP_FLAG(AGC_MARGIN_FLAG, "agc_margin", true, nat, "10000",
- agc_threshold), /**`agc_margin `
+YAP_FLAG(ADDRESS_BITS_FLAG, "address_bits", false, nat, BITNESS, NULL), /**< `address_bits`
+ Number of address bits in the machine, either 64 or 32 bits */
+YAP_FLAG(AGC_MARGIN_FLAG, "agc_margin", true, nat, "10000",
+ agc_threshold), /**< `agc_margin`
An integer: if this amount of atoms has been created since the last
atom-garbage collection, perform atom garbage collection at the first
opportunity. Initial value is 10,000. May be changed. A value of 0
diff --git a/H/YapLFlagInfo.h b/H/YapLFlagInfo.h
index 4fa1e16ee..4021b62a7 100644
--- a/H/YapLFlagInfo.h
+++ b/H/YapLFlagInfo.h
@@ -17,35 +17,35 @@
/** @file YapLFlagInfo.h
- @ingroup Flags
+ @addtogroup Flags
*/
YAP_FLAG( AUTOLOAD_FLAG, "autoload", true, booleanFlag, "false" , NULL ),
YAP_FLAG( BREAK_LEVEL_FLAG, "break_level", true, nat, "0" , NULL ),
-YAP_FLAG( CALL_COUNTING_FLAG, "call_counting", true, booleanFlag, "true" , NULL ), /**< `call_counting`
-
+YAP_FLAG( CALL_COUNTING_FLAG, "call_counting", true, booleanFlag, "true" , NULL ), /** + `call_counting`
+
Predicates compiled with this flag set maintain a counter on the numbers of proceduree calls and of retries. These counters are decreasing counters, and they can be used as timers. Three counters are available:
-
+
calls: number of predicate calls since execution started or since system was reset;
retries: number of retries for predicates called since execution started or since counters were reset;
calls_and_retries: count both on predicate calls and retries.
These counters can be used to find out how many calls a certain goal takes to execute. They can also be force the computatiom yp
stopping.
-
+
If `on` `fileerrors` is `on`, if `off` (default)
`fileerrors` is disabled.
*/
YAP_FLAG( ENCODING_FLAG, "encoding", true, isatom, "utf-8" , getenc ),
-YAP_FLAG( FILEERRORS_FLAG, "fileerrors", true, booleanFlag, "true" , NULL ), /**< `fileerrors`
-
+YAP_FLAG( FILEERRORS_FLAG, "fileerrors", true, booleanFlag, "true" , NULL ), /** + `fileerrors`
+
If `on` `fileerrors` is `on`, if `off` (default)
`fileerrors` is disabled.
*/
-YAP_FLAG( LANGUAGE_MODE_FLAG, "language_mode", true, isatom, "yap" , NULL ), /**< `language_mode`
-
+YAP_FLAG( LANGUAGE_MODE_FLAG, "language_mode", true, isatom, "yap" , NULL ), /** + `language_mode`
+
wweter native mode or trying to emulate a different Prolog.
*/
-YAP_FLAG( REDEFINE_WARNINGS_FLAG, "redefine_warnings", true, booleanFlag, "true" , NULL ), /**< `redefine_warnings `
+YAP_FLAG( REDEFINE_WARNINGS_FLAG, "redefine_warnings", true, booleanFlag, "true" , NULL ), /** + `redefine_warnings `
If _Value_ is unbound, tell whether warnings for procedures defined
in several different files are `on` or
@@ -53,17 +53,17 @@ in several different files are `on` or
and if it is bound to `off` disable them. The default for YAP is
`off`, unless we are in `sicstus` or `iso` mode.
*/
-YAP_FLAG( SINGLE_VAR_WARNINGS_FLAG, "single_var_warnings", true, booleanFlag, "true" , NULL ), /**< `single_var_warnings`
+YAP_FLAG( SINGLE_VAR_WARNINGS_FLAG, "single_var_warnings", true, booleanFlag, "true" , NULL ), /** + `single_var_warnings`
If `true` (default `true`) YAP checks for singleton variables when loading files. A singleton variable is a variable that appears ony once in a clause. The name must start with a capital letter, variables whose name starts with underscore are never considered singleton.
-
+
*/
-YAP_FLAG( STACK_DUMP_ON_ERROR_FLAG, "stack_dump_on_error", true, booleanFlag, "false" , NULL ), /**< `stack_dump_on_error `
+YAP_FLAG( STACK_DUMP_ON_ERROR_FLAG, "stack_dump_on_error", true, booleanFlag, "false" , NULL ), /** + `stack_dump_on_error `
If `true` show a stack dump when YAP finds an error. The default is
`off`.
*/
YAP_FLAG( STREAM_TYPE_CHECK_FLAG, "stream_type_check", true, isatom, "loose" , NULL ),
-YAP_FLAG( SYNTAX_ERRORS_FLAG, "syntax_errors", true, synerr, "error" , NULL ), /**< `syntax_errors`
+YAP_FLAG( SYNTAX_ERRORS_FLAG, "syntax_errors", true, synerr, "error" , NULL ), /** + `syntax_errors`
Control action to be taken after syntax errors while executing read/1,
`read/2`, or `read_term/3`:
@@ -76,14 +76,14 @@ Report the syntax error and generate an error (default).
+ `quiet`
Just fail
*/
-YAP_FLAG( TYPEIN_MODULE_FLAG, "typein_module", true, isatom, "user" , typein ), /**< `typein_module `
+YAP_FLAG( TYPEIN_MODULE_FLAG, "typein_module", true, isatom, "user" , typein ), /** + `typein_module `
If bound, set the current working or type-in module to the argument,
which must be an atom. If unbound, unify the argument with the current
working module.
*/
- YAP_FLAG( USER_ERROR_FLAG, "user_error", true, stream, "user_error" , set_error_stream ), /**< `user_error1`
+ YAP_FLAG( USER_ERROR_FLAG, "user_error", true, stream, "user_error" , set_error_stream ), /** + `user_error1`
If the second argument is bound to a stream, set user_error to
this stream. If the second argument is unbound, unify the argument with
@@ -104,7 +104,7 @@ The next example shows how to use this flag:
close(mauri_tripa).
yes
- ?-
+ ?-
~~~
We execute three commands. First, we open a stream in write mode and
give it an alias, in this case `mauri_tripa`. Next, we set
diff --git a/H/qly.h b/H/qly.h
index b1b8ab833..e06986662 100644
--- a/H/qly.h
+++ b/H/qly.h
@@ -18,11 +18,13 @@
*************************************************************************/
/**
- *
- * @file qly.h
- *
+ *
+ * @file qly.h
+ *
+
* @defgroup SaveRestoreSupport C-support for saved states.
- * @ingroup YAPSaving
+ * @ingroup QLY
+ * @{
*
*/
@@ -137,3 +139,5 @@ typedef enum {
#define AllocTempSpace() (HR)
#define EnoughTempSpace(sz) ((ASP - HR) * sizeof(CELL) > sz)
+
+/// @} @}
diff --git a/OPTYap/tab.insts.h b/OPTYap/tab.insts.h
index 4a81bb03f..7559c3643 100644
--- a/OPTYap/tab.insts.h
+++ b/OPTYap/tab.insts.h
@@ -1356,42 +1356,42 @@
answer_resolution:
- dep_fr_ptr dep_fr;
- ans_node_ptr ans_node;
- INIT_PREFETCH();
+ INIT_PREFETCH()
+ dep_fr_ptr dep_fr;
+ ans_node_ptr ans_node;
- OPTYAP_ERROR_CHECKING(answer_resolution, SCH_top_shared_cp(B) && B->cp_or_fr->alternative != ANSWER_RESOLUTION);
- OPTYAP_ERROR_CHECKING(answer_resolution, !SCH_top_shared_cp(B) && B->cp_ap != ANSWER_RESOLUTION);
- dep_fr = CONS_CP(B)->cp_dep_fr;
- LOCK_DEP_FR(dep_fr);
- ans_node = DepFr_last_answer(dep_fr);
- if (TrNode_child(ans_node)) {
- /* unconsumed answers */
+ OPTYAP_ERROR_CHECKING(answer_resolution, SCH_top_shared_cp(B) && B->cp_or_fr->alternative != ANSWER_RESOLUTION);
+ OPTYAP_ERROR_CHECKING(answer_resolution, !SCH_top_shared_cp(B) && B->cp_ap != ANSWER_RESOLUTION);
+ dep_fr = CONS_CP(B)->cp_dep_fr;
+ LOCK_DEP_FR(dep_fr);
+ ans_node = DepFr_last_answer(dep_fr);
+ if (TrNode_child(ans_node)) {
+ /* unconsumed answers */
#ifdef MODE_DIRECTED_TABLING
- if (IS_ANSWER_INVALID_NODE(TrNode_child(ans_node))) {
- ans_node_ptr old_ans_node;
- old_ans_node = ans_node;
- ans_node = TrNode_child(ans_node);
- do {
+ if (IS_ANSWER_INVALID_NODE(TrNode_child(ans_node))) {
+ ans_node_ptr old_ans_node;
+ old_ans_node = ans_node;
ans_node = TrNode_child(ans_node);
- } while (IS_ANSWER_INVALID_NODE(ans_node));
- TrNode_child(old_ans_node) = ans_node;
- } else
+ do {
+ ans_node = TrNode_child(ans_node);
+ } while (IS_ANSWER_INVALID_NODE(ans_node));
+ TrNode_child(old_ans_node) = ans_node;
+ } else
#endif /* MODE_DIRECTED_TABLING */
- ans_node = TrNode_child(ans_node);
- DepFr_last_answer(dep_fr) = ans_node;
+ ans_node = TrNode_child(ans_node);
+ DepFr_last_answer(dep_fr) = ans_node;
+ UNLOCK_DEP_FR(dep_fr);
+ consume_answer_and_procceed(dep_fr, ans_node);
+ }
UNLOCK_DEP_FR(dep_fr);
- consume_answer_and_procceed(dep_fr, ans_node);
- }
- UNLOCK_DEP_FR(dep_fr);
#ifdef YAPOR
- if (B == DepFr_leader_cp(LOCAL_top_dep_fr)) {
- /* B is a generator-consumer node **
- ** never here if batched scheduling */
- TABLING_ERROR_CHECKING(answer_resolution, IS_BATCHED_GEN_CP(B));
- goto completion;
- }
+ if (B == DepFr_leader_cp(LOCAL_top_dep_fr)) {
+ /* B is a generator-consumer node **
+ ** never here if batched scheduling */
+ TABLING_ERROR_CHECKING(answer_resolution, IS_BATCHED_GEN_CP(B));
+ goto completion;
+ }
#endif /* YAPOR */
/* no unconsumed answers */
@@ -1664,14 +1664,14 @@
#ifdef THREADS_CONSUMER_SHARING
goto answer_resolution_completion;
#endif /* THREADS_CONSUMER_SHARING */
- dep_fr_ptr dep_fr;
- ans_node_ptr ans_node;
+ INIT_PREFETCH()
+ dep_fr_ptr dep_fr;
+ ans_node_ptr ans_node;
#ifdef YAPOR
#ifdef TIMESTAMP_CHECK
long timestamp = 0;
#endif /* TIMESTAMP_CHECK */
int entry_owners = 0;
- INIT_PREFETCH();
if (SCH_top_shared_cp(B)) {
#ifdef TIMESTAMP_CHECK
diff --git a/docs/md/README.md b/README.md
similarity index 96%
rename from docs/md/README.md
rename to README.md
index 756627999..3f94fb556 100644
--- a/docs/md/README.md
+++ b/README.md
@@ -3,9 +3,6 @@

-User Manual for YAP6 (#main)
-====================
-
NOTE: this version of YAP is still experimental, documentation may be out of date.
## Introduction
@@ -39,6 +36,10 @@ Springer-Verlag.
YAP 6.3.4 has been built with the gcc and clang compilers on Linux and OSX machines. We expect to recover support for WIN32 machines and
Android next.
+We are happy to include in YAP several excellent packages developed
+under separate licenses. Our thanks to the authors for their kind
+authorization to include these packages.
+
The overall copyright and permission notice for YAP4.3 can be found in
the Artistic file in this directory. YAP follows the Perl Artistic
license, and it is thus non-copylefted freeware. Some components of YAP have been obtained from SWI Prolog and ciao, and have
@@ -54,10 +55,6 @@ On-line documentation is available for [YAP](http://www.dcc.fp.pt/~vsc/yap/)
-We are happy to include in YAP several excellent packages developed
-under separate licenses. Our thanks to the authors for their kind
-authorization to include these packages.
-
The packages are, in alphabetical order:
+ The CHR package developed by Tom Schrijvers,
diff --git a/console/terminal/console.h b/console/terminal/console.h
index 068c5807b..47def85fe 100644
--- a/console/terminal/console.h
+++ b/console/terminal/console.h
@@ -1,4 +1,4 @@
-/****************************************************************************
+l/****************************************************************************
**
** Copyright (C) 2012 Denis Shienkov
** Copyright (C) 2012 Laszlo Papp
diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in
index 159aa8ec3..a98df128f 100644
--- a/docs/Doxyfile.in
+++ b/docs/Doxyfile.in
@@ -522,14 +522,14 @@ CASE_SENSE_NAMES = NO
# scope will be hidden.
# The default value is: NO.
-HIDE_SCOPE_NAMES = NO
+HIDE_SCOPE_NAMES = YES
# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will
# append additional text to a page's title, such as Class Reference. If set to
# YES the compound reference will be hidden.
# The default value is: NO.
-HIDE_COMPOUND_REFERENCE= NO
+HIDE_COMPOUND_REFERENCE= YES
# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of
# the files that are included by a file in the documentation of that file.
@@ -775,7 +775,8 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.
-INPUT = @PROJECT_SOURCE_DIR@/pl \
+INPUT = @PROJECT_SOURCE_DIR@/INSTALL.md \
+ @PROJECT_SOURCE_DIR@/pl \
@PROJECT_SOURCE_DIR@/CXX \
@PROJECT_SOURCE_DIR@/OPTYap \
@PROJECT_SOURCE_DIR@/C \
@@ -784,9 +785,8 @@ INPUT = @PROJECT_SOURCE_DIR@/pl \
@PROJECT_SOURCE_DIR@/os \
@PROJECT_SOURCE_DIR@/library \
@PROJECT_SOURCE_DIR@/packages \
- @PROJECT_SOURCE_DIR@/swi/library
-# @PROJECT_SOURCE_DIR@/docs/md \
-# @PROJECT_SOURCE_DIR@/INSTALL.md
+ @PROJECT_SOURCE_DIR@/swi/library \
+ @PROJECT_SOURCE_DIR@/docs/md \
# This tag can be used to specify the character encoding of the source files
@@ -844,6 +844,7 @@ EXCLUDE = *pltotex.pl \
@PROJECT_SOURCE_DIR@/packages/CLPBN/examples \
@PROJECT_SOURCE_DIR@/packages/prosqlite \
@PROJECT_SOURCE_DIR@/packages/pyswip \
+@PROJECT_SOURCE_DIR@/library/dialect/swi/os
# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
@@ -860,7 +861,13 @@ EXCLUDE_SYMLINKS = NO
# Note that the wildcards are matched against the file with absolute path, so to
# exclude all test directories for example use the pattern */test/*
-EXCLUDE_PATTERNS = */CMakeFiles/* *~
+EXCLUDE_PATTERNS = \
+ @PROJECT_SOURCE_DIR@/packages/gecode/gecode3_yap.cc \
+ @PROJECT_SOURCE_DIR@/packages/gecode/gecode4_yap.cc \
+ @PROJECT_SOURCE_DIR@/packages/gecode/gecode3.yap \
+ @PROJECT_SOURCE_DIR@/packages/gecode/gecode4.yap \
+ @PROJECT_SOURCE_DIR@/packages/gecode/gecode3_yap_hand_written.yap \ @PROJECT_SOURCE_DIR@/packages/gecode/gecode4_yap_hand_written.yap
+ */CMakeFiles/* *~ */\#* \
# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
# (namespaces, classes, functions, etc.) that should be excluded from the
@@ -2044,7 +2051,11 @@ SEARCH_INCLUDES = YES
# This tag requires that the tag SEARCH_INCLUDES is set to YES.
INCLUDE_PATH = @CMAKE_BINARY_DIR@ \
- @CMAKE_BINARY_DIR@/packages/gecode
+ @PROJECT_SOURCE_DIR@/H \
+ @PROJECT_SOURCE_DIR@/H/generated \
+ @PROJECT_SOURCE_DIR@/include \
+ @PROJECT_SOURCE_DIR@/os \
+ @PROJECT_SOURCE_DIR@/OPTYap \
# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
# patterns (like *.h and *.hpp) to filter out the header-files in the
diff --git a/docs/md/INSTALL.md b/docs/md/INSTALL.md
index 8de57fe84..b663e630a 100644
--- a/docs/md/INSTALL.md
+++ b/docs/md/INSTALL.md
@@ -5,8 +5,8 @@ Installing YAP {#install}
### Downloading YAP {#download}
-The latest development version of Yap-6 is available source-only through GIT repositories. The main references
-repository is at
+The latest development version of Yap-6 is available source-only
+through GIT repositories. The main reference repository is at
+ [github](https://github.com/vscosta/yap-6.3)
@@ -16,7 +16,7 @@ We store an older version of YAP at:
Please just use `git clone` to obtain the distribution. Ie, to download YAP from the command line please type:
-~~~~=
+~~~~~
git clone https://github.com/vscosta/yap-6.3 yap-6.3
~~~~~
@@ -26,15 +26,15 @@ The first argument is the repository, the last argument is the (optional) target
#### Download Options
-More detailed, maybe useful information:
+It may be useful to know:
- + If you are have limited bandwith or disk room, consider using
+ + If you are have limited bandwith or disk spaceq, consider using
`git clone --depth XX` to only include the last `XX` commits.
+ Older versions of YAP were distributed with modules. YAP-6.3.5 is
a single package, and it does not need `git submodule`.
- + The GitHub site includes a number of companion packages,
+ + The GitHub site includes a number of companion packages for YAP,
including [doxygen-yap](https://github.com/vscosta/doxygen-yap), a
version of doxygen adapted to Prolog that was used to generate
these documents.
@@ -48,9 +48,9 @@ generate Makefiles, Ninja, Apple's XCode, VisualStudio and ANdroid
Studio, and because it includes packaging suppport, The steps required
to install core YAP under `cmake`:
-##### Ensure that you have a working `C/C++` compiler in your system
+##### `C/C++` compiler
- 1. Status as of early 17
+ *Status as of early 2017*
YAP should compile well under the [GNU-CC](https://gcc.gnu.org/)
and the [C-LANG]https://clang.llvm.org/() families, that are
@@ -58,23 +58,27 @@ to install core YAP under `cmake`:
undder Intel `icc`.
We do not recommend using Microoft's VC++. To the best of our
- knowledge MSC does not support threaded code, which YAP recquires
+ knowledge MSC does not support threaded emulation, which YAP recquires
for performance, You can still use the IDE, and experiment with
the c-lang plugin.
YAP compiles cleanly under cross-compilers, and we have used the
- crosss-compirt [mxe](http://mxe.cc/) system with good results.
+ crosss-compilation system [mxe](http://mxe.cc/) system with good results.
-##### Ensure that you have a working `cmake` in your systen,
+##### `cmake`
- All Linux and BSD distributions include `cmake`, so
+All Linux and BSD distributions include `cmake`, so
does [Homebrew](https://brew.sh/)
and [MacPorts](https://www.macports.org/) for the Mac,
-and [MSYS2](http://www.msys2.org/) and [cygwin](http://www.cygwin.org/)
-for WIN32. Android Studio has native support, and there are excellenr
-plugins for the Visual Codes. The `cmake` site includes pre-compiled
-binaries. If you have an older Linux you may need to compile from
-source, available at GitHub.
+and [MSYS2](http://www.msys2.org/)
+and [cygwin](http://www.cygwin.org/) for WIN32. Android Studio has
+native support for `cmake`since 2.1, although we advise to use
+2.2. Last, there are excellent plugins for the Visual Codes. In case
+you need a recent version, consider using pre-compiled binaries at
+the [CMake site](https://www.cmake.org).
+
+If you have an older Linux you may need to compile from source,
+available at GitHub.
##### Ensure that you have other necessary packages installed:
diff --git a/docs/md/attributes.md b/docs/md/attributes.md
index 5f216a200..cc1f68ec1 100644
--- a/docs/md/attributes.md
+++ b/docs/md/attributes.md
@@ -1,5 +1,7 @@
- Attributed Variables and Co-Routining {#AttributedVariables}
+ Attributed Variables and Co-Routining {#attributes}
=======================================
+@ingroup extensions
+
YAP supports attributed variables, originally developed at OFAI by
Christian Holzbaur. Attributes are a means of declaring that an
@@ -24,12 +26,12 @@ 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.
-+ @ewd attributes
++ @ref SICS_attributes
+ @ref New_Style_Attribute_Declarations
+ @ref CohYroutining
+ @ref AttributeVariables_Builtins
-@section attributes SICStus Style attribute declarations.
+@section SICS_attributes SICStus Style attribute declarations.
The YAP library `atts` implements attribute variables in the style of
SICStus Prolog. Attributed variables work as follows:
diff --git a/docs/md/bdd.md b/docs/md/bdd.md
index 57602797d..c087b90c5 100644
--- a/docs/md/bdd.md
+++ b/docs/md/bdd.md
@@ -14,4 +14,6 @@ with cudd binaries. This works:
In ubuntu, you may want to install the fedora rpm, or just download the package from the original
and compile it.
- .
+
+ + @ref BDDsPL
+ + @ref CUDD
diff --git a/docs/md/builtins.md b/docs/md/builtins.md
index 5625441b5..bcfad0408 100644
--- a/docs/md/builtins.md
+++ b/docs/md/builtins.md
@@ -3,29 +3,13 @@ YAP Built-ins {#builtins}
This chapter describes the core predicates that control the execution of
Prolog programs, provide fundamental functionality such as termm manipulation or arithmetic, and support interaction with external
-resources, Many of the predicates described here have been standardised by the ISO. The standartised subset of Proloh also known as ISO-Prolog.
+resources, Many of the predicates described here have been standardised by the ISO. The standartised subset of Prolog also known as ISO-Prolog.
-In the description of the arguments of functors the following notation
-will be used:
+In the description of the arguments of predicates the following
+notation will be used:
+ a preceding plus sign will denote an argument as an "input
argument" - it cannot be a free variable at the time of the call;
+ a preceding minus sign will denote an "output argument";
+ an argument with no preceding symbol can be used in both ways.
-+ @ref YAPControl
-+ @ref Arithmetic
-
-+ @ref YAPChars
-
-+ @ref YAP_Terms
-
-+ @ref InputOutput
-
-+ @ref AbsoluteFileName
-
-+ @ref YAPOS
-
-+ @ref Internal_Database
-
-+ @ref Sets
diff --git a/docs/md/extensions.md b/docs/md/extensions.md
index 844c2e302..70cf92da7 100644
--- a/docs/md/extensions.md
+++ b/docs/md/extensions.md
@@ -1,12 +1,12 @@
-Extensions to core Prolog. {#extensions}
-=========================
+Extensions to core Prolog. {#extensions}
+========================
YAP includes a number of extensions over the original Prolog
-language. Next, we discuss how to use the most important ones.
+language.
+ @ref Rational_Trees
- + @ref AttributedVariables
+ + @subpage attributes
+ @ref DepthLimited
@@ -19,3 +19,6 @@ language. Next, we discuss how to use the most important ones.
+ @ref YAPArrays
+ @ref Parallelism
+
+
+
diff --git a/docs/md/load_files.md b/docs/md/load_files.md
index c8700e089..066d11ac7 100644
--- a/docs/md/load_files.md
+++ b/docs/md/load_files.md
@@ -1,11 +1,11 @@
-Loading and Oganising YAP Programs {#consult}
+Loading and Oganising YAP Programs {#load_files}
===================================
Next, we present the main predicates and directives available to load
files and to control the Prolog environment.
- + @subpage modules.md
+ + @subpage YAPModules
+ @ref YAPConsulting
- + @ref YAPSaving
+ + @ref QLY
diff --git a/docs/md/modules.md b/docs/md/modules.md
index 5913c1555..37addc0b0 100644
--- a/docs/md/modules.md
+++ b/docs/md/modules.md
@@ -1,7 +1,5 @@
-The YAP Module system
-======================
-
-[TOC]
+The YAP Module system {#YAPModules}
+=====================
The YAP module system is based on the Quintus/SISCtus module
system ˜\cite quintus . In this design, modules are named collections of predicates,
@@ -12,9 +10,9 @@ _exported_, that is, visible to other modules.
The main predicates in the module system are:
- * module/2 associates a source file to a module. It has two arguments: the name of the new module, and a list of predicates exported by the module.
+ * module/2 associates a source file to a module. It has two arguments: the name of the new module, and a list of predicates exported by the module.
- * use_module/1 and use_module/2 can be used to load a module. They take as first argument the source file for the module. Whereas use_module/1 loads all exported predicates, use_module/2 only takes the ones given by the second argument.
+ * use_module/1 and use_module/2 can be used to load a module. They take as first argument the source file for the module. Whereas use_module/1 loads all exported predicates, use_module/2 only takes the ones given by the second argument.
YAP pre-defines a number of modules. Most system predicates belong to
the module `prolog`. Predicates from the module `prolog` are
diff --git a/docs/md/packages.md b/docs/md/packages.md
index d7aa35e09..8344d6d3f 100644
--- a/docs/md/packages.md
+++ b/docs/md/packages.md
@@ -1,28 +1,30 @@
-YAP packages files {#packages}
-===================
+YAP packages files {packages}
+==============================
-+ @subpage real
+ + @subpage real
-+ @ref BDDs
+ + @subpage bdds
-+ @subpage gecode
+ + @subpage gecode
-+ @subpage myddas
+ + @subpage myddas
-+ @ref PFL/CLP(BN)
+ + @ref PFL
-+ @ref ProbLog1
+ + @subpage ProbLog1
-+ @ref Python
+ + @ref Python
-+ @subpage YAPRaptor
+ + @subpage raptor
-+ @ref YAP-LBFGS
+ + @ref YAP-LBFGS
-+ @subpage yap-udi-indexers
+ + @subpage yap-udi-indexers
-Leuven packages ported from SWI-Prolog:
+ Leuven packages ported from SWI-Prolog:
+
+ + @subpage chr
+
+ + @subpage clpqr
-+ @subpage chr
-+ @subpage clpqr
diff --git a/docs/md/programming.md b/docs/md/programming.md
new file mode 100644
index 000000000..b1f1e7518
--- /dev/null
+++ b/docs/md/programming.md
@@ -0,0 +1,10 @@
+Programming in YAP {#YAPProgramming}
+====================
+
+ + @subpage YAPSyntax
+
+ + @ref YAPCompilerSettings
+
+ + @ref Indexing
+
+ + @ref Deb_Interaction
diff --git a/docs/md/swi.md b/docs/md/swi.md
index 7366dd2ca..711700866 100644
--- a/docs/md/swi.md
+++ b/docs/md/swi.md
@@ -1,5 +1,7 @@
-Compatibility with other Prolog systems {#swi_iso_c}
-=======================================
+Compatibility with other Prolog systems {#swi_iso_c}
+======================================
+
+@ingroup YAPProgramming
YAP has been designed to be as compatible as possible with other
Prolog systems, originally with C-Prolog\cite x and SICStus
diff --git a/docs/md/syntax.md b/docs/md/syntax.md
index 6c95b7f87..79a292f23 100644
--- a/docs/md/syntax.md
+++ b/docs/md/syntax.md
@@ -1,6 +1,7 @@
YAP Syntax {#YAPSyntax}
============
+ @ingroup YAPProgrammming
We will describe the syntax of YAP at two levels. We first will
describe the syntax for Prolog terms. In a second level we describe
diff --git a/docs/md/yap.md b/docs/md/yap.md
index 5a1d3c773..0253aaad4 100644
--- a/docs/md/yap.md
+++ b/docs/md/yap.md
@@ -1,18 +1,27 @@
YAP 6-3.5 Manual {#mainpage}
====================
-This file documents the YAP Prolog System version 6.3.4, a high-performance Prolog compiler developed at LIACC, Universidade do Porto. YAP is based on David H. D. Warren's WAM (Warren Abstract Machine), with several optimizations for better performance. YAP follows the Edinburgh tradition, and is largely compatible with DEC-10 Prolog, Quintus Prolog, and originally with C-Prolog.
+
+
+
+
+NOTE: this version of YAP is still experimental, documentation may be out of date.
+
+## Introduction
+
+This document provides User information on version 6.3.4 of
+YAP (Yet Another Prolog). The YAP Prolog System is a
+high-performance Prolog compiler developed at Universidade do
+Porto.
The manual is organised as follows:
-+ @subpage download
-
+ @subpage install
+ @subpage run
-+ @subpage consult
++ @subpage load_files
+ @subpage builtins
@@ -22,15 +31,11 @@ The manual is organised as follows:
+ @subpage packages
-+ @subpage swi_iso_c
-
+ @subpage YAPProgramming
+ @subpage fli_c_cxx
-
-
\author Vitor Santos Costa,
\author Luís Damas,
\author Rogério Reis
diff --git a/include/YapInterface.h b/include/YapInterface.h
index 5ed4ecc17..bf9be2fc7 100755
--- a/include/YapInterface.h
+++ b/include/YapInterface.h
@@ -18,17 +18,10 @@
@file YapInterface.h
+@addtogroup ChYInterface
@{
- @defgroup fli_c_cx Foreign Language interface to YAP
-
- @toc
-
- @defgroup ChYInterface C interface to YAP
- @{
-
- @ingroup fli_c_cx
-
+\
@brief Core interface to YAP.
@toc
diff --git a/include/c_interface.h b/include/c_interface.h
index 0db0c5a3d..563212c76 100644
--- a/include/c_interface.h
+++ b/include/c_interface.h
@@ -13,7 +13,11 @@
* comments: c_interface header file for YAP *
* *
*************************************************************************/
-
+/**
+ * @file c_interface.h
+ *
+ * @addtogroup ChYInterface
+ */
#if !defined(_c_interface_h) && !defined(_YAP_NOT_INSTALLED_)
#define _c_interface_h 1
diff --git a/library/arg.yap b/library/arg.yap
index 95fd8867d..35424861a 100644
--- a/library/arg.yap
+++ b/library/arg.yap
@@ -10,7 +10,7 @@
/**
*
-@defgroup arg Term Argument Manipulation.
+@defgroup args Term Argument Manipulation.
@ingroup @library
diff --git a/library/atts.yap b/library/atts.yap
index bdffdf880..de245a6ec 100644
--- a/library/atts.yap
+++ b/library/atts.yap
@@ -18,32 +18,35 @@
:- module(attributes, [op(1150, fx, attribute)]).
/**
- @addtogroup attributes
+ *
+ * @defgroup sicsatts SICStus style attribute declarations
+ *
+ * @ingroup attributes
+ *
+ * @{
+ *
+ SICStus style attribute declarations are activated through loading the
+ library atts. The command
-%% @{
+ ~~~~~
+ | ?- use_module(library(atts)).
+ ~~~~~
+ enables this form of attributed variables.
- SICStus style attribute declarations are activated through loading the
-library atts. The command
+ The directive
-~~~~~
-| ?- use_module(library(atts)).
-~~~~~
-enables this form of attributed variables.
+ - attribute/1
-The directive
+ and the following user defined predicates can be used:
-- attribute/1
+ - Module:get_atts/2
-and the following user defined predicates can be used:
+ - Module:put_atts/2
-- Module:get_atts/2
+ - Module:put_atts/3
-- Module:put_atts/2
-
-- Module:put_atts/3
-
-- Module:woken_att_do/4
+ - Module:woken_att_do/4
*/
diff --git a/library/dialect/swi.yap b/library/dialect/swi.yap
index 3a75daf58..eb42c7b64 100644
--- a/library/dialect/swi.yap
+++ b/library/dialect/swi.yap
@@ -2,13 +2,17 @@
% SWI emulation.
% written in an on-demand basis.
-%% @defgroup swi Compatibility with SWI-Prolog and Other Prolog systems
+%% @defgroup SWI Compatibility with SWI-Prolog and Other Prolog systems
+%% @{
+%% @ingroup YAPProgramming
-/**
+/**
@defgroup System SWI Dialect Support
+@ingroup SWI
+
+@{
-
This library provides a number of SWI-Prolog builtins that are not by
default in YAP. This support is loaded with the
~~~~~
@@ -17,20 +21,18 @@ expects_dialect(swi)
command.
-@{
-
*/
-/** @pred time_file(+ _File_,- _Time_)
+/** @pred time_file(+ _File_,- _Time_)
Unify the last modification time of _File_ with
_Time_. _Time_ is a floating point number expressing the seconds
elapsed since Jan 1, 1970.
-
+
*/
-/** @pred concat_atom(+ _List_,- _Atom_)
+/** @pred concat_atom(+ _List_,- _Atom_)
@@ -39,7 +41,7 @@ if _Atom_ can be unified with the concatenated elements of _List_. If
_List_ has exactly 2 elements it is equivalent to `atom_concat/3`,
allowing for variables in the list.
-
+
*/
:- module(system, [concat_atom/2,
@@ -143,14 +145,14 @@ concatenated are the representation for _A12_.
If _A1_ and _A2_ are unbound, the built-in will find all the atoms
that concatenated give _A12_.
-
+
*/
goal_expansion(atom_concat(A,B,C),atomic_concat(A,B,C)).
%goal_expansion(arg(A,_,_),_) :- nonvar(A), !, fail.
goal_expansion(arg(A,B,C),arg:genarg(A,B,C)).
-% make sure we also use
+% make sure we also use
:- user:library_directory(X),
atom(X),
atom_concat([X,'/dialect/swi'],SwiDir),
@@ -187,7 +189,7 @@ instantiating _Separator_ and _Atom_:
L = [gnu, gnat]
~~~~~
-
+
*/
concat_atom([A|List], Separator, New) :- var(List), !,
atom_codes(Separator,[C]),
@@ -224,7 +226,7 @@ cvt_bindings([[Name|Value]|L],[AName=Value|Bindings]) :-
atom_codes(AName, Name),
cvt_bindings(L,Bindings).
-/** @pred chdir(+ _Dir_)
+/** @pred chdir(+ _Dir_)
Compatibility predicate. New code should use working_directory/2.
*/
@@ -317,5 +319,7 @@ required_predicate(Na/Ar, M) :-
).
/**
+@}
+
@}
*/
diff --git a/library/readutil.yap b/library/readutil.yap
index 95bd988e6..59671958a 100644
--- a/library/readutil.yap
+++ b/library/readutil.yap
@@ -38,7 +38,7 @@
]).
/**
-* @defsgroup readutil
+* @defgroup readutil
* @ingroup library
*
* Read full lines and a full file in a single call.
diff --git a/library/varnumbers.yap b/library/varnumbers.yap
index 6fc8c0046..b4b76f8cf 100644
--- a/library/varnumbers.yap
+++ b/library/varnumbers.yap
@@ -2,10 +2,10 @@
* @file varnumbers.yap
* @author VITOR SANTOS COSTA
* @date 2006
- *
+ *
* @brief opposite to numbervars
- *
- *
+ *
+ *
*/
:- module(varnumbers, [
@@ -16,8 +16,8 @@
/**
* @defgroup varnumbers Variabilize term.
-* @ingroup ellllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll
-*
+* @ingroup library
+*
*/
diff --git a/os/chartypes.c b/os/chartypes.c
index 1e61250fc..bb0d60d20 100644
--- a/os/chartypes.c
+++ b/os/chartypes.c
@@ -29,7 +29,6 @@ static char SccsId[] = "%W% %G%";
///{@
-/// @addtogroup CharProps
/**
* @defgroup CharIO Character-Based Input/Output
* @ingroup InputOutput
diff --git a/os/chartypes.yap b/os/chartypes.yap
index 7660ae702..c1df74ec2 100644
--- a/os/chartypes.yap
+++ b/os/chartypes.yap
@@ -1386,7 +1386,6 @@ digit_weight( 0x1D7D7, 9).
digit_weight( 0x1D7E1, 9).
digit_weight( 0x1D7EB, 9).
digit_weight( 0x1D7F5, 9).
-x
digit_weight( 0x1D7FF, 9).
digit_weight( 0x1E8CF, 9).
digit_weight( 0x1F10A, 9).
diff --git a/os/fmemopen.c b/os/fmemopen.c
index 3033d1a55..e8f061f94 100644
--- a/os/fmemopen.c
+++ b/os/fmemopen.c
@@ -14,12 +14,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-//
+//
/**
* @file fmemopen.c
- * @defgroup Memory Streams.
- * @in.
+ * @defgroup MemoryStreams Memory Streams
+ * @ingroup InputOutput
* @return Description of returned value.
*/
#ifdef __APPLE__
@@ -41,13 +41,13 @@ typedef struct fmem fmem_t;
static int readfn(void *handler, char *buf, int size) {
fmem_t *mem = handler;
size_t available = mem->size - mem->pos;
-
+
if (size > available) {
size = available;
}
memcpy(buf, mem->buffer + mem->pos, sizeof(char) * size);
mem->pos += size;
-
+
return size;
}
diff --git a/packages/CLPBN/pfl.yap b/packages/CLPBN/pfl.yap
index a9b5855f1..a35e1d495 100644
--- a/packages/CLPBN/pfl.yap
+++ b/packages/CLPBN/pfl.yap
@@ -22,7 +22,7 @@
]).
/** @defgroup PFL The PrologFactor Language
-@ingroup YAPPackagaes
+@ingroup packages
section{Introduction}
The Prolog Factor Language (PFL) is a language that extends Prolog for providing a syntax to describe first-order probabilistic graphical models. These models can be either directed (bayesian networks) or undirected (markov networks). This language replaces the old one known as CLP(BN).
diff --git a/packages/bdd/bdd.yap b/packages/bdd/bdd.yap
index 03abff01a..d56c6070e 100644
--- a/packages/bdd/bdd.yap
+++ b/packages/bdd/bdd.yap
@@ -1,7 +1,8 @@
-/** @defgroup BDDs Binary Decision Diagrams and Friends
-@ingroup packages
+@defgroup BDDsPL Binary Decision Diagrams and Friends
+@ingroup BDDs
@{
+
This library provides an interface to the BDD package CUDD. It requires
CUDD compiled as a dynamic library. In Linux this is available out of
box in Fedora, but can easily be ported to other Linux
diff --git a/docs/md/chr.md b/packages/chr/chr.md
similarity index 100%
rename from docs/md/chr.md
rename to packages/chr/chr.md
diff --git a/packages/chr/chr_compiler_options.pl b/packages/chr/chr_compiler_options.pl
index 891c7ac2e..fa7f4fbfa 100644
--- a/packages/chr/chr_compiler_options.pl
+++ b/packages/chr/chr_compiler_options.pl
@@ -28,7 +28,8 @@
invalidate any other reasons why the executable file might be covered by
the GNU General Public License.
*/
-%% @addtogroup CHR_in_YAP_Programs
+%% @addtogroup CHR_in_YAP_Programs CHR Programs
+%% @ingroup CHR
%
% CHR controlling the compiler
%
@@ -38,7 +39,7 @@
, init_chr_pp_flags/0
, chr_pp_flag/2
]).
-
+
%% SICStus begin
%% :- use_module(hprolog, [nb_setval/2,nb_getval/2]).
%% local_current_prolog_flag(_,_) :- fail.
@@ -55,11 +56,11 @@ local_current_prolog_flag(X,Y) :- current_prolog_flag(X,Y).
% Global Options
%
-handle_option(Name,Value) :-
+handle_option(Name,Value) :-
var(Name), !,
chr_error(syntax((:- chr_option(Name,Value))),'First argument should be an atom, not a variable.\n',[]).
-handle_option(Name,Value) :-
+handle_option(Name,Value) :-
var(Value), !,
chr_error(syntax((:- chr_option(Name,Value))),'Second argument cannot be a variable.\n',[]).
@@ -68,11 +69,11 @@ handle_option(Name,Value) :-
!,
set_chr_pp_flags(Flags).
-handle_option(Name,Value) :-
+handle_option(Name,Value) :-
\+ option_definition(Name,_,_), !,
chr_error(syntax((:- chr_option(Name,Value))),'Invalid option name ~w: consult the manual for valid options.\n',[Name]).
-handle_option(Name,Value) :-
+handle_option(Name,Value) :-
chr_error(syntax((:- chr_option(Name,Value))),'Invalid option value ~w: consult the manual for valid option values.\n',[Value]).
option_definition(optimize,experimental,Flags) :-
@@ -198,7 +199,7 @@ option_definition(type_declaration,TypeDecl,[]) :-
TypeDecl =.. [_|ArgTypes],
chr_translate:constraint_type(F/A,ArgTypes)
; true).
-
+
option_definition(mode,ModeDecl,[]) :-
( nonvar(ModeDecl) ->
functor(ModeDecl,F,A),
@@ -290,7 +291,7 @@ option_definition(ht_removal,off,Flags) :-
option_definition(mixed_stores,on,Flags) :-
Flags = [mixed_stores - on].
option_definition(mixed_stores,off,Flags) :-
- Flags = [mixed_stores - off].
+ Flags = [mixed_stores - off].
option_definition(line_numbers,on,Flags) :-
Flags = [line_numbers - on].
@@ -312,7 +313,7 @@ init_chr_pp_flags :-
chr_pp_flag_definition(Name,[DefaultValue|_]),
set_chr_pp_flag(Name,DefaultValue),
fail.
-init_chr_pp_flags.
+init_chr_pp_flags.
set_chr_pp_flags([]).
set_chr_pp_flags([Name-Value|Flags]) :-
@@ -368,7 +369,7 @@ chr_pp_flag(Name,Value) :-
;
V = Value
).
-
+
% TODO: add whatever goes wrong with (debug,on), (optimize,full) combo here!
% trivial example of what does go wrong:
diff --git a/packages/chr/chr_debug.pl b/packages/chr/chr_debug.pl
index 376ab1440..49b71bac3 100644
--- a/packages/chr/chr_debug.pl
+++ b/packages/chr/chr_debug.pl
@@ -29,7 +29,8 @@
the GNU General Public License.
*/
-%% @addtogroup CHR_Debugging
+%% @addtogroup CHR_Debugging Debugging
+%% @ingroup CHR
%
% CHR debugger
%
@@ -43,7 +44,7 @@
%% chr_show_store(+Module)
-%
+%
% Prints all suspended constraints of module Mod to the standard
% output.
diff --git a/packages/chr/chr_runtime.pl b/packages/chr/chr_runtime.pl
index 0058e9742..4f61926ca 100644
--- a/packages/chr/chr_runtime.pl
+++ b/packages/chr/chr_runtime.pl
@@ -68,7 +68,8 @@
%% * Added initialization directives for saved-states
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-%% @addtogroup CHR_Rule_Types
+%% @addtogroup CHR_Rule_Types Rule Types
+%% @ingroup CHR
%
% CHR controlling the compiler
%
diff --git a/packages/chr/chr_swi.pl b/packages/chr/chr_swi.pl
index 09140d1da..bebbbfd51 100644
--- a/packages/chr/chr_swi.pl
+++ b/packages/chr/chr_swi.pl
@@ -30,7 +30,8 @@
*/
%% SWI begin
-%% @addtogroup CHR
+%% @addtogroup CHR chr
+%% @ingroup packages
%
% SWI interface.
%
diff --git a/docs/md/clpqr.md b/packages/clpqr/clpqr.md
similarity index 98%
rename from docs/md/clpqr.md
rename to packages/clpqr/clpqr.md
index db838adeb..9e18f0bf0 100644
--- a/docs/md/clpqr.md
+++ b/packages/clpqr/clpqr.md
@@ -1,4 +1,4 @@
- Constraint Logic Programming over Rationals and Reals {#clpqr}
+Constraint Logic Programming over Rationals and Reals {#clpqr}
=====================================================
YAP now uses the CLP(R) package developed by Leslie De Koninck,
diff --git a/packages/clpqr/clpr.pl b/packages/clpqr/clpr.pl
index e065bb960..d84070ba4 100644
--- a/packages/clpqr/clpr.pl
+++ b/packages/clpqr/clpr.pl
@@ -1,7 +1,7 @@
/* $Id$
Part of CLP(R) (Constraint Logic Programming over Reals)
-
+
Author: Leslie De Koninck
E-mail: Leslie.DeKoninck@cs.kuleuven.be
WWW: http://www.swi-prolog.org
@@ -38,16 +38,21 @@
the GNU General Public License.
*/
-/** @defgroup clpr_implementation CLP(QR) Predicates
+/** @addtogroup clpqr CLP(QR)
+ @ingroup packages
+ @{
+ */
+
+/** @defgroup clpr_implementation CLP(QR) Predicates
@ingroup clpqr
-
+ @{
*/
/** @pred bb_inf(+ _Ints_,+ _Expression_,- _Inf_)
The same as bb_inf/5 but without returning the values of the integers
and with an eps of 0.001.
-
+
*/
/** @pred bb_inf(+ _Ints_,+ _Expression_,- _Inf_,- _Vertext_,+ _Eps_)
Computes the infimum of _Expression_ within the current constraint
@@ -58,7 +63,7 @@ value may differ from an integer to be considered an integer. E.g. when
_Eps_ = 0.001, then X = 4.999 will be considered as an integer (5 in
this case). _Eps_ should be between 0 and 0.5.
-
+
*/
/** @pred dump(+ _Target_,+ _Newvars_,- _CodedAnswer_)
Returns the constraints on _Target_ in the list _CodedAnswer_
@@ -81,28 +86,28 @@ Succeeds if _Constraint_ is necessarily true within the current
constraint store. This means that adding the negation of the constraint
to the store results in failure.
-
+
*/
/** @pred inf(+ _Expression_,- _Inf_)
Computes the infimum of _Expression_ within the current state of the
constraint store and returns that infimum in _Inf_. This predicate
does not change the constraint store.
-
+
*/
/** @pred inf(+ _Expression_,- _Sup_)
Computes the supremum of _Expression_ within the current state of
the constraint store and returns that supremum in _Sup_. This
predicate does not change the constraint store.
-
+
*/
/** @pred maximize( _V_)
maximise variable _V_
-
+
*/
-/** @pred minimize(V)
+/** @pred minimize(V)
minimise variable _V_
@@ -205,3 +210,7 @@ memberchk_eq(X,[Y|Ys]) :-
-> true
; memberchk_eq(X,Ys)
).
+
+%% @}
+
+%% @}
diff --git a/docs/md/gecode.md b/packages/gecode/gecode.md
similarity index 100%
rename from docs/md/gecode.md
rename to packages/gecode/gecode.md
diff --git a/packages/gecode/gecode5_yap_hand_written.yap b/packages/gecode/gecode5_yap_hand_written.yap
index b51355964..2e9778173 100644
--- a/packages/gecode/gecode5_yap_hand_written.yap
+++ b/packages/gecode/gecode5_yap_hand_written.yap
@@ -1,4 +1,4 @@
-%% -*- prolog -*-
+pgec%% -*- prolog -*-
%%=============================================================================
%% Copyright (C) 2011 by Denys Duchier
%%
@@ -6,12 +6,12 @@
%% under the terms of the GNU Lesser General Public License as published by the
%% Free Software Foundation, either version 3 of the License, or (at your
%% option) any later version.
-%%
+%%
%% This program is distributed in the hope that it will be useful, but WITHOUT
%% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
%% FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
%% more details.
-%%
+%%
%% You should have received a copy of the GNU Lesser General Public License
%% along with this program. If not, see .
%%=============================================================================
@@ -31,7 +31,7 @@ Duchier, with recent work by Vítor Santos Costa to port it to version 4
of gecode and to have an higher level interface,
- @defgroup The_Gecode_Interface The Gecode Interface
+ @addtogroup The_Gecode_Interface The Gecode Interface
@ingroup Gecode
@{
@@ -265,7 +265,7 @@ and lookup values of variables in each solution:
-
+
*/
:- use_module(library(debug)).
@@ -797,11 +797,11 @@ new_setvar(SVar,Space,X1,X2) :-
new_tupleset( TupleSet, List ) :-
gecode_new_tupleset(List, TupleSet_),
TupleSet = 'TupleSet'(TupleSet_).
-
+
new_dfa( DFA, S0, List, Finals ) :-
gecode_new_dfa(DFA_, S0, List, Finals),
DFA = 'DFA'(DFA_).
-
+
minimize(Space,IVar) :-
assert_is_Space(Space,Space_),
diff --git a/packages/md b/packages/md
new file mode 100644
index 000000000..3a7c83ea2
--- /dev/null
+++ b/packages/md
@@ -0,0 +1,15 @@
+
+This is an experimental interface to BDD libraries. It is not as
+sophisticated as simplecudd, but it should be fun to play around with bdds.
+
+It currently works with cudd only, although it should be possible to
+port to other libraries. It requires the ability to dynamically link
+with cudd binaries. This works:
+
+- in fedora with standard package
+- in osx with hand-compiled and ports package
+
+In ubuntu, you may want to install the fedora rpm, or just download the package from the original
+ and compile it.
+
+ .
diff --git a/docs/md/myddas.md b/packages/myddas/myddas.md
similarity index 81%
rename from docs/md/myddas.md
rename to packages/myddas/myddas.md
index 056e514fa..7520eeac0 100644
--- a/docs/md/myddas.md
+++ b/packages/myddas/myddas.md
@@ -1,14 +1,20 @@
- The MYDDAS Data-base interface {#myddas}
- ==============================
+The MYDDAS Data-base interface {#myddas}
+===============================
+
+@ingroup Packages
+
+@{
+
+@file myddas.md
The MYDDAS database project was developed within a FCT project aiming at
the development of a highly efficient deductive database system, based
on the coupling of the MySQL relational database system with the YAP
Prolog system. MYDDAS was later expanded to support the ODBC interface.
+@defgroup Requirements_and_Installation_Guide Requirements and Installation Guide
+@ingroup #myddas
- @defgroup Requirements_and_Installation_Guide Requirements and Installation Guide
- ee
Next, we describe how to usen of the YAP with the MYDDAS System. The
use of this system is entirely depend of the MySQL development libraries
or the ODBC development libraries. At least one of the this development
@@ -39,7 +45,8 @@
two different ways. As if we were on the MySQL Client Shell, and as if
we were using Datalog.
- @defgroup MYDDAS_Architecture MYDDAS Architecture
+@defgroup MYDDAS_Architecture MYDDAS Architecture
+@ingroup myddas
The system includes four main blocks that are put together through the
MYDDAS interface: the Yap Prolog compiler, the MySQL database system, an
@@ -64,33 +71,32 @@
Prolog cut operator, which has exactly the same behaviour from
predicates defined in the Prolog program source code, or from predicates
defined in database as relations.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Name = 'John Doe',
Number = 123456789 ?
yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Backtracking can then be used to retrieve the next row
of the relation phonebook. Records with particular field values may be
selected in the same way as in Prolog. (In particular, no mode
specification for database predicates is required). For instance:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- phonebook(Letter,'John Doe',Letter).
Letter = 'D',
Number = 123456789 ?
yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
generates the query
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SELECT A.Letter , 'John Doe' , A.Number
FROM 'phonebook' A
WHERE A.Name = 'John Doe';
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-
- @defgroup View_Level_Interface View Level Interface
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+@defgroup View_Level_Interface View Level Interface
+@ingroup myddas
@pred db view(+,+,+).
@@ -101,18 +107,18 @@
If we import a database relation, such as an edge relation representing the edges of a directed graph, through
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_import('Edge',edge).
yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
sqliand we then write a query to retrieve all the direct cycles in the
graph, such as
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- edge(A,B), edge(B,A).
A = 10,
B = 20 ?
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
this is clearly inefficient [3], because of relation-level
access. Relation-level access means that a separate SQL query will be
generated for every goal in the body of the clause. For the second
@@ -129,10 +135,10 @@
predicates. One can use the view level interface through the predicates
db_view/3 and `db_view/2`:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_view(Conn,PredName(Arg_1,...,Arg_n),DbGoal).
?- db_view(PredName(Arg_1,...,Arg_n),DbGoal).
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All arguments are standard Prolog terms. _Arg1_ through _Argn_
define the attributes to be retrieved from the database, while
_DbGoal_ defines the selection restrictions and join
@@ -142,48 +148,48 @@
an example of a view definition for the direct cycles discussed
above. Assuming the declaration:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_import('Edge',edge).
yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
we
write:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_view(direct_cycle(A,B),(edge(A,B), edge(B,A))).
yes
?- direct_cycle(A,B)).
A = 10,
B = 20 ?
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This call generates the SQL
statement:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SELECT A.attr1 , A.attr2
FROM Edge A , Edge B
WHERE B.attr1 = A.attr2 AND B.attr2 = A.attr1;
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Backtracking, as in relational level interface, can be used to retrieve the next row of the view.
The view interface also supports aggregate function predicates such as
`sum`, `avg`, `count`, `min` and `max`. For
instance:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_view(count(X),(X is count(B, B^edge(10,B)))).
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
generates the query :
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SELECT COUNT(A.attr2)
FROM Edge A WHERE A.attr1 = 10;
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To know how to use db `view/3`, please refer to Draxler's Prolog to
SQL Compiler Manual.
-
- @defgroup Accessing_Tables_in_Data_Sources_Using_SQL Accessing Tables in Data Sources Using SQL
+@defgroup Accessing_Tables_in_Data_Sources_Using_SQL Accessing Tables in Data Sources Using SQL
+@ingroup myddas
@pred db_sql(+,+,?).
@@ -196,22 +202,22 @@
It is also possible to explicitly send a SQL query to the database server using
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_sql(Conn,SQL,List).
?- db_sql(SQL,List).
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
where _SQL_ is an arbitrary SQL expression, and _List_ is a list
holding the first tuple of result set returned by the server. The result
set can also be navigated through backtracking.
Example:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_sql('SELECT * FROM phonebook',LA).
LA = ['D','John Doe',123456789] ?
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-@defgroup Insertion_of_Rows Insertion of Rows
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+@defgroup Insertion_of_Rows Insertion of Rows
+@ingroup myddas
@ingroup MYDDAS
@pred db_assert(+,+).
@@ -224,36 +230,36 @@
`db_import/2` or db_import/3, you can insert to that table
by using db_assert/2 predicate any given fact.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_assert(Conn,Fact).
?- db_assert(Fact).
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The second argument must be declared with all of its arguments bound to
constants. For example assuming `helloWorld` is imported through
`db_import/2`:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_import('Hello World',helloWorld).
yes
?- db_assert(helloWorld('A' ,'Ana',31)).
yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This, would generate the following query
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INSERT INTO helloWorld
VALUES ('A','Ana',3)
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
which would insert into the helloWorld, the following row:
`A,Ana,31`. If we want to insert `NULL` values into the
relation, we call db_assert/2 with a uninstantiated variable in
the data base imported predicate. For example, the following query on
the YAP-prolog system:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_assert(helloWorld('A',NULL,31)).
yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Would insert the row: `A,null value,31` into the relation
`Hello World`, assuming that the second row allows null values.
@@ -268,22 +274,23 @@
This predicate would create a new database predicate, which will insert
any given tuple into the database.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_insert(Conn,RelationName,PredName).
?- db_insert(RelationName,PredName).
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This would create a new predicate with name _PredName_, that will
insert tuples into the relation _RelationName_. is the connection
identifier. For example, if we wanted to insert the new tuple
`('A',null,31)` into the relation `Hello World`, we do:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_insert('Hello World',helloWorldInsert).
yes
?- helloWorldInsert('A',NULL,31).
yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-@defgroup Types_of_Attributes Types of AttributesL
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+@defgroup Types_of_Attributes Types of AttributesL
+@ingroup myddas
@pred db_get_attributes_types(+,+,?).
@@ -297,25 +304,25 @@
The prototype for this predicate is the following:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_get_attributes_types(Conn,RelationName,ListOfFields).
?- db_get_attributes_types(RelationName,ListOfFields).
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can use the
predicate `db_get_attributes types/2` or db_get_attributes_types/3, to
know what are the names and attributes types of the fields of a given
relation. For example:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_get_attributes_types(myddas,'Hello World',LA).
LA = ['Number',integer,'Name',string,'Letter',string] ?
yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
where Hello World is the name of the relation and myddas is the
connection identifier.
-
- @defgroup Number_of_Fields Number of Fields
+@defgroup Number_of_Fields Number of Fields
+@ingroup myddas
@pred db_number_of_fields(+,?).
@@ -326,23 +333,24 @@
The prototype for this
predicate is the following:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_number_of_fields(Conn,RelationName,Arity).
?- db_number_of_fields(RelationName,Arity).
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can use the predicate db_number_of_fields/2 or
`db_number_of_fields/3` to know what is the arity of a given
relation. Example:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_number_of_fields(myddas,'Hello World',Arity).
Arity = 3 ?
yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
where `Hello World` is the name of the
relation and `myddas` is the connection identifier.
- @defgroup Describing_a_Relation Describing a Relation
+@defgroup Describing_a_Relation Describing a Relation
+@ingroup #myddas
@pred db_datalog_describe(+,+).
@pred db_datalog_describe(+).
@@ -353,7 +361,7 @@
value. It simply prints to the screen the result of the MySQL describe
command, the same way as `DESCRIBE` in the MySQL prompt would.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_datalog_describe(myddas,'Hello World').
+----------+----------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
@@ -363,7 +371,7 @@
+ Letter | char(1) | YES | | NULL | |
+----------+----------+------+-----+---------+-------+
yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@pred db_describe(+,+).
@@ -376,15 +384,15 @@
difference. The results are returned by backtracking. For example, the
last query:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_describe(myddas,'Hello World',Term).
Term = tableInfo('Number',int(11),'YES','',null(0),'') ? ;
Term = tableInfo('Name',char(10),'YES','',null(1),'' ? ;
Term = tableInfo('Letter',char(1),'YES','',null(2),'') ? ;
no
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- @defgroup Enumerating_Relations Enumeration Relations Describing_a_Relation Describing a Relation
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+@defgroup Enumerating_Relations Enumeration Relations Describing_a_Relation Describing a Relation
+@ingroup #myddas
/@pred db_datalog_show_tables(+).
@@ -396,7 +404,7 @@
it does not returns any value, but instead prints to the screen the result of the
`SHOW TABLES` command, the same way as it would be in the MySQL prompt.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_datalog_show_tables(myddas).
+-----------------+
| Tables_in_guest |
@@ -404,7 +412,7 @@
| Hello World |
+-----------------+
yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@pred db_show_tables(+, ?).
@@ -418,12 +426,15 @@
`db_show_tables/1` predicate but with one major difference. The
results are returned by backtracking. For example, given the last query:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_show_tables(myddas,Table).
Table = table('Hello World') ? ;
no
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- @defgroup The_MYDDAS_MySQL_Top_Level The MYDDAS MySQL Top Level
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+
+@defgroup The_MYDDAS_MySQL_Top_Level The MYDDAS MySQL Top Level
+@ingroup #myddas
@pred db_top_level(+,+,+,+,+).
@pred db_top_level(+,+,+,+).
@@ -437,27 +448,27 @@
different from the standard mysql client. We can use this
mode, by invoking the db top level/5. as one of the following:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_top_level(mysql,Connection,Host/Database,User,Password).
?- db_top_level(mysql,Connection,Host/Database/Port,User,Password).
?- db_top_level(mysql,Connection,Host/Database/UnixSocket,User,Password).
?- db_top_level(mysql,Connection,Host/Database/Port/UnixSocket,User,Password).
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Usage is similar as the one described for the db_open/5 predicate
discussed above. If the login is successful, automatically the prompt of
the mysql client will be used. For example:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_top_level(mysql,con1,localhost/guest_db,guest,'').
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
opens a
connection identified by the `con1` atom, to an instance of a MySQL server
running on host `localhost`, using database guest `db` and user `guest` with
empty password. After this is possible to use MYDDAS as the mysql
client.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_top_level(mysql,con1,localhost/guest_db,guest,'').
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
@@ -472,8 +483,10 @@
Bye
yes
?-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- @defgroup Other_MYDDAS_Properties Other MYDDAS Properties
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@defgroup Other_MYDDAS_Properties Other MYDDAS Properties
+@ingroup #myddas
@pred db_verbose(+).
@@ -483,11 +496,11 @@
`QUERY`. If we want to see that query, we must to this at a given
point in our session on YAP.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_verbose(1).
yes
?-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If we want to
disable this feature, we must call the `db_verbose/1` predicate with the value 0.
@@ -504,51 +517,51 @@
by default on the `user` module. If we want to change this value, we can
use the db_module/1 predicate to do so.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_module(lists).
yes
?-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
By executing this predicate, all of the predicates asserted by the
predicates enumerated earlier will created in the lists module.
If we want to put back the value on default, we can manually put the
value user. Example:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_module(user).
yes
?-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
We can also see in what module the predicates are being asserted by doing:
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_module(X).
X=user
yes
?-
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@pred db_my_result_set(?).
The MySQL C API permits two modes for transferring the data generated by
a query to the client, in our case YAP. The first mode, and the default
- mode used by the MYDDAS-MySQL, is to store the result. This mode copies all the
+ mod-MySQL, is to store the result. This mode copies all the
information generated to the client side.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_my_result_set(X).
X=store_result
yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The other mode that we can use is use result. This one uses the result
set created directly from the server. If we want to use this mode, he
simply do
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?- db_my_result_set(use_result).
yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
After this command, all
of the database predicates will use use result by default. We can change
this by doing again `db_my_result_set(store_result)`.
@@ -567,8 +580,10 @@
not to ignore the INSERT statement warnings and instead of taking
action, report an error, we could use the following SQL mode.
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
?-db_my_sql_mode(traditional). yes
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can see the available SQL Modes at the MySQL homepage at
.
+
+@}
diff --git a/docs/md/raptor.md b/packages/raptor/raptor.md
similarity index 92%
rename from docs/md/raptor.md
rename to packages/raptor/raptor.md
index 3cc8dcd51..0fe72e20e 100644
--- a/docs/md/raptor.md
+++ b/packages/raptor/raptor.md
@@ -1,4 +1,4 @@
-WWW Reader/Writers for YAP. {#YAPRaptor}
+WWW Reader/Writers for YAP. {#raptor}
=========================
This provides YAP a rdf reader using
diff --git a/docs/md/real.md b/packages/real/real.md
similarity index 99%
rename from docs/md/real.md
rename to packages/real/real.md
index ce0aad31d..3948c302b 100644
--- a/docs/md/real.md
+++ b/packages/real/real.md
@@ -6,7 +6,7 @@ The R Prolog Progrmming Interface {#real}
@author Vitor Santos Costa
@version 1:0:4, 2013/12/25, sinter_class
@license Perl Artistic License
- @defgroup libReal An interface to the R statistical software.
+
@ingroup packages
diff --git a/docs/md/udi.md b/packages/udi/udi.md
similarity index 100%
rename from docs/md/udi.md
rename to packages/udi/udi.md
diff --git a/packages/yap-lbfgs/liblbfgs-1.10/include/lbfgs.h b/packages/yap-lbfgs/liblbfgs-1.10/include/lbfgs.h
index e16ae922c..2b4604f5d 100644
--- a/packages/yap-lbfgs/liblbfgs-1.10/include/lbfgs.h
+++ b/packages/yap-lbfgs/liblbfgs-1.10/include/lbfgs.h
@@ -59,8 +59,9 @@ typedef double lbfgsfloatval_t;
#endif
-/**
+/**
* \addtogroup liblbfgs_api libLBFGS API
+ * @ingroup YAP-LBFGS
* @{
*
* The libLBFGS API.
@@ -68,7 +69,7 @@ typedef double lbfgsfloatval_t;
/**
* Return values of lbfgs().
- *
+ *
* Roughly speaking, a negative value indicates an error.
*/
enum {
@@ -365,7 +366,7 @@ typedef struct {
* function and its gradients when needed. A client program must implement
* this function to evaluate the values of the objective function and its
* gradients, given current values of variables.
- *
+ *
* @param instance The user data sent for lbfgs() function by the client.
* @param x The current values of variables.
* @param g The gradient vector. The callback function must compute
@@ -502,14 +503,14 @@ void lbfgs_parameter_init(lbfgs_parameter_t *param);
* when libLBFGS is built with SSE/SSE2 optimization routines. A user does
* not have to use this function for libLBFGS built without SSE/SSE2
* optimization.
- *
+ *
* @param n The number of variables.
*/
lbfgsfloatval_t* lbfgs_malloc(int n);
/**
* Free an array of variables.
- *
+ *
* @param x The array of variables allocated by ::lbfgs_malloc
* function.
*/
diff --git a/packages/yap-lbfgs/yap_lbfgs.c b/packages/yap-lbfgs/yap_lbfgs.c
index fbf224101..4ae2a26cf 100644
--- a/packages/yap-lbfgs/yap_lbfgs.c
+++ b/packages/yap-lbfgs/yap_lbfgs.c
@@ -1,4 +1,4 @@
-#include
+o#include
#include "YapInterface.h"
#include
#include
@@ -60,9 +60,9 @@ static lbfgsfloatval_t evaluate(
t[2] = YAP_MkFloatTerm(step);
call = YAP_MkApplTerm(fcall3, 3, t);
- g=g_tmp;
+ g=g_tmp;
+
-
s1 = YAP_InitSlot(call);
optimizer_status=OPTIMIZER_STATUS_CB_EVAL;
result=YAP_CallProlog(call);
@@ -151,7 +151,7 @@ static YAP_Bool set_x_value(void) {
printf("ERROR: set_x_value/2 can be called only when the optimizer is initialized and not running.\n");
return FALSE;
}
-
+
if (YAP_IsIntTerm(t1)) {
i=YAP_IntOfTerm(t1);
} else {
@@ -183,12 +183,12 @@ static YAP_Bool get_x_value(void) {
YAP_Term t1=YAP_ARG1;
YAP_Term t2=YAP_ARG2;
int i=0;
-
+
if (optimizer_status==OPTIMIZER_STATUS_NONE) {
printf("ERROR: set_x_value/2 can be called only when the optimizer is initialized.\n");
return FALSE;
}
-
+
if (YAP_IsIntTerm(t1)) {
i=YAP_IntOfTerm(t1);
} else {
@@ -219,7 +219,7 @@ static YAP_Bool set_g_value(void) {
printf("ERROR: optimizer_set_g/2 can only be called by the evaluation call back function.\n");
return FALSE;
}
-
+
if (YAP_IsIntTerm(t1)) {
i=YAP_IntOfTerm(t1);
} else {
@@ -256,7 +256,7 @@ static YAP_Bool get_g_value(void) {
printf("ERROR: optimizer_get_g/2 can only be called while the optimizer is running.\n");
return FALSE;
}
-
+
if (YAP_IsIntTerm(t1)) {
i=YAP_IntOfTerm(t1);
} else {
@@ -272,18 +272,18 @@ static YAP_Bool get_g_value(void) {
/** @pred optimizer_initialize(+N,+Module,+Evaluate,+Progress)
Create space to optimize a function with _N_ variables (_N_ has to be
-integer).
+integer).
+ _Module_ is the name of the module where the call back
-predicates can be found,
+predicates can be found,
+ _Evaluate_ is the call back predicate (arity 3)
-to evaluate the function math _F_,
+to evaluate the function math _F_,
+ _Progress_ is the call back predicate invoked
(arity 8) after every iteration
-Example
+Example
~~~~
optimizer_initialize(1,user,evaluate,progress)
~~~~
@@ -314,7 +314,7 @@ value will terminate the optimization process.
static YAP_Bool optimizer_initialize(void) {
YAP_Term t1 = YAP_ARG1;
int temp_n=0;
-
+
if (optimizer_status!=OPTIMIZER_STATUS_NONE) {
printf("ERROR: Optimizer has already been initialized. Please call optimizer_finalize/0 first.\n");
return FALSE;
@@ -365,13 +365,13 @@ static YAP_Bool optimizer_run(void) {
printf("ERROR: Memory for parameter vector not initialized, please call optimizer_initialize/1 first.\n");
return FALSE;
}
-
+
if (optimizer_status != OPTIMIZER_STATUS_INITIALIZED) {
printf("ERROR: Optimizer is running right now. Please wait till it is finished.\n");
return FALSE;
}
-
+
// both arguments have to be variables
if (! YAP_IsVarTerm(t1) || ! YAP_IsVarTerm(t2)) {
return FALSE;
@@ -439,7 +439,7 @@ static YAP_Bool optimizer_set_parameter( void ) {
param.m = YAP_IntOfTerm(t2);
} else if ((strcmp(name, "epsilon") == 0)) {
lbfgsfloatval_t v;
-
+
if (YAP_IsFloatTerm(t2)) {
v=YAP_FloatOfTerm(t2);
} else if (YAP_IsIntTerm(t2)) {
@@ -456,7 +456,7 @@ static YAP_Bool optimizer_set_parameter( void ) {
param.past = YAP_IntOfTerm(t2);
} else if ((strcmp(name, "delta") == 0)) {
lbfgsfloatval_t v;
-
+
if (YAP_IsFloatTerm(t2)) {
v=YAP_FloatOfTerm(t2);
} else if (YAP_IsIntTerm(t2)) {
@@ -483,7 +483,7 @@ static YAP_Bool optimizer_set_parameter( void ) {
param.max_linesearch = YAP_IntOfTerm(t2);
} else if ((strcmp(name, "min_step") == 0)) {
lbfgsfloatval_t v;
-
+
if (YAP_IsFloatTerm(t2)) {
v=YAP_FloatOfTerm(t2);
} else if (YAP_IsIntTerm(t2)) {
@@ -495,7 +495,7 @@ static YAP_Bool optimizer_set_parameter( void ) {
param.min_step=v;
} else if ((strcmp(name, "max_step") == 0)) {
lbfgsfloatval_t v;
-
+
if (YAP_IsFloatTerm(t2)) {
v=YAP_FloatOfTerm(t2);
} else if (YAP_IsIntTerm(t2)) {
@@ -507,7 +507,7 @@ static YAP_Bool optimizer_set_parameter( void ) {
param.max_step=v;
} else if ((strcmp(name, "ftol") == 0)) {
lbfgsfloatval_t v;
-
+
if (YAP_IsFloatTerm(t2)) {
v=YAP_FloatOfTerm(t2);
} else if (YAP_IsIntTerm(t2)) {
@@ -519,7 +519,7 @@ static YAP_Bool optimizer_set_parameter( void ) {
param.ftol=v;
} else if ((strcmp(name, "gtol") == 0)) {
lbfgsfloatval_t v;
-
+
if (YAP_IsFloatTerm(t2)) {
v=YAP_FloatOfTerm(t2);
} else if (YAP_IsIntTerm(t2)) {
@@ -531,7 +531,7 @@ static YAP_Bool optimizer_set_parameter( void ) {
param.gtol=v;
} else if ((strcmp(name, "xtol") == 0)) {
lbfgsfloatval_t v;
-
+
if (YAP_IsFloatTerm(t2)) {
v=YAP_FloatOfTerm(t2);
} else if (YAP_IsIntTerm(t2)) {
@@ -543,7 +543,7 @@ static YAP_Bool optimizer_set_parameter( void ) {
param.xtol=v;
} else if ((strcmp(name, "orthantwise_c") == 0)) {
lbfgsfloatval_t v;
-
+
if (YAP_IsFloatTerm(t2)) {
v=YAP_FloatOfTerm(t2);
} else if (YAP_IsIntTerm(t2)) {
@@ -567,7 +567,7 @@ static YAP_Bool optimizer_set_parameter( void ) {
printf("ERROR: The parameter %s is unknown.\n",name);
return FALSE;
}
-
+
return TRUE;
}
@@ -626,8 +626,8 @@ static YAP_Bool optimizer_get_parameter( void ) {
-void init_lbfgs_predicates( void )
-{
+void init_lbfgs_predicates( void )
+{
fcall3 = YAP_MkFunctor(YAP_LookupAtom("$lbfgs_callback_evaluate"), 3);
fprogress8 = YAP_MkFunctor(YAP_LookupAtom("$lbfgs_callback_progress"), 8);
@@ -646,4 +646,4 @@ void init_lbfgs_predicates( void )
YAP_UserCPredicate("optimizer_set_parameter",optimizer_set_parameter,2);
YAP_UserCPredicate("optimizer_get_parameter",optimizer_get_parameter,2);
-}
+}
diff --git a/pl/atoms.yap b/pl/atoms.yap
index e278d29ec..3f74f89aa 100644
--- a/pl/atoms.yap
+++ b/pl/atoms.yap
@@ -9,7 +9,7 @@
*************************************************************************/
/**
- *@file atoms.yap
+ * @file atoms.yap
*
*/
@@ -23,8 +23,8 @@
:- use_system_module( '$_errors', ['$do_error'/2]).
-/?**
- * @addtogroup Predicates_on_Atoms
+/**
+ * @addtogroup Predicates_on_Atoms
*
*/
diff --git a/pl/attributes.yap b/pl/attributes.yap
index 0eb083053..d9727d8e7 100644
--- a/pl/attributes.yap
+++ b/pl/attributes.yap
@@ -10,7 +10,7 @@
* *
* File: atts.yap *
* Last rev: 8/2/88 *
-* mods: *
+* mods: *
* comments: attribute support for Prolog *
* *
*************************************************************************/
@@ -18,9 +18,11 @@
/**
@file attributes.yap
-@{
-@addtogroup New_Style_Attribute_Declarations
+@defgroup New_Style_Attribute_Declarations SWI Compatible attributes
+@{
+@ingroup attributes
+
*/
:- module('$attributes', [
@@ -489,7 +491,6 @@ typically this will involve expressing all constraints in terms of
_QueryVars_ and considering all remaining variables as existentially
quantified.
-
Projection interacts with attribute_goal/2 at the Prolog top
level. When the query succeeds, the system first calls
project_attributes/2. The system then calls
@@ -498,8 +499,6 @@ constraints. Typically, attribute_goal/2 will convert from the
original constraints into a set of new constraints on the projection,
and these constraints are the ones that will have an
attribute_goal/2 handler.
-
-
*/
project_attributes(AllVs, G) :-
attributes:modules_with_attributes(LMods),
@@ -523,6 +522,6 @@ project_module([Mod|LMods], LIV, LAV) :-
project_module([_|LMods], LIV, LAV) :-
project_module(LMods,LIV,LAV).
-/**
-@}
-*/
+%% @}
+
+
diff --git a/pl/consult.yap b/pl/consult.yap
index c0438f36f..b0929de1c 100644
--- a/pl/consult.yap
+++ b/pl/consult.yap
@@ -74,12 +74,13 @@
:- use_system_module( '$_preds', ['$current_predicate'/4]).
-%% @{
-
/**
+
@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
@@ -87,12 +88,10 @@ files and to set-up the Prolog environment. We discuss
+ @ref YAPCompilerSettings
- @{
-
@defgroup YAPReadFiles The Predicates that Read Source Files
@ingroup YAPConsulting
-
+@{
*/
/**
diff --git a/pl/corout.yap b/pl/corout.yap
index a89a0f59f..38adfe638 100644
--- a/pl/corout.yap
+++ b/pl/corout.yap
@@ -24,11 +24,11 @@
* @addtogroup extensions Extensions to Core Prolog
*
* @{
- * @ addtogroup AttributeVariables Attributed Variables and Co-Routining
+ * @ addtogroup attributes Attributed Variables and Co-Routining
* @{
* @brief Support for co-routining
- *
- *
+ *
+ *
*/
@@ -43,8 +43,7 @@
:- use_system_module( '$_boot', ['$$compile'/4]).
-:- use_system_module( '$_errors', ['$do_error'/2]).
-
+
:- use_system_module( attributes, [get_module_atts/2,
put_module_atts/2]).
@@ -52,9 +51,9 @@
%%@{
%% @aaddtogroup CohYroutining
-%% @ingroup AttributedVariables
+%% @ingroup attributes
-/** @pred attr_unify_hook(+ _AttValue_,+ _VarValue_)
+/** @pred attr_unify_hook(+ _AttValue_,+ _VarValue_)
@@ -69,11 +68,11 @@ Normally this predicate fails to veto binding the variable to
the two attribute and associates the combined attribute with
_VarValue_ using put_attr/3.
-
+
*/
attr_unify_hook(DelayList, _) :-
wake_delays(DelayList).
-
+
wake_delays([]).
wake_delays([Delay|List]) :-
wake_delay(Delay),
@@ -95,12 +94,12 @@ wake_delay(redo_ground(Done, X, Goal)) :-
attribute_goals(Var) -->
{ get_attr(Var, '$coroutining', Delays) },
attgoal_for_delays(Delays, Var).
-
+
attgoal_for_delays([], _V) --> [].
attgoal_for_delays([G|AllAtts], V) -->
attgoal_for_delay(G, V),
attgoal_for_delays(AllAtts, V).
-
+
attgoal_for_delay(redo_dif(Done, X, Y), V) -->
{ var(Done), first_att(dif(X,Y), V) }, !,
[prolog:dif(X,Y)].
@@ -126,10 +125,10 @@ remove_when_declarations(Goal, Goal).
%
/**
@pred freeze(? _X_,: _G_)
-
+
Delay execution of goal _G_ until the variable _X_ is bound.
-
+
*/
prolog:freeze(V, G) :-
var(V), !,
@@ -183,18 +182,18 @@ freeze_goal(V,G) :-
% several times. dif calls a special version of freeze that checks
% whether that is in fact the case.
%
-/** @pred dif( _X_, _Y_)
+/** @pred dif( _X_, _Y_)
Succeed if the two arguments do not unify. A call to dif/2 will
suspend if unification may still succeed or fail, and will fail if they
always unify.
-
+
*/
prolog:dif(X, Y) :-
'$can_unify'(X, Y, LVars), !,
- LVars = [_|_],
+ LVars = [_|_],
dif_suspend_on_lvars(LVars, redo_dif(_Done, X, Y)).
prolog:dif(_, _).
@@ -269,7 +268,7 @@ redo_ground('$done', _, Goal) :-
%
% support for when/2 built-in
%
-/** @pred when(+ _C_,: _G_)
+/** @pred when(+ _C_,: _G_)
Delay execution of goal _G_ until the conditions _C_ are
@@ -289,7 +288,7 @@ Delay until variable _V_ is ground.
Note that when/2 will fail if the conditions fail.
-
+
*/
prolog:when(Conds,Goal) :-
'$current_module'(Mod),
@@ -330,7 +329,7 @@ generate_code_for_when(Conds, G,
prepare_goal_for_when(G, Mod, Mod:call(G)) :- var(G), !.
prepare_goal_for_when(M:G, _, M:G) :- !.
prepare_goal_for_when(G, Mod, Mod:G).
-
+
%
% now for the important bit
@@ -398,7 +397,7 @@ try_freeze(V, G, Done, LG0, LGF) :-
var(V),
LGF = ['$coroutining':internal_freeze(V, redo_freeze(Done, V, G))|LG0].
-try_eq(X, Y, G, Done, LG0, LGF) :-
+try_eq(X, Y, G, Done, LG0, LGF) :-
'$can_unify'(X, Y, LVars), LVars = [_|_],
LGF = ['$coroutining':dif_suspend_on_lvars(LVars, redo_eq(Done, X, Y, G))|LG0].
@@ -450,7 +449,7 @@ generate_blocking_code(Conds, G, Code) :-
functor(G, Na, Ar),
'$current_module'(M),
abolish(M:Na, Ar),
- generate_blocking_code((Conds,OldConds), G, Code).
+ generate_blocking_code((Conds,OldConds), G, Code).
generate_blocking_code(Conds, G, (G :- (If, !, when(When, G)))) :-
extract_head_for_block(Conds, G),
recorda('$blocking_code','$code'(G,Conds),_),
@@ -476,7 +475,7 @@ extract_head_for_block(C, G) :-
%
% We generate code as follows:
%
-% block a(-,-,?)
+% block a(-,-,?)
%
% (var(A1), var(A2) -> true ; fail), !, when((nonvar(A1);nonvar(A2)),G).
%
@@ -524,13 +523,13 @@ prolog:'$wait'(Na/Ar) :-
'$$compile'((S :- var(A), !, freeze(A, S)), (S :- var(A), !, freeze(A, S)), 5, M), fail.
prolog:'$wait'(_).
-/** @pred frozen( _X_, _G_)
+/** @pred frozen( _X_, _G_)
Unify _G_ with a conjunction of goals suspended on variable _X_,
or `true` if no goal has suspended.
-
+
*/
prolog:frozen(V, LG) :-
var(V), !,
@@ -564,7 +563,7 @@ update_att(V, G) :-
attributes:put_module_atts(V, '$coroutining'(_,[G|Gs])).
update_att(V, G) :-
attributes:put_module_atts(V, '$coroutining'(_,[G])).
-
+
not_vmember(_, []).
not_vmember(V, [V1|DonesSoFar]) :-
diff --git a/pl/dbload.yap b/pl/dbload.yap
index e7e6862ae..a890ab182 100644
--- a/pl/dbload.yap
+++ b/pl/dbload.yap
@@ -1,7 +1,7 @@
-//!@{
+%%% @{
-//!@ingroup YAPModules
-}/*************************************************************************
+%%% @addtogroup YAPModules
+/*************************************************************************
* *
* YAP Prolog *
* *
@@ -176,4 +176,4 @@ clean_up :-
clean_up.
-//!@}
+%% @}
diff --git a/pl/flags.yap b/pl/flags.yap
index 118c1b228..7fc5a6982 100644
--- a/pl/flags.yap
+++ b/pl/flags.yap
@@ -14,6 +14,16 @@
* comments: controlling YAP *
* *
*************************************************************************/
+/**
+ * @file flagd.ysp
+ *
+ * @defgroup Flags Yap Flags
+ *n@{}
+ * @ingroup builtins
+ * @}@[ ]
+ */
+
+
:- system_module( '$_flags', [create_prolog_flag/3,
current_prolog_flag/2,
@@ -69,7 +79,7 @@
unknown(_,error).
-/** @pred create_prolog_flag(+ _Flag_,+ _Value_,+ _Options_)
+/** @pred create_prolog_flag(+ _Flag_,+ _Value_,+ _Options_)
Create a new YAP Prolog flag. _Options_ include
diff --git a/pl/init.yap b/pl/init.yap
index 1d72d7193..dd80aa8ab 100644
--- a/pl/init.yap
+++ b/pl/init.yap
@@ -385,4 +385,9 @@ clause_to_indicator(T, M:Name/Arity) :- ,
/**
@}
+
+@defgroup packages YAP Packages
+
+
+
*/
diff --git a/pl/qly.yap b/pl/qly.yap
index 397eb1f11..c883976d4 100755
--- a/pl/qly.yap
+++ b/pl/qly.yap
@@ -18,21 +18,8 @@
%% @file qly.yap
/**
-
-@defgroup YAPSaving Saving and Loading Prolog States
-@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
-or a file. Notice that saved states in YAP depend on the architecture
-where they were made, and may also depend on the version of YAP being
-saved.
-
-YAP always tries to find saved states from the current directory
-first. If it cannot it will use the environment variable [YAPLIBDIR](@ref YAPLIBDIR), if
-defined, or search the default library directory.
-
-@{
+@defgroup QLY Creating and Using a saved state
+@ingroup YAPConsulting
*/
:- system_module( '$_qly', [qload_module/1,
@@ -63,6 +50,18 @@ defined, or search the default library directory.
:- use_system_module( '$_yio', ['$extend_file_search_path'/1]).
+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
+or a file. Notice that saved states in YAP depend on the architecture
+where they were made, and may also depend on the version of YAP being
+saved.
+
+YAP always tries to find saved states from the current directory
+first. If it cannot it will use the environment variable [YAPLIBDIR](@ref YAPLIBDIR), if
+defined, or search the default library directory.
+
+*/
+
/** @pred save_program(+ _F_)
Saves the current state of the data-base in file _F_ .
diff --git a/swi/library/packages.yap b/swi/library/packages.yap
deleted file mode 100644
index 7b349d0ec..000000000
--- a/swi/library/packages.yap
+++ /dev/null
@@ -1,24 +0,0 @@
-/**
- @defgroup clib swi
-@ingroup swi
-
-The clib package is a series of libraries developed by Jan Wielmaker
-and the SWI-Prolog community for extended Operating System support.
-Please consult clib.doc for the complete documentation.
-
-*/
-
-/**
-
-@defgroup http The SWI http packages
-@ingroup swi
-
-The HTTP package is a series of libraries developed by Jan Wielmaker
-and the SWI-Prolog community for accessing and serving data on the
-web. It supports lower-level transport protocols, but also
-data-representation primitives, and more.
-
-The port to YAP focused on the client-side support. The server
-package has not been as widely tested.
-
-*/
\ No newline at end of file