more doc stuff

This commit is contained in:
Vitor Santos Costa 2018-05-10 13:11:56 +01:00
parent 74222843e5
commit 1206035805
25 changed files with 780 additions and 819 deletions

View File

@ -8,10 +8,8 @@
* * * *
************************************************************************** **************************************************************************
* * * *
* File: attvar.c * * File: attvar.c * Last rev:
* Last rev: * ** mods: * comments: YAP support for attributed vars *
* mods: *
* comments: YAP support for attributed vars *
* * * *
*************************************************************************/ *************************************************************************/
#ifdef SCCS #ifdef SCCS
@ -29,19 +27,20 @@ static char SccsId[] = "%W% %G%";
*/ */
#include "Yap.h" #include "Yap.h"
#include "Yatom.h"
#include "YapHeap.h" #include "YapHeap.h"
#include "heapgc.h" #include "Yatom.h"
#include "attvar.h" #include "attvar.h"
#include "heapgc.h"
#ifndef NULL #ifndef NULL
#define NULL (void *)0 #define NULL (void *)0
#endif #endif
/** /**
@defgroup AttributedVariables_Builtins Low-level support for Attributed Variables @defgroup AttributedVariables_Builtins Low-level support for Attributed
Variables
@brief Implementation of Attribute Declarations @brief Implementation of Attribute Declarations
@ingroup attributes @ingroup AttributedVariables
@{ @{
*/ */
@ -684,7 +683,6 @@ static Int free_att(USES_REGS1) {
} }
} }
static Int get_atts(USES_REGS1) { static Int get_atts(USES_REGS1) {
/* receive a variable in ARG1 */ /* receive a variable in ARG1 */
Term inp = Deref(ARG1); Term inp = Deref(ARG1);
@ -921,8 +919,7 @@ static Term AllAttVars(USES_REGS1) {
pt += 3 + pt[1]; pt += 3 + pt[1];
break; break;
case (CELL)FunctorBigInt: { case (CELL)FunctorBigInt: {
Int sz = 3 + Int sz = 3 + (sizeof(MP_INT) +
(sizeof(MP_INT) +
(((MP_INT *)(pt + 2))->_mp_alloc * sizeof(mp_limb_t))) / (((MP_INT *)(pt + 2))->_mp_alloc * sizeof(mp_limb_t))) /
sizeof(CELL); sizeof(CELL);
pt += sz; pt += sz;
@ -1038,8 +1035,7 @@ void Yap_InitAttVarPreds(void) {
Yap_InitCPred("rm_att", 4, rm_att, 0); Yap_InitCPred("rm_att", 4, rm_att, 0);
Yap_InitCPred("bind_attvar", 1, bind_attvar, SafePredFlag); Yap_InitCPred("bind_attvar", 1, bind_attvar, SafePredFlag);
Yap_InitCPred("unbind_attvar", 1, unbind_attvar, SafePredFlag); Yap_InitCPred("unbind_attvar", 1, unbind_attvar, SafePredFlag);
Yap_InitCPred("modules_with_attributes", 2, modules_with_atts, Yap_InitCPred("modules_with_attributes", 2, modules_with_atts, SafePredFlag);
SafePredFlag);
Yap_InitCPred("void_term", 1, void_term, SafePredFlag); Yap_InitCPred("void_term", 1, void_term, SafePredFlag);
Yap_InitCPred("free_term", 1, free_term, SafePredFlag); Yap_InitCPred("free_term", 1, free_term, SafePredFlag);
Yap_InitCPred("fast_unify_attributed", 2, fast_unify, 0); Yap_InitCPred("fast_unify_attributed", 2, fast_unify, 0);

View File

@ -17,11 +17,21 @@
/** @file C/flags.c /** @file C/flags.c
@brief Prolog parameter setting,
*/
/*
* @namespace prolog
*/
/**
@{ @{
@defgroup YAPFlags_Impl C-code to handle Prolog flags. @defgroup YAPFlags_Impl C-code to handle Prolog flags.
@ingroup YAPFlags @ingroup YAPFlags
@brief Low-level code to support flags. Flags can be: @brief Low-level code to support flags.
Prolog Flags can be:
= thread-local or global = thread-local or global
= module-based or module-independent. = module-based or module-independent.
= read-only or read-write = read-only or read-write
@ -30,10 +40,6 @@
*/ */
/*
* @namespace prolog
* /
// this is where we define flags // this is where we define flags
#define INIT_FLAGS 1 #define INIT_FLAGS 1
@ -78,21 +84,22 @@ static Int set_prolog_flag(USES_REGS1);
#include "YapEval.h" #include "YapEval.h"
#include "yapio.h" #include "yapio.h"
#define YAP_FLAG(ID, NAME, WRITABLE, DEF, INIT, HELPER) \ #define YAP_FLAG(ID, NAME, WRITABLE, DEF, INIT, HELPER) { NAME, WRITABLE, DEF, INIT, HELPER }
{ NAME, WRITABLE, DEF, INIT, HELPER }
#define START_LOCAL_FLAGS static flag_info local_flags_setup[] = {
#define END_LOCAL_FLAGS LZERO_FLAG};
#define START_GLOBAL_FLAGS static flag_info global_flags_setup[] = {
#define END_GLOBAL_FLAGS GZERO_FLAG};
#define GZERO_FLAG { NULL, false, NULL, NULL, NULL }
#define LZERO_FLAG { NULL, false, NULL, NULL, NULL }
#define GZERO_FLAG \
{ NULL, false, NULL, NULL, NULL }
#define LZERO_FLAG \
{ NULL, false, NULL, NULL, NULL }
static flag_info global_flags_setup[] = {
#include "YapGFlagInfo.h" #include "YapGFlagInfo.h"
GZERO_FLAG};
static flag_info local_flags_setup[] = {
#include "YapLFlagInfo.h" #include "YapLFlagInfo.h"
LZERO_FLAG};
static Term indexer(Term inp) { static Term indexer(Term inp) {
if (inp == TermOff || inp == TermSingle || inp == TermCompact || if (inp == TermOff || inp == TermSingle || inp == TermCompact ||

View File

@ -14,6 +14,8 @@
* comments: module support * * comments: module support *
* * * *
*************************************************************************/ *************************************************************************/
#ifdef SCCSLookupSystemModule #ifdef SCCSLookupSystemModule
static char SccsId[] = "%W% %G%"; static char SccsId[] = "%W% %G%";
#endif #endif

View File

@ -239,7 +239,10 @@ Set or read system properties for _Param_:
#define YAP_FLAG(ITEM, NAME, WRITABLE, DEF, INIT, HELPER) ITEM #define YAP_FLAG(ITEM, NAME, WRITABLE, DEF, INIT, HELPER) ITEM
#define START_LOCAL_FLAGS enum {
#define END_LOCAL_FLAGS };
#define START_GLOBAL_FLAGS enum {
#define END_GLOBAL_FLAGS };
/* */ /* */
#include "YapGFlagInfo.h" #include "YapGFlagInfo.h"
@ -249,6 +252,10 @@ Set or read system properties for _Param_:
#undef YAP_FLAG #undef YAP_FLAG
#undef START_LOCAL_FLAGS
#undef END_LOCAL_FLAGS
#undef START_GLOBAL_FLAGS
#undef END_GLOBAL_FLAGS
bool setYapFlag(Term tflag, Term t2); bool setYapFlag(Term tflag, Term t2);
Term getYapFlag(Term tflag); Term getYapFlag(Term tflag);

View File

@ -17,20 +17,22 @@
/** @file YapGFlagInfo.h /** @file YapGFlagInfo.h
@addtogroup YAPFlags @addtogroup YAPGFlags YAPGlobalFlags
@ingroup builtins @ingroup builtins
@{ @{
@enum YapGFlag Prolog @enum global_flags_setup Global Flags supported by YAP
@brief global flags and their values.
@enum GlobalFlags Global Flags supported by YAP
@brief global flag:
*/ */
typedef enum {
/**< `address_bits` START_GLOBAL_FLAGS
Number of address bits in the machine, either 64 or 32 bits */
/**
`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), YAP_FLAG(ADDRESS_BITS_FLAG, "address_bits", false, nat, BITNESS, NULL),
/**< `agc_margin` /**< `agc_margin`
An integer: if this amount of atoms has been created since the last An integer: if this amount of atoms has been created since the last
atom-garbage collection, perform atom garbage collection at the first atom-garbage collection, perform atom garbage collection at the first
@ -472,8 +474,7 @@ YAP. Currently it informs whether the system supports `big_numbers`,
`threads`, or the `wam_profiler`. `threads`, or the `wam_profiler`.
*/ */
YAP_FLAG(SYSTEM_OPTIONS_FLAG, "system_options", false, options, YAP_FLAG(SYSTEM_OPTIONS_FLAG, "system_options", false, options,
SYSTEM_OPTIONS, SYSTEM_OPTIONS, NULL),
NULL),
YAP_FLAG(SYSTEM_THREAD_ID_FLAG, "system_thread_id", false, sys_thread_id, YAP_FLAG(SYSTEM_THREAD_ID_FLAG, "system_thread_id", false, sys_thread_id,
"@boot", NULL), "@boot", NULL),
/**< `tabling_mode` /**< `tabling_mode`
@ -619,6 +620,6 @@ this flag is `off`.
YAP_FLAG(WRITE_STRINGS_FLAG, "write_strings", true, booleanFlag, "false", YAP_FLAG(WRITE_STRINGS_FLAG, "write_strings", true, booleanFlag, "false",
NULL), NULL),
} global_flag_t; END_GLOBAL_FLAGS
//! @} //! @}

View File

@ -24,10 +24,10 @@
@{ @{
@enum local_flags flag: @enum local_flags_setup thread-local flag:
*/ */
typedef enum local_flags_enum { START_LOCAL_FLAGS
/** + `autoload`: set the system to look for undefined procedures */ /** + `autoload`: set the system to look for undefined procedures */
YAP_FLAG( AUTOLOAD_FLAG, "autoload", true, booleanFlag, "false" , NULL ), YAP_FLAG( AUTOLOAD_FLAG, "autoload", true, booleanFlag, "false" , NULL ),
@ -128,7 +128,6 @@ automatically redirects the user_error alias to the original
YAP_FLAG( USER_INPUT_FLAG, "user_input", true, stream, "user_input" , set_input_stream ), YAP_FLAG( USER_INPUT_FLAG, "user_input", true, stream, "user_input" , set_input_stream ),
YAP_FLAG( USER_OUTPUT_FLAG, "user_output", true, stream, "user_output" , set_output_stream ), YAP_FLAG( USER_OUTPUT_FLAG, "user_output", true, stream, "user_output" , set_output_stream ),
END_LOCAL_FLAGS
} local_flag_t;
/// @} /// @}

View File

@ -1,8 +1,9 @@
Attributed Variables and Co-Routining {#AttributedVariables}
==================================== @defgroup AttributedVariables Attributed Variables and Co-Routining
@ingroup extensions @ingroup extensions
@{
YAP supports attributed variables, originally developed at OFAI by YAP supports attributed variables, originally developed at OFAI by
Christian Holzbaur. Attributes are a means of declaring that an Christian Holzbaur. Attributes are a means of declaring that an
@ -27,9 +28,8 @@ work with. Most packages included in YAP that use attributed
variables, such as CHR, CLP(FD), and CLP(QR), rely on the SWI-Prolog variables, such as CHR, CLP(FD), and CLP(QR), rely on the SWI-Prolog
awi interface. awi interface.
[TOC] @defgroup SICS_attributes SICStus Style attribute declarations.
## SICStus Style attribute declarations. {#SICS_attributes}
The YAP library `atts` implements attribute variables in the style of The YAP library `atts` implements attribute variables in the style of
SICStus Prolog. Attributed variables work as follows: SICStus Prolog. Attributed variables work as follows:
@ -84,6 +84,7 @@ The attribute manipulation predicates always work as follows:
+ The first argument is the unbound variable associated with + The first argument is the unbound variable associated with
attributes, attributes,
+ The second argument is a list of attributes. Each attribute will + The second argument is a list of attributes. Each attribute will
be a Prolog term or a constant, prefixed with the <tt>+</tt> and <tt>-</tt> unary be a Prolog term or a constant, prefixed with the <tt>+</tt> and <tt>-</tt> unary
operators. The prefix <tt>+</tt> may be dropped for convenience. operators. The prefix <tt>+</tt> may be dropped for convenience.
@ -99,9 +100,9 @@ attempting to unify an attributed variable which might have attributes
in some _Module_. in some _Module_.
Attributes are usually presented as goals. The following routines are At execution conclusion, attributes still unsatisfied are presented as
used by built-in predicates such as call_residue/2 and by the goals. The following routines are used by built-in predicates such as
Prolog top-level to display attributes: call_residue/2 and by the Prolog top-level to display attributes:
Constraint solvers must be able to project a set of constraints to a set Constraint solvers must be able to project a set of constraints to a set
@ -269,12 +270,11 @@ variables only. More complicated interactions are likely to be found
in more sophisticated solvers. The corresponding in more sophisticated solvers. The corresponding
verify_attributes/3 predicates would typically refer to the verify_attributes/3 predicates would typically refer to the
attributes from other known solvers/modules via the module prefix in attributes from other known solvers/modules via the module prefix in
Module:get_atts/2`. Module:get_atts/2.
@}
@{ hProlog and SWI-Prolog style Attribute Declarations {#New_Style_Attribute_Declarations}
#### hProlog and SWI-Prolog style Attribute Declarations {#New_Style_Attribute_Declarations} ------------------------------------------------
The following documentation is taken from the SWI-Prolog manual. The following documentation is taken from the SWI-Prolog manual.
@ -297,12 +297,16 @@ Module:get_atts/2`.
get_attr(X, domain, Dom). get_attr(X, domain, Dom).
domain(X, List) :- domain(X, List) :-
list_to_ord_set(List, Domain), list_to_ord_set(List, Domain),
v put_attr(Y, domain, Domain), put_attr(Y, domain, Domain),
X = Y. X = Y.
% An attributed variable with attribute value Domain has been % ~~~~~
% assigned the value Y %
The next predicate is called *after* _X_, the attributed variable with attribute value _Domain_ has been
assigned the value Y.
~~~~~
attr_unify_hook(Domain, Y) :- attr_unify_hook(Domain, Y) :-
( get_attr(Y, domain, Dom2) ( get_attr(Y, domain, Dom2)
-> ord_intersection(Domain, Dom2, NewDomain), -> ord_intersection(Domain, Dom2, NewDomain),
@ -316,15 +320,17 @@ v put_attr(Y, domain, Domain),
-> put_attr( Y, domain, Domain ) -> put_attr( Y, domain, Domain )
; ord_memberchk(Y, Domain) ; ord_memberchk(Y, Domain)
). ).
~~~~~
% Translate attributes from this module to residual goals % The user defined attribute_goals/1 attributes from this module to residual goals
~~~~~
attribute_goals(X) --> attribute_goals(X) -->
{ get_attr(X, domain, List) }, { get_attr(X, domain, List) },
[domain(X, List)]. [domain(X, List)].
~~~~~ ~~~~~
Before explaining the code we give some example queries: Before explaining the code in detail we give some example queries:
The predicate `domain/2` fetches (first clause) or assigns The predicate `domain/2` fetches (first clause) or assigns
(second clause) the variable a <em>domain</em>, a set of values it can (second clause) the variable a <em>domain</em>, a set of values it can
@ -342,11 +348,8 @@ v put_attr(Y, domain, Domain),
remaining attributes to user-readable goals that, when executed, reinstate remaining attributes to user-readable goals that, when executed, reinstate
these attributes. these attributes.
@} Co-routining {#CohYroutining}
------------
@{
#### Co-routining {#CohYroutining}
Prolog uses a simple left-to-right flow of control. It is sometimes Prolog uses a simple left-to-right flow of control. It is sometimes
convenient to change this control so that goals will only execute when convenient to change this control so that goals will only execute when
@ -383,7 +386,3 @@ The following primitives can be used:
- frozen/2 - frozen/2
@}
@}

View File

@ -7,56 +7,14 @@ resources,
Many of the predicates described here have been standardised by the International Standard Organization. Many of the predicates described here have been standardised by the International Standard Organization.
The corresponding standartised subset of Prolog also known as ISO-Prolog. The corresponding standartised subset of Prolog also known as ISO-Prolog.
In the description of the arguments of predicates the following In the description of the arguments of predicates the following
notation will be used: notation will be used:
+ a preceding plus sign will denote an argument as an "input + a preceding plus sign will denote an argument as an "input
argument" - the argument is read, not written, and it cannot be a free variable at the time of the call; argument" - the argument is read, not written, and it cannot
be a free variable at the time of the call;
+ a preceding minus sign will denote an "output argument"; + a preceding minus sign will denote an "output argument";
+ an argument with no preceding symbol can be used in both ways. + an argument with no preceding symbol can be used in both ways.
+ @ref AbsoluteFileName
+ @ref CompilerAnalysis
+ @ref New_Style_Attribute_Declarations
+ @ref YAPControl
+ @ref Profiling
+ @ref Call_Counting
+ @ref YAPConsulting
+ @ref YAPReadFiles
+ @ref ModPreds
+ @ref Conditional_Compilation
+ @ref YAPBigLoad
+ @ref Deb_Interaction
+ @ref DepthLimited
+ @ref Dialects
+ @ref Directives
+ @ref EAM
+ @ref SWI-error
+ @ref YAPErrorHandler
+ @ref CompiledExpression
+ @ref YAPFlags
+ @ref Grammars
+ @ref Hacks
+ @ref Listing
+ @ref LoadForeign
+ @ref Messages
+ @ref YAPMetaPredicates
+ @ref ModuleBuiltins
+ @ref YAPOS
+ @ref pathconf
+ @ref YAPPredDecls
+ @ref Database
+ @ref The_Count_Profiler
+ @ref QLY
+ @ref Sets
+ @ref Deb_Preds
+ @ref Statistics
+ @ref Tabling
+ @ref Threads
+ @ref TopLevel
+ @ref Undefined_Procedures
+ @ref MixBag
+ @ref InputOutput
+ @ref IO_Sockets
+ @ref ypp

View File

@ -19,3 +19,16 @@ language. Next, we discuss how to use the most important ones.
+ @ref YAPArrays + @ref YAPArrays
+ @ref Parallelism + @ref Parallelism
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": the argument is read, not written, and 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.

View File

@ -1,61 +1,27 @@
YAP Prolog Library {#library} YAP Prolog Library {#LibraryPage}
=================== ===================
the library_directory path (set by the YAP provides a collection of Prolog utilities, that extend core Prolog
`LIBDIR` variable in the Makefile for YAP). Several files in the with data-structures such as balanced trees and hash tables, extend
library are originally from the public-domain Edinburgh Prolog library. Input Output, or use the `C`-interface to interact with the
Operating System or to implement arrays.
@tableofcontents These programs are stored at the library_directory path (set by the
`LIBDIR` variable in the Makefile for YAP).
The files have different sources. Many were part of the public-domain
Edinburgh Prolog library. Other Prolog systems such as SWI-Prolog
were kind enough to allow using files from their distributions.
+ @ref apply_stub @copydoc library
+ @ref apply_macros
+ @ref args
+ @ref Association_Lists @{
+ @ref sicsatts
+ @ref avl @defgroup library The YAP Library
+ @ref bhash
+ @ref block_diagram @}
+ @ref c_alarms
+ @ref charsio
+ @ref clauses
+ @ref cleanup
+ @ref dbqueues
+ @ref dbusage
+ @ref dgraphs
+ @ref exo_interval
+ @ref flags
+ @ref gensym
+ @ref yap_hacks
+ @ref heaps
+ @ref lam_mpi
+ @ref line_utils
+ @ref Log2MD
+ @ref mapargs
+ @ref maplist
+ @ref matlab
+ @ref matrix
+ @ref nb
+ @ref ordsets
+ @ref parameters
+ @ref queues
+ @ref random
+ @ref Pseudo_Random
+ @ref rbtrees
+ @ref readutil
+ @ref regexp
+ @ref rltrees
+ @ref Splay_Trees
+ @ref operating_system_support
+ @ref Terms
+ @ref timeout
+ @ref trees
+ @ref tries
+ @ref ugraphs
+ @ref undgraphs
+ @ref varnumbers
+ @ref wdgraphs
+ @ref wgraphs
+ @ref wundgraphs

View File

@ -6,7 +6,7 @@ Loading and Organising YAP Programs {#load_files}
+ @ref YAPConsulting + @ref YAPConsulting
- @page modules + @page modules
+ @ref YAPBigLoad + @ref YAPBigLoad

View File

@ -40,7 +40,8 @@ the type-in module permanently by using the built-in `module/1`.
[TOC] [TOC]
## Explicit Naming {#ExplicitNaming} Explicit Naming {#ExplicitNaming}
+++++++++++++++
The module system allows one to _explicitly_ specify the source mode for The module system allows one to _explicitly_ specify the source mode for
a clause by prefixing a clause with its module, say: a clause by prefixing a clause with its module, say:
@ -228,7 +229,8 @@ X = 2 ? ;
The state of the module system after this error is undefined. The state of the module system after this error is undefined.
## BuiltIn predicates {#ModuleBuiltins) BuiltIn predicates {#ModuleBuiltins)
++++++++++++++++++
@\pred module(+ M:atom,+ L:list ) is directive @\pred module(+ M:atom,+ L:list ) is directive
the current file defines module _M_ with exports _L_. The list may include the current file defines module _M_ with exports _L_. The list may include
@ -298,7 +300,7 @@ the graphs library is implemented on top of the red-black trees library, and som
Unfortunately it is still not possible to change argument order. Unfortunately it is still not possible to change argument order.
\pred module(+ M:atom,+ L:list ) is directive @pred module(+ M:atom,+ L:list ) is directive
the current file defines module _M_ with exports _L_. The list may include the current file defines module _M_ with exports _L_. The list may include
+ predicate indicators + predicate indicators

View File

@ -1,6 +1,6 @@
YAP Syntax {#YAPSyntax} @defgroup YAPSyntax YAP Syntax
============
@{
@ingroup YAPProgrammming @ingroup YAPProgrammming
We will describe the syntax of YAP at two levels. We first will We will describe the syntax of YAP at two levels. We first will
@ -9,6 +9,7 @@ the tokens from which Prolog terms are
built. built.
@defgroup Formal_Syntax Syntax of Terms @defgroup Formal_Syntax Syntax of Terms
@{
@ingroup YAPSyntax @ingroup YAPSyntax
Below, we describe the syntax of YAP terms from the different Below, we describe the syntax of YAP terms from the different
@ -82,19 +83,22 @@ paragraph). When a name consisting of a single dot could be taken for
the end of term marker, the ambiguity should be avoided by surrounding the the end of term marker, the ambiguity should be avoided by surrounding the
dot with single quotes. dot with single quotes.
@}
@defgroup Tokens Prolog Tokens
@{
# @defgroup Tokens Prolog Tokens
@ingroup YAPSyntax @ingroup YAPSyntax
Prolog tokens are grouped into the following categories: Prolog tokens are grouped into the following categories:
## @defgroup Numbers Numbers @defgroup Numbers Numbers
@{
@ingroup Tokens @ingroup Tokens
Numbers can be further subdivided into integer and floating-point numbers. Numbers can be further subdivided into integer and floating-point numbers.
### @defgroup Integers Integers @defgroup Integers Integers
@{
@ingroup Numbers @ingroup Numbers
Integer numbers Integer numbers
@ -141,8 +145,10 @@ YAP (version 6.3.4) supports integers that can fit
the word size of the machine. This is 32 bits in most current machines, the word size of the machine. This is 32 bits in most current machines,
but 64 in some others, such as the Alpha running Linux or Digital but 64 in some others, such as the Alpha running Linux or Digital
Unix. The scanner will read larger or smaller integers erroneously. Unix. The scanner will read larger or smaller integers erroneously.
@}
### @defgroup Floats Floats @defgroup Floats Floats
@}
@ingroup Numbers @ingroup Numbers
Floating-point numbers are described by: Floating-point numbers are described by:
@ -167,7 +173,10 @@ Examples:
Floating-point numbers are represented as a double in the target Floating-point numbers are represented as a double in the target
machine. This is usually a 64-bit number. machine. This is usually a 64-bit number.
## Strings @defgroup Strings Character Strings @}
@}
@defgroup Strings Character Strings
@{
Strings are described by the following rules: Strings are described by the following rules:
@ -218,7 +227,7 @@ Escape sequences can be used to include the non-printable characters
`f` (form feed), `t` (horizontal tabulation), `n` (new `f` (form feed), `t` (horizontal tabulation), `n` (new
line), and `v` (vertical tabulation). Escape sequences also be line), and `v` (vertical tabulation). Escape sequences also be
include the meta-characters `\\`, `"`, `'`, and include the meta-characters `\\`, `"`, `'`, and
```. Last, one can use escape sequences to include the characters `''`. Last, one can use escape sequences to include the characters
either as an octal or hexadecimal number. either as an octal or hexadecimal number.
The next examples demonstrates the use of escape sequences in YAP: The next examples demonstrates the use of escape sequences in YAP:
@ -237,7 +246,12 @@ versions of YAP up to 4.2.0. Escape sequences can be disabled by using:
:- yap_flag(character_escapes,false). :- yap_flag(character_escapes,false).
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## @addgroup Atoms Atoms @}
@addtogroup Atoms Atoms
@}
@ingroup Tokens @ingroup Tokens
Atoms are defined by one of the following rules: Atoms are defined by one of the following rules:
@ -278,7 +292,10 @@ Version `4.2.0` of YAP removed the previous limit of 256
characters on an atom. Size of an atom is now only limited by the space characters on an atom. Size of an atom is now only limited by the space
available in the system. available in the system.
## @addgroup Variables Variables @}
@addtogroup Variables Variables
@{
@ingroup Tokens @ingroup Tokens
Variables are described by: Variables are described by:
@ -299,7 +316,9 @@ variables are known as anonymous variables. Note that different
occurrences of `_` on the same term represent <em>different</em> occurrences of `_` on the same term represent <em>different</em>
anonymous variables. anonymous variables.
## @addgroup Punctuation_Tokens Punctuation Tokens @}
@addtogroup Punctuation_Tokens Punctuation Tokens
@{
@ingroup Tokens @ingroup Tokens
Punctuation tokens consist of one of the following characters: Punctuation tokens consist of one of the following characters:
@ -309,7 +328,10 @@ Punctuation tokens consist of one of the following characters:
These characters are used to group terms. These characters are used to group terms.
@subsection LayoutComents Character Layout @}
@defgroup LayoutComents Character Layout
@{
@ingroup Tokens
Any characters with ASCII code less than or equal to 32 appearing before Any characters with ASCII code less than or equal to 32 appearing before
a token are ignored. a token are ignored.
@ -321,7 +343,10 @@ layout characters, the YAP parser behaves as if it had found a
single blank character. The end of a file also counts as a blank single blank character. The end of a file also counts as a blank
character for this purpose. character for this purpose.
## @addgroup WideChars Encoding Wide Character Support @}
@}
@addtogroup WideChars Encoding Wide Character Support
@{
@ingroup YAPSyntax @ingroup YAPSyntax
@ -353,7 +378,8 @@ other software components using the foreign language interface. In this
section we only deal with I/O through streams, which includes file I/O section we only deal with I/O through streams, which includes file I/O
as well as I/O through network sockets. as well as I/O through network sockets.
== @addtogroup Stream_Encoding Wide character encodings on streams @addtogroup Stream_Encoding Wide character encodings on streams
@{
@ingroup WideChars @ingroup WideChars
The UCS standard describes all possible characters (or code points, as they include The UCS standard describes all possible characters (or code points, as they include
@ -460,9 +486,10 @@ errors can be controlled using `open/4` or `set_stream/2` (not
implemented). Initially the terminal stream write the characters using implemented). Initially the terminal stream write the characters using
Prolog escape sequences while other streams generate an I/O exception. Prolog escape sequences while other streams generate an I/O exception.
@{ @}
@addtogroup BOM BOM: Byte Order Mark @addtogroup BOM BOM: Byte Order Mark
@{
@ingroup WideChars @ingroup WideChars
From Stream Encoding, you may have got the impression that From Stream Encoding, you may have got the impression that
@ -483,11 +510,10 @@ writing, writing a BOM can be requested using the option
UTF-32; otherwise the default is not to write a BOM. BOMs are not avaliable for ASCII and UTF-32; otherwise the default is not to write a BOM. BOMs are not avaliable for ASCII and
ISO-LATIN-1. ISO-LATIN-1.
@{ @}
@} @}
@addgroup Operators Summary of YAP Predefined Operators @addgroup Operators Summary of YAP Predefined Operators
@{
@ingroup YapSyntax @ingroup YapSyntax
The Prolog syntax caters for operators of three main kinds: The Prolog syntax caters for operators of three main kinds:
@ -567,3 +593,4 @@ The following is the list of the declarations of the predefined operators:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@} @}
@}

View File

@ -60,43 +60,6 @@ Jan Wielemaker. We would also like to gratefully
acknowledge the contributions from Ashwin Srinivasian. acknowledge the contributions from Ashwin Srinivasian.
@page Library YAP Library
the library_directory path (set by the
`LIBDIR` variable in the Makefile for YAP). Several files in the
library are originally from the public-domain Edinburgh Prolog library.
@page Extensions YAP Extensions
YAP includes a number of extensions over the original Prolog
language.
+ @subpage attributes.md
+ @ref Rational_Trees
+ @ref CohYroutining
+ @ref DepthLimited
+ @ref Tabling
+ @ref Threads
+ @ref Profiling
+ @ref YAPArrays
+ @ref Parallelism
@page YAPProgramming Programming in YAP
@page packages Packages for YAP

View File

@ -48,7 +48,8 @@
/** /**
* @{ * @{
* *
* @addtogroup library The Prolog Library * @addtogroup lists List Predicates in the Prolog Library
* @ingroup library
* *
* @brief List Manipulation Predicates * @brief List Manipulation Predicates
* *

View File

@ -91,7 +91,7 @@
/** /**
@defgroup YAPConsulting Loading files into YAP @defgroup YAPConsulting Loading files into YAP
@ingroup consult @ingroup load_files
@{ @{

View File

@ -41,14 +41,11 @@
/** /**
* @defgroup attscorouts Implementing Attributed Variables and Co-Routining * @ingroup AttributedVariables_Builtins
*
* @ingroup attributes
* @{ * @{
* @brief Support for co-routining
* *
* *
”” */ */
/** @pred attr_unify_hook(+ _AttValue_,+ _VarValue_) /** @pred attr_unify_hook(+ _AttValue_,+ _VarValue_)

View File

@ -245,7 +245,9 @@ be lost.
/** /**
* ### Implementation * @defgroup DebImplementation Implementation of the Debugger
* @{
* @brief Prolog code to do debugging.
* *
* The debugger is an interpreter. with main predicates: * The debugger is an interpreter. with main predicates:
* - $trace: this is the API * - $trace: this is the API
@ -256,7 +258,7 @@ be lost.
* + asking Prolog to do it (system_library-builtins) * + asking Prolog to do it (system_library-builtins)
* *
* |flag | description | initial | possible values * |flag | description | initial | possible values
* ---------------------------------------------------------------- * | ----------------------------------------------------------------
* | spy_gn | last goal number | 1 | 1... * | spy_gn | last goal number | 1 | 1...
* | spy_trace | trace | 0 | 0, 1 * | spy_trace | trace | 0 | 0, 1
* | spy_status | step | creep | creep,leap,skip * | spy_status | step | creep | creep,leap,skip
@ -1065,3 +1067,6 @@ be lost.
'$creep'(creep) :- '$creep'. '$creep'(creep) :- '$creep'.
'$creep'(leap) :- '$creep'. '$creep'(leap) :- '$creep'.
'$creep'(zip). '$creep'(zip).
%% @}
%% @}

View File

@ -23,7 +23,8 @@
* @brief Control File Loading * @brief Control File Loading
% %
% @defgroup Directives Prolog Directives % @defgroup Directives Prolog Directives
@ @ingroup consult * @ingroup YAPConsulting
* @{
* *
* *
*/ */
@ -279,3 +280,5 @@ user_defined_directive(Dir,Action) :-
!. !.
'$process_directive'(G, _Mode, M, _VL, _Pos) :- '$process_directive'(G, _Mode, M, _VL, _Pos) :-
format(user_error,':- ~w:~w failed.~n',[M,G]). format(user_error,':- ~w:~w failed.~n',[M,G]).
%% @}

View File

@ -26,7 +26,7 @@
/** /**
@defgroup SWI-error High-level error testing. @defgroup SWI-error High-level error testing.
@ingroup YAPError @ingroup builtins
This SWI module provides predicates to simplify error generation and This SWI module provides predicates to simplify error generation and
checking. Adapted to use YAP built-ins. checking. Adapted to use YAP built-ins.

View File

@ -14,7 +14,17 @@
* comments: initializing the full prolog system * * comments: initializing the full prolog system *
* * * *
*************************************************************************/ *************************************************************************/
/**
* @file init.yap
*
* @brief how to boot and run the top-level.
*
*/
/**
* @insection YAPControl
*
*/
'$init_globals' :- '$init_globals' :-
% set_prolog_flag(break_level, 0), % set_prolog_flag(break_level, 0),

View File

@ -29,7 +29,7 @@
/** /**
@defgroup LoadForeign Access to Foreign Language Programs @defgroup LoadForeign Access to Foreign Language Programs
@ingroup fli_c_cx @ingroup fli_c_cxx
@{ @{

View File

@ -4,9 +4,11 @@
* @author VITOR SANTOS COSTA <vsc@vcosta-laptop.dcc.fc.up.pt> * @author VITOR SANTOS COSTA <vsc@vcosta-laptop.dcc.fc.up.pt>
* @date Sat Apr 7 03:08:03 2018 * @date Sat Apr 7 03:08:03 2018
* *
* @brief meta=declarations to run early. * @brief meta=declarations, must be run early.
* *
* @addtogroup Meta-Calls The Module System versus the meta-call.
* @ingroup YAPMetaPredicates * @ingroup YAPMetaPredicates
* @{
* *
*/ */
@ -99,3 +101,5 @@
->(2,2,?,?), ->(2,2,?,?),
\+(2,?,?), \+(2,?,?),
\+( 0 )]). \+( 0 )]).
@}

View File

@ -19,7 +19,7 @@
/** /**
@defgroup QLY Creating and Using a saved state @defgroup QLY Creating and Using a saved state
@ingroup YAPConsulting @ingroup load_files
@{ @{
*/ */

View File

@ -1,3 +1,7 @@
/**
* @file spy.yap
* @brief debugger operation.
*/
:- system_module( '$_debug', [debug/0, :- system_module( '$_debug', [debug/0,
debugging/0, debugging/0,
leash/1, leash/1,
@ -27,8 +31,9 @@
-----------------------------------------------------------------------------*/ -----------------------------------------------------------------------------*/
/** @defgroup Deb_Preds Debugging Predicates /**
@ingroup builtins * @defgroup DebSet Debugger Control
* @ingroup builtins Deb_Interaction
@{ @{
The The
@ -39,10 +44,7 @@ programs:
Switches the debugger on. Switches the debugger on.
+ debuggi= + debugging
r
g
Outputs status information about the debugger which includes the leash Outputs status information about the debugger which includes the leash
@ -50,7 +52,6 @@ mode and the existing spy-points, when the debugger is on.
+ nodebug + nodebug
Switches the debugger off. Switches the debugger off.