From faf3c930c8943eb38ac81bd7e37f3cae06d50c32 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 7 Apr 2017 23:10:59 +0100 Subject: [PATCH] docs --- C/attvar.c | 11 +- C/exec.c | 3 +- C/flags.c | 5 +- C/init.c | 4 +- C/inlines.c | 177 +++++++------ C/qlyr.c | 10 + C/qlyw.c | 13 + C/stdpreds.c | 6 +- CXX/yapa.hh | 30 ++- CXX/yapdb.hh | 17 +- CXX/yapi.cpp | 2 +- CXX/yapi.hh | 39 +-- CXX/yapie.hh | 11 +- CXX/yapq.hh | 9 +- CXX/yapt.hh | 16 +- packages/clpqr/clpqr.md => Debug/docs/md | 0 H/Foreign.h | 27 +- H/qly.h | 19 +- OPTYap/or.structs.h | 3 + OPTYap/tab.insts.h | 64 ++--- docs/CMakeLists.txt | 30 ++- docs/Doxyfile.in | 37 ++- {packages/bdd => docs/md}/bdd.md | 0 {packages/chr => docs/md}/chr.md | 0 {packages/gecode => docs/md}/gecode.md | 0 {packages/myddas => docs/md}/myddas.md | 0 .../raptor/README.md => docs/md/raptor.md | 0 packages/real/README.md => docs/md/real.md | 0 {packages/udi => docs/md}/udi.md | 0 docs/source/conf.py | 250 +++++------------- docs/source/conf.py.in | 205 +++++++++++++- docs/source/index.rst | 38 ++- include/YapInterface.h | 47 ++-- library/apply_macros.yap | 12 +- library/arg.yap | 34 +-- library/block_diagram.yap | 2 +- library/dgraphs.yap | 3 + library/dialect/swi/fli/swi.h | 2 +- library/exo_interval.yap | 8 +- library/flags.yap | 2 +- library/hacks.yap | 2 +- library/heaps.yap | 2 + library/lam_mpi.yap | 2 + library/listing.yap | 2 +- library/lists.yap | 6 + library/mapargs.yap | 2 +- library/maplist.yap | 4 +- library/matlab.yap | 2 + library/matrix.yap | 2 + library/nb.yap | 2 + library/ordsets.yap | 2 + library/queues.yap | 2 + library/random.yap | 2 + library/rbtrees.yap | 31 ++- library/regexp.yap | 2 + library/rltree.yap | 6 +- library/splay.yap | 2 + library/system.yap | 2 + library/terms.yap | 2 + library/timeout.yap | 3 + library/trees.yap | 3 +- library/tries.yap | 3 + library/ugraphs.yap | 2 + library/undgraphs.yap | 2 + library/wdgraphs.yap | 131 +++------ library/wgraphs.yap | 11 +- library/wundgraphs.yap | 11 +- os/alias.c | 2 +- os/charsio.c | 6 +- os/chartypes.yap | 5 +- os/fmemopen.c | 10 +- os/format.c | 4 +- os/streams.c | 4 +- packages/yap-lbfgs/lbfgs.pl | 10 +- pl/absf.yap | 28 +- pl/atoms.yap | 11 +- pl/boot.yap | 11 +- pl/bootlists.yap | 2 +- pl/corout.yap | 7 +- pl/dbload.yap | 8 +- pl/grammar.yap | 4 +- pl/init.yap | 10 +- pl/load_foreign.yap | 2 +- pl/modules.yap | 2 +- pl/qly.yap | 35 +-- pl/yio.yap | 3 +- 86 files changed, 901 insertions(+), 642 deletions(-) rename packages/clpqr/clpqr.md => Debug/docs/md (100%) rename {packages/bdd => docs/md}/bdd.md (100%) rename {packages/chr => docs/md}/chr.md (100%) rename {packages/gecode => docs/md}/gecode.md (100%) rename {packages/myddas => docs/md}/myddas.md (100%) rename packages/raptor/README.md => docs/md/raptor.md (100%) rename packages/real/README.md => docs/md/real.md (100%) rename {packages/udi => docs/md}/udi.md (100%) diff --git a/C/attvar.c b/C/attvar.c index e6045e8d8..dbb5e39dd 100644 --- a/C/attvar.c +++ b/C/attvar.c @@ -1,4 +1,4 @@ -/************************************************************************* +0/************************************************************************* * * * YAP Prolog * * * @@ -28,11 +28,10 @@ static char SccsId[] = "%W% %G%"; #define NULL (void *)0 #endif -/** @file attvars.c - @{ */ - -/** - * @defgroup AttributeVariables_Builtins Implementation of Attribute Declarations +/** + @file attvar.c + @{ + @defgroup AttributeVariables_Builtins Implementation of Attribute Declarations @ingroup AttributeVariables */ diff --git a/C/exec.c b/C/exec.c index 98e4dc532..2fe3a293c 100755 --- a/C/exec.c +++ b/C/exec.c @@ -950,8 +950,7 @@ static Int protect_stack_from_cut(USES_REGS1) { * external backtrack to current stack frame: call method * and control backtracking. * - * @` - * method protect_stack_from_restore + * @method protect_stack_from_restore * @param USES_REGS1 [env for threaded execution] * @return c [next answer] diff --git a/C/flags.c b/C/flags.c index 411026375..f670bb1cf 100644 --- a/C/flags.c +++ b/C/flags.c @@ -17,8 +17,9 @@ /** @file C/flags.c -@ingroup Flags -@{ + @addtogroup Flags +@ingroup core + @{ */ // this is where we define flags diff --git a/C/init.c b/C/init.c index c15664cce..29b29de81 100755 --- a/C/init.c +++ b/C/init.c @@ -106,11 +106,9 @@ void *YAP_save; @ingroup Syntax @{ - - The Prolog syntax caters for operators of three main kinds: - + prefix; + + prefix; + infix; + postfix. diff --git a/C/inlines.c b/C/inlines.c index 16d2eada0..edc2b2c8b 100644 --- a/C/inlines.c +++ b/C/inlines.c @@ -16,9 +16,15 @@ *************************************************************************/ -/** @defgroup YAP_Terms Predicates on terms -@ingroup builtins -@{ +/** + + + @file inlines.c + + @defgroup YAP_Inlines Inlined Tests nad Ter Manipulation + + @ingroup builtins + @{ */ @@ -998,41 +1004,65 @@ p_erroneous_call( USES_REGS1 ) return(FALSE); } -/** - * @genarg( ?_Index_, +_Term_ , -_Arg_ ) - * - * Similar to arg/3, but it can also backtrack through _T_'s arguments, that is: + static Int + p_save_cp( USES_REGS1 ) +{ + Term t = Deref(ARG1); + Term td; +#if SHADOW_HB + register CELL *HBREG = HB; +#endif + if (!IsVarTerm(t)) return(FALSE); + td = cp_as_integer(B PASS_REGS); + YapBind((CELL *)t,td); + return(TRUE); +} -~~~~~~~~~ -?- arg:genarg(I, f(a,b), A). -A = a, -I = 1. -; -A = b, -I = 2. -~~~~~~~~~ - * - * Note: SWI-Prolog defines arg/3 as genarg/3. - */ -static Int -genarg( USES_REGS1 ) -{ /* getarg(?Atom) */ - Term t0 = Deref(ARG1); - Term t1 = Deref(ARG2); - CELL *pt, *end; - int res; - UInt arity; + /// @} - if (!IsVarTerm(t0)) { - res = p_arg( PASS_REGS1 ); - if (res) { - cut_succeed(); - } else { - cut_fail(); - } - } - if (IsVarTerm(t1)) { - Yap_Error(INSTANTIATION_ERROR,t1,"genarg/3"); + /** + * + * @addtogroup args + * + * @{ + * + * @namespace args + * + * @pred genarg( ?Index, +Term , -Arg ) + * + * + * Similar to arg/3, but it can also backtrack through _T_'s arguments, that is: + + ~~~~~~~~~ + ?- arg:genarg(I, f(a,b), A). + A = a, + I = 1. + ; + A = b, + I = 2. + ~~~~~~~~~ + * + * Note: SWI-Prolog defines arg/3 as genarg/3. + */ + static Int + genarg( USES_REGS1 ) + { /* getarg(?Atom) */ + Term t0 = Deref(ARG1); + Term t1 = Deref(ARG2); + CELL *pt, *end; + int res; + UInt arity; + + if (!IsVarTerm(t0)) { + res = p_arg( PASS_REGS1 ); + if (res) { + cut_succeed(); + } else { + cut_fail(); + } + } + if (IsVarTerm(t1)) { + Yap_Error(INSTANTIATION_ERROR,t1,"genarg/3"); return FALSE; } if (IsPrimitiveTerm(t1)) { @@ -1088,55 +1118,38 @@ cont_genarg( USES_REGS1 ) Yap_unify(ARG3,pt[0]); } -static Int -p_save_cp( USES_REGS1 ) -{ - Term t = Deref(ARG1); - Term td; -#if SHADOW_HB - register CELL *HBREG = HB; -#endif - if (!IsVarTerm(t)) return(FALSE); - td = cp_as_integer(B PASS_REGS); - YapBind((CELL *)t,td); - return(TRUE); -} - -void -Yap_InitInlines(void) -{ - CACHE_REGS - Term cm = CurrentModule; - Yap_InitAsmPred("$$cut_by", 1, _cut_by, p_cut_by, SafePredFlag); - Yap_InitAsmPred("$$save_by", 1, _save_by, p_save_cp, SafePredFlag); - Yap_InitAsmPred("atom", 1, _atom, p_atom, SafePredFlag); - Yap_InitAsmPred("atomic", 1, _atomic, p_atomic, SafePredFlag); - Yap_InitAsmPred("integer", 1, _integer, p_integer, SafePredFlag); - Yap_InitAsmPred("nonvar", 1, _nonvar, p_nonvar, SafePredFlag); - Yap_InitAsmPred("number", 1, _number, p_number, SafePredFlag); - Yap_InitAsmPred("var", 1, _var, p_var, SafePredFlag); - Yap_InitAsmPred("db_reference", 1, _db_ref, p_db_ref, SafePredFlag); - Yap_InitAsmPred("primitive", 1, _primitive, p_primitive, SafePredFlag); - Yap_InitAsmPred("compound", 1, _compound, p_compound, SafePredFlag); - Yap_InitAsmPred("float", 1, _float, p_float, SafePredFlag); - Yap_InitAsmPred("=", 2, _equal, p_equal, SafePredFlag); + void + Yap_InitInlines(void) + { + CACHE_REGS + Term cm = CurrentModule; + Yap_InitAsmPred("$$cut_by", 1, _cut_by, p_cut_by, SafePredFlag); + Yap_InitAsmPred("$$save_by", 1, _save_by, p_save_cp, SafePredFlag); + Yap_InitAsmPred("atom", 1, _atom, p_atom, SafePredFlag); + Yap_InitAsmPred("atomic", 1, _atomic, p_atomic, SafePredFlag); + Yap_InitAsmPred("integer", 1, _integer, p_integer, SafePredFlag); + Yap_InitAsmPred("nonvar", 1, _nonvar, p_nonvar, SafePredFlag); + Yap_InitAsmPred("number", 1, _number, p_number, SafePredFlag); + Yap_InitAsmPred("var", 1, _var, p_var, SafePredFlag); + Yap_InitAsmPred("db_reference", 1, _db_ref, p_db_ref, SafePredFlag); + Yap_InitAsmPred("primitive", 1, _primitive, p_primitive, SafePredFlag); + Yap_InitAsmPred("compound", 1, _compound, p_compound, SafePredFlag); + Yap_InitAsmPred("float", 1, _float, p_float, SafePredFlag); + Yap_InitAsmPred("=", 2, _equal, p_equal, SafePredFlag); #if INLINE_BIG_COMPARISONS - Yap_InitAsmPred("\\=", 2, _dif, p_dif, SafePredFlag|TestPredFlag); - Yap_InitAsmPred("==", 2, _eq, p_eq, SafePredFlag|TestPredFlag); + Yap_InitAsmPred("\\=", 2, _dif, p_dif, SafePredFlag|TestPredFlag); + Yap_InitAsmPred("==", 2, _eq, p_eq, SafePredFlag|TestPredFlag); #else - Yap_InitCPred("\\=", 2, p_dif, SafePredFlag); - Yap_InitCPred("==", 2, p_eq, SafePredFlag); + Yap_InitCPred("\\=", 2, p_dif, SafePredFlag); + Yap_InitCPred("==", 2, p_eq, SafePredFlag); #endif - Yap_InitAsmPred("arg", 3, _arg, p_arg, SafePredFlag); - Yap_InitAsmPred("functor", 3, _functor, p_functor, 0); - Yap_InitAsmPred("$label_ctl", 2, _p_label_ctl, p_erroneous_call, SafePredFlag); - CurrentModule = ARG_MODULE; - Yap_InitCPredBack("genarg", 3, 3, genarg, cont_genarg,SafePredFlag); - CurrentModule = cm; -} + Yap_InitAsmPred("arg", 3, _arg, p_arg, SafePredFlag); + Yap_InitAsmPred("functor", 3, _functor, p_functor, 0); + Yap_InitAsmPred("$label_ctl", 2, _p_label_ctl, p_erroneous_call, SafePredFlag); + CurrentModule = ARG_MODULE; + Yap_InitCPredBack("genarg", 3, 3, genarg, cont_genarg,SafePredFlag); + CurrentModule = cm; + } -/** -@} -*/ diff --git a/C/qlyr.c b/C/qlyr.c index 4fbf46662..850ab4172 100755 --- a/C/qlyr.c +++ b/C/qlyr.c @@ -15,6 +15,14 @@ * $Log: not supported by cvs2svn $ * * * *************************************************************************/ +/** + * + * @file qlyr.c + * + * @addtogroup SaveRestoreSupport + * @{ + * + */ #include "absmi.h" #include "alloc.h" @@ -1084,3 +1092,5 @@ void Yap_InitQLYR(void) { restore_codes(); } } + +/// @} diff --git a/C/qlyw.c b/C/qlyw.c index b186a0e81..ebe2bfd0f 100755 --- a/C/qlyw.c +++ b/C/qlyw.c @@ -16,6 +16,15 @@ * * *************************************************************************/ +/** + * + * @file qlyr.c + * + * @addtogroup SaveRestoreSupport + * @{ + * + */ + #include "absmi.h" #include "Foreign.h" #include "alloc.h" @@ -971,3 +980,7 @@ void Yap_InitQLY(void) restore_codes(); } } + +/// @} + + diff --git a/C/stdpreds.c b/C/stdpreds.c index f9a0b7cdd..71e38efe0 100755 --- a/C/stdpreds.c +++ b/C/stdpreds.c @@ -204,11 +204,11 @@ Int show_time(USES_REGS1) /* MORE PRECISION */ } #endif /* BEAM */ - // @{ /** - @defgroup YAPSetVal + @defgroup YAPSetVal Atom to Atomic Family of Built-ins. @ingroup Internal_Database + @{ Maintain a light-weight map where the key is an atom, and the value can be any constant. @@ -284,7 +284,7 @@ static Int p_values(USES_REGS1) { /* '$values'(Atom,Old,New) */ return (TRUE); } -//@} +///@} static Int p_opdec(USES_REGS1) { /* '$opdec'(p,type,atom) */ /* we know the arguments are integer, atom, atom */ diff --git a/CXX/yapa.hh b/CXX/yapa.hh index a1bafe241..332a9dc2f 100644 --- a/CXX/yapa.hh +++ b/CXX/yapa.hh @@ -1,25 +1,34 @@ -/// @{ +/// @file yapa.hh +/// +/// @brief C++ Interface to atoms and their properties. #ifndef YAPA_HH #define YAPA_HH 1 /** * - * @defgroup yap-cplus-interface An object oriented interface for YAP. + * @defgroup yap-cplus-interface-atoms Prolog Atoms * - * @ingroup ChYInterface + * @brief Symbols and associated propeeties. + * + * @ingroup yap-cplus-interface * @tableofcontents + * @{ * * - * Prolog operates over constants, called atoms. YAP's stores most data as a list - * of properties for atoms. Properties include functors, data-base tecords, predicates. operators, - * and more. + * Prolog interns symbols, called *atoms* in a Hash table, usually + called the atom table_. Each entry in this table stores the atom's + name, but also may have a linked list of _properties_ We use + properties to represent all kinds of data including. data-base + tecords, predicates. operators, and more. * + * In a nutshell: + * - YAPAtom serves as the gateway to the data-base; + * + * - YAProp abstracts most data-base objects. * + * - PropTag allows distinguishing the different classes of YAPProp. */ -/** - Tne different tgaas area represented through PropTag. -*/ enum PropTag { /// predicate PRED_TAG = PEProp, // 0x0000, @@ -110,7 +119,6 @@ public: }; -#endif /* YAPA_HH */ - +#endif /* YAPA_HH */ /// @} diff --git a/CXX/yapdb.hh b/CXX/yapdb.hh index f431bcd5d..ac8d3a3e2 100644 --- a/CXX/yapdb.hh +++ b/CXX/yapdb.hh @@ -1,21 +1,32 @@ +/// @file yapdb.hh +/// +/// @brief C++ Interface to generated code. + #ifndef _YAPDB_H #define _YAPDB_H #define YAP_CPP_DB_INTERFACE 1 -//! @{ /** * * @defgroup yap-cplus-db-interface Data-Base Component of YAP interface. * * @ingroup yap-cplus-interface + * @{ * @tableofcontents * * - * These classes define the main data-structures stored in the Data-base component: atoms, functors - * and predicates. + * These classes define the main data-structures stored to represent compiled + * programs: + * + * + YAPFunctor represents a name/arity combination. + * + * + YAPModule wraps the YAP module implementation. + * + * + YAPPredicate and subclasses store the actual program, Preliminary + * support covers Prolog and C-defined predicates. */ class YAPTerm; diff --git a/CXX/yapi.cpp b/CXX/yapi.cpp index 927b59adb..92ebe6fb6 100644 --- a/CXX/yapi.cpp +++ b/CXX/yapi.cpp @@ -935,7 +935,7 @@ YAPPredicate::YAPPredicate(YAPAtom at) ap = RepPredProp(PredPropByAtom(at.a, Yap_CurrentModule())); } -YAPPredicate::YAPPredicate(YAPAtom at, arity_t arity) +YAPPredicate::YAPPredicate(YAPAtom at, uintptr_t arity) { CACHE_REGS if (arity) diff --git a/CXX/yapi.hh b/CXX/yapi.hh index c00459cce..6c80daa5f 100644 --- a/CXX/yapi.hh +++ b/CXX/yapi.hh @@ -1,4 +1,9 @@ +/** + @file yapi,hh + @brief entry file for the YAP C++ interface + +*/ #define YAP_CPP_INTERFACE 1 @@ -8,18 +13,22 @@ #include #include - //! @{ -/** +/*! * + * @{ + * @ingroup fli_c_cx * @defgroup yap-cplus-interface An object oriented interface for YAP. * - * @ingroup yap-cplus-interface * @tableofcontents * * - * C++ interface to YAP. Designed to be object oriented and to fit naturally - * with the swig interface language generator. It uses ideas from the old YAP - * interface and from the SWI foreign language interface. + * @short C++ wrapper to terms, predicates and queries + * + * + * This new interface is designed to be object oriented and to fit + * naturally with the swig interface language generator. It uses ideas + * from the old YAP interface and from the SWI foreign language + * interface. * */ #include @@ -63,21 +72,21 @@ extern "C" { #endif #if _MSC_VER || defined(__MINGW32__) -//#include + //#include #endif -// taken from yap_structs.h + // taken from yap_structs.h #include "iopreds.h" -X_API void YAP_UserCPredicate(const char *, YAP_UserCPred, YAP_Arity arity); + X_API void YAP_UserCPredicate(const char *, YAP_UserCPred, YAP_Arity arity); -/* void UserCPredicateWithArgs(const char *name, int *fn(), unsigned int arity) - */ -X_API void YAP_UserCPredicateWithArgs(const char *, YAP_UserCPred, YAP_Arity, - YAP_Term); + /* void UserCPredicateWithArgs(const char *name, int *fn(), unsigned int arity) + */ + X_API void YAP_UserCPredicateWithArgs(const char *, YAP_UserCPred, YAP_Arity, + YAP_Term); -X_API void UserBackCPredicate(const char *name, int *init(), int *cont(), int - arity, int extra); + X_API void UserBackCPredicate(const char *name, int *init(), int *cont(), int + arity, int extra); } diff --git a/CXX/yapie.hh b/CXX/yapie.hh index 422d5711c..c851777e0 100644 --- a/CXX/yapie.hh +++ b/CXX/yapie.hh @@ -1,15 +1,22 @@ /** - * @{ + * @file yapie.hh * * @defgroup yap-cplus-error-hanadlinge Errir Handling in the YAP interface. * + * @brief this is an attempt at supporting error + * * @ingroup yap-cplus-interface * @tableofcontents * + * @{ * * These classes define an object that we can then throw when an error * or unexoected event interrupts YAP. Often, the object is built by - * YAP itself, but we may generate our own errors. + * YAP itself. One can also define one's own error objects. + * + * Errors will be thrown from the `C++` code, and may be processed in + * very different ways. The error object should provide as much data asa + * possible. */ diff --git a/CXX/yapq.hh b/CXX/yapq.hh index 8b930fb40..fca7d5c77 100644 --- a/CXX/yapq.hh +++ b/CXX/yapq.hh @@ -1,14 +1,17 @@ /** - * @{ + * @file yapq.hh ^ * @defgroup yap-cplus-query-hanadlinge Query Handling in the YAP interface. + * @brief Engine and Query Management * * @ingroup yap-cplus-interface * @tableofcontents * - * - * These classes define the concepts of engine ana of query.Ann engine is an environment where we can rum + * @{ + * + * These classes wrap engine ana of query.Ann engine is an environment where we can rum * Prolog, that is, where we can run queries. + * */ #ifndef YAPQ_HH diff --git a/CXX/yapt.hh b/CXX/yapt.hh index eec5d076b..124b1b4a7 100644 --- a/CXX/yapt.hh +++ b/CXX/yapt.hh @@ -1,15 +1,23 @@ /** - * @{ + * @file yapt.hh + */ + +/** * @defgroup yap-cplus-term-handling Term Handling in the YAP interface. * + * @{ + * * @ingroup yap-cplus-interface - * @tableofcontents + * @tableofcontents * * - * These classes define a term objectthat can be refined, Currently, all exported terms have an - * handle, in the SWI-Prolog style. + * These classes offer term construction and access. Terms are seens + * as objects that inherit from a virtual class, Currently, all + * terms must reside in the stack and may be moved around during + * garbage collection. Term objects use an handle, in the SWI-Prolog style. * * Nottce that terms are forcefully destroyed during backtracking. + * */ diff --git a/packages/clpqr/clpqr.md b/Debug/docs/md similarity index 100% rename from packages/clpqr/clpqr.md rename to Debug/docs/md diff --git a/H/Foreign.h b/H/Foreign.h index 41e32c823..764e7d6f4 100644 --- a/H/Foreign.h +++ b/H/Foreign.h @@ -17,15 +17,28 @@ #ifndef FOREIGN_H #define FOREIGN_H -/* Currently load_foreign_files works for the following machines: +/** - AIX: should work for 3.2 and 4.1 at least, using ECOFF; - linux: should work both for a.out (untested by me) and ELF; - osf: should work, but isn't working yet. - sunos4: should work, using A.OUT format; - svr4, eg solaris: should work, using ELF format; + @: + @file Foreign.h - YAP should be able to load on most BSD Unixes, but you will need to + load_foreign_files/3 has works for the following configurations: + + - linux: should work both for a.out (untested by me) and ELF; + + - WIN32: works (notice that symbols are not exported by default) + + - OSX: works using Mach dynamic libs. + + - osf: should work, but isn't working yet. + + - sunos4: should work, using A.OUT format; + + - svr4, eg solaris: should work, using ELF format; + + - AIX: should work for 3.2 and 4.1 at least, using ECOFF; + + YAP should be able to load on most BSD Unixes, but you will need to say that here. YAP also supports COFF loading (pretty much the same technique as diff --git a/H/qly.h b/H/qly.h index e0d0c8b32..b1b8ab833 100644 --- a/H/qly.h +++ b/H/qly.h @@ -17,6 +17,15 @@ * * *************************************************************************/ +/** + * + * @file qly.h + * + * @defgroup SaveRestoreSupport C-support for saved states. + * @ingroup YAPSaving + * + */ + #define EXPORT_ATOM_TABLE_SIZE (16 * 4096) #define EXPORT_FUNCTOR_TABLE_SIZE (16 * 4096) #define EXPORT_OPCODE_TABLE_SIZE (4096) @@ -101,11 +110,11 @@ typedef enum { QLY_ATOM_BLOB = 14 } qlf_tag_t; -#define STATIC_PRED_FLAGS \ - (SourcePredFlag | DynamicPredFlag | LogUpdatePredFlag | CompiledPredFlag | \ - MultiFileFlag | TabledPredFlag | MegaClausePredFlag | CountPredFlag | \ - ProfiledPredFlag | ThreadLocalPredFlag | AtomDBPredFlag | \ - ModuleTransparentPredFlag | NumberDBPredFlag | MetaPredFlag | \ +#define STATIC_PRED_FLAGS \ + (SourcePredFlag | DynamicPredFlag | LogUpdatePredFlag | CompiledPredFlag | \ + MultiFileFlag | TabledPredFlag | MegaClausePredFlag | CountPredFlag | \ + ProfiledPredFlag | ThreadLocalPredFlag | AtomDBPredFlag | \ + ModuleTransparentPredFlag | NumberDBPredFlag | MetaPredFlag | \ SyncPredFlag | BackCPredFlag) #define EXTRA_PRED_FLAGS \ (QuasiQuotationPredFlag | NoTracePredFlag | NoSpyPredFlag) diff --git a/OPTYap/or.structs.h b/OPTYap/or.structs.h index 9af48440d..05fa1b043 100644 --- a/OPTYap/or.structs.h +++ b/OPTYap/or.structs.h @@ -197,3 +197,6 @@ typedef struct table_subgoal_answer_frame{ #define TgAnsFr_answer(X,N) ((X)->answer[N]) #define TgAnsFr_next(X) ((X)->next) #endif /* TABLING_INNER_CUTS */ + +///@} + diff --git a/OPTYap/tab.insts.h b/OPTYap/tab.insts.h index 7559c3643..4a81bb03f 100644 --- a/OPTYap/tab.insts.h +++ b/OPTYap/tab.insts.h @@ -1356,42 +1356,42 @@ answer_resolution: - INIT_PREFETCH() - dep_fr_ptr dep_fr; - ans_node_ptr ans_node; + dep_fr_ptr dep_fr; + ans_node_ptr ans_node; + INIT_PREFETCH(); - 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; + 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 { ans_node = TrNode_child(ans_node); - do { - ans_node = TrNode_child(ans_node); - } while (IS_ANSWER_INVALID_NODE(ans_node)); - TrNode_child(old_ans_node) = ans_node; - } else + } 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; - UNLOCK_DEP_FR(dep_fr); - consume_answer_and_procceed(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); #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 */ - INIT_PREFETCH() - dep_fr_ptr dep_fr; - ans_node_ptr ans_node; + 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/CMakeLists.txt b/docs/CMakeLists.txt index e36cb0a49..79852fd55 100644 --- a/docs/CMakeLists.txt +++ b/docs/CMakeLists.txt @@ -1,11 +1,11 @@ SET (CODES -solarized-light.css -theme.css -yap.css -icons/yap_64x64x32.png -icons/yap_256x256x32.png -icons/yap_128x128x32.png -icons/yap_48x48x32.png + solarized-light.css + theme.css + yap.css + icons/yap_64x64x32.png + icons/yap_256x256x32.png + icons/yap_128x128x32.png + icons/yap_48x48x32.png ) SET (DOCS @@ -42,14 +42,16 @@ if (WITH_DOCS) configure_file(${doxyfile_in} ${doxyfile} @ONLY) - add_custom_target(doc - COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} - COMMENT "Generating API documentation with Doxygen" - VERBATIM) + configure_file(source/conf.py.in source/conf.py) + configure_file(source/index.rst source/index.rst) + add_custom_target(doc + COMMAND ${DOXYGEN_EXECUTABLE} ${doxyfile} + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + COMMENT "Generating API documentation with Doxygen" + VERBATIM) - install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${docdir}) - install(FILES ${CODES} DESTINATION ${docdir}) + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html DESTINATION ${docdir}) + install(FILES ${CODES} DESTINATION ${docdir}) endif() diff --git a/docs/Doxyfile.in b/docs/Doxyfile.in index c4338c1e1..1299c47d7 100644 --- a/docs/Doxyfile.in +++ b/docs/Doxyfile.in @@ -58,7 +58,7 @@ PROJECT_LOGO = @CMAKE_SOURCE_DIR@/docs/icons/yap_96x96x32.png # entered, it will be relative to the location where doxygen was started. If # left blank the current directory will be used. -OUTPUT_DIRECTORY = @PROJECT_BINARY_DIR@/Docs +OUTPUT_DIRECTORY = @PROJECT_BINARY_DIR@/docs # If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- # directories (in 2 levels) under the output directory of each output format and @@ -775,7 +775,7 @@ 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@/pl \ @PROJECT_SOURCE_DIR@/CXX \ @PROJECT_SOURCE_DIR@/OPTYap \ @PROJECT_SOURCE_DIR@/C \ @@ -784,9 +784,10 @@ 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 \ +# @PROJECT_SOURCE_DIR@/INSTALL.md # This tag can be used to specify the character encoding of the source files @@ -829,9 +830,22 @@ RECURSIVE = YES EXCLUDE = *pltotex.pl \ @PROJECT_SOURCE_DIR@/packages/myddas/sqlite3/src \ -@PROJECT_SOURCE_DIR@/packages/gecode/4.0.* \ -@PROJECT_SOURCE_DIR@/packages/gecode/3,* \ -@PROJECT_SOURCE_DIR@/C/traced_absmi_insts.h +@PROJECT_SOURCE_DIR@/packages/gecode/4.4.0 \ +@PROJECT_SOURCE_DIR@/packages/gecode/4.2.1 \ +@PROJECT_SOURCE_DIR@/packages/gecode/4.2.0 \ +@PROJECT_SOURCE_DIR@/packages/gecode/4.0.0 \ +@PROJECT_SOURCE_DIR@/packages/gecode/3.7.3 \ +@PROJECT_SOURCE_DIR@/packages/gecode/3.7.2 \ +@PROJECT_SOURCE_DIR@/packages/gecode/3.7.1 \ +@PROJECT_SOURCE_DIR@/packages/gecode/3.7.0 \ +@PROJECT_SOURCE_DIR@/packages/gecode/3.6.0 \ +@PROJECT_SOURCE_DIR@/packages/gecode/dev \ +@PROJECT_SOURCE_DIR@/C/traced_absmi_insts.h \ +@PROJECT_SOURCE_DIR@/packages/cplint \ +@PROJECT_SOURCE_DIR@/packages/CLPBN/examples \ +@PROJECT_SOURCE_DIR@/packages/prosqlite \ +@PROJECT_SOURCE_DIR@/packages/pyswip \ + # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or # directories that are symbolic links (a Unix file system feature) are excluded @@ -1316,7 +1330,7 @@ BINARY_TOC = NO # The default value is: NO. # This tag requires that the tag GENERATE_HTMLHELP is set to YES. -TOC_EXPAND = NO +TOC_EXPAND = YES # If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and # QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that @@ -2030,7 +2044,8 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = @CMAKE_BINARY_DIR@ \ + @CMAKE_BINARY_DIR@/packages/gecode # 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 @@ -2261,7 +2276,7 @@ TEMPLATE_RELATIONS = NO INCLUDE_GRAPH = YES -# If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are + # If the INCLUDED_BY_GRAPH, ENABLE_PREPROCESSING and SEARCH_INCLUDES tags are # set to YES then doxygen will generate a graph for each documented file showing # the direct and indirect include dependencies of the file with other documented # files. diff --git a/packages/bdd/bdd.md b/docs/md/bdd.md similarity index 100% rename from packages/bdd/bdd.md rename to docs/md/bdd.md diff --git a/packages/chr/chr.md b/docs/md/chr.md similarity index 100% rename from packages/chr/chr.md rename to docs/md/chr.md diff --git a/packages/gecode/gecode.md b/docs/md/gecode.md similarity index 100% rename from packages/gecode/gecode.md rename to docs/md/gecode.md diff --git a/packages/myddas/myddas.md b/docs/md/myddas.md similarity index 100% rename from packages/myddas/myddas.md rename to docs/md/myddas.md diff --git a/packages/raptor/README.md b/docs/md/raptor.md similarity index 100% rename from packages/raptor/README.md rename to docs/md/raptor.md diff --git a/packages/real/README.md b/docs/md/real.md similarity index 100% rename from packages/real/README.md rename to docs/md/real.md diff --git a/packages/udi/udi.md b/docs/md/udi.md similarity index 100% rename from packages/udi/udi.md rename to docs/md/udi.md diff --git a/docs/source/conf.py b/docs/source/conf.py index 4d2f6d501..cc44b2861 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -1,7 +1,8 @@ +#!/Usr/bin/env python3 # -*- coding: utf-8 -*- # -# yap documentation build configuration file, created by -# sphinx-quickstart on Tue Jan 5 11:01:36 2016. +# YAP documentation build configuration file, created by +# sphinx-quickstart on Sun Mar 26 10:27:55 2017. # # This file is execfile()d with the current directory set to its # containing dir. @@ -12,25 +13,26 @@ # All configuration values have a default; values that are commented out # serve to show the default. -import sys -import os -import shlex - # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) +from recommonmark.parser import CommonMarkParser + # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' +# +# needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. -extensions = [ - 'sphinx.ext.autodoc', +extensions = ['sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.intersphinx', 'sphinx.ext.todo', @@ -38,37 +40,38 @@ extensions = [ 'sphinx.ext.mathjax', 'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', - 'sphinx.ext.pngmath', - 'breathe' + 'sphinx.ext.githubpages', + 'breathe' ] +breathe_projects = { "yap": "${CMAKE_CURRENT_BINARY_DIR" } +breathe_default_project = "yap" + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: -# source_suffix = ['.rst', '.md'] -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' +# +source_suffix = ['.rst', '.md'] +# source_suffix = '.rst' # The master toctree document. master_doc = 'index' # General information about the project. -project = u'yap' -copyright = u'2016, Vitor Santos Costa' -author = u'Vitor Santos Costa' +project = 'YAP' +copyright = '2017, Vitor Santos Costa' +author = 'Vitor Santos Costa' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. -version = u'4.6.3' +version = '6.3' # The full version, including alpha/beta/rc tags. -release = u'4.6.3' +release = '6.3.5' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -77,199 +80,83 @@ release = u'4.6.3' # Usually you set "language" from the command line for these cases. language = None -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path exclude_patterns = [] -# The reST default role (used for this markup: `text`) to use for all -# documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False - # If true, `todo` and `todoList` produce output, else they produce nothing. todo_include_todos = True - +source_parsers = { + '.md': 'recommonmark.parser.CommonMarkParser', +} # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. +# html_theme = 'alabaster' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None +# +# html_theme_options = {} # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -#html_extra_path = [] -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Language to be used for generating the HTML full-text search index. -# Sphinx supports the following languages: -# 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' -# 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' -#html_search_language = 'en' - -# A dictionary with options for the search language support, empty by default. -# Now only 'ja' uses this config value -#html_search_options = {'type': 'default'} - -# The name of a javascript file (relative to the configuration directory) that -# implements a search results scorer. If empty, the default will be used. -#html_search_scorer = 'scorer.js' +# -- Options for HTMLHelp output ------------------------------------------ # Output file base name for HTML help builder. -htmlhelp_basename = 'yapdoc' +htmlhelp_basename = 'YAPdoc' + # -- Options for LaTeX output --------------------------------------------- latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', -# Additional stuff for the LaTeX preamble. -#'preamble': '', + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', -# Latex figure (float) alignment -#'figure_align': 'htbp', + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'yap.tex', u'yap Documentation', - u'Vitor Santos Costa', 'manual'), + (master_doc, 'YAP.tex', 'YAP Documentation', + 'Vitor Santos Costa', 'manual'), ] -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'yap', u'yap Documentation', + (master_doc, 'yap', 'YAP Documentation', [author], 1) ] -# If true, show URL addresses after external links. -#man_show_urls = False - # -- Options for Texinfo output ------------------------------------------- @@ -277,27 +164,34 @@ man_pages = [ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'yap', u'yap Documentation', - author, 'yap', 'One line description of project.', - 'Miscellaneous'), + (master_doc, 'YAP', 'YAP Documentation', + author, 'YAP', 'One line description of project.', + 'Miscellaneous'), ] -# Documents to append as an appendix to all manuals. -#texinfo_appendices = [] -# If false, no module index is generated. -#texinfo_domain_indices = True -# How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' +# -- Options for Epub output ---------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project +epub_author = author +epub_publisher = author +epub_copyright = copyright + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = '' + +# A unique identification for the text. +# +# epub_uid = '' + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ['search.html'] -# If true, do not generate a @detailmenu in the "Top" node's menu. -#texinfo_no_detailmenu = False # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = {'https://docs.python.org/': None} - -breathe_projects = { "yap": "/Users/vsc/git/yap-6.3/Release/docs/xml/" } -breathe_default_project = "yap" - diff --git a/docs/source/conf.py.in b/docs/source/conf.py.in index ab3a25183..65ce3c892 100644 --- a/docs/source/conf.py.in +++ b/docs/source/conf.py.in @@ -1,10 +1,197 @@ -extensions = [ -breathe_projects = { "yap": "/Users/vsc/git/yap-6.3/Release/doc/xml/" }i -breathe_default_project = "yap" -.. doxygenindex:: -.. doxygenfunction:: -.. doxygenstruct:: -.. doxygenenum:: -.. doxygentypedef:: -.. doxygenclass:: +#!/Usr/bin/env python3 +# -*- coding: utf-8 -*- +# +# YAP documentation build configuration file, created by +# sphinx-quickstart on Sun Mar 26 10:27:55 2017. +# +# This file is execfile()d with the current directory set to its +# containing dir. +# +# Note that not all possible configuration values are present in this +# autogenerated file. +# +# All configuration values have a default; values that are commented out +# serve to show the default. +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) +from recommonmark.parser import CommonMarkParser + + +# -- General configuration ------------------------------------------------ + +# If your documentation needs a minimal Sphinx version, state it here. +# +# needs_sphinx = '1.0' + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = ['sphinx.ext.autodoc', + 'sphinx.ext.doctest', + 'sphinx.ext.intersphinx', + 'sphinx.ext.todo', + 'sphinx.ext.coverage', + 'sphinx.ext.mathjax', + 'sphinx.ext.ifconfig', + 'sphinx.ext.viewcode', + 'sphinx.ext.githubpages', + 'breathe' +] + +breathe_projects = { "yap": "@CMAKE_CURRENT_BINARY_DIR@/xml" } +breathe_default_project = "yap" + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +source_suffix = ['.rst', '.md'] +# source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = 'YAP' +copyright = '2017, Vitor Santos Costa' +author = 'Vitor Santos Costa' + +# The version info for the project you're documenting, acts as replacement for +# |version| and |release|, also used in various other places throughout the +# built documents. +# +# The short X.Y version. +version = '6.3' +# The full version, including alpha/beta/rc tags. +release = '6.3.5' + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This patterns also effect to html_static_path and html_extra_path +exclude_patterns = [] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + +source_parsers = { + '.md': 'recommonmark.parser.CommonMarkParser', +} +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = 'alabaster' + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +# html_theme_options = {} + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + + +# -- Options for HTMLHelp output ------------------------------------------ + +# Output file base name for HTML help builder. +htmlhelp_basename = 'YAPdoc' + + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = { + # The paper size ('letterpaper' or 'a4paper'). + # + # 'papersize': 'letterpaper', + + # The font size ('10pt', '11pt' or '12pt'). + # + # 'pointsize': '10pt', + + # Additional stuff for the LaTeX preamble. + # + # 'preamble': '', + + # Latex figure (float) alignment + # + # 'figure_align': 'htbp', +} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'YAP.tex', 'YAP Documentation', + 'Vitor Santos Costa', 'manual'), +] + + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'yap', 'YAP Documentation', + [author], 1) +] + + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'YAP', 'YAP Documentation', + author, 'YAP', 'One line description of project.', + 'Miscellaneous'), +] + + + +# -- Options for Epub output ---------------------------------------------- + +# Bibliographic Dublin Core info. +epub_title = project +epub_author = author +epub_publisher = author +epub_copyright = copyright + +# The unique identifier of the text. This can be a ISBN number +# or the project homepage. +# +# epub_identifier = '' + +# A unique identification for the text. +# +# epub_uid = '' + +# A list of files that should not be packed into the epub file. +epub_exclude_files = ['search.html'] + + + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'https://docs.python.org/': None} diff --git a/docs/source/index.rst b/docs/source/index.rst index 2d0dec9f0..19ee52bf8 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -1,16 +1,11 @@ -.. yap documentation master file, created by - sphinx-quickstart on Tue Jan 5 11:01:36 2016. +.. YAP documentation master file, created by + sphinx-quickstart on Sun Mar 26 10:27:55 2017. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. -Welcome to yap's documentation! +Welcome to YAP's documentation! =============================== -Contents: - -.. toctree:: - :maxdepth: 2 - .. doxygenindex:: .. doxygenfunction:: .. doxygenstruct:: @@ -18,12 +13,33 @@ Contents: .. doxygentypedef:: .. doxygenclass:: +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + '../../md/attributes.md' + '../../md'/builtins.md' + '../../md'/download.md' + '../../md'/extensions.md' + '../../md'/fli.md' + '../../md'/library.md' + '../../md'/load_files.md' + '../../md'/modules.md' + '../../md'/packages.md' + '../../md'/run.md' + '../../md'/swi.md' + '../../md'/syntax.md' + '../../md'/yap.md' + 'classlist.rst' + 'file.rst' + 'group.rst' + 'section.rst' + 'union.rst' + 'namespace.rst' + Indices and tables ================== -* :ref:`genindex` -* :ref:`modindex` * :ref:`search` - diff --git a/include/YapInterface.h b/include/YapInterface.h index 0552dafb5..5ed4ecc17 100755 --- a/include/YapInterface.h +++ b/include/YapInterface.h @@ -1,27 +1,38 @@ /************************************************************************* -* * -* YAP Prolog @(#)c_interface.h 2.2 * -* Yap Prolog was developed at NCCUP - Universidade do Porto * -* * -* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 * -* * -************************************************************************** -* * -* File: YapInterface.h * -* Last rev: 19/2/88 * -* mods: * -* comments: c_interface header file for YAP * -* * -*************************************************************************/ + * * + * YAP Prolog @(#)c_interface.h 2.2 * + * Yap Prolog was developed at NCCUP - Universidade do Porto * + * * + * Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 * + * * + ************************************************************************** + * * + * File: YapInterface.h * + * Last rev: 19/2/88 * + * mods: * + * comments: c_interface header file for YAP * + * * + *************************************************************************/ /** -@file YapInterface.h + @file YapInterface.h -@defgroup ChYInterface Foreign Language interface to YAP + @{ + + @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 -@brief Core interface to YAP. -q */ #ifndef _yap_c_interface_h diff --git a/library/apply_macros.yap b/library/apply_macros.yap index bf4d2d53a..3302a3849 100644 --- a/library/apply_macros.yap +++ b/library/apply_macros.yap @@ -1,13 +1,15 @@ -% File : apply_macros.yap -% Author : E. Alphonse from code by Joachim Schimpf -% Updated: 15 June 2002 -% Purpose: Macros to apply a predicate to all elements +%% @file apply_macros.yap +%% @author E. Alphonse from code by Joachim Schimpf +%% @date 15 June 2002 +%% @nrief Purpose: Macros to apply a predicate to all elements % of a list or to all sub-terms of a term. :- module(apply_macros, []). -/** @defgroup apply_macros Apply Interface to maplist +/** + +@defgroup apply_macros Apply Interface to maplist @ingroup library @{ diff --git a/library/arg.yap b/library/arg.yap index af6e24c37..3c84013c7 100644 --- a/library/arg.yap +++ b/library/arg.yap @@ -7,21 +7,10 @@ */ - -:- module(arg, - [ - genarg/3, - arg0/3, - genarg0/3, - args/3, - args0/3, -% project/3 - path_arg/3 - ]). - - /** -* @defgroup arg Term Argument Manipulation. +* + +@defgroup arg Term Argument Manipulation. @ingroup @library @@ -45,6 +34,19 @@ This file has been included in the YAP library by Vitor Santos Costa, 2008. No e genarg/3. */ +:- module(arg, + [ + genarg/3, + arg0/3, + genarg0/3, + args/3, + args0/3, +% project/3 + path_arg/3 + ]). + + + /** * @pred arg0( +_Index_, +_Term_ , -_Arg_ ) * @@ -161,5 +163,7 @@ path_arg([Index|Indices], Term, SubTerm) :- genarg(Index, Term, Arg), path_arg(Indices, Arg, SubTerm). -%%@} +%%% @} + +/** @} */ diff --git a/library/block_diagram.yap b/library/block_diagram.yap index 189f9b5e9..0706fa152 100644 --- a/library/block_diagram.yap +++ b/library/block_diagram.yap @@ -474,4 +474,4 @@ write_explicit. write(NodeConnection), nl. */ -%% @} +%% @} @} diff --git a/library/dgraphs.yap b/library/dgraphs.yap index 3c76c214e..1e07f5de2 100644 --- a/library/dgraphs.yap +++ b/library/dgraphs.yap @@ -703,3 +703,6 @@ vertices_without_children((V-[]).Pairs, V.Vertices) :- vertices_without_children(Pairs, Vertices). vertices_without_children(_V-[_|_].Pairs, Vertices) :- vertices_without_children(Pairs, Vertices). + +%% @}/** @} */ + diff --git a/library/dialect/swi/fli/swi.h b/library/dialect/swi/fli/swi.h index 01e8030d5..26cc9673a 100644 --- a/library/dialect/swi/fli/swi.h +++ b/library/dialect/swi/fli/swi.h @@ -15,7 +15,7 @@ @file swi.h @defgroup swi-c-interface SWI-Prolog Foreign Language Interface - @ingroup ChYInterface + @ingroup fli_c_cx * * @tableofcontents diff --git a/library/exo_interval.yap b/library/exo_interval.yap index 40c63e4dd..e1a3e30f6 100644 --- a/library/exo_interval.yap +++ b/library/exo_interval.yap @@ -9,7 +9,7 @@ * It assumes simple queries and a contiguous interval, * and does not really expect to do non-trivial * constraint propagation and solving. - * + * * */ :- module(exo_interval, @@ -33,7 +33,9 @@ op(700, xfx, (#=))]). -/** @defgroup exo_interval Exo Intervals +/** + +@defgroup exo_interval Exo Intervals @ingroup library @{ @@ -236,3 +238,5 @@ expand_op(A1, A2, A3) :- A1 == max -> A3 = max; A2 == max -> A3 = max; A3 = any ). +%% @} + diff --git a/library/flags.yap b/library/flags.yap index 2e47a13b0..4b3daf33b 100644 --- a/library/flags.yap +++ b/library/flags.yap @@ -586,4 +586,4 @@ defined_flag(FlagName, FlagGroup, FlagType, DefaultValue, Description, Access, H nonvar(FlagName), nonvar(FlagGroup), '$defined_flag$'(FlagName, FlagGroup, FlagType, DefaultValue, Description, Access, Handler). -%%@} +%% @} diff --git a/library/hacks.yap b/library/hacks.yap index 5a6fd7944..856670b89 100644 --- a/library/hacks.yap +++ b/library/hacks.yap @@ -1,5 +1,5 @@ /** - * @file hacks.yap + * @file library/hacks.yap * @author VITOR SANTOS COSTA * @date Tue Nov 17 19:00:25 2015 * diff --git a/library/heaps.yap b/library/heaps.yap index 5c426e779..745eb4edf 100644 --- a/library/heaps.yap +++ b/library/heaps.yap @@ -279,3 +279,5 @@ Succeeds if _Heap_ is an empty heap. empty_heap(t(0,[],t)). +/** @} */ + diff --git a/library/lam_mpi.yap b/library/lam_mpi.yap index 340dbcdcf..44297a928 100644 --- a/library/lam_mpi.yap +++ b/library/lam_mpi.yap @@ -217,3 +217,5 @@ message and _Data_ with the message itself. mpi_msg_size(Term, Size) :- terms:export_term(Term, Buf, Size), terms:kill_exported_term(Buf). +/** @} */ + diff --git a/library/listing.yap b/library/listing.yap index fe4904787..7c869a4db 100644 --- a/library/listing.yap +++ b/library/listing.yap @@ -16,7 +16,7 @@ *************************************************************************/ /** - * @file listing.yap + * @file library/listing.yap * @author VITOR SANTOS COSTA * @date Tue Nov 17 22:03:59 2015 * diff --git a/library/lists.yap b/library/lists.yap index 5065b90bf..3c1fd6723 100644 --- a/library/lists.yap +++ b/library/lists.yap @@ -3,6 +3,10 @@ * @author Bob Welham, Lawrence Byrd, and R. A. O'Keefe. Contributions from Vitor Santos Costa, Jan Wielemaker and others. * @date 1999 * + * @addtogroup library The Prolog Library + * + * @{ + * * @brief List Manipulation Predicates * * @@ -621,3 +625,5 @@ close_list([_|T]) :- %% @} +/** @} */ + diff --git a/library/mapargs.yap b/library/mapargs.yap index 189feca58..018ae78a0 100644 --- a/library/mapargs.yap +++ b/library/mapargs.yap @@ -1,5 +1,5 @@ /** - * @file mapargs.yap + * @file library/mapargs.yap * @author Lawrence Byrd + Richard A. O'Keefe, VITOR SANTOS COSTA * @author : E. Alphonse from code by Joachim Schimpf, Jan Wielemaker, Vitor Santos Costa * @date 4 August 1984 and Ken Johnson 11-8-87 diff --git a/library/maplist.yap b/library/maplist.yap index e1af90dfe..289b14176 100644 --- a/library/maplist.yap +++ b/library/maplist.yap @@ -331,7 +331,7 @@ maplist(Pred, [A1|L1], [A2|L2], [A3|L3], [A4|L4]) :- maplist(Pred, L1, L2, L3, L4). /** - convlist(: _Pred_, + _ListIn_, ? _ListOut_) @anchor convlist + convlist(: _Pred_, + _ListIn_, ? _ListOut_) @anchor convlist3 A combination of maplist/3 and selectlist/3: creates _ListOut_ by applying the predicate _Pred_ to all list elements on which @@ -355,7 +355,7 @@ convlist(Pred, [_|Olds], News) :- convlist(Pred, Olds, News). /** - convlist(: Pred, ? ListIn, ?ExtraList, ? ListOut) @anchor convlist + convlist(: Pred, ? ListIn, ?ExtraList, ? ListOut) @anchor convlist5 A combination of maplist/4 and selectlist/3: _ListIn_, _ListExtra_, and _ListOut_ are the sublists so that the predicate _Pred_ succeeds. diff --git a/library/matlab.yap b/library/matlab.yap index c4120d0f4..b7a64dcb0 100644 --- a/library/matlab.yap +++ b/library/matlab.yap @@ -324,3 +324,5 @@ build_string([S0|S],[C|Lf],L0) :- process_arg_entry([],[]) :- !. process_arg_entry(L,['('|L]). +/** @} */ + diff --git a/library/matrix.yap b/library/matrix.yap index ae7d9f206..9de723e8f 100644 --- a/library/matrix.yap +++ b/library/matrix.yap @@ -1399,3 +1399,5 @@ ints(A,B,O) :- ( A > B -> O = [] ; O = [A|L], A1 is A+1, ints(A1,B,L) ). zero(_, 0). +/** @} */ + diff --git a/library/nb.yap b/library/nb.yap index 2e67d125b..8e245502b 100644 --- a/library/nb.yap +++ b/library/nb.yap @@ -228,3 +228,5 @@ Unify _Size_ with the number of elements in the queue _Queue_. */ +/** @} */ + diff --git a/library/ordsets.yap b/library/ordsets.yap index 456a74a6e..81c093893 100644 --- a/library/ordsets.yap +++ b/library/ordsets.yap @@ -497,3 +497,5 @@ ord_memberchk(Element, [E|_]) :- E == Element, !. ord_memberchk(Element, [_|Set]) :- ord_memberchk(Element, Set). +/** @} */ + diff --git a/library/queues.yap b/library/queues.yap index 85d6b1eea..fe4c123a6 100644 --- a/library/queues.yap +++ b/library/queues.yap @@ -283,3 +283,5 @@ queue_to_list(Front, Back, Ans) :- queue_to_list([Head|Front], Back, [Head|Tail]) :- queue_to_list(Front, Back, Tail). +/** @} */ + diff --git a/library/random.yap b/library/random.yap index 54aa2b268..c199aca66 100644 --- a/library/random.yap +++ b/library/random.yap @@ -218,3 +218,5 @@ setrand(rand(X,Y,Z)) :- getrand(rand(X,Y,Z)) :- getrand(X,Y,Z). +/** @} */ + diff --git a/library/rbtrees.yap b/library/rbtrees.yap index ce0267105..b4b6d8eb1 100644 --- a/library/rbtrees.yap +++ b/library/rbtrees.yap @@ -49,12 +49,11 @@ rb_in/3 ]). -%%! @{ - /** * @defgroup rbtrees Red-Black Trees * @ingroup library - + + @{ Red-Black trees are balanced search binary trees. They are named because nodes can be classified as either red or black. The code we include is based on "Introduction to Algorithms", second edition, by Cormen, @@ -96,8 +95,8 @@ form colour(Left, Key, Value, Right), where _colour_ is one of =red= or :- pred next(tree(K,V),K,pair(K,V),V,tree(K,V)). */ +%% @pred rb_new(-T) is det. % create an empty tree. -%% rb_new(-T) is det. % % Create a new Red-Black tree. % @@ -107,12 +106,12 @@ rb_new(t(Nil,Nil)) :- Nil = black('',_,_,''). rb_new(K,V,t(Nil,black(Nil,K,V,Nil))) :- Nil = black('',_,_,''). -%% rb_empty(?T) is semidet. +%% @pred rb_empty(?T) is semidet. % % Succeeds if T is an empty Red-Black tree. rb_empty(t(Nil,Nil)) :- Nil = black('',_,_,''). -%% rb_lookup(+Key, -Value, +T) is semidet. +%% @pred rb_lookup(+Key, -Value, +T) is semidet. % % Backtrack through all elements with key Key in the Red-Black % tree T, returning for each the value Value. @@ -135,7 +134,7 @@ lookup(<, K, V, Tree) :- lookup(=, _, V, Tree) :- arg(3,Tree,V). -%% rb_min(+T, -Key, -Value) is semidet. +%% @pred rb_min(+T, -Key, -Value) is semidet. % % Key is the minimum key in T, and is associated with Val. @@ -149,7 +148,7 @@ min(red(Right,_,_,_), Key, Val) :- min(black(Right,_,_,_), Key, Val) :- min(Right,Key,Val). -%% rb_max(+T, -Key, -Value) is semidet. +%% @pred rb_max(+T, -Key, -Value) is semidet. % % Key is the maximal key in T, and is associated with Val. @@ -163,7 +162,7 @@ max(red(_,_,_,Left), Key, Val) :- max(black(_,_,_,Left), Key, Val) :- max(Left,Key,Val). -%% rb_next(+T, +Key, -Next,-Value) is semidet. +%% @pred rb_next(+T, +Key, -Next,-Value) is semidet. % % Next is the next element after Key in T, and is associated with % Val. @@ -193,7 +192,7 @@ next(=, _, _, _, NK, Val, Tree, Candidate) :- Candidate = (NK-Val) ). -%% rb_previous(+T, +Key, -Previous, -Value) is semidet. +%% @pred rb_previous(+T, +Key, -Previous, -Value) is semidet. % % Previous is the previous element after Key in T, and is % associated with Val. @@ -223,8 +222,8 @@ previous(=, _, _, _, K, Val, Tree, Candidate) :- Candidate = (K-Val) ). -%% rb_update(+T, +Key, +NewVal, -TN) is semidet. -%% rb_update(+T, +Key, ?OldVal, +NewVal, -TN) is semidet. +%% @pred rb_update(+T, +Key, +NewVal, -TN) is semidet. +%% @pred rb_update(+T, +Key, ?OldVal, +NewVal, -TN) is semidet. % % Tree TN is tree T, but with value for Key associated with % NewVal. Fails if it cannot find Key in T. @@ -263,8 +262,8 @@ update(red(Left,Key0,Val0,Right), Key, OldVal, Val, NewTree) :- update(Right, Key, OldVal, Val, NewRight) ). -%% rb_rewrite(+T, +Key, +NewVal) is semidet. -%% rb_rewrite(+T, +Key, ?OldVal, +NewVal) is semidet. +%% @pred rb_rewrite(+T, +Key, +NewVal) is semidet. +%% @pred rb_rewrite(+T, +Key, ?OldVal, +NewVal) is semidet. % % Tree T has value for Key associated with % NewVal. Fails if it cannot find Key in T. @@ -288,7 +287,7 @@ rewrite(Node, Key, OldVal, Val) :- ; rewrite(Right, Key, OldVal, Val) ). -rewrite(Node, Key, OldVal, Val) :- + rewrite(Node, Key, OldVal, Val) :- Node = red(Left,Key0,Val0,Right), Left \= [], compare(Cmp,Key0,Key), @@ -305,7 +304,7 @@ rewrite(Node, Key, OldVal, Val) :- rewrite(Right, Key, OldVal, Val) ). -%% rb_apply(+T, +Key, :G, -TN) is semidet. +%% @pred rb_apply(+T, +Key, :G, -TN) is semidet. % % If the value associated with key Key is Val0 in T, and if % call(G,Val0,ValF) holds, then TN differs from T only in that Key diff --git a/library/regexp.yap b/library/regexp.yap index 3fec4051e..76412b763 100644 --- a/library/regexp.yap +++ b/library/regexp.yap @@ -213,3 +213,5 @@ process_opt(I,_,G) :- throw(error(domain_error(flag_value,regexp_options+I),G)). +/** @} */ + diff --git a/library/rltree.yap b/library/rltree.yap index 9eff908cf..9844dbe5c 100644 --- a/library/rltree.yap +++ b/library/rltree.yap @@ -3,8 +3,6 @@ * @author Nuno A. Fonseca * @date 2008-03-26 23:05:22 * - * @brief Range-List (RL) tree data structure implementation for YAP - * * */ @@ -23,10 +21,10 @@ /** -* @defgroup rltrees +* @defgroup rltrees Range-List (RL) trees * @ingroup library * -* Range-List (RL) tree data structure implementation for YAP +* @brief Range-List (RL) tree data structure implementation for YAP */ diff --git a/library/splay.yap b/library/splay.yap index 8dfad8d82..37b17dd03 100644 --- a/library/splay.yap +++ b/library/splay.yap @@ -274,3 +274,5 @@ join(Left-n(Y, VY, n(X, VX, C, B), NL), n(X, VX, C, n(Y, VY, B, n(Z, VZ, A1, A2) splay_init(_). +/** @} */ + diff --git a/library/system.yap b/library/system.yap index 9dbcca7f1..35cefc661 100644 --- a/library/system.yap +++ b/library/system.yap @@ -811,3 +811,5 @@ read_link(P,D,F) :- read_link(P, D), absolute_file_name(D, [], F). +/** @} */ + diff --git a/library/terms.yap b/library/terms.yap index eb526174c..64d5972ae 100644 --- a/library/terms.yap +++ b/library/terms.yap @@ -154,3 +154,5 @@ subsumes_chk(X,Y) :- +/** @} */ + diff --git a/library/timeout.yap b/library/timeout.yap index 9765b248a..b09bc72c4 100644 --- a/library/timeout.yap +++ b/library/timeout.yap @@ -102,3 +102,6 @@ time_out(Goal, Time, Result) :- time_out, Result0 = time_out ), Result = Result0. + +%% @} + diff --git a/library/trees.yap b/library/trees.yap index ca166de8d..d409e6cb4 100644 --- a/library/trees.yap +++ b/library/trees.yap @@ -243,6 +243,5 @@ tree_to_list(Tree, List) :- list(0, []). list(N, [N|L]) :- M is N-1, list(M, L). - - +%% @}/** @} */ diff --git a/library/tries.yap b/library/tries.yap index ae255ee9e..8153bd249 100644 --- a/library/tries.yap +++ b/library/tries.yap @@ -222,3 +222,6 @@ trie_to_depth_breadth_trie(Trie, DepthBreadthTrie, FinalLabel, OptimizationLevel trie_to_depth_breadth_trie(Trie, DepthBreadthTrie, FinalLabel, OptimizationLevel, StartCounter, EndCounter) :- trie_depth_breadth(Trie, DepthBreadthTrie, FinalLabel, OptimizationLevel, StartCounter, EndCounter). + +%% @} + diff --git a/library/ugraphs.yap b/library/ugraphs.yap index 4b22788f5..faf4da51c 100644 --- a/library/ugraphs.yap +++ b/library/ugraphs.yap @@ -861,3 +861,5 @@ ugraph_union(<, Head1, Tail1, Head2, Tail2, [Head1|Union]) :- ugraph_union(>, Head1, Tail1, Head2, Tail2, [Head2|Union]) :- ugraph_union([Head1|Tail1], Tail2, Union). +%% @} + diff --git a/library/undgraphs.yap b/library/undgraphs.yap index 36469c039..9d2869c4d 100644 --- a/library/undgraphs.yap +++ b/library/undgraphs.yap @@ -276,3 +276,5 @@ expand_component([_|Children], Map1, Map, Graph1, NGraph) :- pick_node(Graph,Node,Children,Graph1) :- rb_in(Node,Children,Graph), !, rb_delete(Graph, Node, Graph1). + +%% @} diff --git a/library/wdgraphs.yap b/library/wdgraphs.yap index 774d8ced3..a330c8d6b 100644 --- a/library/wdgraphs.yap +++ b/library/wdgraphs.yap @@ -3,102 +3,45 @@ * @author VITOR SANTOS COSTA * @date 2006 * + * +*/ + +:- module( wdgraphs, + [ + wdgraph_new/1, + wdgraph_add_edge/5, + wdgraph_add_edges/3, + wdgraph_add_vertices_and_edges/4, + wdgraph_del_edge/5, + wdgraph_del_edges/3, + wdgraph_del_vertex/3, + wdgraph_del_vertices/3, + wdgraph_edge/4, + wdgraph_to_dgraph/2, + dgraph_to_wdgraph/2, + wdgraph_neighbors/3, + wdgraph_neighbours/3, + wdgraph_wneighbors/3, + wdgraph_wneighbours/3, + wdgraph_transpose/2, + wdgraph_transitive_closure/2, + wdgraph_symmetric_closure/2, + wdgraph_top_sort/2, + wdgraph_min_path/5, + wdgraph_min_paths/3, + wdgraph_max_path/5, + wdgraph_path/3, + wdgraph_reachable/3]). + +/** + * @defgroup wdgraphs Weighted Directed Graphs + * @ingroup library + * * @brief Weighted Directed Graph Processing Utilities. * + * @{ * -*/ - -:- module( wdgraphs, - [ - wdgraph_new/1, - wdgraph_add_edge/5, - wdgraph_add_edges/3, - wdgraph_add_vertices_and_edges/4, - wdgraph_del_edge/5, - wdgraph_del_edges/3, - wdgraph_del_vertex/3, - wdgraph_del_vertices/3, - wdgraph_edge/4, - wdgraph_to_dgraph/2, - dgraph_to_wdgraph/2, - wdgraph_neighbors/3, - wdgraph_neighbours/3, - wdgraph_wneighbors/3, - wdgraph_wneighbours/3, - wdgraph_transpose/2, - wdgraph_transitive_closure/2, - wdgraph_symmetric_closure/2, - wdgraph_top_sort/2, - wdgraph_min_path/5, - wdgraph_min_paths/3, - wdgraph_max_path/5, - wdgraph_path/3, - wdgraph_reachable/3]). - -:- module( wdgraphs, - [ - wdgraph_new/1, - wdgraph_add_edge/5, - wdgraph_add_edges/3, - wdgraph_add_vertices_and_edges/4, - wdgraph_del_edge/5, - wdgraph_del_edges/3, - wdgraph_del_vertex/3, - wdgraph_del_vertices/3, - wdgraph_edge/4, - wdgraph_to_dgraph/2, - dgraph_to_wdgraph/2, - wdgraph_neighbors/3, - wdgraph_neighbours/3, - wdgraph_wneighbors/3, - wdgraph_wneighbours/3, - wdgraph_transpose/2, - wdgraph_transitive_closure/2, - wdgraph_symmetric_closure/2, - wdgraph_top_sort/2, - wdgraph_min_path/5, - wdgraph_min_paths/3, - wdgraph_max_path/5, - wdgraph_path/3, - wdgraph_reachable/3]). - -/** -* @defgroup wdgraphs Weighted Directed Graph Processing Utilities. - -:- module( wdgraphs, - [ - wdgraph_new/1, - wdgraph_add_edge/5, - wdgraph_add_edges/3, - wdgraph_add_vertices_and_edges/4, - wdgraph_del_edge/5, - wdgraph_del_edges/3, - wdgraph_del_vertex/3, - wdgraph_del_vertices/3, - wdgraph_edge/4, - wdgraph_to_dgraph/2, - dgraph_to_wdgraph/2, - wdgraph_neighbors/3, - wdgraph_neighbours/3, - wdgraph_wneighbors/3, - wdgraph_wneighbours/3, - wdgraph_transpose/2, - wdgraph_transitive_closure/2, - wdgraph_symmetric_closure/2, - wdgraph_top_sort/2, - wdgraph_min_path/5, - wdgraph_min_paths/3, - wdgraph_max_path/5, - wdgraph_path/3, - wdgraph_reachable/3]). - -/** -* @defgroup wdgraphs -/** -* @defgroup wdgraphs Weighted Directed Graph Processing Utilities. -* @ingroup library -* -*/ + */ :- reexport(library(dgraphs), @@ -527,3 +470,5 @@ reachable([V-_|Vertices], Done0, DoneF, G, [V|EdgesF], Edges0) :- rb_insert(Done0, V, [], Done1), reachable(Kids, Done1, DoneI, G, EdgesF, EdgesI), reachable(Vertices, DoneI, DoneF, G, EdgesI, Edges0). + +%% @} diff --git a/library/wgraphs.yap b/library/wgraphs.yap index d16f6969f..12ee16023 100644 --- a/library/wgraphs.yap +++ b/library/wgraphs.yap @@ -3,8 +3,6 @@ * @author VITOR SANTOS COSTA * @date 2006 * - * @brief Weighted Graph Processing Utilities. - * * */ @@ -19,8 +17,11 @@ SICStus compatible wgraphs.yap ). /** -* @defgroup wgraphs -* @ingroup library + * @defgroup wgraphs Weighted Graphs + * @ingroup library + * @brief Weighted Graph Processing Utilities. + * + * @{ */ @@ -56,3 +57,5 @@ vertices_edges_to_wgraph(Vertices, Edges, Graph) :- wdgraph_add_vertices_and_edges(G0, Vertices, Edges, Graph). +%% @} + diff --git a/library/wundgraphs.yap b/library/wundgraphs.yap index 3782d657f..f5e2cf4ee 100644 --- a/library/wundgraphs.yap +++ b/library/wundgraphs.yap @@ -2,10 +2,11 @@ * @file wundgraphs.yap * @author VITOR SANTOS COSTA * @date 2006 - * - * @brief Directed Graph Processing Utilities. + * + * */ + :- module( wundgraphs, [ wundgraph_add_edge/5, @@ -16,14 +17,16 @@ wundgraph_edges/2, wundgraph_neighbours/3, wundgraph_neighbors/3, - wundgraph_wneighbours/3, + wundgraph_wneighbours/3, wundgraph_wneighbors/3, wundgraph_min_tree/3, wundgraph_max_tree/3]). /** -* @defgroup wundgraphs +* @defgroup wundgraphs Weighted Undirected Graphs * @ingroup library +* + * @brief Weighted Undirected Graph Processing Utilities. */ diff --git a/os/alias.c b/os/alias.c index cd70f62fd..1620f46c8 100644 --- a/os/alias.c +++ b/os/alias.c @@ -30,7 +30,7 @@ static char SccsId[] = "%W% %G%"; /** - * @defgroup Aliases + * @defgroup Aliases Aliases to Stream Names * @ingroup InputOutput * * Aliases: diff --git a/os/charsio.c b/os/charsio.c index 37e31cafd..0547884b0 100644 --- a/os/charsio.c +++ b/os/charsio.c @@ -28,9 +28,9 @@ static char SccsId[] = "%W% %G%"; * */ -/* @defgroup CharIO Character-Based Input/Output +/** @defgroup CharIO Character-Based Input/Output * @ingroup InputOutput - * + * @{ * YAP implements most of the ISO-Prolog built-ins. Input/Output may be *performed on * the current stream or on a specified stream, and it may involve a: @@ -1220,3 +1220,5 @@ void Yap_InitCharsio(void) { Yap_InitCPred("tab", 2, tab, SafePredFlag | SyncPredFlag); Yap_InitCPred("tab", 1, tab_1, SafePredFlag | SyncPredFlag); } + +/// @} diff --git a/os/chartypes.yap b/os/chartypes.yap index 35d19be46..0d7615768 100644 --- a/os/chartypes.yap +++ b/os/chartypes.yap @@ -9,7 +9,7 @@ /** @defgroup CharacterCodes Character Encoding and Manipulation. - @ingroup TextProcessing + @ingroup InputOutput @{ The Prolog library includes a set of built-in predicates designed to @@ -1909,3 +1909,6 @@ paren_paren( 0xFF5F, 0xFF60). paren_paren( 0xFF60, 0xFF5F). paren_paren( 0xFF62, 0xFF63). paren_paren( 0xFF63, 0xFF62). + +/** @} */ + diff --git a/os/fmemopen.c b/os/fmemopen.c index 9e444db2d..3033d1a55 100644 --- a/os/fmemopen.c +++ b/os/fmemopen.c @@ -17,11 +17,11 @@ // /** - * @file memopen.c - * @defgroup Memory Streams. - * @in. - * @return Description of returned value. - */ + * @file fmemopen.c + * @defgroup Memory Streams. + * @in. + * @return Description of returned value. + */ #ifdef __APPLE__ #include diff --git a/os/format.c b/os/format.c index 105faab12..bd02a38b2 100644 --- a/os/format.c +++ b/os/format.c @@ -19,8 +19,10 @@ static char SccsId[] = "%W% %G%"; #endif /** + * @file format.c + * * @defgroup FormattedIO Formatted Output - * @ingroup YAPIO + * @ingroup InputOutput * This file includes the definition of the formatted output predicates. * * @{ diff --git a/os/streams.c b/os/streams.c index 4d69009ab..1f4a7f5b6 100644 --- a/os/streams.c +++ b/os/streams.c @@ -18,7 +18,9 @@ static char SccsId[] = "%W% %G%"; #endif -/* +/** + * + * This file includes the definition of a miscellania of standard predicates * for yap refering to: Files and GLOBAL_Streams, Simple Input/Output, * diff --git a/packages/yap-lbfgs/lbfgs.pl b/packages/yap-lbfgs/lbfgs.pl index 44c9292f6..45b34debf 100644 --- a/packages/yap-lbfgs/lbfgs.pl +++ b/packages/yap-lbfgs/lbfgs.pl @@ -1,5 +1,7 @@ %%% -*- Mode: Prolog; -*- +%% @file lbfgs.pl + % This file is part of YAP-LBFGS. % Copyright (C) 2009 Bernd Gutmann % @@ -39,18 +41,20 @@ /** -@defgroup YAP-LBFGS +@defgroup YAP-LBFGS Interface to LibLBFGS @ingroup packages -@short What is YAP-LBFGS? YAP-LBFGS is an interface to call libLBFGS, http://www.chokkan.org/software/liblbfgs/, from within +@short What is YAP-LBFGS? YAP-LBFGS is an interface to call [libLBFG](http://www.chokkan.org/software/liblbfgs/), from within YAP. libLBFGS is a C library for Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L-BFGS) solving the under-constrained minimization problem: +~~~~~~~~~~~~~~~~~~~~~~~~ + minimize `F(X), X=(x1,x2,..., xN)` +~~~~~~~~~~~~~~~~~~~~~~~~ -### Contact +### Contact YAP-LBFGS has been developed by Bernd Gutmann. In case you publish something using YAP-LBFGS, please give credit to me and to libLBFGS. And if you find YAP-LBFGS useful, or if you find a bug, or if you port it to another system, ... please send me an email. diff --git a/pl/absf.yap b/pl/absf.yap index 52dbdac4c..f97f6b60e 100755 --- a/pl/absf.yap +++ b/pl/absf.yap @@ -13,18 +13,8 @@ @file absf.yap @author L.Damas, V.S.Costa -*/ -:- system_module( absf, [absolute_file_name/2, - absolute_file_name/3, - add_to_path/1, - add_to_path/2, - path/1, - remove_from_path/1], ['$full_filename'/3, - '$system_library_directories'/2]). - -/** - * @defgroup AbsoluteFileName File Name Resolution - * @ingroup builtins + @defgroup AbsoluteFileName File Name Resolution + @ingroup builtins Support for file name resolution through absolute_file_name/3 and friends. These utility built-ins describe a list of directories that @@ -34,7 +24,15 @@ @{ - */ +*/ +:- system_module( absf, [absolute_file_name/2, + absolute_file_name/3, + add_to_path/1, + add_to_path/2, + path/1, + remove_from_path/1], ['$full_filename'/3, + '$system_library_directories'/2]). + :- use_system_module( '$_boot', ['$system_catch'/4]). @@ -299,8 +297,8 @@ absolute_file_name(File0,File) :- '$var'(S) --> '$id'(S). -'$drive' --> - '$id'(_), +'$drive'(C) --> + '$id'(C), ":\\\\". '$id'([C|S]) --> [C], diff --git a/pl/atoms.yap b/pl/atoms.yap index f3dd5d967..e278d29ec 100644 --- a/pl/atoms.yap +++ b/pl/atoms.yap @@ -8,7 +8,10 @@ * * *************************************************************************/ -%% @{ +/** + *@file atoms.yap + * + */ :- system_module( '$_atoms', [ atom_concat/2, @@ -19,15 +22,13 @@ :- use_system_module( '$_errors', ['$do_error'/2]). -%% @{ -/** +/?** * @addtogroup Predicates_on_Atoms - * @ingroup YAPChars * */ -/** @pred atom_concat(+ _As_,? _A_) +/** @pred atom_concat(+ As, ? A) The predicate holds when the first argument is a list of atoms, and the diff --git a/pl/boot.yap b/pl/boot.yap index 41d4b1ebb..a1046b87c 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -18,14 +18,17 @@ /** @file boot.yap + +@addtogroup builtins Core YAP Builtins + @defgroup YAPControl Control Predicates @ingroup builtins +@{ + + */ -%% @{ - - /** @pred :_P_ ; :_Q_ is iso Disjunction of goals (or). @@ -1651,5 +1654,5 @@ log_event( String, Args ) :- '$ensure_prompting'. /** - @} +@} @} */ diff --git a/pl/bootlists.yap b/pl/bootlists.yap index 39e631347..5508b55b1 100644 --- a/pl/bootlists.yap +++ b/pl/bootlists.yap @@ -1,5 +1,5 @@ /** - * @file pl/lists.yap + * @file bootlists.yap * @author VITOR SANTOS COSTA * @date Thu Nov 19 09:54:00 2015 * diff --git a/pl/corout.yap b/pl/corout.yap index 25e5a7962..a89a0f59f 100644 --- a/pl/corout.yap +++ b/pl/corout.yap @@ -20,7 +20,12 @@ * @file corout.yap * @author VITOR SANTOS COSTA * @date Mon Nov 16 22:47:27 2015 - * + * + * @addtogroup extensions Extensions to Core Prolog + * + * @{ + * @ addtogroup AttributeVariables Attributed Variables and Co-Routining + * @{ * @brief Support for co-routining * * diff --git a/pl/dbload.yap b/pl/dbload.yap index f2ebcbcb3..e7e6862ae 100644 --- a/pl/dbload.yap +++ b/pl/dbload.yap @@ -1,4 +1,7 @@ -/************************************************************************* +//!@{ + +//!@ingroup YAPModules +}/************************************************************************* * * * YAP Prolog * * * @@ -170,4 +173,7 @@ clean_up :- retractall(dbloading(_,_,_,_,_,_)), retractall(dbprocess(_,_)), fail. + clean_up. + +//!@} diff --git a/pl/grammar.yap b/pl/grammar.yap index f073a3b73..a3a298cec 100644 --- a/pl/grammar.yap +++ b/pl/grammar.yap @@ -26,9 +26,9 @@ */ /** -@{ @defgroup Grammars Grammar Rules @ingroup builtins +@{ Grammar rules in Prolog are both a convenient way to express definite clause grammars and an extension of the well known context-free grammars. @@ -66,8 +66,6 @@ right hand side of a grammar rule Grammar related built-in predicates: -@{ - */ :- system_module( '$_grammar', [!/2, diff --git a/pl/init.yap b/pl/init.yap index cc70b482f..1c0fdafed 100644 --- a/pl/init.yap +++ b/pl/init.yap @@ -14,9 +14,15 @@ * comments: initializing the full prolog system * * * *************************************************************************/ -%% @defgroup builtins YAP Built-Ins -/* +/** + + @file init.yap + +@{ + @defgroup library The Prolog library + +@} @addtogroup YAPControl diff --git a/pl/load_foreign.yap b/pl/load_foreign.yap index 6b06fb811..3856243c6 100644 --- a/pl/load_foreign.yap +++ b/pl/load_foreign.yap @@ -27,7 +27,7 @@ /** @defgroup LoadForeign Access to Foreign Language Programs -@ingroup fli +@ingroup fli_c_cx @{ diff --git a/pl/modules.yap b/pl/modules.yap index 6f9f70e6a..96dca73fb 100644 --- a/pl/modules.yap +++ b/pl/modules.yap @@ -78,7 +78,7 @@ /** \pred use_module( +Files ) is directive - loads a module file + @load a module file This predicate loads the file specified by _Files_, importing all their public predicates into the current type-in module. It is diff --git a/pl/qly.yap b/pl/qly.yap index 4b5362190..397eb1f11 100755 --- a/pl/qly.yap +++ b/pl/qly.yap @@ -17,6 +17,24 @@ %% @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. + +@{ +*/ + :- system_module( '$_qly', [qload_module/1, qsave_file/1, qsave_module/1, @@ -44,23 +62,6 @@ :- use_system_module( '$_yio', ['$extend_file_search_path'/1]). -/** - -@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. - -@{ -*/ /** @pred save_program(+ _F_) Saves the current state of the data-base in file _F_ . diff --git a/pl/yio.yap b/pl/yio.yap index 4826a1646..bd1e1a037 100644 --- a/pl/yio.yap +++ b/pl/yio.yap @@ -69,8 +69,7 @@ setting and clearing this flag are given under 7.7. /* stream predicates */ /** @defgroup IO_Sockets YAP Old Style Socket and Pipe Interface - @ingroup InputOutput - @{ + @{ Autoload the socket/pipe library