doc
This commit is contained in:
parent
44ac70d3ab
commit
ef04b30d66
@ -15,7 +15,13 @@
|
|||||||
* *
|
* *
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
/** @defgroup YAPArrays Named Arrays
|
/**
|
||||||
|
|
||||||
|
@file arrays.c
|
||||||
|
|
||||||
|
@namespace prolog
|
||||||
|
|
||||||
|
@addtogroup YAPArrays Named Arrays
|
||||||
@ingroup extensions
|
@ingroup extensions
|
||||||
@{
|
@{
|
||||||
|
|
||||||
|
18
C/atomic.c
18
C/atomic.c
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* *
|
* *
|
||||||
* YAP Prolog *
|
* YAP Prolog *
|
||||||
@ -22,15 +21,20 @@ static char SccsId[] = "%W% %G%";
|
|||||||
/**
|
/**
|
||||||
* @file atomic.c
|
* @file atomic.c
|
||||||
*
|
*
|
||||||
|
* @namespace prolog
|
||||||
|
*
|
||||||
|
/
|
||||||
|
|
||||||
|
/**
|
||||||
* @defgroup Predicates_on_Atoms Predicates on Atoms and Strings
|
* @defgroup Predicates_on_Atoms Predicates on Atoms and Strings
|
||||||
* @ingroup builtins
|
* @ingroup builtins
|
||||||
* @{
|
* @{
|
||||||
|
*
|
||||||
@brief The following predicates are used to manipulate atoms, strings, lists of
|
* @brief The following predicates are used to manipulate atoms, strings, lists of
|
||||||
codes and lists of chars:
|
* codes and lists of chars:
|
||||||
|
*
|
||||||
\toc
|
* \toc
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define HAS_CACHE_REGS 1
|
#define HAS_CACHE_REGS 1
|
||||||
|
@ -18,6 +18,15 @@
|
|||||||
static char SccsId[] = "%W% %G%";
|
static char SccsId[] = "%W% %G%";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file attvar.c
|
||||||
|
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP-2.lan>
|
||||||
|
* @date Mon Apr 30 09:31:59 2018
|
||||||
|
*
|
||||||
|
* @brief attributed variables
|
||||||
|
* @namespace prolog
|
||||||
|
*
|
||||||
|
*/
|
||||||
#include "Yap.h"
|
#include "Yap.h"
|
||||||
|
|
||||||
#include "Yatom.h"
|
#include "Yatom.h"
|
||||||
|
11
C/bb.c
11
C/bb.c
@ -18,6 +18,17 @@
|
|||||||
static char SccsId[] = "%W% %G%";
|
static char SccsId[] = "%W% %G%";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file bb.c
|
||||||
|
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP-2.lan>
|
||||||
|
* @date Mon Apr 30 09:32:54 2018
|
||||||
|
*
|
||||||
|
* @brief blackboard
|
||||||
|
*
|
||||||
|
* @namespace prolog
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/** @defgroup BlackBoard The Blackboard
|
/** @defgroup BlackBoard The Blackboard
|
||||||
@ingroup builtins
|
@ingroup builtins
|
||||||
|
11
C/bignum.c
11
C/bignum.c
@ -17,6 +17,17 @@
|
|||||||
#ifdef SCCS
|
#ifdef SCCS
|
||||||
static char SccsId[] = "%W% %G%";
|
static char SccsId[] = "%W% %G%";
|
||||||
#endif
|
#endif
|
||||||
|
/**
|
||||||
|
* @file bignum.c
|
||||||
|
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP-2.lan>
|
||||||
|
* @date Mon Apr 30 09:34:59 2018
|
||||||
|
*
|
||||||
|
* @brief BigNums and More
|
||||||
|
* @namespace prolog
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include "Yap.h"
|
#include "Yap.h"
|
||||||
#include "Yatom.h"
|
#include "Yatom.h"
|
||||||
|
12
C/cmppreds.c
12
C/cmppreds.c
@ -16,6 +16,18 @@
|
|||||||
* *
|
* *
|
||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file cmppreds.c
|
||||||
|
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP-2.lan>
|
||||||
|
* @date Mon Apr 30 09:35:58 2018
|
||||||
|
*
|
||||||
|
* @brief comparison
|
||||||
|
*
|
||||||
|
* @namespace prolog
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
/// @file cmppreds.c
|
/// @file cmppreds.c
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
14
C/dbase.c
14
C/dbase.c
@ -18,6 +18,20 @@
|
|||||||
static char SccsId[] = "%W% %G%";
|
static char SccsId[] = "%W% %G%";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file dbase.c
|
||||||
|
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP-2.lan>
|
||||||
|
* @date Mon Apr 30 09:36:46 2018
|
||||||
|
*
|
||||||
|
* @brief record and other forms of storing terms.
|
||||||
|
*
|
||||||
|
* @namespace prolog
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
/** @defgroup Internal_Database Internal Data Base
|
/** @defgroup Internal_Database Internal Data Base
|
||||||
@ingroup builtins
|
@ingroup builtins
|
||||||
@{
|
@{
|
||||||
|
15
C/eval.c
15
C/eval.c
@ -17,8 +17,19 @@
|
|||||||
#ifdef SCCS
|
#ifdef SCCS
|
||||||
static char SccsId[] = "%W% %G%";
|
static char SccsId[] = "%W% %G%";
|
||||||
#endif
|
#endif
|
||||||
|
/**
|
||||||
//! @file eval.c
|
* @file eval.c
|
||||||
|
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP-2.lan>
|
||||||
|
* @date Mon Apr 30 09:37:59 2018
|
||||||
|
*
|
||||||
|
* @brief is/2
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* @namespace prolog
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
//! @{
|
//! @{
|
||||||
|
|
||||||
|
20
C/exec.c
20
C/exec.c
@ -18,6 +18,19 @@
|
|||||||
static char SccsId[] = "@(#)cdmgr.c 1.1 05/02/98";
|
static char SccsId[] = "@(#)cdmgr.c 1.1 05/02/98";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file exec.c
|
||||||
|
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP-2.lan>
|
||||||
|
* @date Mon Apr 30 13:48:35 2018
|
||||||
|
*
|
||||||
|
* @brief meta-call
|
||||||
|
*
|
||||||
|
* @namespace prolog
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include "absmi.h"
|
#include "absmi.h"
|
||||||
#include "attvar.h"
|
#include "attvar.h"
|
||||||
#include "cut_c.h"
|
#include "cut_c.h"
|
||||||
@ -121,7 +134,8 @@ inline static bool CallMetaCall(Term t, Term mod USES_REGS) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Transfer control to a meta-call in ARG1, cut up to B.
|
* Transfer control to a meta-call in ARG1, cut up to B.
|
||||||
* @method Yap_ExecuteCallMetaCall
|
*
|
||||||
|
* @param g goal
|
||||||
* @param mod current module
|
* @param mod current module
|
||||||
* @return su
|
* @return su
|
||||||
*/
|
*/
|
||||||
@ -1574,8 +1588,8 @@ bool Yap_exec_absmi(bool top, yap_reset_t has_reset) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Fails computation up to choice-point bb
|
* Fails computation up to choice-point bb
|
||||||
* @method Yap_fail_all
|
*
|
||||||
* @param USES_REGS [description]
|
* @param USES_REGS thread support
|
||||||
*/
|
*/
|
||||||
void Yap_fail_all(choiceptr bb USES_REGS) {
|
void Yap_fail_all(choiceptr bb USES_REGS) {
|
||||||
yamop *saved_p, *saved_cp;
|
yamop *saved_p, *saved_cp;
|
||||||
|
@ -30,6 +30,10 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
* @namespace prolog
|
||||||
|
* /
|
||||||
|
|
||||||
// this is where we define flags
|
// this is where we define flags
|
||||||
#define INIT_FLAGS 1
|
#define INIT_FLAGS 1
|
||||||
|
|
||||||
|
16
C/stack.c
16
C/stack.c
@ -1260,19 +1260,21 @@ static Term all_calls(bool internal USES_REGS) {
|
|||||||
return Yap_MkApplTerm(f, 6, ts);
|
return Yap_MkApplTerm(f, 6, ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* report the current status of the stacks up to level $N$
|
|
||||||
*
|
|
||||||
* @param depth
|
|
||||||
*
|
|
||||||
* @return data on the current program counter
|
|
||||||
*/
|
|
||||||
|
|
||||||
Term Yap_all_calls(void) {
|
Term Yap_all_calls(void) {
|
||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
return all_calls(true PASS_REGS);
|
return all_calls(true PASS_REGS);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @pred current_stack( +Depth )
|
||||||
|
*
|
||||||
|
* report the current status of the stacks up to level $N$
|
||||||
|
*
|
||||||
|
* @param Depth
|
||||||
|
*
|
||||||
|
* @return data on the current Prolog stack.
|
||||||
|
*/
|
||||||
static Int current_stack(USES_REGS1) {
|
static Int current_stack(USES_REGS1) {
|
||||||
Term t;
|
Term t;
|
||||||
while ((t = all_calls(false PASS_REGS)) == 0L) {
|
while ((t = all_calls(false PASS_REGS)) == 0L) {
|
||||||
|
@ -1617,8 +1617,9 @@ p_term_variables( USES_REGS1 ) /* variables in term t */
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Exports a nil-terminated list with all the variables in a term.
|
* Exports a nil-terminated list with all the variables in a term.
|
||||||
* @param[in] the term
|
* @param[t] the term
|
||||||
* @param[in] the arity of the calling predicate (required for exact garbage collection).
|
* @param[arity] the arity of the calling predicate (required for exact garbage collection).
|
||||||
|
* @param[USES_REGS] threading
|
||||||
*/
|
*/
|
||||||
Term
|
Term
|
||||||
Yap_TermVariables( Term t, UInt arity USES_REGS ) /* variables in term t */
|
Yap_TermVariables( Term t, UInt arity USES_REGS ) /* variables in term t */
|
||||||
|
@ -47,11 +47,11 @@ YAP_FLAG(ALLOW_ASSERT_FOR_STATIC_PREDICATES,
|
|||||||
NULL),
|
NULL),
|
||||||
|
|
||||||
/**< `allow_variable_name_as_functor` boolean flag allows constructs such as
|
/**< `allow_variable_name_as_functor` boolean flag allows constructs such as
|
||||||
~~~~~~~~~~~~
|
~~~
|
||||||
Tree(Node(L,node,R)) :-
|
Tree(Node(L,node,R)) :-
|
||||||
Tree(L),
|
Tree(L),
|
||||||
Tree(R).
|
Tree(R).
|
||||||
~~~~~~~~~~~~
|
~~~
|
||||||
*/
|
*/
|
||||||
YAP_FLAG( ALLOW_VARIABLE_NAME_AS_FUNCTOR_FLAG, "allow_variable_name_as_functor", false, booleanFlag, "false", NULL),
|
YAP_FLAG( ALLOW_VARIABLE_NAME_AS_FUNCTOR_FLAG, "allow_variable_name_as_functor", false, booleanFlag, "false", NULL),
|
||||||
|
|
||||||
|
@ -24,11 +24,10 @@
|
|||||||
@{
|
@{
|
||||||
|
|
||||||
|
|
||||||
@enum LocalFlags local Flags supported by YAP
|
@enum local_flags flag:
|
||||||
@brief local flag:
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
typedef enum {
|
typedef enum local_flags_enum {
|
||||||
|
|
||||||
/** + `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 ),
|
||||||
|
@ -241,7 +241,7 @@ void Yap_init_optyap_preds(void) {
|
|||||||
SafePredFlag | SyncPredFlag);
|
SafePredFlag | SyncPredFlag);
|
||||||
Yap_InitCPred("abolish_all_tables", 0, p_abolish_all_tables,
|
Yap_InitCPred("abolish_all_tables", 0, p_abolish_all_tables,
|
||||||
SafePredFlag | SyncPredFlag);
|
SafePredFlag | SyncPredFlag);
|
||||||
/** @pred abolish_all_tables/0
|
/** @pred abolish_all_tables
|
||||||
|
|
||||||
|
|
||||||
Removes all the entries from the table space for all tabled
|
Removes all the entries from the table space for all tabled
|
||||||
|
@ -8,7 +8,9 @@ if (WITH_DOCS)
|
|||||||
|
|
||||||
set(DOCS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/docs)
|
set(DOCS_SOURCE_DIR ${CMAKE_SOURCE_DIR}/docs)
|
||||||
|
|
||||||
SET (CMAKE_HTML_EXTRA_
|
SET (CMAKE_HTML_EXTRA_)
|
||||||
|
|
||||||
|
SET( EXT
|
||||||
${DOCS_SOURCE_DIR}/custom/application.js
|
${DOCS_SOURCE_DIR}/custom/application.js
|
||||||
${DOCS_SOURCE_DIR}/custom/assets
|
${DOCS_SOURCE_DIR}/custom/assets
|
||||||
${DOCS_SOURCE_DIR}/custom/bootstrap.min.css
|
${DOCS_SOURCE_DIR}/custom/bootstrap.min.css
|
||||||
@ -84,11 +86,9 @@ endforeach(i ${DOCS_EXCLUDE_})
|
|||||||
|
|
||||||
add_subdirectory(../packages/raptor/doc ${CMAKE_BINARY_DIR}/packages/raptor/doc)
|
add_subdirectory(../packages/raptor/doc ${CMAKE_BINARY_DIR}/packages/raptor/doc)
|
||||||
|
|
||||||
|
SET(DOC_INPUT_FILES_
|
||||||
|
|
||||||
|
|
||||||
SET(DOC_INPUT_FILES_ ${CMAKE_SOURCE_DIR}/INSTALL.md
|
|
||||||
${CMAKE_SOURCE_DIR}/pl
|
${CMAKE_SOURCE_DIR}/pl
|
||||||
|
${CMAKE_SOURCE_DIR}/docs/md
|
||||||
${CMAKE_SOURCE_DIR}/CXX
|
${CMAKE_SOURCE_DIR}/CXX
|
||||||
${CMAKE_SOURCE_DIR}/OPTYap
|
${CMAKE_SOURCE_DIR}/OPTYap
|
||||||
${CMAKE_SOURCE_DIR}/C
|
${CMAKE_SOURCE_DIR}/C
|
||||||
@ -97,8 +97,7 @@ SET(DOC_INPUT_FILES_ ${CMAKE_SOURCE_DIR}/INSTALL.md
|
|||||||
${CMAKE_SOURCE_DIR}/os
|
${CMAKE_SOURCE_DIR}/os
|
||||||
${CMAKE_SOURCE_DIR}/library
|
${CMAKE_SOURCE_DIR}/library
|
||||||
${CMAKE_SOURCE_DIR}/swi/library
|
${CMAKE_SOURCE_DIR}/swi/library
|
||||||
${CMAKE_SOURCE_DIR}/docs/md
|
)
|
||||||
)
|
|
||||||
|
|
||||||
foreach(i ${DOC_INPUT_FILES_})
|
foreach(i ${DOC_INPUT_FILES_})
|
||||||
|
|
||||||
|
@ -68,7 +68,7 @@ OUTPUT_DIRECTORY = @PROJECT_BINARY_DIR@/docs
|
|||||||
# performance problems for the file system.
|
# performance problems for the file system.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
CREATE_SUBDIRS = YES
|
CREATE_SUBDIRS = NO
|
||||||
|
|
||||||
# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
|
# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII
|
||||||
# characters to appear in the names of generated files. If set to NO, non-ASCII
|
# characters to appear in the names of generated files. If set to NO, non-ASCII
|
||||||
@ -98,7 +98,7 @@ OUTPUT_LANGUAGE = English
|
|||||||
# documentation (similar to Javadoc). Set to NO to disable this.
|
# documentation (similar to Javadoc). Set to NO to disable this.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
|
|
||||||
BRIEF_MEMBER_DESC = YES
|
BRIEF_MEMBER_DESC = NO
|
||||||
|
|
||||||
# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
|
# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief
|
||||||
# description of a member or function before the detailed description
|
# description of a member or function before the detailed description
|
||||||
@ -107,7 +107,7 @@ BRIEF_MEMBER_DESC = YES
|
|||||||
# brief descriptions will be completely suppressed.
|
# brief descriptions will be completely suppressed.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
|
|
||||||
REPEAT_BRIEF = YES
|
REPEAT_BRIEF = NO
|
||||||
|
|
||||||
# This tag implements a quasi-intelligent brief description abbreviator that is
|
# This tag implements a quasi-intelligent brief description abbreviator that is
|
||||||
# used to form the text in various listings. Each string in this list, if found
|
# used to form the text in various listings. Each string in this list, if found
|
||||||
@ -204,7 +204,7 @@ MULTILINE_CPP_IS_BRIEF = NO
|
|||||||
# documentation from any documented member that it re-implements.
|
# documentation from any documented member that it re-implements.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
|
|
||||||
INHERIT_DOCS = YES
|
INHERIT_DOCS = NO
|
||||||
|
|
||||||
# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
|
# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new
|
||||||
# page for each member. If set to NO, the documentation of a member will be part
|
# page for each member. If set to NO, the documentation of a member will be part
|
||||||
@ -277,7 +277,7 @@ OPTIMIZE_OUTPUT_VHDL = NO
|
|||||||
# Prolog sources. Doxygen will then generate output that is tailored for Prolog.
|
# Prolog sources. Doxygen will then generate output that is tailored for Prolog.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
OPTIMIZE_OUTPUT_FOR_PROLOG = YES
|
OPTIMIZE_OUTPUT_FOR_PROLOG = NO
|
||||||
|
|
||||||
# Doxygen selects the parser to use depending on the extension of the files it
|
# Doxygen selects the parser to use depending on the extension of the files it
|
||||||
# parses. With this tag you can assign which parser to use for a given
|
# parses. With this tag you can assign which parser to use for a given
|
||||||
@ -318,7 +318,7 @@ MARKDOWN_SUPPORT = YES
|
|||||||
# Minimum value: 0, maximum value: 99, default value: 0.
|
# Minimum value: 0, maximum value: 99, default value: 0.
|
||||||
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
|
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
|
||||||
|
|
||||||
TOC_INCLUDE_HEADINGS = 0
|
TOC_INCLUDE_HEADINGS = 99
|
||||||
|
|
||||||
# When enabled doxygen tries to link words that correspond to documented
|
# When enabled doxygen tries to link words that correspond to documented
|
||||||
# classes, or namespaces to their corresponding documentation. Such a link can
|
# classes, or namespaces to their corresponding documentation. Such a link can
|
||||||
@ -711,7 +711,7 @@ FILE_VERSION_FILTER =
|
|||||||
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
|
# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE
|
||||||
# tag is left empty.
|
# tag is left empty.
|
||||||
|
|
||||||
LAYOUT_FILE =
|
LAYOUT_FILE = @CMAKE_SOURCE_DIR@/docs/custom/DoxygenLayout.xml
|
||||||
|
|
||||||
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
|
# The CITE_BIB_FILES tag can be used to specify one or more bib files containing
|
||||||
# the reference definitions. This must be a list of .bib files. The .bib
|
# the reference definitions. This must be a list of .bib files. The .bib
|
||||||
@ -748,7 +748,7 @@ WARNINGS = YES
|
|||||||
# will automatically be disabled.
|
# will automatically be disabled.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
|
|
||||||
WARN_IF_UNDOCUMENTED = YES
|
WARN_IF_UNDOCUMENTED = NO
|
||||||
|
|
||||||
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
|
# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for
|
||||||
# potential errors in the documentation, such as not documenting some parameters
|
# potential errors in the documentation, such as not documenting some parameters
|
||||||
@ -1097,7 +1097,7 @@ VERBATIM_HEADERS = YES
|
|||||||
# classes, structs, unions or interfaces.
|
# classes, structs, unions or interfaces.
|
||||||
# The default value is: YES.
|
# The default value is: YES.
|
||||||
|
|
||||||
ALPHABETICAL_INDEX = YES
|
ALPHABETICAL_INDEX = NO
|
||||||
|
|
||||||
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
|
# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in
|
||||||
# which the alphabetical index list will be split.
|
# which the alphabetical index list will be split.
|
||||||
@ -1156,7 +1156,7 @@ HTML_FILE_EXTENSION = .html
|
|||||||
# of the possible markers and block names see the documentation.
|
# of the possible markers and block names see the documentation.
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
HTML_HEADER =
|
HTML_HEADER = @CMAKE_SOURCE_DIR@/docs/custom/header.html
|
||||||
|
|
||||||
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
|
# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each
|
||||||
# generated HTML page. If the tag is left blank doxygen will generate a standard
|
# generated HTML page. If the tag is left blank doxygen will generate a standard
|
||||||
@ -1166,7 +1166,7 @@ HTML_HEADER =
|
|||||||
# that doxygen normally uses.
|
# that doxygen normally uses.
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
HTML_FOOTER =
|
HTML_FOOTER = @CMAKE_SOURCE_DIR@/docs/custom/footer.html
|
||||||
|
|
||||||
|
|
||||||
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
|
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style
|
||||||
@ -1192,7 +1192,7 @@ HTML_STYLESHEET =
|
|||||||
# list). For an example see the documentation.
|
# list). For an example see the documentation.
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
HTML_EXTRA_STYLESHEET =
|
HTML_EXTRA_STYLESHEET = @CMAKE_SOURCE_DIR@/docs/custom/customdoxygen.css
|
||||||
|
|
||||||
|
|
||||||
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
|
# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or
|
||||||
@ -1203,7 +1203,7 @@ HTML_EXTRA_STYLESHEET =
|
|||||||
# files will be copied as-is; there are no commands or markers available.
|
# files will be copied as-is; there are no commands or markers available.
|
||||||
# This tag requires that the tag GENERATE_HTML is set to YES.
|
# This tag requires that the tag GENERATE_HTML is set to YES.
|
||||||
|
|
||||||
HTML_EXTRA_FILES =
|
HTML_EXTRA_FILES = @CMAKE_SOURCE_DIR@/docs/custom/doxy-boot.js
|
||||||
|
|
||||||
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
|
# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen
|
||||||
# will adjust the colors in the style sheet and background images according to
|
# will adjust the colors in the style sheet and background images according to
|
||||||
@ -1958,7 +1958,7 @@ MAN_LINKS = NO
|
|||||||
# captures the structure of the code including all documentation.
|
# captures the structure of the code including all documentation.
|
||||||
# The default value is: NO.
|
# The default value is: NO.
|
||||||
|
|
||||||
GENERATE_XML = YES
|
GENERATE_XML = NO
|
||||||
|
|
||||||
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
|
# The XML_OUTPUT tag is used to specify where the XML pages will be put. If a
|
||||||
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of
|
||||||
|
@ -1,104 +1,17 @@
|
|||||||
h1, .h1, h2, .h2, h3, .h3{
|
/* Custom Look and feel - Can be edited
|
||||||
font-weight: 200 !important;
|
----------------------------------- */
|
||||||
}
|
|
||||||
|
|
||||||
#navrow1, #navrow2, #navrow3, #navrow4, #navrow5{
|
#navrow1, #navrow2, #navrow3, #navrow4, #navrow5{
|
||||||
border-bottom: 1px solid #EEEEEE;
|
border-bottom: 1px solid #EEEEEE;
|
||||||
}
|
}
|
||||||
|
|
||||||
.adjust-right {
|
.adjust-right {
|
||||||
margin-left: 30px !important;
|
margin-left: 30px !important;
|
||||||
font-size: 1.15em !important;
|
font-size: 1.15em !important;
|
||||||
}
|
|
||||||
.navbar{
|
|
||||||
border: 0px solid #222 !important;
|
|
||||||
}
|
|
||||||
table{
|
|
||||||
white-space:pre-wrap !important;
|
|
||||||
}
|
|
||||||
/*
|
|
||||||
===========================
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/* Sticky footer styles
|
|
||||||
-------------------------------------------------- */
|
|
||||||
html,
|
|
||||||
body {
|
|
||||||
height: 100%;
|
|
||||||
/* The html and body elements cannot have any padding or margin. */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Wrapper for page content to push down footer */
|
/* DOXYGEN Code Styles - These are from doxygen but can be changed to fit the theme
|
||||||
#wrap {
|
|
||||||
min-height: 100%;
|
|
||||||
height: auto;
|
|
||||||
/* Negative indent footer by its height */
|
|
||||||
margin: 0 auto -60px;
|
|
||||||
/* Pad bottom by footer height */
|
|
||||||
padding: 0 0 60px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Set the fixed height of the footer here */
|
|
||||||
#footer {
|
|
||||||
font-size: 0.9em;
|
|
||||||
padding: 8px 0px;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-row {
|
|
||||||
line-height: 44px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#footer > .container {
|
|
||||||
padding-left: 15px;
|
|
||||||
padding-right: 15px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-follow-icon {
|
|
||||||
margin-left: 3px;
|
|
||||||
text-decoration: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-follow-icon img {
|
|
||||||
width: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-link {
|
|
||||||
padding-top: 5px;
|
|
||||||
display: inline-block;
|
|
||||||
color: #999999;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-copyright {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@media (min-width: 992px) {
|
|
||||||
.footer-row {
|
|
||||||
text-align: left;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-icons {
|
|
||||||
text-align: right;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@media (max-width: 991px) {
|
|
||||||
.footer-row {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer-icons {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* DOXYGEN Code Styles
|
|
||||||
----------------------------------- */
|
----------------------------------- */
|
||||||
|
|
||||||
|
|
||||||
a.qindex {
|
a.qindex {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
@ -148,8 +61,8 @@ div.fragment {
|
|||||||
}
|
}
|
||||||
|
|
||||||
div.line {
|
div.line {
|
||||||
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
|
font-family: monospace, fixed;
|
||||||
font-size: 12px;
|
font-size: 13px;
|
||||||
min-height: 13px;
|
min-height: 13px;
|
||||||
line-height: 1.0;
|
line-height: 1.0;
|
||||||
text-wrap: unrestricted;
|
text-wrap: unrestricted;
|
||||||
@ -157,7 +70,7 @@ div.line {
|
|||||||
white-space: -pre-wrap; /* Opera 4-6 */
|
white-space: -pre-wrap; /* Opera 4-6 */
|
||||||
white-space: -o-pre-wrap; /* Opera 7 */
|
white-space: -o-pre-wrap; /* Opera 7 */
|
||||||
white-space: pre-wrap; /* CSS3 */
|
white-space: pre-wrap; /* CSS3 */
|
||||||
word-wrap: normal; /* IE 5.5+ */
|
word-wrap: break-word; /* IE 5.5+ */
|
||||||
text-indent: -53px;
|
text-indent: -53px;
|
||||||
padding-left: 53px;
|
padding-left: 53px;
|
||||||
padding-bottom: 0px;
|
padding-bottom: 0px;
|
||||||
@ -173,9 +86,6 @@ div.line {
|
|||||||
transition-property: background-color, box-shadow;
|
transition-property: background-color, box-shadow;
|
||||||
transition-duration: 0.5s;
|
transition-duration: 0.5s;
|
||||||
}
|
}
|
||||||
div.line:hover{
|
|
||||||
background-color: #FBFF00;
|
|
||||||
}
|
|
||||||
|
|
||||||
div.line.glow {
|
div.line.glow {
|
||||||
background-color: cyan;
|
background-color: cyan;
|
||||||
@ -186,21 +96,16 @@ div.line.glow {
|
|||||||
span.lineno {
|
span.lineno {
|
||||||
padding-right: 4px;
|
padding-right: 4px;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
color:rgba(0,0,0,0.3);
|
border-right: 2px solid #0F0;
|
||||||
border-right: 1px solid #EEE;
|
background-color: #E8E8E8;
|
||||||
border-left: 1px solid #EEE;
|
|
||||||
background-color: #FFF;
|
|
||||||
white-space: pre;
|
white-space: pre;
|
||||||
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace ;
|
|
||||||
}
|
}
|
||||||
span.lineno a {
|
span.lineno a {
|
||||||
background-color: #FAFAFA;
|
background-color: #D8D8D8;
|
||||||
cursor:pointer;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
span.lineno a:hover {
|
span.lineno a:hover {
|
||||||
background-color: #EFE200;
|
background-color: #C8C8C8;
|
||||||
color: #1e1e1e;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
div.groupHeader {
|
div.groupHeader {
|
||||||
@ -267,104 +172,3 @@ blockquote {
|
|||||||
padding: 0 12px 0 16px;
|
padding: 0 12px 0 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------- Search Box */
|
|
||||||
|
|
||||||
#search-box {
|
|
||||||
margin: 10px 0px;
|
|
||||||
}
|
|
||||||
#search-box .close {
|
|
||||||
display: none;
|
|
||||||
position: absolute;
|
|
||||||
right: 0px;
|
|
||||||
padding: 6px 12px;
|
|
||||||
z-index: 5;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*---------------- Search results window */
|
|
||||||
|
|
||||||
#search-results-window {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
iframe#MSearchResults {
|
|
||||||
width: 100%;
|
|
||||||
height: 15em;
|
|
||||||
}
|
|
||||||
|
|
||||||
.SRChildren {
|
|
||||||
padding-left: 3ex; padding-bottom: .5em
|
|
||||||
}
|
|
||||||
.SRPage .SRChildren {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
a.SRScope {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
a.SRSymbol:focus, a.SRSymbol:active,
|
|
||||||
a.SRScope:focus, a.SRScope:active {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
span.SRScope {
|
|
||||||
padding-left: 4px;
|
|
||||||
}
|
|
||||||
.SRResult {
|
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* class and file list */
|
|
||||||
.directory .icona,
|
|
||||||
.directory .arrow {
|
|
||||||
height: auto;
|
|
||||||
}
|
|
||||||
.directory .icona .icon {
|
|
||||||
height: 16px;
|
|
||||||
}
|
|
||||||
.directory .icondoc {
|
|
||||||
background-position: 0px 0px;
|
|
||||||
height: 20px;
|
|
||||||
}
|
|
||||||
.directory .iconfopen {
|
|
||||||
background-position: 0px 0px;
|
|
||||||
}
|
|
||||||
.directory td.entry {
|
|
||||||
padding: 7px 8px 6px 8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.table > tbody > tr > td.memSeparator {
|
|
||||||
line-height: 0;
|
|
||||||
.table-hover;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
.memItemLeft, .memTemplItemLeft {
|
|
||||||
white-space: normal;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* enumerations */
|
|
||||||
.panel-body thead > tr {
|
|
||||||
background-color: #e0e0e0;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* todo lists */
|
|
||||||
.todoname,
|
|
||||||
.todoname a {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Class title */
|
|
||||||
.summary {
|
|
||||||
margin-top: 25px;
|
|
||||||
}
|
|
||||||
.page-header {
|
|
||||||
margin: 20px 0px !important;
|
|
||||||
}
|
|
||||||
.page-header .title {
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
.page-header .pull-right {
|
|
||||||
margin-top: 0.3em;
|
|
||||||
margin-left: 0.5em;
|
|
||||||
}
|
|
||||||
.page-header .label {
|
|
||||||
font-size: 50%;
|
|
||||||
}
|
|
||||||
|
@ -4,6 +4,7 @@ $( document ).ready(function() {
|
|||||||
$("div.title").addClass("h1");
|
$("div.title").addClass("h1");
|
||||||
|
|
||||||
$('li > a[href="index.html"] > span').before("<i class='fa fa-cog'></i> ");
|
$('li > a[href="index.html"] > span').before("<i class='fa fa-cog'></i> ");
|
||||||
|
$('li > a[href="index.html"] > span').text("YAP");
|
||||||
$('li > a[href="modules.html"] > span').before("<i class='fa fa-square'></i> ");
|
$('li > a[href="modules.html"] > span').before("<i class='fa fa-square'></i> ");
|
||||||
$('li > a[href="namespaces.html"] > span').before("<i class='fa fa-bars'></i> ");
|
$('li > a[href="namespaces.html"] > span').before("<i class='fa fa-bars'></i> ");
|
||||||
$('li > a[href="annotated.html"] > span').before("<i class='fa fa-list-ul'></i> ");
|
$('li > a[href="annotated.html"] > span').before("<i class='fa fa-list-ul'></i> ");
|
||||||
@ -26,7 +27,7 @@ $( document ).ready(function() {
|
|||||||
$("#nav-path > ul").addClass("breadcrumb");
|
$("#nav-path > ul").addClass("breadcrumb");
|
||||||
|
|
||||||
$("table.params").addClass("table");
|
$("table.params").addClass("table");
|
||||||
$("div.ingroups").wrapInner("<span class='text-nowrap'></span>");
|
$("div.ingroups").wrapInner("<small></small>");
|
||||||
$("div.levels").css("margin", "0.5em");
|
$("div.levels").css("margin", "0.5em");
|
||||||
$("div.levels > span").addClass("btn btn-default btn-xs");
|
$("div.levels > span").addClass("btn btn-default btn-xs");
|
||||||
$("div.levels > span").css("margin-right", "0.25em");
|
$("div.levels > span").css("margin-right", "0.25em");
|
||||||
@ -53,8 +54,10 @@ $( document ).ready(function() {
|
|||||||
$("div.ttname a").css("color", 'white');
|
$("div.ttname a").css("color", 'white');
|
||||||
$("div.ttdef,div.ttdoc,div.ttdeci").addClass("panel-body");
|
$("div.ttdef,div.ttdoc,div.ttdeci").addClass("panel-body");
|
||||||
|
|
||||||
$('div.fragment.well div.line:first').css('margin-top', '2px');
|
$('#MSearchBox').parent().remove();
|
||||||
$('div.fragment.well div.line:last').css('margin-bottom', '2px');
|
|
||||||
|
$('div.fragment.well div.line:first').css('margin-top', '15px');
|
||||||
|
$('div.fragment.well div.line:last').css('margin-bottom', '15px');
|
||||||
|
|
||||||
$('table.doxtable').removeClass('doxtable').addClass('table table-striped table-bordered').each(function(){
|
$('table.doxtable').removeClass('doxtable').addClass('table table-striped table-bordered').each(function(){
|
||||||
$(this).prepend('<thead></thead>');
|
$(this).prepend('<thead></thead>');
|
||||||
@ -77,11 +80,6 @@ $( document ).ready(function() {
|
|||||||
$(this).siblings('.memItemLeft').attr('align', 'left');
|
$(this).siblings('.memItemLeft').attr('align', 'left');
|
||||||
});
|
});
|
||||||
|
|
||||||
$('table.memberdecls').find('.memTemplItemRight').each(function(){
|
|
||||||
$(this).contents().appendTo($(this).siblings('.memTemplItemLeft'));
|
|
||||||
$(this).siblings('.memTemplItemLeft').attr('align', 'left');
|
|
||||||
});
|
|
||||||
|
|
||||||
function getOriginalWidthOfImg(img_element) {
|
function getOriginalWidthOfImg(img_element) {
|
||||||
var t = new Image();
|
var t = new Image();
|
||||||
t.src = (img_element.getAttribute ? img_element.getAttribute("src") : false) || img_element.src;
|
t.src = (img_element.getAttribute ? img_element.getAttribute("src") : false) || img_element.src;
|
||||||
@ -93,147 +91,6 @@ $( document ).ready(function() {
|
|||||||
$(this).css('width', '100%');
|
$(this).css('width', '100%');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
/* responsive search box */
|
|
||||||
$('#MSearchBox').parent().remove();
|
|
||||||
|
|
||||||
var nav_container = $('<div class="row"></div>');
|
|
||||||
$('#navrow1').parent().prepend(nav_container);
|
|
||||||
|
|
||||||
var left_nav = $('<div class="col-md-9"></div>');
|
|
||||||
for (i = 0; i < 6; i++) {
|
|
||||||
var navrow = $('#navrow' + i + ' > ul.tablist').detach();
|
|
||||||
left_nav.append(navrow);
|
|
||||||
$('#navrow' + i).remove();
|
|
||||||
}
|
|
||||||
var right_nav = $('<div class="col-md-3"></div>').append('\
|
|
||||||
<div id="search-box" class="input-group">\
|
|
||||||
<div class="input-group-btn">\
|
|
||||||
<button aria-expanded="false" type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">\
|
|
||||||
<span class="glyphicon glyphicon-search"></span> <span class="caret"></span>\
|
|
||||||
</button>\
|
|
||||||
<ul class="dropdown-menu">\
|
|
||||||
</ul>\
|
|
||||||
</div>\
|
|
||||||
<button id="search-close" type="button" class="close" aria-label="Close"><span aria-hidden="true">×</span></button>\
|
|
||||||
<input id="search-field" class="form-control" accesskey="S" onkeydown="searchBox.OnSearchFieldChange(event);" placeholder="Search ..." type="text">\
|
|
||||||
</div>');
|
|
||||||
$(nav_container).append(left_nav);
|
|
||||||
$(nav_container).append(right_nav);
|
|
||||||
|
|
||||||
$('#MSearchSelectWindow .SelectionMark').remove();
|
|
||||||
var search_selectors = $('#MSearchSelectWindow .SelectItem');
|
|
||||||
for (var i = 0; i < search_selectors.length; i += 1) {
|
|
||||||
var element_a = $('<a href="#"></a>').text($(search_selectors[i]).text());
|
|
||||||
|
|
||||||
element_a.click(function(){
|
|
||||||
$('#search-box .dropdown-menu li').removeClass('active');
|
|
||||||
$(this).parent().addClass('active');
|
|
||||||
searchBox.OnSelectItem($('#search-box li a').index(this));
|
|
||||||
searchBox.Search();
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
|
|
||||||
var element = $('<li></li>').append(element_a);
|
|
||||||
$('#search-box .dropdown-menu').append(element);
|
|
||||||
}
|
|
||||||
$('#MSearchSelectWindow').remove();
|
|
||||||
|
|
||||||
$('#search-box .close').click(function (){
|
|
||||||
searchBox.CloseResultsWindow();
|
|
||||||
});
|
|
||||||
|
|
||||||
$('body').append('<div id="MSearchClose"></div>');
|
|
||||||
$('body').append('<div id="MSearchBox"></div>');
|
|
||||||
$('body').append('<div id="MSearchSelectWindow"></div>');
|
|
||||||
|
|
||||||
searchBox.searchLabel = '';
|
|
||||||
searchBox.DOMSearchField = function() {
|
|
||||||
return document.getElementById("search-field");
|
|
||||||
}
|
|
||||||
searchBox.DOMSearchClose = function(){
|
|
||||||
return document.getElementById("search-close");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* search results */
|
|
||||||
var results_iframe = $('#MSearchResults').detach();
|
|
||||||
$('#MSearchResultsWindow')
|
|
||||||
.attr('id', 'search-results-window')
|
|
||||||
.addClass('panel panel-default')
|
|
||||||
.append(
|
|
||||||
'<div class="panel-heading">\
|
|
||||||
<h3 class="panel-title">Search Results</h3>\
|
|
||||||
</div>\
|
|
||||||
<div class="panel-body"></div>'
|
|
||||||
);
|
|
||||||
$('#search-results-window .panel-body').append(results_iframe);
|
|
||||||
|
|
||||||
searchBox.DOMPopupSearchResultsWindow = function() {
|
|
||||||
return document.getElementById("search-results-window");
|
|
||||||
}
|
|
||||||
|
|
||||||
function update_search_results_window() {
|
|
||||||
$('#search-results-window').removeClass('panel-default panel-success panel-warning panel-danger')
|
|
||||||
var status = $('#MSearchResults').contents().find('.SRStatus:visible');
|
|
||||||
if (status.length > 0) {
|
|
||||||
switch(status.attr('id')) {
|
|
||||||
case 'Loading':
|
|
||||||
case 'Searching':
|
|
||||||
$('#search-results-window').addClass('panel-warning');
|
|
||||||
break;
|
|
||||||
case 'NoMatches':
|
|
||||||
$('#search-results-window').addClass('panel-danger');
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$('#search-results-window').addClass('panel-default');
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
$('#search-results-window').addClass('panel-success');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
$('#MSearchResults').load(function() {
|
|
||||||
$('#MSearchResults').contents().find('link[href="search.css"]').attr('href','../doxygen.css');
|
|
||||||
$('#MSearchResults').contents().find('head').append(
|
|
||||||
'<link href="../customdoxygen.css" rel="stylesheet" type="text/css">');
|
|
||||||
|
|
||||||
update_search_results_window();
|
|
||||||
|
|
||||||
// detect status changes (only for search with external search backend)
|
|
||||||
var observer = new MutationObserver(function(mutations) {
|
|
||||||
update_search_results_window();
|
|
||||||
});
|
|
||||||
var config = { attributes: true};
|
|
||||||
|
|
||||||
var targets = $('#MSearchResults').contents().find('.SRStatus');
|
|
||||||
for (i = 0; i < targets.length; i++) {
|
|
||||||
observer.observe(targets[i], config);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
|
|
||||||
/* enumerations */
|
|
||||||
$('table.fieldtable').removeClass('fieldtable').addClass('table table-striped table-bordered').each(function(){
|
|
||||||
$(this).prepend('<thead></thead>');
|
|
||||||
$(this).find('tbody > tr:first').prependTo($(this).find('thead'));
|
|
||||||
|
|
||||||
$(this).find('td > span.success').parent().addClass('success');
|
|
||||||
$(this).find('td > span.warning').parent().addClass('warning');
|
|
||||||
$(this).find('td > span.danger').parent().addClass('danger');
|
|
||||||
});
|
|
||||||
|
|
||||||
/* todo list */
|
|
||||||
var todoelements = $('.contents > .textblock > dl.reflist > dt, .contents > .textblock > dl.reflist > dd');
|
|
||||||
for (var i = 0; i < todoelements.length; i += 2) {
|
|
||||||
$('.contents > .textblock').append(
|
|
||||||
'<div class="panel panel-default active">'
|
|
||||||
+ "<div class=\"panel-heading todoname\">" + $(todoelements[i]).html() + "</div>"
|
|
||||||
+ "<div class=\"panel-body\">" + $(todoelements[i+1]).html() + "</div>"
|
|
||||||
+ '</div>');
|
|
||||||
}
|
|
||||||
$('.contents > .textblock > dl').remove();
|
|
||||||
|
|
||||||
|
|
||||||
$(".memitem").removeClass('memitem');
|
$(".memitem").removeClass('memitem');
|
||||||
$(".memproto").removeClass('memproto');
|
$(".memproto").removeClass('memproto');
|
||||||
$(".memdoc").removeClass('memdoc');
|
$(".memdoc").removeClass('memdoc');
|
||||||
@ -261,11 +118,4 @@ $( document ).ready(function() {
|
|||||||
$(this).siblings('.memItemRight').remove();
|
$(this).siblings('.memItemRight').remove();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$('td.memTemplItemLeft').each(function(){
|
|
||||||
if($(this).siblings('.memTemplItemRight').html()=="") {
|
|
||||||
$(this).attr('colspan', 2);
|
|
||||||
$(this).siblings('.memTemplItemRight').remove();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
searchBox.CloseResultsWindow();
|
|
||||||
});
|
});
|
@ -1,20 +1,15 @@
|
|||||||
<!-- HTML footer for doxygen 1.8.8-->
|
<!-- HTML footer for doxygen 1.8.14-->
|
||||||
<!-- start footer part -->
|
<!-- start footer part -->
|
||||||
<!--BEGIN GENERATE_TREEVIEW-->
|
<!--BEGIN GENERATE_TREEVIEW-->
|
||||||
<!-- <div id="nav-path" class="navpath"><\!-- id is needed for treeview function! -\-> -->
|
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
|
||||||
<!-- <ul> -->
|
<ul>
|
||||||
<!-- $navpath -->
|
$navpath
|
||||||
<!-- <li class="footer">$generatedby -->
|
<li class="footer">$generatedby
|
||||||
<!-- <a href="http://www.doxygen.org/index.html"> -->
|
<a href="http://www.doxygen.org/index.html">
|
||||||
<!-- <img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> $doxygenversion </li> -->
|
<img class="footer" src="$relpath^doxygen.png" alt="doxygen"/></a> $doxygenversion </li>
|
||||||
<!-- </ul> -->
|
</ul>
|
||||||
<!-- </div> -->
|
</div>
|
||||||
<!--END GENERATE_TREEVIEW-->
|
<!--END GENERATE_TREEVIEW-->
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!--BEGIN !GENERATE_TREEVIEW-->
|
<!--BEGIN !GENERATE_TREEVIEW-->
|
||||||
<hr class="footer"/><address class="footer"><small>
|
<hr class="footer"/><address class="footer"><small>
|
||||||
$generatedby  <a href="http://www.doxygen.org/index.html">
|
$generatedby  <a href="http://www.doxygen.org/index.html">
|
||||||
|
@ -1,72 +1,39 @@
|
|||||||
<!-- HTML header for doxygen 1.8.8-->
|
<!-- HTML header for doxygen 1.8.14-->
|
||||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||||
<head>
|
<head>
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||||
<!-- Required meta tags -->
|
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
|
||||||
<meta charset="utf-8">
|
<meta name="generator" content="Doxygen $doxygenversion"/>
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||||
|
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css" integrity="sha384-9gVQ4dYFwwWSjIDZnLEWnxCjeSWFphJiwGPXr1jddIhOegiu1FwO5qRGvFXOdJZ4" crossorigin="anonymous">
|
||||||
<!-- Bootstrap CSS -->
|
|
||||||
<script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script>
|
|
||||||
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
|
||||||
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
|
|
||||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
|
|
||||||
<meta name="generator" content="Doxygen $doxygenversion"/>
|
|
||||||
|
|
||||||
|
<!-- <script type="text/javascript" src="https://code.jquery.com/jquery-2.1.1.min.js"></script> -->
|
||||||
|
|
||||||
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
<!--BEGIN PROJECT_NAME--><title>$projectname: $title</title><!--END PROJECT_NAME-->
|
||||||
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
<!--BEGIN !PROJECT_NAME--><title>$title</title><!--END !PROJECT_NAME-->
|
||||||
<!--<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>-->
|
<link href="$relpath^tabs.css" rel="stylesheet" type="text/css"/>
|
||||||
$extrastylesheet
|
<script type="text/javascript" src="$relpath^dynsections.js"></script>
|
||||||
<!-- $treeview -->
|
$treeview
|
||||||
<!-- $search -->
|
$search
|
||||||
$mathjax
|
$mathjax
|
||||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
<link href="$relpath^$stylesheet" rel="stylesheet" type="text/css" />
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
|
<link href="http://thomasf.github.io/solarized-css/solarized-light.min.css" rel="stylesheet"></link>
|
||||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
|
|
||||||
<script type="text/javascript" src="$relpath^doxy-boot.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
|
||||||
<!-- this div, it is closed by doxygen! -->
|
|
||||||
<div id="titlearea">
|
|
||||||
<nav class="navbar navbar-expand-lg navbar-light bg-light">
|
|
||||||
<a class="navbar-brand" href="#">$projectname $projectnumber</a>
|
|
||||||
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
|
|
||||||
<span class="navbar-toggler-icon"></span>
|
|
||||||
</button>
|
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="navbarSupportedContent">
|
$extrastylesheet
|
||||||
<ul class="navbar-nav mr-auto">
|
|
||||||
<li class="nav-item active">
|
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||||
<a class="nav-link" href="#">Home <span class="sr-only">(current)</span></a>
|
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js" integrity="sha384-cs/chFZiN24E4KMATLdqdvsezGxaGsi4hLGOzlXwp5UZB1LY//20VyM2taTB4QvJ" crossorigin="anonymous"></script>
|
||||||
</li>
|
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js" integrity="sha384-uefMccjFJAIv6A+rW+L4AHf99KvxDjWSu1z9VI8SKNVmz4sk7buKt/6v9KI65qnm" crossorigin="anonymous"></script>
|
||||||
<li class="nav-item">
|
<!-- <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> -->
|
||||||
<a class="nav-link" href="#">Link</a>
|
<!-- <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script> -->
|
||||||
</li>
|
<script type="text/javascript" src="doxy-boot.js"></script>
|
||||||
<li class="nav-item dropdown">
|
</head>
|
||||||
<a class="nav-link dropdown-toggle" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
<body>
|
||||||
Dropdown
|
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
|
||||||
</a>
|
|
||||||
<div class="dropdown-menu" aria-labelledby="navbarDropdown">
|
<!-- <\!--BEGIN TITLEAREA-\-> -->
|
||||||
<a class="dropdown-item" href="#">Action</a>
|
<!-- <div id="titlearea"> -->
|
||||||
<a class="dropdown-item" href="#">Another action</a>
|
|
||||||
<div class="dropdown-divider"></div>
|
|
||||||
<a class="dropdown-item" href="#">Something else here</a>
|
|
||||||
</div>
|
|
||||||
</li>
|
|
||||||
<li class="nav-item">
|
|
||||||
<a class="nav-link disabled" href="#">Disabled</a>
|
|
||||||
</li>
|
|
||||||
</ul>
|
|
||||||
<form class="form-inline my-2 my-lg-0">
|
|
||||||
<input class="form-control mr-sm-2" type="search" placeholder="Search" aria-label="Search">
|
|
||||||
<button class="btn btn-outline-success my-2 my-sm-0" type="submit">Search</button>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</nav> <!--BEGIN TITLEAREA-->
|
|
||||||
<!-- <table cellspacing="0" cellpadding="0"> -->
|
<!-- <table cellspacing="0" cellpadding="0"> -->
|
||||||
<!-- <tbody> -->
|
<!-- <tbody> -->
|
||||||
<!-- <tr style="height: 56px;"> -->
|
<!-- <tr style="height: 56px;"> -->
|
||||||
@ -90,12 +57,12 @@
|
|||||||
<!-- <\!--END !PROJECT_NAME-\-> -->
|
<!-- <\!--END !PROJECT_NAME-\-> -->
|
||||||
<!-- <\!--BEGIN DISABLE_INDEX-\-> -->
|
<!-- <\!--BEGIN DISABLE_INDEX-\-> -->
|
||||||
<!-- <\!--BEGIN SEARCHENGINE-\-> -->
|
<!-- <\!--BEGIN SEARCHENGINE-\-> -->
|
||||||
<!-- <td>$Search</td> -->
|
<!-- <td>$searchbox</td> -->
|
||||||
<!-- <\!--END SEARCHENGINE-\-> -->
|
<!-- <\!--END SEARCHENGINE-\-> -->
|
||||||
<!-- <\!--END DISABLE_INDEX-\-> -->
|
<!-- <\!--END DISABLE_INDEX-\-> -->
|
||||||
<!-- </tr> -->
|
<!-- </tr> -->
|
||||||
<!-- </tbody> -->
|
``<!-- </tbody> -->
|
||||||
<!-- </table> -->
|
<!-- </table> -->
|
||||||
</div>
|
<!-- </div> -->
|
||||||
<!--END TITLEAREA-->
|
<!--END TITLEAREA-->
|
||||||
<!-- end header part -->
|
<!-- end header part -->
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
|
Downloading and Installing YAP {#INSTALL}
|
||||||
|
===========================
|
||||||
|
|
||||||
|
This text includes instructions to download and install YAP.
|
||||||
|
|
||||||
Installing YAP {#INSTALL}
|
[TOC]
|
||||||
++++++++
|
|
||||||
|
|
||||||
### Downloading YAP {#Download}
|
### Downloading YAP {#Download}
|
||||||
|
|
||||||
@ -24,7 +26,7 @@ The first argument is the repository, the last argument is the (optional) target
|
|||||||
|
|
||||||
There are a variety of graphical interfaces to `git`, including GitHub's own [GitHub Desktop](https://desktop.github.com/) that supports Microsoft Windows and Apple OSX. A list with GUI applications, editor integration, and much more can be found at the [git Wiki](https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools),
|
There are a variety of graphical interfaces to `git`, including GitHub's own [GitHub Desktop](https://desktop.github.com/) that supports Microsoft Windows and Apple OSX. A list with GUI applications, editor integration, and much more can be found at the [git Wiki](https://git.wiki.kernel.org/index.php/InterfacesFrontendsAndTools),
|
||||||
|
|
||||||
#### Download Options
|
### Download Options
|
||||||
|
|
||||||
It may be useful to know:
|
It may be useful to know:
|
||||||
|
|
||||||
@ -40,7 +42,6 @@ It may be useful to know:
|
|||||||
these documents.
|
these documents.
|
||||||
|
|
||||||
### Compiling YAP {#CompilingYAP}
|
### Compiling YAP {#CompilingYAP}
|
||||||
-------------
|
|
||||||
|
|
||||||
YAP-6.3.4 is a [cmake](www.cmake.org) based
|
YAP-6.3.4 is a [cmake](www.cmake.org) based
|
||||||
system. We use `cmake` because it supports mosts popular software, can
|
system. We use `cmake` because it supports mosts popular software, can
|
||||||
@ -48,7 +49,7 @@ generate Makefiles, Ninja, Apple's XCode, VisualStudio and ANdroid
|
|||||||
Studio, and because it includes packaging suppport, The steps required
|
Studio, and because it includes packaging suppport, The steps required
|
||||||
to install core YAP under `cmake`:
|
to install core YAP under `cmake`:
|
||||||
|
|
||||||
##### `C/C++` compiler
|
#### The compiler
|
||||||
|
|
||||||
*Status as of early 2017*
|
*Status as of early 2017*
|
||||||
|
|
||||||
@ -65,7 +66,7 @@ to install core YAP under `cmake`:
|
|||||||
YAP compiles cleanly under cross-compilers, and we have used the
|
YAP compiles cleanly under cross-compilers, and we have used the
|
||||||
crosss-compilation system [mxe](http://mxe.cc/) system with good results.
|
crosss-compilation system [mxe](http://mxe.cc/) system with good results.
|
||||||
|
|
||||||
##### `cmake`
|
### cmake
|
||||||
|
|
||||||
All Linux and BSD distributions include `cmake`, so
|
All Linux and BSD distributions include `cmake`, so
|
||||||
does [Homebrew](https://brew.sh/)
|
does [Homebrew](https://brew.sh/)
|
||||||
@ -80,7 +81,7 @@ the [CMake site](https://www.cmake.org).
|
|||||||
If you have an older Linux you may need to compile from source,
|
If you have an older Linux you may need to compile from source,
|
||||||
available at GitHub.
|
available at GitHub.
|
||||||
|
|
||||||
##### Ensure that you have other necessary packages installed:
|
### Ensure that you have other necessary packages installed:
|
||||||
|
|
||||||
+ YAP requires [gmp]{https://gmplib.org/} for infinite precision
|
+ YAP requires [gmp]{https://gmplib.org/} for infinite precision
|
||||||
integer and rational. Please ensure the development pacakage
|
integer and rational. Please ensure the development pacakage
|
||||||
@ -101,7 +102,7 @@ available at GitHub.
|
|||||||
|
|
||||||
+ make sure to install Python-3, and not Python-2,
|
+ make sure to install Python-3, and not Python-2,
|
||||||
|
|
||||||
##### Compile and Install
|
### Compile and Install
|
||||||
|
|
||||||
1: Create a directory, say `Build` and `cd` to the directory (`cd Build`).
|
1: Create a directory, say `Build` and `cd` to the directory (`cd Build`).
|
||||||
*YAP should not be compiled at its rootxo directory, some packages do not allow for that.
|
*YAP should not be compiled at its rootxo directory, some packages do not allow for that.
|
||||||
@ -115,15 +116,14 @@ available at GitHub.
|
|||||||
5: If you feel satisfied with the result, do `make install`.
|
5: If you feel satisfied with the result, do `make install`.
|
||||||
* In most systems you will need to be superuser in order to do `make install` and `make info` on the standard directories.
|
* In most systems you will need to be superuser in order to do `make install` and `make info` on the standard directories.
|
||||||
|
|
||||||
Tuning the Functionality of YAP
|
### Tuning the Functionality of YAP
|
||||||
-------------------------------
|
|
||||||
|
|
||||||
By default, YAP supports tabling, depth first search, and most features found in
|
By default, YAP supports tabling, depth first search, and most features found in
|
||||||
modern Prologs. In some cases, you may want to suport extra features, or reduce system size.
|
modern Prologs. In some cases, you may want to suport extra features, or reduce system size.
|
||||||
`cmake`provides an graphical interface for doing so. From the commmand line, a typical example could be:
|
`cmake`provides an graphical interface for doing so. From the commmand line, a typical example could be:
|
||||||
|
|
||||||
~~~~~
|
~~~~~
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~ /users/vsc/src/yap
|
Cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=~ /users/vsc/src/yap
|
||||||
~~~~~
|
~~~~~
|
||||||
|
|
||||||
The first argument says that this is a release, compiled with full optimisation. The second argument says YAP should install under the ~ drectory. In this case, YAP will add the binaries to /users/vsc/bin, include files to `/users/vsc/include/Yap`, Prolog files to `/users/vsc/share/Yap`, and ay DLL to `/users/vsc/lib/Yap`.
|
The first argument says that this is a release, compiled with full optimisation. The second argument says YAP should install under the ~ drectory. In this case, YAP will add the binaries to /users/vsc/bin, include files to `/users/vsc/include/Yap`, Prolog files to `/users/vsc/share/Yap`, and ay DLL to `/users/vsc/lib/Yap`.
|
||||||
@ -177,7 +177,7 @@ You can also use `xcodebuild` from the command line.
|
|||||||
|
|
||||||
Bext follow instructions to fully compile YAP:
|
Bext follow instructions to fully compile YAP:
|
||||||
|
|
||||||
#### Compilation Notes for OSX/Brew
|
### Compilation Notes for OSX/Brew
|
||||||
|
|
||||||
Next follows a detailed description of a full install of YAP, including all the packages that YAP can use:
|
Next follows a detailed description of a full install of YAP, including all the packages that YAP can use:
|
||||||
|
|
||||||
@ -210,7 +210,7 @@ brew install cudd
|
|||||||
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl ..
|
cmake -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl ..
|
||||||
~~~~~
|
~~~~~
|
||||||
|
|
||||||
#### Compilation Notes for Android
|
### Compilation Notes for Android
|
||||||
|
|
||||||
Next we present the compilation process for Android. The environment is an OSX, but steps
|
Next we present the compilation process for Android. The environment is an OSX, but steps
|
||||||
should be similar for Linux machines. We assume you have downloaded both the Android NDK and the Android SDK.
|
should be similar for Linux machines. We assume you have downloaded both the Android NDK and the Android SDK.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Attributed Variables and Co-Routining {#attributes}
|
### Attributed Variables and Co-Routining {#attributes}
|
||||||
=======================================
|
|
||||||
@ingroup extensions
|
@ingroup extensions
|
||||||
|
|
||||||
|
|
||||||
@ -26,15 +26,9 @@ 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.
|
||||||
|
|
||||||
+ @ref SICS_attributes
|
[TOC]
|
||||||
+ @ref sicsatts
|
|
||||||
+ @ref New_Style_Attribute_Declarations
|
|
||||||
+ @ref CohYroutining
|
|
||||||
+ @ref AttributeVariables_Builtins
|
|
||||||
|
|
||||||
|
#### SICStus Style attribute declarations. {#SICS_attributes}
|
||||||
|
|
||||||
### 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:
|
||||||
@ -279,7 +273,7 @@ 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.
|
||||||
|
|
||||||
@ -351,7 +345,7 @@ v put_attr(Y, domain, Domain),
|
|||||||
|
|
||||||
|
|
||||||
@{
|
@{
|
||||||
### 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
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@defgroup builtins YAP Core Built-ins
|
YAP Core Built-ins {#builtins}
|
||||||
|
==================
|
||||||
|
|
||||||
@brief This chapter describes the core built-in predicates that control the execution of
|
@brief This chapter describes the core built-in predicates that control the execution of
|
||||||
Prolog programs, provide fundamental functionality such as termm manipulation or arithmetic, and support interaction with external
|
Prolog programs, provide fundamental functionality such as termm manipulation or arithmetic, and support interaction with external
|
||||||
@ -13,3 +14,49 @@ notation will be used:
|
|||||||
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
|
||||||
|
|
||||||
|
24
docs/md/c
24
docs/md/c
@ -1,24 +0,0 @@
|
|||||||
YAP Core Built-ins {#core}
|
|
||||||
=================
|
|
||||||
|
|
||||||
This chapter describes the core predicates that control the execution of
|
|
||||||
Prolog programs, provide fundamental functionality such as termm manipulation or arithmetic, and support interaction with external
|
|
||||||
resources, Many of the predicates described here have been standardised by the ISO. The standartised subset of Prolog also known as ISO-Prolog.
|
|
||||||
|
|
||||||
In the description of the arguments of predicates the following
|
|
||||||
notation will be used:
|
|
||||||
|
|
||||||
+ a preceding plus sign will denote an argument as an "input
|
|
||||||
argument" - it cannot be a free variable at the time of the call;
|
|
||||||
+ a preceding minus sign will denote an "output argument";
|
|
||||||
+ an argument with no preceding symbol can be used in both ways.
|
|
||||||
|
|
||||||
|
|
||||||
@copydoc builtins
|
|
||||||
|
|
||||||
|
|
||||||
@{
|
|
||||||
@defgroup builtins YAP Core Builtins:
|
|
||||||
|
|
||||||
@}
|
|
||||||
|
|
@ -1,8 +1,62 @@
|
|||||||
|
|
||||||
@page Library YAP Library
|
YAP Prolog Library {#library}
|
||||||
|
===================
|
||||||
|
|
||||||
|
|
||||||
the library_directory path (set by the
|
the library_directory path (set by the
|
||||||
`LIBDIR` variable in the Makefile for YAP). Several files in the
|
`LIBDIR` variable in the Makefile for YAP). Several files in the
|
||||||
library are originally from the public-domain Edinburgh Prolog library.
|
library are originally from the public-domain Edinburgh Prolog library.
|
||||||
|
|
||||||
|
@tableofcontents
|
||||||
|
|
||||||
|
|
||||||
|
+ @ref apply_stub
|
||||||
|
+ @ref apply_macros
|
||||||
|
+ @ref args
|
||||||
|
+ @ref Association_Lists
|
||||||
|
+ @ref sicsatts
|
||||||
|
+ @ref avl
|
||||||
|
+ @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 swi_listing
|
||||||
|
+ @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
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
@defgroup load_files Loading and Organising YAP Programs
|
Loading and Organising YAP Programs {#load_files}
|
||||||
|
====================================
|
||||||
|
|
||||||
@brief Next, we present the main predicates and directives available to load
|
@brief Next, we present the main predicates and directives available to load
|
||||||
files and to control the Prolog environment.
|
files and to control the Prolog environment.
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
### The YAP Module system {#YAPModules}
|
The YAP Module system {#YAPModules}
|
||||||
|
=======================
|
||||||
|
|
||||||
The YAP module system is based on the Quintus/SISCtus module
|
The YAP module system is based on the Quintus/SISCtus module
|
||||||
system ˜\cite quintus . In this design, modules are named collections of predicates,
|
system ˜\cite quintus . In this design, modules are named collections of predicates,
|
||||||
@ -38,6 +38,8 @@ the module/2 declaration.This declaration sets the source module when
|
|||||||
it starts consulting a file, and resets it at the end. One can set
|
it starts consulting a file, and resets it at the end. One can set
|
||||||
the type-in module permanently by using the built-in `module/1`.
|
the type-in module permanently by using the built-in `module/1`.
|
||||||
|
|
||||||
|
[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
|
||||||
|
@ -1,13 +1,13 @@
|
|||||||
|
|
||||||
|
|
||||||
#### Running YAP {#run}
|
## Running YAP {#run}
|
||||||
|
|
||||||
|
|
||||||
We next describe how to invoke YAP in Unix systems.
|
We next describe how to invoke YAP in Unix systems.
|
||||||
|
|
||||||
[TOC]
|
[TOC]
|
||||||
|
|
||||||
##### Running YAP Interactively {#Running_YAP_Interactively}
|
### Running YAP Interactively {#Running_YAP_Interactively}
|
||||||
|
|
||||||
|
|
||||||
Most often you will want to use YAP in interactive mode. Assuming that
|
Most often you will want to use YAP in interactive mode. Assuming that
|
||||||
@ -104,7 +104,7 @@ YAP can also be used to run Prolog files as scripts, at least in
|
|||||||
Unix-like environments. A simple example is shown next (do not forget
|
Unix-like environments. A simple example is shown next (do not forget
|
||||||
that the shell comments are very important):
|
that the shell comments are very important):
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~
|
||||||
#!/usr/local/bin/yap -L --
|
#!/usr/local/bin/yap -L --
|
||||||
#
|
#
|
||||||
# Hello World script file using YAP
|
# Hello World script file using YAP
|
||||||
@ -113,7 +113,7 @@ that the shell comments are very important):
|
|||||||
|
|
||||||
:- write('Hello World'), nl.
|
:- write('Hello World'), nl.
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~
|
||||||
|
|
||||||
The `#!` characters specify that the script should call the binary
|
The `#!` characters specify that the script should call the binary
|
||||||
file YAP. Notice that many systems will require the complete path to the
|
file YAP. Notice that many systems will require the complete path to the
|
||||||
@ -147,7 +147,7 @@ Notice that the `--` is required so that the shell passes the extra
|
|||||||
arguments to YAP. As an example, consider the following script
|
arguments to YAP. As an example, consider the following script
|
||||||
`dump_args`:
|
`dump_args`:
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~
|
||||||
#!/usr/bin/yap -L --
|
#!/usr/bin/yap -L --
|
||||||
#.
|
#.
|
||||||
|
|
||||||
@ -158,13 +158,13 @@ main( [H|T] ) :-
|
|||||||
|
|
||||||
:- unix( argv(AllArgs) ), main( AllArgs ).
|
:- unix( argv(AllArgs) ), main( AllArgs ).
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~
|
||||||
|
|
||||||
If you this run this script with the arguments:
|
If you this run this script with the arguments:
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~
|
||||||
./dump_args -s 10000
|
./dump_args -s 10000
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~
|
||||||
the script will start an YAP process with stack size `10MB`, and
|
the script will start an YAP process with stack size `10MB`, and
|
||||||
the list of arguments to the process will be empty.
|
the list of arguments to the process will be empty.
|
||||||
|
|
||||||
@ -172,7 +172,7 @@ Often one wants to run the script as any other program, and for this it
|
|||||||
is convenient to ignore arguments to YAP. This is possible by using
|
is convenient to ignore arguments to YAP. This is possible by using
|
||||||
`L --` as in the next version of `dump_args`:
|
`L --` as in the next version of `dump_args`:
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~
|
||||||
#!/usr/bin/yap -L --
|
#!/usr/bin/yap -L --
|
||||||
|
|
||||||
main( [] ).
|
main( [] ).
|
||||||
@ -182,13 +182,13 @@ main( [H|T] ) :-
|
|||||||
|
|
||||||
:- unix( argv(AllArgs) ), main( AllArgs ).
|
:- unix( argv(AllArgs) ), main( AllArgs ).
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~
|
||||||
|
|
||||||
The `--` indicates the next arguments are not for YAP. Instead,
|
The `--` indicates the next arguments are not for YAP. Instead,
|
||||||
they must be sent directly to the argv built-in. Hence, running
|
they must be sent directly to the argv built-in. Hence, running
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~
|
||||||
./dump_args test
|
./dump_args test
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~
|
||||||
|
|
||||||
will write `test` on the standard output.
|
will write `test` on the standard output.
|
||||||
|
@ -67,9 +67,9 @@ assert/1, clause/1 and retract/1 are used. First
|
|||||||
predicates which will change during execution should be declared as
|
predicates which will change during execution should be declared as
|
||||||
`dynamic` by using commands like:
|
`dynamic` by using commands like:
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~
|
||||||
:- dynamic f/n.
|
:- dynamic f/n.
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~
|
||||||
|
|
||||||
where `f` is the predicate name and n is the arity of the
|
where `f` is the predicate name and n is the arity of the
|
||||||
predicate. Note that several such predicates can be declared in a
|
predicate. Note that several such predicates can be declared in a
|
||||||
@ -174,12 +174,9 @@ standard.
|
|||||||
The following incompatibilities between YAP and the ISO standard are
|
The following incompatibilities between YAP and the ISO standard are
|
||||||
known to still exist (please check Ulrich Neumerkel's page for more details):
|
known to still exist (please check Ulrich Neumerkel's page for more details):
|
||||||
|
|
||||||
<ul>
|
+ Currently, YAP does not handle overflow errors in integer
|
||||||
|
|
||||||
<li>Currently, YAP does not handle overflow errors in integer
|
|
||||||
operations, and handles floating-point errors only in some
|
operations, and handles floating-point errors only in some
|
||||||
architectures. Otherwise, YAP follows IEEE arithmetic.
|
architectures. Otherwise, YAP follows IEEE arithmetic.
|
||||||
|
|
||||||
<ul>
|
|
||||||
Please inform the authors on other incompatibilities that may still
|
Please inform the authors on other incompatibilities that may still
|
||||||
exist.
|
exist.
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
///
|
///
|
||||||
/// @file YapErrors.h
|
/// @file YapErrors.h
|
||||||
/// /// @adddtogroup YapError
|
///
|
||||||
|
/// @addtogroup YapError
|
||||||
///
|
///
|
||||||
/// The file YapErrors.h contains a list with all the error classes known
|
/// The file YapErrors.h contains a list with all the error classes known
|
||||||
/// internally to the YAP system.
|
/// internally to the YAP system.
|
||||||
|
@ -11,30 +11,6 @@
|
|||||||
|
|
||||||
:- module(apply_stub,[]).
|
:- module(apply_stub,[]).
|
||||||
|
|
||||||
/**
|
|
||||||
* @file apply.yap
|
|
||||||
* @defgroup apply_stub Apply Predicates
|
|
||||||
*
|
|
||||||
* @ingroup library
|
|
||||||
*
|
|
||||||
* @{
|
|
||||||
|
|
||||||
This library provides a SWI-compatible set of utilities for applying a
|
|
||||||
predicate to all elements of a list.
|
|
||||||
|
|
||||||
The apply library is a _stub_, it just forwards definitions to the
|
|
||||||
@ref maplist library. The predicates forwarded are:
|
|
||||||
|
|
||||||
- maplist/2,
|
|
||||||
- maplist/3,
|
|
||||||
- maplist/4,
|
|
||||||
- maplist/5,
|
|
||||||
- include/3,
|
|
||||||
- exclude/3,
|
|
||||||
- partition/4,
|
|
||||||
- partition/5
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
:- reexport(library(maplist),
|
:- reexport(library(maplist),
|
||||||
[maplist/2,
|
[maplist/2,
|
||||||
@ -47,6 +23,31 @@ The apply library is a _stub_, it just forwards definitions to the
|
|||||||
partition/5
|
partition/5
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup apply_stub Apply Predicates
|
||||||
|
*
|
||||||
|
* @ingroup library
|
||||||
|
*
|
||||||
|
|
||||||
|
* @{
|
||||||
|
|
||||||
|
This library provides a SWI-compatible set of utilities for applying a
|
||||||
|
predicate to all elements of a list.
|
||||||
|
|
||||||
|
The apply library is a _stub_, it just forwards definitions to the
|
||||||
|
@ref maplist library. The predicates forwarded are:
|
||||||
|
|
||||||
|
- @ref maplist/2,
|
||||||
|
- @ref maplist/3,
|
||||||
|
- @ref maplist/4,
|
||||||
|
- @ref maplist/5,
|
||||||
|
- @ref include/3,
|
||||||
|
- @ref exclude/3,
|
||||||
|
- @ref partition/4,
|
||||||
|
- @ref partition/5
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
%% @}
|
%% @}
|
||||||
|
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
%% @file apply_macros.yap
|
%% @file apply_macros.yap
|
||||||
%% @author E. Alphonse from code by Joachim Schimpf
|
%% @author E. Alphonse from code by Joachim Schimpf
|
||||||
%% @date 15 June 2002
|
%% @date 15 June 2002
|
||||||
%% @nrief Purpose: Macros to apply a predicate to all elements
|
%% @brief Purpose: Macros to apply a predicate to all elements
|
||||||
% of a list or to all sub-terms of a term.
|
%% of a list or to all sub-terms of a term.
|
||||||
|
|
||||||
:- module(apply_macros, []).
|
:- module(apply_macros, []).
|
||||||
|
|
||||||
|
@ -2,15 +2,8 @@
|
|||||||
* @file library/lists.yap
|
* @file library/lists.yap
|
||||||
* @author Bob Welham, Lawrence Byrd, and R. A. O'Keefe. Contributions from Vitor Santos Costa, Jan Wielemaker and others.
|
* @author Bob Welham, Lawrence Byrd, and R. A. O'Keefe. Contributions from Vitor Santos Costa, Jan Wielemaker and others.
|
||||||
* @date 1999
|
* @date 1999
|
||||||
*
|
|
||||||
* @{
|
|
||||||
*
|
|
||||||
x * @addtogroup library The Prolog Library
|
|
||||||
*
|
|
||||||
* @brief List Manipulation Predicates
|
|
||||||
*
|
|
||||||
*
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
% This file has been included as an YAP library by Vitor Santos Costa, 1999
|
% This file has been included as an YAP library by Vitor Santos Costa, 1999
|
||||||
|
|
||||||
:- module(lists,
|
:- module(lists,
|
||||||
@ -52,15 +45,18 @@ x * @addtogroup library The Prolog Library
|
|||||||
]).
|
]).
|
||||||
|
|
||||||
|
|
||||||
/** @defgroup lists List Manipulation
|
/**
|
||||||
@ingroup library
|
* @{
|
||||||
@{
|
*
|
||||||
|
* @addtogroup library The Prolog Library
|
||||||
The following list manipulation routines are available once included
|
*
|
||||||
with the `use_module(library(lists))` command.
|
* @brief List Manipulation Predicates
|
||||||
|
*
|
||||||
|
* The following list manipulation routines are available once included
|
||||||
|
with the `use_module(library(lists))` command.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/** @pred list_concat(+ _Lists_,? _List_)
|
/** @pred list_concat(+ _Lists_,? _List_)
|
||||||
|
|
||||||
|
|
||||||
|
@ -47,6 +47,7 @@
|
|||||||
/**
|
/**
|
||||||
* @defgroup maplist Map List and Term Operations
|
* @defgroup maplist Map List and Term Operations
|
||||||
* @ingroup library
|
* @ingroup library
|
||||||
|
* @{
|
||||||
*
|
*
|
||||||
* This library provides a set of utilities for applying a predicate to
|
* This library provides a set of utilities for applying a predicate to
|
||||||
* all elements of a list. They allow one to easily perform the most common do-loop constructs in Prolog.
|
* all elements of a list. They allow one to easily perform the most common do-loop constructs in Prolog.
|
||||||
@ -56,20 +57,20 @@
|
|||||||
* by Joachim Schimpf and on code from SWI-Prolog, and it is also inspired by the GHC
|
* by Joachim Schimpf and on code from SWI-Prolog, and it is also inspired by the GHC
|
||||||
* libraries.
|
* libraries.
|
||||||
*
|
*
|
||||||
* The following routines are available once included with the
|
* The routines are available once included with the
|
||||||
* `use_module(library(apply_macros))` command.
|
* `use_module(library(apply_macros))` command.
|
||||||
* @author : Lawrence Byrd
|
|
||||||
* @author Richard A. O'Keefe
|
|
||||||
* @author Joachim Schimpf
|
|
||||||
* @author Jan Wielemaker
|
|
||||||
* @author E. Alphonse
|
|
||||||
* @author Vitor Santos Costa
|
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{.prolog}
|
~~~~
|
||||||
%given
|
|
||||||
|
given the progran:
|
||||||
|
|
||||||
|
~~~~
|
||||||
plus(X,Y,Z) :- Z is X + Y.
|
plus(X,Y,Z) :- Z is X + Y.
|
||||||
|
|
||||||
plus_if_pos(X,Y,Z) :- Y > 0, Z is X + Y.
|
plus_if_pos(X,Y,Z) :- Y > 0, Z is X + Y.
|
||||||
@ -82,7 +83,7 @@ trans(TermIn, TermOut) :-
|
|||||||
TermIn =.. [p|Args],
|
TermIn =.. [p|Args],
|
||||||
TermOut =..[q|Args], !.
|
TermOut =..[q|Args], !.
|
||||||
trans(X,X).
|
trans(X,X).
|
||||||
|
~~~~
|
||||||
%success
|
%success
|
||||||
|
|
||||||
?- maplist(plus(1), [1,2,3,4], [2,3,4,5]).
|
?- maplist(plus(1), [1,2,3,4], [2,3,4,5]).
|
||||||
@ -96,15 +97,13 @@ trans(X,X).
|
|||||||
?- sumlist(plus, [1,2,3,4], 1, 11).
|
?- sumlist(plus, [1,2,3,4], 1, 11).
|
||||||
|
|
||||||
?- maplist(mapargs(number_atom),[c(1),s(1,2,3)],[c('1'),s('1','2','3')]).
|
?- maplist(mapargs(number_atom),[c(1),s(1,2,3)],[c('1'),s('1','2','3')]).
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~
|
||||||
|
|
||||||
@{
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/** @pred maplist(+ _Pred_,+ _List1_,+ _List2_)
|
/** @pred maplist( 2:Pred, + _List1_,+ _List2_)
|
||||||
|
|
||||||
Apply _Pred_ on all successive pairs of elements from
|
Apply _Pred_ on all successive pairs of elements from
|
||||||
_List1_ and
|
_List1_ and
|
||||||
@ -113,7 +112,8 @@ pair. See the example above.
|
|||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
/** @pred maplist(+ _Pred_,+ _List1_,+ _List2_,+ _List4_)
|
|
||||||
|
/** @pred maplist(3:Pred,+ List1,+ List2,+ List4)
|
||||||
|
|
||||||
Apply _Pred_ on all successive triples of elements from _List1_,
|
Apply _Pred_ on all successive triples of elements from _List1_,
|
||||||
_List2_ and _List3_. Fails if _Pred_ can not be applied to a
|
_List2_ and _List3_. Fails if _Pred_ can not be applied to a
|
||||||
@ -167,13 +167,17 @@ triple. See the example above.
|
|||||||
%
|
%
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
/** include(+ _Pred_, + _ListIn_, ? _ListOut_)
|
/**
|
||||||
|
@pred include( 2:Pred, + ListIn, ? ListOut)
|
||||||
|
|
||||||
Same as selectlist/3.
|
Same as selectlist/3.
|
||||||
*/
|
*/
|
||||||
include(G,In,Out) :-
|
include(G,In,Out) :-
|
||||||
selectlist(G, In, Out).
|
selectlist(G, In, Out).
|
||||||
|
|
||||||
/** selectlist(: _Pred_, + _ListIn_, ? _ListOut_))
|
/**
|
||||||
|
@pred selectlist(1:Pred, + ListIn, ? ListOut))
|
||||||
|
|
||||||
Creates _ListOut_ of all list elements of _ListIn_ that pass a given test
|
Creates _ListOut_ of all list elements of _ListIn_ that pass a given test
|
||||||
*/
|
*/
|
||||||
selectlist(_, [], []).
|
selectlist(_, [], []).
|
||||||
@ -185,7 +189,9 @@ selectlist(Pred, [In|ListIn], ListOut) :-
|
|||||||
),
|
),
|
||||||
selectlist(Pred, ListIn, NewListOut).
|
selectlist(Pred, ListIn, NewListOut).
|
||||||
|
|
||||||
/** selectlist(: _Pred_, + _ListIn_, + _ListInAux_, ? _ListOut_, ? _ListOutAux_)
|
/**
|
||||||
|
@pred selectlist( 2:Pred, + ListIn, + ListInAux, ? ListOut, ? ListOutAux)
|
||||||
|
|
||||||
Creates _ListOut_ and _ListOutAux_ of all list elements of _ListIn_ and _ListInAux_ that
|
Creates _ListOut_ and _ListOutAux_ of all list elements of _ListIn_ and _ListInAux_ that
|
||||||
pass the given test _Pred_.
|
pass the given test _Pred_.
|
||||||
*/
|
*/
|
||||||
@ -200,7 +206,8 @@ selectlists(Pred, [In|ListIn], [In1|ListIn1], ListOut, ListOut1) :-
|
|||||||
),
|
),
|
||||||
selectlist(Pred, ListIn, ListIn1, NewListOut, NewListOut1).
|
selectlist(Pred, ListIn, ListIn1, NewListOut, NewListOut1).
|
||||||
|
|
||||||
/** selectlist(: _Pred_, + _ListIn_, + _ListInAux_, ? _ListOut_)
|
/** @pred selectlist( 2:Pred, + ListIn, + ListInAux, ? ListOut)
|
||||||
|
|
||||||
Creates _ListOut_ of all list elements of _ListIn_ that
|
Creates _ListOut_ of all list elements of _ListIn_ that
|
||||||
pass the given test _Pred_ using + _ListInAux_ as an
|
pass the given test _Pred_ using + _ListInAux_ as an
|
||||||
auxiliary element.
|
auxiliary element.
|
||||||
@ -214,7 +221,9 @@ selectlist(Pred, [In|ListIn], [In1|ListIn1], ListOut) :-
|
|||||||
),
|
),
|
||||||
selectlist(Pred, ListIn, ListIn1, NewListOut).
|
selectlist(Pred, ListIn, ListIn1, NewListOut).
|
||||||
|
|
||||||
/** exclude(+ _Goal_, + _List1_, ? _List2_)
|
/**
|
||||||
|
@pred exclude( 2:Goal, + List1, ? List2)
|
||||||
|
|
||||||
Filter elements for which _Goal_ fails. True if _List2_ contains
|
Filter elements for which _Goal_ fails. True if _List2_ contains
|
||||||
those elements _Xi_ of _List1_ for which `call(Goal, Xi)` fails.
|
those elements _Xi_ of _List1_ for which `call(Goal, Xi)` fails.
|
||||||
*/
|
*/
|
||||||
@ -227,11 +236,13 @@ exclude(Pred, [In|ListIn], ListOut) :-
|
|||||||
),
|
),
|
||||||
exclude(Pred, ListIn, NewListOut).
|
exclude(Pred, ListIn, NewListOut).
|
||||||
|
|
||||||
/** partition(+ _Pred_, + _List1_, ? _Included_, ? _Excluded_)
|
/**
|
||||||
Filter elements of _List_ according to _Pred_. True if
|
@pred partition(1:Pred, + List1, ? Included, ? Excluded)
|
||||||
|
|
||||||
|
Filter elements of _List1_ according to _Pred_. True if
|
||||||
_Included_ contains all elements for which `call(Pred, X)`
|
_Included_ contains all elements for which `call(Pred, X)`
|
||||||
succeeds and _Excluded_ contains the remaining elements.
|
succeeds and _Excluded_ contains the remaining elements.
|
||||||
*/
|
*/
|
||||||
partition(_, [], [], []).
|
partition(_, [], [], []).
|
||||||
partition(Pred, [In|ListIn], List1, List2) :-
|
partition(Pred, [In|ListIn], List1, List2) :-
|
||||||
(call(Pred, In) ->
|
(call(Pred, In) ->
|
||||||
@ -243,7 +254,8 @@ partition(Pred, [In|ListIn], List1, List2) :-
|
|||||||
),
|
),
|
||||||
partition(Pred, ListIn, RList1, RList2).
|
partition(Pred, ListIn, RList1, RList2).
|
||||||
|
|
||||||
/** partition(+ _Pred_, + _List1_, ? _Lesser_, ? _Equal_, ? _Greater_)
|
/**
|
||||||
|
@pred partition(2:Pred, + List1, ? Lesser, ? Equal, ? Greater)
|
||||||
|
|
||||||
Filter list according to _Pred_ in three sets. For each element
|
Filter list according to _Pred_ in three sets. For each element
|
||||||
_Xi_ of _List_, its destination is determined by
|
_Xi_ of _List_, its destination is determined by
|
||||||
@ -274,7 +286,9 @@ partition(Pred, [In|ListIn], List1, List2, List3) :-
|
|||||||
),
|
),
|
||||||
partition(Pred, ListIn, RList1, RList2, RList3).
|
partition(Pred, ListIn, RList1, RList2, RList3).
|
||||||
|
|
||||||
/** checklist(: _Pred_, + _List_)
|
/**
|
||||||
|
@pred checklist( 1:Pred, + List)
|
||||||
|
|
||||||
Succeeds if the predicate _Pred_ succeeds on all elements of _List_.
|
Succeeds if the predicate _Pred_ succeeds on all elements of _List_.
|
||||||
*/
|
*/
|
||||||
checklist(_, []).
|
checklist(_, []).
|
||||||
@ -282,7 +296,8 @@ checklist(Pred, [In|ListIn]) :-
|
|||||||
call(Pred, In),
|
call(Pred, In),
|
||||||
checklist(Pred, ListIn).
|
checklist(Pred, ListIn).
|
||||||
|
|
||||||
/** maplist(: _Pred_, ? _ListIn_)
|
/**
|
||||||
|
@pred maplist(: Pred, ? ListIn)
|
||||||
|
|
||||||
Applies predicate _Pred_( _El_ ) to all
|
Applies predicate _Pred_( _El_ ) to all
|
||||||
elements _El_ of _ListIn_.
|
elements _El_ of _ListIn_.
|
||||||
@ -294,7 +309,8 @@ maplist(Pred, [In|ListIn]) :-
|
|||||||
maplist(Pred, ListIn).
|
maplist(Pred, ListIn).
|
||||||
|
|
||||||
|
|
||||||
/** maplist(: _Pred_, ? _L1_, ? _L2_ )
|
/**
|
||||||
|
@pred maplist(: Pred, ? L1, ? L2 )
|
||||||
_L1_ and _L2_ are such that
|
_L1_ and _L2_ are such that
|
||||||
`call( _Pred_, _A1_, _A2_)` holds for every
|
`call( _Pred_, _A1_, _A2_)` holds for every
|
||||||
corresponding element in lists _L1_, _L2_.
|
corresponding element in lists _L1_, _L2_.
|
||||||
@ -308,7 +324,8 @@ maplist(Pred, [In|ListIn], [Out|ListOut]) :-
|
|||||||
call(Pred, In, Out),
|
call(Pred, In, Out),
|
||||||
maplist(Pred, ListIn, ListOut).
|
maplist(Pred, ListIn, ListOut).
|
||||||
|
|
||||||
/** maplist(: _Pred_, ? _L1_, ? _L2_, ? _L3_)
|
/**
|
||||||
|
@pred maplist(: Pred, ? L1, ? L2, ? L3)
|
||||||
_L1_, _L2_, and _L3_ are such that
|
_L1_, _L2_, and _L3_ are such that
|
||||||
`call( _Pred_, _A1_, _A2_, _A3_)` holds for every
|
`call( _Pred_, _A1_, _A2_, _A3_)` holds for every
|
||||||
corresponding element in lists _L1_, _L2_, and _L3_.
|
corresponding element in lists _L1_, _L2_, and _L3_.
|
||||||
@ -319,7 +336,9 @@ maplist(Pred, [A1|L1], [A2|L2], [A3|L3]) :-
|
|||||||
call(Pred, A1, A2, A3),
|
call(Pred, A1, A2, A3),
|
||||||
maplist(Pred, L1, L2, L3).
|
maplist(Pred, L1, L2, L3).
|
||||||
|
|
||||||
/** maplist(: _Pred_, ? _L1_, ? _L2_, ? _L3_, ? _L4_)
|
/**
|
||||||
|
@pred maplist(: Pred, ? L1, ? L2, ? L3, ? L4)
|
||||||
|
|
||||||
_L1_, _L2_, _L3_, and _L4_ are such that
|
_L1_, _L2_, _L3_, and _L4_ are such that
|
||||||
`call( _Pred_, _A1_, _A2_, _A3_, _A4_)` holds
|
`call( _Pred_, _A1_, _A2_, _A3_, _A4_)` holds
|
||||||
for every corresponding element in lists _L1_, _L2_, _L3_, and
|
for every corresponding element in lists _L1_, _L2_, _L3_, and
|
||||||
@ -331,7 +350,7 @@ maplist(Pred, [A1|L1], [A2|L2], [A3|L3], [A4|L4]) :-
|
|||||||
maplist(Pred, L1, L2, L3, L4).
|
maplist(Pred, L1, L2, L3, L4).
|
||||||
|
|
||||||
/**
|
/**
|
||||||
convlist(: _Pred_, + _ListIn_, ? _ListOut_) @anchor convlist3
|
@pred convlist(: Pred, + ListIn, ? ListOut)
|
||||||
|
|
||||||
A combination of maplist/3 and selectlist/3: creates _ListOut_ by
|
A combination of maplist/3 and selectlist/3: creates _ListOut_ by
|
||||||
applying the predicate _Pred_ to all list elements on which
|
applying the predicate _Pred_ to all list elements on which
|
||||||
@ -355,7 +374,7 @@ convlist(Pred, [_|Olds], News) :-
|
|||||||
convlist(Pred, Olds, News).
|
convlist(Pred, Olds, News).
|
||||||
|
|
||||||
/**
|
/**
|
||||||
convlist(: Pred, ? ListIn, ?ExtraList, ? ListOut) @anchor convlist5
|
@pred convlist(: Pred, ? ListIn, ?ExtraList, ? ListOut)
|
||||||
|
|
||||||
A combination of maplist/4 and selectlist/3: _ListIn_, _ListExtra_,
|
A combination of maplist/4 and selectlist/3: _ListIn_, _ListExtra_,
|
||||||
and _ListOut_ are the sublists so that the predicate _Pred_ succeeds.
|
and _ListOut_ are the sublists so that the predicate _Pred_ succeeds.
|
||||||
@ -378,7 +397,7 @@ convlist(Pred, [_|Olds], News) :-
|
|||||||
convlist(Pred, Olds, News).
|
convlist(Pred, Olds, News).
|
||||||
|
|
||||||
/**
|
/**
|
||||||
mapnodes(+ _Pred_, + _TermIn_, ? _TermOut_)
|
@pred mapnodes(+ _Pred_, + _TermIn_, ? _TermOut_)
|
||||||
|
|
||||||
Creates _TermOut_ by applying the predicate _Pred_
|
Creates _TermOut_ by applying the predicate _Pred_
|
||||||
to all sub-terms of _TermIn_ (depth-first and left-to-right order).
|
to all sub-terms of _TermIn_ (depth-first and left-to-right order).
|
||||||
@ -398,7 +417,7 @@ mapnodes_list(Pred, [TermIn|ArgsIn], [TermOut|ArgsOut]) :-
|
|||||||
mapnodes_list(Pred, ArgsIn, ArgsOut).
|
mapnodes_list(Pred, ArgsIn, ArgsOut).
|
||||||
|
|
||||||
/**
|
/**
|
||||||
checknodes(+ _Pred_, + _Term_) @anchor checknodes
|
@pred checknodes(+ _Pred_, + _Term_)
|
||||||
|
|
||||||
Succeeds if the predicate _Pred_ succeeds on all sub-terms of
|
Succeeds if the predicate _Pred_ succeeds on all sub-terms of
|
||||||
_Term_ (depth-first and left-to-right order)
|
_Term_ (depth-first and left-to-right order)
|
||||||
@ -417,7 +436,7 @@ checknodes_list(Pred, [Term|Args]) :-
|
|||||||
checknodes_list(Pred, Args).
|
checknodes_list(Pred, Args).
|
||||||
|
|
||||||
/**
|
/**
|
||||||
sumlist(: _Pred_, + _List_, ? _AccIn_, ? _AccOut_)
|
@pred sumlist(: _Pred_, + _List_, ? _AccIn_, ? _AccOut_)
|
||||||
|
|
||||||
Calls _Pred_ on all elements of List and collects a result in
|
Calls _Pred_ on all elements of List and collects a result in
|
||||||
_Accumulator_. Same as fold/4.
|
_Accumulator_. Same as fold/4.
|
||||||
@ -428,7 +447,7 @@ sumlist(Pred, [H|T], AccIn, AccOut) :-
|
|||||||
sumlist(Pred, T, A1, AccOut).
|
sumlist(Pred, T, A1, AccOut).
|
||||||
|
|
||||||
/**
|
/**
|
||||||
sumnodes(+ _Pred_, + _Term_, ? _AccIn_, ? _AccOut_) @anchor sumnodes
|
@pred sumnodes(+ _Pred_, + _Term_, ? _AccIn_, ? _AccOut_)
|
||||||
|
|
||||||
Calls the predicate _Pred_ on all sub-terms of _Term_ and
|
Calls the predicate _Pred_ on all sub-terms of _Term_ and
|
||||||
collect a result in _Accumulator_ (depth-first and left-to-right
|
collect a result in _Accumulator_ (depth-first and left-to-right
|
||||||
@ -457,11 +476,12 @@ sumnodes_body(Pred, Term, A1, A3, N0, Ar) :-
|
|||||||
* FOLDL *
|
* FOLDL *
|
||||||
*******************************/
|
*******************************/
|
||||||
|
|
||||||
%% foldl(:Goal, +List, +V0, -V, +W0, -WN).
|
%%
|
||||||
|
%% @pred foldl(:Goal, +List, +V0, -V, +W0, -WN).
|
||||||
%
|
%
|
||||||
|
|
||||||
/**
|
/**
|
||||||
foldl(: _Pred_, + _List1_, + _List2_, ? _AccIn_, ? _AccOut_)
|
@pred oldl(: _Pred_, + _List1_, + _List2_, ? _AccIn_, ? _AccOut_)
|
||||||
|
|
||||||
Calls _Pred_ on all elements of `List1` and collects a result in _Accumulator_. Same as
|
Calls _Pred_ on all elements of `List1` and collects a result in _Accumulator_. Same as
|
||||||
foldr/3.
|
foldr/3.
|
||||||
@ -475,7 +495,7 @@ foldl_([H|T], Goal, V0, V) :-
|
|||||||
foldl_(T, Goal, V1, V).
|
foldl_(T, Goal, V1, V).
|
||||||
|
|
||||||
/**
|
/**
|
||||||
foldl(: _Pred_, + _List1_, + _List2_, ? _AccIn_, ? _AccOut_)
|
@pred foldl(: _Pred_, + _List1_, + _List2_, ? _AccIn_, ? _AccOut_)
|
||||||
|
|
||||||
Calls _Pred_ on all elements of _List1_ and
|
Calls _Pred_ on all elements of _List1_ and
|
||||||
_List2_ and collects a result in _Accumulator_. Same as
|
_List2_ and collects a result in _Accumulator_. Same as
|
||||||
@ -522,7 +542,7 @@ foldl_([H1|T1], [H2|T2], [H3|T3], [H4|T4], Goal, V0, V) :-
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
foldl2(: _Pred_, + _List_, ? _X0_, ? _X_, ? _Y0_, ? _Y_)
|
@pred foldl2(: _Pred_, + _List_, ? _X0_, ? _X_, ? _Y0_, ? _Y_)
|
||||||
|
|
||||||
Calls _Pred_ on all elements of `List` and collects a result in
|
Calls _Pred_ on all elements of `List` and collects a result in
|
||||||
_X_ and _Y_.
|
_X_ and _Y_.
|
||||||
@ -537,7 +557,7 @@ foldl2_([H|T], Goal, V0, V, W0, W) :-
|
|||||||
foldl2_(T, Goal, V1, V, W1, W).
|
foldl2_(T, Goal, V1, V, W1, W).
|
||||||
|
|
||||||
/**
|
/**
|
||||||
foldl2(: _Pred_, + _List_, ? _List1_, ? _X0_, ? _X_, ? _Y0_, ? _Y_)
|
v @pred foldl2(: _Pred_, + _List_, ? _List1_, ? _X0_, ? _X_, ? _Y0_, ? _Y_)
|
||||||
|
|
||||||
Calls _Pred_ on all elements of _List_ and _List1_ and collects a result in
|
Calls _Pred_ on all elements of _List_ and _List1_ and collects a result in
|
||||||
_X_ and _Y_.
|
_X_ and _Y_.
|
||||||
@ -551,7 +571,7 @@ foldl2_([H1|T1], [H2|T2], Goal, V0, V, W0, W) :-
|
|||||||
foldl2_(T1, T2, Goal, V1, V, W1, W).
|
foldl2_(T1, T2, Goal, V1, V, W1, W).
|
||||||
|
|
||||||
/**
|
/**
|
||||||
foldl2(: _Pred_, + _List_, ? _List1_, ? _List2_, ? _X0_, ? _X_, ? _Y0_, ? _Y_)
|
@pred foldl2(: _Pred_, + _List_, ? _List1_, ? _List2_, ? _X0_, ? _X_, ? _Y0_, ? _Y_)
|
||||||
|
|
||||||
Calls _Pred_ on all elements of _List_, _List1_ and _List2_ and collects a result in
|
Calls _Pred_ on all elements of _List_, _List1_ and _List2_ and collects a result in
|
||||||
_X_ and _Y_.
|
_X_ and _Y_.
|
||||||
@ -567,7 +587,7 @@ foldl2_([H1|T1], [H2|T2], [H3|T3], Goal, V0, V, W0, W) :-
|
|||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
foldl3(: _Pred_, + _List1_, ? _List2_, ? _X0_, ? _X_, ? _Y0_, ? _Y_, ? _Z0_, ? _Z_)
|
@pred foldl3(: _Pred_, + _List1_, ? _List2_, ? _X0_, ? _X_, ? _Y0_, ? _Y_, ? _Z0_, ? _Z_)
|
||||||
|
|
||||||
|
|
||||||
Calls _Pred_ on all elements of `List` and collects a
|
Calls _Pred_ on all elements of `List` and collects a
|
||||||
@ -582,7 +602,7 @@ foldl3_([H|T], Goal, V0, V, W0, W, X0, X) :-
|
|||||||
fold3_(T, Goal, V1, V, W1, W, X1, X).
|
fold3_(T, Goal, V1, V, W1, W, X1, X).
|
||||||
|
|
||||||
/**
|
/**
|
||||||
foldl4(: _Pred_, + _List1_, ? _List2_, ? _X0_, ? _X_, ? _Y0_, ? _Y_, ? _Z0_, ? _Z_, ? _W0_, ? _W_)
|
@pred foldl4(: _Pred_, + _List1_, ? _List2_, ? _X0_, ? _X_, ? _Y0_, ? _Y_, ? _Z0_, ? _Z_, ? _W0_, ? _W_)
|
||||||
|
|
||||||
|
|
||||||
Calls _Pred_ on all elements of `List` and collects a
|
Calls _Pred_ on all elements of `List` and collects a
|
||||||
@ -618,7 +638,6 @@ foldl4_([H|T], Goal, V0, V, W0, W, X0, X, Y0, Y) :-
|
|||||||
% ==
|
% ==
|
||||||
|
|
||||||
/**
|
/**
|
||||||
scanl(: _Pred_, + _List_, + _V0_, ? _Values_)
|
|
||||||
|
|
||||||
|
|
||||||
Left scan of list. The scanl family of higher order list
|
Left scan of list. The scanl family of higher order list
|
||||||
|
@ -37,16 +37,35 @@
|
|||||||
* @(#)cclass.h 8.3 (Berkeley) 3/20/94
|
* @(#)cclass.h 8.3 (Berkeley) 3/20/94
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file cclass.h
|
||||||
|
*
|
||||||
|
* @brief Regexp character classes.
|
||||||
|
*
|
||||||
|
* @namespace regexp
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
typedef enum {CALNUM, CALPHA, CBLANK, CCNTRL, CDIGIT, CGRAPH,
|
typedef enum {
|
||||||
CLOWER, CPRINT, CPUNCT, CSPACE, CUPPER, CXDIGIT} citype;
|
CALNUM,
|
||||||
|
CALPHA,
|
||||||
|
CBLANK,
|
||||||
|
CCNTRL,
|
||||||
|
CDIGIT,
|
||||||
|
CGRAPH,
|
||||||
|
CLOWER,
|
||||||
|
CPRINT,
|
||||||
|
CPUNCT,
|
||||||
|
CSPACE,
|
||||||
|
CUPPER,
|
||||||
|
CXDIGIT
|
||||||
|
} citype;
|
||||||
|
|
||||||
/* character-class table */
|
/* character-class table */
|
||||||
static struct cclass {
|
static struct cclass {
|
||||||
char *name;
|
char *name;
|
||||||
citype fidx;
|
citype fidx;
|
||||||
} cclasses[] = {
|
} cclasses[] = {{"alnum", CALNUM},
|
||||||
{"alnum", CALNUM},
|
|
||||||
{"alpha", CALPHA},
|
{"alpha", CALPHA},
|
||||||
{"blank", CBLANK},
|
{"blank", CBLANK},
|
||||||
{"cntrl", CCNTRL},
|
{"cntrl", CCNTRL},
|
||||||
@ -58,5 +77,6 @@ static struct cclass {
|
|||||||
{"space", CSPACE},
|
{"space", CSPACE},
|
||||||
{"upper", CUPPER},
|
{"upper", CUPPER},
|
||||||
{"xdigit", CXDIGIT},
|
{"xdigit", CXDIGIT},
|
||||||
{NULL, }
|
{
|
||||||
};
|
NULL,
|
||||||
|
}};
|
||||||
|
@ -37,12 +37,20 @@
|
|||||||
* @(#)cname.h 8.3 (Berkeley) 3/20/94
|
* @(#)cname.h 8.3 (Berkeley) 3/20/94
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file cname.h
|
||||||
|
*
|
||||||
|
* Vharacter names.
|
||||||
|
*
|
||||||
|
* @namespace regexp
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/* character-name table */
|
/* character-name table */
|
||||||
static struct cname {
|
static struct cname {
|
||||||
char *name;
|
char *name;
|
||||||
char code;
|
char code;
|
||||||
} cnames[] = {
|
} cnames[] = {{"NUL", '\0'},
|
||||||
{"NUL", '\0'},
|
|
||||||
{"SOH", '\001'},
|
{"SOH", '\001'},
|
||||||
{"STX", '\002'},
|
{"STX", '\002'},
|
||||||
{"ETX", '\003'},
|
{"ETX", '\003'},
|
||||||
@ -124,7 +132,7 @@ static struct cname {
|
|||||||
{"left-square-bracket", '['},
|
{"left-square-bracket", '['},
|
||||||
{"backslash", '\\'},
|
{"backslash", '\\'},
|
||||||
{"reverse-solidus", '\\'},
|
{"reverse-solidus", '\\'},
|
||||||
{"right-square-bracket",']'},
|
{"right-square-bracket", ']'},
|
||||||
{"circumflex", '^'},
|
{"circumflex", '^'},
|
||||||
{"circumflex-accent", '^'},
|
{"circumflex-accent", '^'},
|
||||||
{"underscore", '_'},
|
{"underscore", '_'},
|
||||||
@ -137,5 +145,4 @@ static struct cname {
|
|||||||
{"right-curly-bracket", '}'},
|
{"right-curly-bracket", '}'},
|
||||||
{"tilde", '~'},
|
{"tilde", '~'},
|
||||||
{"DEL", '\177'},
|
{"DEL", '\177'},
|
||||||
{NULL, 0}
|
{NULL, 0}};
|
||||||
};
|
|
||||||
|
@ -44,6 +44,14 @@
|
|||||||
* of code.
|
* of code.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file engine.c
|
||||||
|
*
|
||||||
|
* regex interpeter.
|
||||||
|
*
|
||||||
|
* @namespace regexp
|
||||||
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
|
|
||||||
#ifndef HAVE_REGEXEC
|
#ifndef HAVE_REGEXEC
|
||||||
|
File diff suppressed because it is too large
Load Diff
@ -41,13 +41,22 @@
|
|||||||
static char sccsid[] = "@(#)regerror.c 8.4 (Berkeley) 3/20/94";
|
static char sccsid[] = "@(#)regerror.c 8.4 (Berkeley) 3/20/94";
|
||||||
#endif /* LIBC_SCCS and not lint */
|
#endif /* LIBC_SCCS and not lint */
|
||||||
|
|
||||||
#include <sys/types.h>
|
/**
|
||||||
#include <stdio.h>
|
* @file regerror.c
|
||||||
#include <string.h>
|
*
|
||||||
#include <limits.h>
|
* @brief Error handling.
|
||||||
#include <stdlib.h>
|
*
|
||||||
|
* @namespace regexp
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include "YapInterface.h"
|
#include "YapInterface.h"
|
||||||
#include "yapregex.h"
|
#include "yapregex.h"
|
||||||
|
#include <limits.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
|
||||||
#include "utils.h"
|
#include "utils.h"
|
||||||
|
|
||||||
@ -57,7 +66,7 @@ extern "C" {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* === regerror.c === */
|
/* === regerror.c === */
|
||||||
static char * regatoi(const regex_t *preg, char *localbuf);
|
static char *regatoi(const regex_t *preg, char *localbuf);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
@ -87,8 +96,7 @@ static struct rerr {
|
|||||||
int code;
|
int code;
|
||||||
char *name;
|
char *name;
|
||||||
char *explain;
|
char *explain;
|
||||||
} rerrs[] = {
|
} rerrs[] = {{REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"},
|
||||||
{REG_NOMATCH, "REG_NOMATCH", "regexec() failed to match"},
|
|
||||||
{REG_BADPAT, "REG_BADPAT", "invalid regular expression"},
|
{REG_BADPAT, "REG_BADPAT", "invalid regular expression"},
|
||||||
{REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"},
|
{REG_ECOLLATE, "REG_ECOLLATE", "invalid collating element"},
|
||||||
{REG_ECTYPE, "REG_ECTYPE", "invalid character class"},
|
{REG_ECTYPE, "REG_ECTYPE", "invalid character class"},
|
||||||
@ -104,20 +112,18 @@ static struct rerr {
|
|||||||
{REG_EMPTY, "REG_EMPTY", "empty (sub)expression"},
|
{REG_EMPTY, "REG_EMPTY", "empty (sub)expression"},
|
||||||
{REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"},
|
{REG_ASSERT, "REG_ASSERT", "\"can't happen\" -- you found a bug"},
|
||||||
{REG_INVARG, "REG_INVARG", "invalid argument to regex routine"},
|
{REG_INVARG, "REG_INVARG", "invalid argument to regex routine"},
|
||||||
{0, "", "*** unknown regexp error code ***"}
|
{0, "", "*** unknown regexp error code ***"}};
|
||||||
};
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
- regerror - the interface to error numbers
|
- regerror - the interface to error numbers
|
||||||
= extern size_t regerror(int, const regex_t *, char *, size_t);
|
= extern size_t regerror(int, const regex_t *, char *, size_t);
|
||||||
*/
|
*/
|
||||||
/* ARGSUSED */
|
/* ARGSUSED */
|
||||||
size_t
|
size_t yap_regerror(int errcode, const regex_t *preg, char *errbuf,
|
||||||
yap_regerror(int errcode,const regex_t *preg,char *errbuf,size_t errbuf_size)
|
size_t errbuf_size) {
|
||||||
{
|
|
||||||
register struct rerr *r;
|
register struct rerr *r;
|
||||||
register size_t len;
|
register size_t len;
|
||||||
register int target = errcode &~ REG_ITOA;
|
register int target = errcode & ~REG_ITOA;
|
||||||
register char *s;
|
register char *s;
|
||||||
char convbuf[50];
|
char convbuf[50];
|
||||||
|
|
||||||
@ -128,9 +134,9 @@ yap_regerror(int errcode,const regex_t *preg,char *errbuf,size_t errbuf_size)
|
|||||||
if (r->code == target)
|
if (r->code == target)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (errcode®_ITOA) {
|
if (errcode & REG_ITOA) {
|
||||||
if (r->code != 0)
|
if (r->code != 0)
|
||||||
(void) strcpy(convbuf, r->name);
|
(void)strcpy(convbuf, r->name);
|
||||||
else
|
else
|
||||||
sprintf(convbuf, "REG_0x%x", target);
|
sprintf(convbuf, "REG_0x%x", target);
|
||||||
assert(strlen(convbuf) < sizeof(convbuf));
|
assert(strlen(convbuf) < sizeof(convbuf));
|
||||||
@ -142,23 +148,21 @@ yap_regerror(int errcode,const regex_t *preg,char *errbuf,size_t errbuf_size)
|
|||||||
len = strlen(s) + 1;
|
len = strlen(s) + 1;
|
||||||
if (errbuf_size > 0) {
|
if (errbuf_size > 0) {
|
||||||
if (errbuf_size > len)
|
if (errbuf_size > len)
|
||||||
(void) strcpy(errbuf, s);
|
(void)strcpy(errbuf, s);
|
||||||
else {
|
else {
|
||||||
(void) strncpy(errbuf, s, errbuf_size-1);
|
(void)strncpy(errbuf, s, errbuf_size - 1);
|
||||||
errbuf[errbuf_size-1] = '\0';
|
errbuf[errbuf_size - 1] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return(len);
|
return (len);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
- regatoi - internal routine to implement REG_ATOI
|
- regatoi - internal routine to implement REG_ATOI
|
||||||
== static char *regatoi(const regex_t *preg, char *localbuf);
|
== static char *regatoi(const regex_t *preg, char *localbuf);
|
||||||
*/
|
*/
|
||||||
static char *
|
static char *regatoi(preg, localbuf) const regex_t *preg;
|
||||||
regatoi(preg, localbuf)
|
|
||||||
const regex_t *preg;
|
|
||||||
char *localbuf;
|
char *localbuf;
|
||||||
{
|
{
|
||||||
register struct rerr *r;
|
register struct rerr *r;
|
||||||
@ -167,8 +171,8 @@ char *localbuf;
|
|||||||
if (strcmp(r->name, preg->re_endp) == 0)
|
if (strcmp(r->name, preg->re_endp) == 0)
|
||||||
break;
|
break;
|
||||||
if (r->code == 0)
|
if (r->code == 0)
|
||||||
return("0");
|
return ("0");
|
||||||
|
|
||||||
sprintf(localbuf, "%d", r->code);
|
sprintf(localbuf, "%d", r->code);
|
||||||
return(localbuf);
|
return (localbuf);
|
||||||
}
|
}
|
||||||
|
@ -1,19 +1,26 @@
|
|||||||
/*************************************************************************
|
/*************************************************************************
|
||||||
* *
|
* *
|
||||||
* YAP Prolog *
|
* YAP Prolog *
|
||||||
* *
|
* *
|
||||||
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
* Yap Prolog was developed at NCCUP - Universidade do Porto *
|
||||||
* *
|
* *
|
||||||
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
||||||
* *
|
* *
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
* *
|
* *
|
||||||
* File: regexp.c *
|
* File: regexp.c * Last rev:
|
||||||
* Last rev: *
|
** mods: * comments: regular expression interpreter *
|
||||||
* mods: *
|
* *
|
||||||
* comments: regular expression interpreter *
|
*************************************************************************/
|
||||||
* *
|
|
||||||
*************************************************************************/
|
/**
|
||||||
|
* @file regexp.c
|
||||||
|
*
|
||||||
|
* A port of the Unix regular expression compiler.
|
||||||
|
*
|
||||||
|
* @namespace regexp
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#if HAVE_SYS_TYPES_H
|
#if HAVE_SYS_TYPES_H
|
||||||
@ -22,69 +29,67 @@
|
|||||||
#include "YapInterface.h"
|
#include "YapInterface.h"
|
||||||
#if HAVE_REGEXEC
|
#if HAVE_REGEXEC
|
||||||
#include "regex.h"
|
#include "regex.h"
|
||||||
#define yap_regcomp(A,B,C) regcomp(A,B,C)
|
#define yap_regcomp(A, B, C) regcomp(A, B, C)
|
||||||
#define yap_regexec(A,B,C,D,E) regexec(A,B,C,D,E)
|
#define yap_regexec(A, B, C, D, E) regexec(A, B, C, D, E)
|
||||||
#define yap_regfree(A) regfree(A)
|
#define yap_regfree(A) regfree(A)
|
||||||
#define yap_regerror(A,B,C,D) regfree(A,B,C,D)
|
#define yap_regerror(A, B, C, D) regfree(A, B, C, D)
|
||||||
#else
|
#else
|
||||||
#include "yapregex.h"
|
#include "yapregex.h"
|
||||||
#endif
|
#endif
|
||||||
/* for the sake of NULL */
|
/* for the sake of NULL */
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
void init_regexp( void );
|
void init_regexp(void);
|
||||||
|
|
||||||
static YAP_Bool check_regexp(void)
|
static YAP_Bool check_regexp(void) {
|
||||||
{
|
unsigned int buflen = (unsigned int)YAP_IntOfTerm(YAP_ARG2) + 1;
|
||||||
unsigned int buflen = (unsigned int)YAP_IntOfTerm(YAP_ARG2)+1;
|
unsigned int sbuflen = (unsigned int)YAP_IntOfTerm(YAP_ARG4) + 1;
|
||||||
unsigned int sbuflen = (unsigned int)YAP_IntOfTerm(YAP_ARG4)+1;
|
|
||||||
char *buf, *sbuf;
|
char *buf, *sbuf;
|
||||||
regex_t reg;
|
regex_t reg;
|
||||||
int out;
|
int out;
|
||||||
int yap_flags = YAP_IntOfTerm(YAP_ARG5);
|
int yap_flags = YAP_IntOfTerm(YAP_ARG5);
|
||||||
int regcomp_flags = REG_NOSUB|REG_EXTENDED;
|
int regcomp_flags = REG_NOSUB | REG_EXTENDED;
|
||||||
|
|
||||||
if ((buf = (char *)YAP_AllocSpaceFromYap(buflen)) == NULL) {
|
if ((buf = (char *)YAP_AllocSpaceFromYap(buflen)) == NULL) {
|
||||||
/* early exit */
|
/* early exit */
|
||||||
return(FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
if (YAP_StringToBuffer(YAP_ARG1,buf,buflen) == FALSE) {
|
if (YAP_StringToBuffer(YAP_ARG1, buf, buflen) == FALSE) {
|
||||||
/* something went wrong, possibly a type checking error */
|
/* something went wrong, possibly a type checking error */
|
||||||
YAP_FreeSpaceFromYap(buf);
|
YAP_FreeSpaceFromYap(buf);
|
||||||
return(FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
if (yap_flags & 1)
|
if (yap_flags & 1)
|
||||||
regcomp_flags |= REG_ICASE;
|
regcomp_flags |= REG_ICASE;
|
||||||
/* cool, now I have my string in the buffer, let's have some fun */
|
/* cool, now I have my string in the buffer, let's have some fun */
|
||||||
if (yap_regcomp(®,buf, regcomp_flags) != 0)
|
if (yap_regcomp(®, buf, regcomp_flags) != 0)
|
||||||
return(FALSE);
|
return (FALSE);
|
||||||
if ((sbuf = (char *)YAP_AllocSpaceFromYap(sbuflen)) == NULL) {
|
if ((sbuf = (char *)YAP_AllocSpaceFromYap(sbuflen)) == NULL) {
|
||||||
/* early exit */
|
/* early exit */
|
||||||
yap_regfree(®);
|
yap_regfree(®);
|
||||||
YAP_FreeSpaceFromYap(buf);
|
YAP_FreeSpaceFromYap(buf);
|
||||||
return(FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
if (YAP_StringToBuffer(YAP_ARG3,sbuf,sbuflen) == FALSE) {
|
if (YAP_StringToBuffer(YAP_ARG3, sbuf, sbuflen) == FALSE) {
|
||||||
/* something went wrong, possibly a type checking error */
|
/* something went wrong, possibly a type checking error */
|
||||||
yap_regfree(®);
|
yap_regfree(®);
|
||||||
YAP_FreeSpaceFromYap(buf);
|
YAP_FreeSpaceFromYap(buf);
|
||||||
YAP_FreeSpaceFromYap(sbuf);
|
YAP_FreeSpaceFromYap(sbuf);
|
||||||
return(FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
out = yap_regexec(®,sbuf,0,NULL,0);
|
out = yap_regexec(®, sbuf, 0, NULL, 0);
|
||||||
yap_regfree(®);
|
yap_regfree(®);
|
||||||
YAP_FreeSpaceFromYap(buf);
|
YAP_FreeSpaceFromYap(buf);
|
||||||
YAP_FreeSpaceFromYap(sbuf);
|
YAP_FreeSpaceFromYap(sbuf);
|
||||||
if (out != 0 && out != REG_NOMATCH) {
|
if (out != 0 && out != REG_NOMATCH) {
|
||||||
return(FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
return(out == 0);
|
return (out == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static YAP_Bool regexp(void)
|
static YAP_Bool regexp(void) {
|
||||||
{
|
unsigned int buflen = (unsigned int)YAP_IntOfTerm(YAP_ARG2) + 1;
|
||||||
unsigned int buflen = (unsigned int)YAP_IntOfTerm(YAP_ARG2)+1;
|
unsigned int sbuflen = (unsigned int)YAP_IntOfTerm(YAP_ARG4) + 1;
|
||||||
unsigned int sbuflen = (unsigned int)YAP_IntOfTerm(YAP_ARG4)+1;
|
|
||||||
char *buf, *sbuf;
|
char *buf, *sbuf;
|
||||||
regex_t reg;
|
regex_t reg;
|
||||||
int out;
|
int out;
|
||||||
@ -94,22 +99,21 @@ static YAP_Bool regexp(void)
|
|||||||
int yap_flags = YAP_IntOfTerm(YAP_ARG5);
|
int yap_flags = YAP_IntOfTerm(YAP_ARG5);
|
||||||
int regcomp_flags = REG_EXTENDED;
|
int regcomp_flags = REG_EXTENDED;
|
||||||
|
|
||||||
|
|
||||||
if ((buf = (char *)YAP_AllocSpaceFromYap(buflen)) == NULL) {
|
if ((buf = (char *)YAP_AllocSpaceFromYap(buflen)) == NULL) {
|
||||||
/* early exit */
|
/* early exit */
|
||||||
return(FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
if (YAP_StringToBuffer(YAP_ARG1,buf,buflen) == FALSE) {
|
if (YAP_StringToBuffer(YAP_ARG1, buf, buflen) == FALSE) {
|
||||||
/* something went wrong, possibly a type checking error */
|
/* something went wrong, possibly a type checking error */
|
||||||
YAP_FreeSpaceFromYap(buf);
|
YAP_FreeSpaceFromYap(buf);
|
||||||
return(FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
if (yap_flags & 1)
|
if (yap_flags & 1)
|
||||||
regcomp_flags |= REG_ICASE;
|
regcomp_flags |= REG_ICASE;
|
||||||
/* cool, now I have my string in the buffer, let's have some fun */
|
/* cool, now I have my string in the buffer, let's have some fun */
|
||||||
if (yap_regcomp(®,buf, regcomp_flags) != 0) {
|
if (yap_regcomp(®, buf, regcomp_flags) != 0) {
|
||||||
YAP_FreeSpaceFromYap(buf);
|
YAP_FreeSpaceFromYap(buf);
|
||||||
return(FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
if (YAP_IsVarTerm(YAP_ARG7)) {
|
if (YAP_IsVarTerm(YAP_ARG7)) {
|
||||||
nmatch = reg.re_nsub;
|
nmatch = reg.re_nsub;
|
||||||
@ -120,25 +124,25 @@ static YAP_Bool regexp(void)
|
|||||||
/* early exit */
|
/* early exit */
|
||||||
yap_regfree(®);
|
yap_regfree(®);
|
||||||
YAP_FreeSpaceFromYap(buf);
|
YAP_FreeSpaceFromYap(buf);
|
||||||
return(FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
if (YAP_StringToBuffer(YAP_ARG3,sbuf,sbuflen) == FALSE) {
|
if (YAP_StringToBuffer(YAP_ARG3, sbuf, sbuflen) == FALSE) {
|
||||||
/* something went wrong, possibly a type checking error */
|
/* something went wrong, possibly a type checking error */
|
||||||
yap_regfree(®);
|
yap_regfree(®);
|
||||||
YAP_FreeSpaceFromYap(buf);
|
YAP_FreeSpaceFromYap(buf);
|
||||||
YAP_FreeSpaceFromYap(sbuf);
|
YAP_FreeSpaceFromYap(sbuf);
|
||||||
return(FALSE);
|
return (FALSE);
|
||||||
}
|
}
|
||||||
pmatch = YAP_AllocSpaceFromYap(sizeof(regmatch_t)*(nmatch));
|
pmatch = YAP_AllocSpaceFromYap(sizeof(regmatch_t) * (nmatch));
|
||||||
out = yap_regexec(®,sbuf,nmatch,pmatch,0);
|
out = yap_regexec(®, sbuf, nmatch, pmatch, 0);
|
||||||
if (out == 0) {
|
if (out == 0) {
|
||||||
/* match succeed, let's fill the match in */
|
/* match succeed, let's fill the match in */
|
||||||
long int i;
|
long int i;
|
||||||
YAP_Term TNil = YAP_MkAtomTerm(YAP_LookupAtom("[]"));
|
YAP_Term TNil = YAP_MkAtomTerm(YAP_LookupAtom("[]"));
|
||||||
YAP_Functor FDiff = YAP_MkFunctor(YAP_LookupAtom("-"),2);
|
YAP_Functor FDiff = YAP_MkFunctor(YAP_LookupAtom("-"), 2);
|
||||||
|
|
||||||
tout = TNil;
|
tout = TNil;
|
||||||
for (i = nmatch-1; i >= 0; --i) {
|
for (i = nmatch - 1; i >= 0; --i) {
|
||||||
int j;
|
int j;
|
||||||
YAP_Term t = TNil;
|
YAP_Term t = TNil;
|
||||||
|
|
||||||
@ -147,30 +151,27 @@ static YAP_Bool regexp(void)
|
|||||||
YAP_Term to[2];
|
YAP_Term to[2];
|
||||||
to[0] = YAP_MkIntTerm(pmatch[i].rm_so);
|
to[0] = YAP_MkIntTerm(pmatch[i].rm_so);
|
||||||
to[1] = YAP_MkIntTerm(pmatch[i].rm_eo);
|
to[1] = YAP_MkIntTerm(pmatch[i].rm_eo);
|
||||||
t = YAP_MkApplTerm(FDiff,2,to);
|
t = YAP_MkApplTerm(FDiff, 2, to);
|
||||||
} else {
|
} else {
|
||||||
for (j = pmatch[i].rm_eo-1; j >= pmatch[i].rm_so; j--) {
|
for (j = pmatch[i].rm_eo - 1; j >= pmatch[i].rm_so; j--) {
|
||||||
t = YAP_MkPairTerm(YAP_MkIntTerm(sbuf[j]),t);
|
t = YAP_MkPairTerm(YAP_MkIntTerm(sbuf[j]), t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
tout = YAP_MkPairTerm(t,tout);
|
tout = YAP_MkPairTerm(t, tout);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
out = !YAP_Unify(tout, YAP_ARG6);
|
out = !YAP_Unify(tout, YAP_ARG6);
|
||||||
}
|
} else if (out != REG_NOMATCH) {
|
||||||
else if (out != REG_NOMATCH) {
|
|
||||||
out = 0;
|
out = 0;
|
||||||
}
|
}
|
||||||
yap_regfree(®);
|
yap_regfree(®);
|
||||||
YAP_FreeSpaceFromYap(buf);
|
YAP_FreeSpaceFromYap(buf);
|
||||||
YAP_FreeSpaceFromYap(sbuf);
|
YAP_FreeSpaceFromYap(sbuf);
|
||||||
YAP_FreeSpaceFromYap(pmatch);
|
YAP_FreeSpaceFromYap(pmatch);
|
||||||
return(out == 0);
|
return (out == 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void init_regexp(void) {
|
||||||
init_regexp(void)
|
|
||||||
{
|
|
||||||
YAP_UserCPredicate("check_regexp", check_regexp, 5);
|
YAP_UserCPredicate("check_regexp", check_regexp, 5);
|
||||||
YAP_UserCPredicate("check_regexp", regexp, 7);
|
YAP_UserCPredicate("check_regexp", regexp, 7);
|
||||||
}
|
}
|
||||||
@ -181,10 +182,8 @@ init_regexp(void)
|
|||||||
|
|
||||||
int WINAPI win_regexp(HANDLE, DWORD, LPVOID);
|
int WINAPI win_regexp(HANDLE, DWORD, LPVOID);
|
||||||
|
|
||||||
int WINAPI win_regexp(HANDLE hinst, DWORD reason, LPVOID reserved)
|
int WINAPI win_regexp(HANDLE hinst, DWORD reason, LPVOID reserved) {
|
||||||
{
|
switch (reason) {
|
||||||
switch (reason)
|
|
||||||
{
|
|
||||||
case DLL_PROCESS_ATTACH:
|
case DLL_PROCESS_ATTACH:
|
||||||
break;
|
break;
|
||||||
case DLL_PROCESS_DETACH:
|
case DLL_PROCESS_DETACH:
|
||||||
|
@ -7,17 +7,12 @@
|
|||||||
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 *
|
||||||
* *
|
* *
|
||||||
**************************************************************************
|
**************************************************************************
|
||||||
* *
|
|
||||||
* File: regexp.yap *
|
|
||||||
* Last rev: 3/22/2000 *
|
|
||||||
* mods: *
|
|
||||||
* comments: Support for Regular Expressions in YAP *
|
|
||||||
* *
|
|
||||||
*************************************************************************/
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file regexp.yap
|
* @file regexp.yap
|
||||||
|
*
|
||||||
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP.lan>
|
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP.lan>
|
||||||
|
* from BSD Unix work.
|
||||||
* @date Wed Nov 18 00:27:52 2015
|
* @date Wed Nov 18 00:27:52 2015
|
||||||
*
|
*
|
||||||
* @brief Support for Regular Expressions in YAP
|
* @brief Support for Regular Expressions in YAP
|
||||||
@ -31,10 +26,13 @@
|
|||||||
regexp/4
|
regexp/4
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
//*
|
||||||
|
* @{
|
||||||
|
*/
|
||||||
|
|
||||||
/** @defgroup regexp Regular Expressions
|
/** @defgroup regexp Regular Expressions
|
||||||
@ingroup library
|
@ingroup library
|
||||||
@{
|
|
||||||
|
|
||||||
This library includes routines to determine whether a regular expression
|
This library includes routines to determine whether a regular expression
|
||||||
matches part or all of a string. The routines can also return which
|
matches part or all of a string. The routines can also return which
|
||||||
@ -79,12 +77,11 @@ in the sequence, make it the first character (following a possible
|
|||||||
`^`). To include a literal `-`, make it the first or last
|
`^`). To include a literal `-`, make it the first or last
|
||||||
character.
|
character.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
@pred regexp(+ _RegExp_,+ _String_,+ _Opts_)
|
@pred regexp(+ _RegExp_,+ _String_,+ _Opts_)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Match regular expression _RegExp_ to input string _String_
|
Match regular expression _RegExp_ to input string _String_
|
||||||
according to options _Opts_. The options may be:
|
according to options _Opts_. The options may be:
|
||||||
|
|
||||||
@ -214,4 +211,3 @@ process_opt(I,_,G) :-
|
|||||||
|
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
|
|
||||||
|
@ -7,16 +7,16 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
:- module(rltree, [
|
:- module(rltree, [
|
||||||
rl_new/2, %% (+Maximum Interval value, -Range-List Id)
|
rl_new/2, % (+Maximum Interval value, -Range-List Id)
|
||||||
rl_free/1, %% (+Range-List Id)
|
rl_free/1, % (+Range-List Id)
|
||||||
rl_size/2, %% (+Range-List Id,-Size in bytes)
|
rl_size/2, % (+Range-List Id,-Size in bytes)
|
||||||
rl_copy/2, %% (+Range-List Id,-New Range-List Id) - copies one rl_tree
|
rl_copy/2, % (+Range-List Id,-New Range-List Id) - copies one rl_tree
|
||||||
rl_set_out/2, %%(+Range-List Id,+Number) - removes Number from the range-list
|
rl_set_out/2, %(+Range-List Id,+Number) - removes Number from the range-list
|
||||||
rl_in/2, %%(+Range-List Id,?Number) - checks if a number is in the rl-tree
|
rl_in/2, %(+Range-List Id,?Number) - checks if a number is in the rl-tree
|
||||||
rl_set_in/2, %%(+Range-List Id,+Number)
|
rl_set_in/2, %(+Range-List Id,+Number)
|
||||||
rl_set_all_in/1,%%(+Range-List Id)
|
rl_set_all_in/1,%(+Range-List Id)
|
||||||
rl_print/1, %%(+Range-List Id)
|
rl_print/1, %(+Range-List Id)
|
||||||
rl_freeze/1 %%(+Range-List Id)
|
rl_freeze/1 %(+Range-List Id)
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
|
||||||
@ -27,7 +27,44 @@
|
|||||||
* @brief Range-List (RL) tree data structure implementation for YAP
|
* @brief Range-List (RL) tree data structure implementation for YAP
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
%% @pred rl_new(+Maximum Interval value, -Range-List Id)
|
||||||
|
%%
|
||||||
|
%% Create a _Range-List Id_, with keyInfoFromExprList frp, 0 to Maximum Interval value
|
||||||
|
|
||||||
|
%% @pred rl_free(+Range-List Id)
|
||||||
|
%%
|
||||||
|
%% close tree _Range-List Id_.
|
||||||
|
|
||||||
|
%% @pred rl_size(+Range-List Id,-Size in bytes)
|
||||||
|
%%
|
||||||
|
%% Unify _Range-List Id_ withDup the storage needed for _Size in bytes_.
|
||||||
|
|
||||||
|
%% @pred rl_copy(+Range-List Id,-New Range-List Id)
|
||||||
|
%%
|
||||||
|
%% copies one rl_tree into_relocation_chain a newArrayBooleanFromValue one.
|
||||||
|
|
||||||
|
%% @pred rl_set_out(+Range-List Id,+Number)
|
||||||
|
%%
|
||||||
|
%% removes Number from the range-list.
|
||||||
|
|
||||||
|
%% @pred rl_in(+Range-List Id,?Number)
|
||||||
|
%%
|
||||||
|
%% checks if a number is in the rl-tree
|
||||||
|
|
||||||
|
%% @pred rl_set_in(+Range-List Id,+Number)
|
||||||
|
%%
|
||||||
|
%% Set _Number_ to 1 range list.
|
||||||
|
|
||||||
|
%% @pred rl_set_all_in(+Range-List Id)
|
||||||
|
%%
|
||||||
|
%% Set all bits to one.
|
||||||
|
|
||||||
|
%% @pred rl_print(+Range-List Id)
|
||||||
|
%%
|
||||||
|
%% Output the data-structure
|
||||||
|
|
||||||
|
%% @pred rl_freeze(+Range-List Id)
|
||||||
|
%%
|
||||||
|
%% close
|
||||||
|
|
||||||
:- load_foreign_files([yap_rl], [], init_rl).
|
:- load_foreign_files([yap_rl], [], init_rl).
|
||||||
|
@ -22,6 +22,15 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||||||
Last rev: $Id: range_list.c,v 1.1 2008-03-26 23:05:22 nunofonseca Exp $
|
Last rev: $Id: range_list.c,v 1.1 2008-03-26 23:05:22 nunofonseca Exp $
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file range_list.c
|
||||||
|
*
|
||||||
|
* @brief Nuno Fonseca range list implementation.
|
||||||
|
*
|
||||||
|
* @namespace rltree
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
#include "range_list.h"
|
#include "range_list.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
/*******************************************************************************************
|
/*******************************************************************************************
|
||||||
|
|
||||||
Copyright (C) 2004,2005,2006,2007,2008 (Nuno A. Fonseca) <nuno.fonseca@gmail.com>
|
Copyright (C) 2004,2005,2006,2007,2008 (Nuno A. Fonseca)
|
||||||
|
<nuno.fonseca@gmail.com>
|
||||||
|
|
||||||
This program is free software; you can redistribute it and/or
|
This program is free software; you can redistribute it and/or
|
||||||
modify it under the terms of the GNU General Public License
|
modify it under the terms of the GNU General Public License
|
||||||
@ -21,6 +22,14 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
|||||||
Last rev: $Id: range_list.h,v 1.1 2008-03-26 23:05:22 nunofonseca Exp $
|
Last rev: $Id: range_list.h,v 1.1 2008-03-26 23:05:22 nunofonseca Exp $
|
||||||
**************************************************************************/
|
**************************************************************************/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @file yap_rl.h
|
||||||
|
*
|
||||||
|
* range list core data-structures.
|
||||||
|
*
|
||||||
|
* @namespace rltree
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Leaf
|
Leaf
|
||||||
@ -42,70 +51,81 @@ Last rev: $Id: range_list.h,v 1.1 2008-03-26 23:05:22 nunofonseca Exp $
|
|||||||
An extra byte is used to keep the number of nodes in the subtrees.
|
An extra byte is used to keep the number of nodes in the subtrees.
|
||||||
*/
|
*/
|
||||||
struct s_node {
|
struct s_node {
|
||||||
//short quadrant;
|
// short quadrant;
|
||||||
unsigned short int quadrant_1: 2; //
|
unsigned short int quadrant_1 : 2; //
|
||||||
unsigned short int quadrant_2: 2;
|
unsigned short int quadrant_2 : 2;
|
||||||
unsigned short int quadrant_3: 2;
|
unsigned short int quadrant_3 : 2;
|
||||||
unsigned short int quadrant_4: 2;
|
unsigned short int quadrant_4 : 2;
|
||||||
unsigned short int num_subnodes: 8;
|
unsigned short int num_subnodes : 8;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef enum { R_TOTALLY_IN_INTERVAL=3, R_PARCIALLY_IN_INTERVAL=2, R_NOT_IN_INTERVAL=0, R_IGNORE=1} QUADRANT_STATUS;
|
typedef enum {
|
||||||
|
R_TOTALLY_IN_INTERVAL = 3,
|
||||||
|
R_PARCIALLY_IN_INTERVAL = 2,
|
||||||
|
R_NOT_IN_INTERVAL = 0,
|
||||||
|
R_IGNORE = 1
|
||||||
|
} QUADRANT_STATUS;
|
||||||
|
|
||||||
#define BRANCH_FACTOR 4 /* factor of division of the range */
|
#define BRANCH_FACTOR 4 /* factor of division of the range */
|
||||||
#define LEAF_SIZE 16 /* how many numbers are represented by a leaf */
|
#define LEAF_SIZE 16 /* how many numbers are represented by a leaf */
|
||||||
|
|
||||||
#define NODE_SIZE sizeof(RL_Node)
|
#define NODE_SIZE sizeof(RL_Node)
|
||||||
|
|
||||||
#define NODE(tree,idx) (RL_Node*)&tree->root[idx]
|
#define NODE(tree, idx) (RL_Node *)&tree->root[idx]
|
||||||
#define ROOT(tree) 0
|
#define ROOT(tree) 0
|
||||||
|
|
||||||
#define IS_ROOT(tree,interval) (tree->range_max<=interval)
|
#define IS_ROOT(tree, interval) (tree->range_max <= interval)
|
||||||
#define ROOT_INTERVAL(tree) (tree->root_i*BRANCH_FACTOR)
|
#define ROOT_INTERVAL(tree) (tree->root_i * BRANCH_FACTOR)
|
||||||
|
|
||||||
#define MIN(a,b) ((a<b)?a:b)
|
#define MIN(a, b) ((a < b) ? a : b)
|
||||||
|
|
||||||
#define ON_BITS(n) (active_bits[n-1]) // mask to check if bits until n are in
|
#define ON_BITS(n) (active_bits[n - 1]) // mask to check if bits until n are in
|
||||||
#define SET_LEAF_IN(max,node,quad_i) (node.leaf=ON_BITS(max-quad_i+1)) // mask to check if bits until n are in
|
#define SET_LEAF_IN(max, node, quad_i) \
|
||||||
|
(node.leaf = \
|
||||||
|
ON_BITS(max - quad_i + 1)) // mask to check if bits until n are in
|
||||||
|
|
||||||
#define LEAF_ALL_IN(leaf) (leaf==65535) // return true if all numbers in leaf are IN (selected)
|
#define LEAF_ALL_IN(leaf) \
|
||||||
#define LEAF_ALL_OUT(leaf) (leaf==0) // return true if all numbers in leaf are OUT
|
(leaf == 65535) // return true if all numbers in leaf are IN (selected)
|
||||||
|
#define LEAF_ALL_OUT(leaf) \
|
||||||
|
(leaf == 0) // return true if all numbers in leaf are OUT
|
||||||
|
|
||||||
#define ALL_OUT(n) memset(n,0,NODE_SIZE) // turn out a node
|
#define ALL_OUT(n) memset(n, 0, NODE_SIZE) // turn out a node
|
||||||
#define ALL_IN(n) memset(n,32767,NODE_SIZE) // turn in a leaf
|
#define ALL_IN(n) memset(n, 32767, NODE_SIZE) // turn in a leaf
|
||||||
#define INODE_CAPACITY (LEAF_SIZE*BRANCH_FACTOR) // minimum range that a inode stores
|
#define INODE_CAPACITY \
|
||||||
|
(LEAF_SIZE * BRANCH_FACTOR) // minimum range that a inode stores
|
||||||
|
|
||||||
// returns the maximum number that a quadrant stores
|
// returns the maximum number that a quadrant stores
|
||||||
#define QUADRANT_MAX_VALUE(node_num,quadrant,quadrant_interval,max) (MIN(node_num+quadrant_interval*quadrant-1,max))
|
#define QUADRANT_MAX_VALUE(node_num, quadrant, quadrant_interval, max) \
|
||||||
|
(MIN(node_num + quadrant_interval * quadrant - 1, max))
|
||||||
|
|
||||||
// returns the interval size for the next level in the tree
|
// returns the interval size for the next level in the tree
|
||||||
#define NEXT_INTERVAL(interval) ((interval<=LEAF_SIZE*BRANCH_FACTOR)?LEAF_SIZE:interval/BRANCH_FACTOR+interval%BRANCH_FACTOR)
|
#define NEXT_INTERVAL(interval) \
|
||||||
|
((interval <= LEAF_SIZE * BRANCH_FACTOR) \
|
||||||
|
? LEAF_SIZE \
|
||||||
|
: interval / BRANCH_FACTOR + interval % BRANCH_FACTOR)
|
||||||
|
|
||||||
|
#define IS_LEAF(interval) \
|
||||||
|
((interval <= LEAF_SIZE) ? 1 : 0) // check if a interval of type Leaf
|
||||||
|
#define LAST_LEVEL_INODE(interval) \
|
||||||
|
((interval <= LEAF_SIZE * BRANCH_FACTOR && interval > LEAF_SIZE) ? 1 : 0)
|
||||||
|
|
||||||
|
#define REALLOC_MEM(tree) (tree->mem_alloc < (tree->size + 1) * NODE_SIZE)
|
||||||
|
#define MEM_SIZE(tree) (tree->size + 2) * NODE_SIZE
|
||||||
|
|
||||||
#define IS_LEAF(interval) ((interval<=LEAF_SIZE)?1:0) // check if a interval of type Leaf
|
#define TREE_SIZE(tree) tree->mem_alloc + sizeof(RL_Tree)
|
||||||
#define LAST_LEVEL_INODE(interval) ((interval<=LEAF_SIZE*BRANCH_FACTOR && interval>LEAF_SIZE)?1:0)
|
|
||||||
|
|
||||||
#define REALLOC_MEM(tree) (tree->mem_alloc < (tree->size+1)*NODE_SIZE)
|
|
||||||
#define MEM_SIZE(tree) (tree->size+2)*NODE_SIZE
|
|
||||||
|
|
||||||
|
|
||||||
#define TREE_SIZE(tree) tree->mem_alloc+sizeof(RL_Tree)
|
|
||||||
|
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
struct s_node i_node;
|
struct s_node i_node;
|
||||||
unsigned short int leaf;
|
unsigned short int leaf;
|
||||||
} RL_Node; /* A node is a internal node (inode) or a leaf depending on their depth in the tree */
|
} RL_Node; /* A node is a internal node (inode) or a leaf depending on their
|
||||||
|
depth in the tree */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Range_List
|
Range_List
|
||||||
Contains the root node, max range size,
|
Contains the root node, max range size,
|
||||||
*/
|
*/
|
||||||
struct rl_struct {
|
struct rl_struct {
|
||||||
RL_Node* root;
|
RL_Node *root;
|
||||||
NUM size; // number of nodes
|
NUM size; // number of nodes
|
||||||
NUM mem_alloc; // memory allocated for *root
|
NUM mem_alloc; // memory allocated for *root
|
||||||
NUM range_max; // maximum value of the interval
|
NUM range_max; // maximum value of the interval
|
||||||
@ -113,10 +133,9 @@ struct rl_struct {
|
|||||||
};
|
};
|
||||||
typedef struct rl_struct RL_Tree;
|
typedef struct rl_struct RL_Tree;
|
||||||
|
|
||||||
|
|
||||||
/* Buffer */
|
/* Buffer */
|
||||||
struct s_buffer {
|
struct s_buffer {
|
||||||
RL_Node* root_node;
|
RL_Node *root_node;
|
||||||
unsigned long size; // memory (in bytes) allocated for root_node
|
unsigned long size; // memory (in bytes) allocated for root_node
|
||||||
};
|
};
|
||||||
typedef struct s_buffer RL_Buffer;
|
typedef struct s_buffer RL_Buffer;
|
||||||
@ -124,43 +143,46 @@ typedef struct s_buffer RL_Buffer;
|
|||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
// Bits operations
|
// Bits operations
|
||||||
#define BITMAP_empty(b) ((b) == 0)
|
#define BITMAP_empty(b) ((b) == 0)
|
||||||
#define BITMAP_member(b,n) (((b) & (1<<(n))) != 0)
|
#define BITMAP_member(b, n) (((b) & (1 << (n))) != 0)
|
||||||
#define BITMAP_alone(b,n) ((b) == (1<<(n)))
|
#define BITMAP_alone(b, n) ((b) == (1 << (n)))
|
||||||
#define BITMAP_subset(b1,b2) (((b1) & (b2)) == b2)
|
#define BITMAP_subset(b1, b2) (((b1) & (b2)) == b2)
|
||||||
#define BITMAP_same(b1,b2) ((b1) == (b2))
|
#define BITMAP_same(b1, b2) ((b1) == (b2))
|
||||||
|
|
||||||
#define BITMAP_on_all(b) ((b) = 255)
|
#define BITMAP_on_all(b) ((b) = 255)
|
||||||
|
|
||||||
#define BITMAP_clear(b) ((b) = 0)
|
#define BITMAP_clear(b) ((b) = 0)
|
||||||
#define BITMAP_and(b1,b2) ((b1) &= (b2))
|
#define BITMAP_and(b1, b2) ((b1) &= (b2))
|
||||||
#define BITMAP_minus(b1,b2) ((b1) &= ~(b2))
|
#define BITMAP_minus(b1, b2) ((b1) &= ~(b2))
|
||||||
#define BITMAP_insert(b,n) ((b) |= (1<<(n)))
|
#define BITMAP_insert(b, n) ((b) |= (1 << (n)))
|
||||||
#define BITMAP_delete(b,n) ((b) &= (~(1<<(n))))
|
#define BITMAP_delete(b, n) ((b) &= (~(1 << (n))))
|
||||||
#define BITMAP_copy(b1,b2) ((b1) = (b2))
|
#define BITMAP_copy(b1, b2) ((b1) = (b2))
|
||||||
#define BITMAP_intersection(b1,b2,b3) ((b1) = ((b2) & (b3)))
|
#define BITMAP_intersection(b1, b2, b3) ((b1) = ((b2) & (b3)))
|
||||||
#define BITMAP_difference(b1,b2,b3) ((b1) = ((b2) & (~(b3))))
|
#define BITMAP_difference(b1, b2, b3) ((b1) = ((b2) & (~(b3))))
|
||||||
|
|
||||||
#
|
#
|
||||||
//----------------------------------------------------------------
|
//----------------------------------------------------------------
|
||||||
typedef enum { TRUE=1, FALSE=0} BOOLEAN;
|
typedef enum { TRUE = 1, FALSE = 0 } BOOLEAN;
|
||||||
typedef enum { IN=1, OUT=0} STATUS;
|
typedef enum { IN = 1, OUT = 0 } STATUS;
|
||||||
|
|
||||||
//
|
//
|
||||||
#define BUFFER_SIZE 1000
|
#define BUFFER_SIZE 1000
|
||||||
/* ********************************************************************************** */
|
/* **********************************************************************************
|
||||||
|
*/
|
||||||
/* API */
|
/* API */
|
||||||
RL_Tree* new_rl(NUM max_size);
|
extern RL_Tree *new_rl(NUM max_size);
|
||||||
RL_Tree* copy_rl(RL_Tree *tree);
|
extern RL_Tree *copy_rl(RL_Tree *tree);
|
||||||
void free_rl(RL_Tree* range);
|
extern void free_rl(RL_Tree *range);
|
||||||
|
|
||||||
void rl_all(RL_Tree* tree,STATUS status);
|
extern void rl_all(RL_Tree *tree, STATUS status);
|
||||||
void display_tree(RL_Tree *tree);
|
extern void display_tree(RL_Tree *tree);
|
||||||
RL_Tree* set_in_rl(RL_Tree* tree,NUM number,STATUS status);
|
extern RL_Tree *set_in_rl(RL_Tree *tree, NUM number, STATUS status);
|
||||||
BOOLEAN in_rl(RL_Tree* range,NUM number);
|
extern BOOLEAN in_rl(RL_Tree *range, NUM number);
|
||||||
BOOLEAN freeze_rl(RL_Tree* tree); /* write operations on the range are finishe */
|
extern BOOLEAN
|
||||||
RL_Tree* intersect_rl(RL_Tree* range1,RL_Tree* range2);
|
freeze_rl(RL_Tree *tree); /* write operations on the range are finishe */
|
||||||
|
extern RL_Tree *intersect_rl(RL_Tree *range1, RL_Tree *range2);
|
||||||
|
|
||||||
NUM rl_next_in_bigger(RL_Tree *tree,NUM min); /* Returns next number in tree bigger than min */
|
extern NUM
|
||||||
|
rl_next_in_bigger(RL_Tree *tree,
|
||||||
#define IS_FREEZED(tree) (tree->mem_alloc!=0)
|
NUM min); /* Returns next number in tree bigger than min */
|
||||||
|
|
||||||
|
#define IS_FREEZED(tree) (tree->mem_alloc != 0)
|
||||||
|
@ -1,6 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* @fileChunkSize library/sockets.yap
|
||||||
|
*/
|
||||||
|
|
||||||
|
:- module(yap_sockets,
|
||||||
|
[ ip_socket/2, % +Domain, -Socket
|
||||||
|
ip_socket/4, % +Domain, +Type, +Protocol, -Socket
|
||||||
|
socket_close/1, % +Socket
|
||||||
|
socket_bind/2, % +Socket, 'AF_INET'(+Host,+Port)
|
||||||
|
tcp_socket_connect/3, % +Socket, 'AF_INET'(+Host,+Port), -Stream
|
||||||
|
socket_listen/2, % +Socket, +Length
|
||||||
|
socket_accept/2, % +Socket, -Stream
|
||||||
|
socket_accept/3, % +Socket, -Client, -Stream
|
||||||
|
% socket_select/5, % +TermsSockets, -NewTermsStreams,
|
||||||
|
% +TimeOut, +Streams, -ReadStreams
|
||||||
|
current_host/1, % ?HostName
|
||||||
|
hostname_address/2 % ?HostName, ?HostAddress
|
||||||
|
]).
|
||||||
|
:- use_module(library(socket)).
|
||||||
|
:- use_module(library(error)).
|
||||||
|
:- use_module(library(apply)).
|
||||||
|
|
||||||
/** uses SWI code
|
/** uses SWI code
|
||||||
|
|
||||||
<module> SICStus compatible socket library
|
@aaddtogroup SICStus compatible socket library
|
||||||
|
|
||||||
@ingroup builtins
|
@ingroup builtins
|
||||||
|
|
||||||
@ -97,23 +119,6 @@ must be of type `SOCK_STREAM` or `SOCK_SEQPACKET`.
|
|||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
:- module(yap_sockets,
|
|
||||||
[ ip_socket/2, % +Domain, -Socket
|
|
||||||
ip_socket/4, % +Domain, +Type, +Protocol, -Socket
|
|
||||||
socket_close/1, % +Socket
|
|
||||||
socket_bind/2, % +Socket, 'AF_INET'(+Host,+Port)
|
|
||||||
tcp_socket_connect/3, % +Socket, 'AF_INET'(+Host,+Port), -Stream
|
|
||||||
socket_listen/2, % +Socket, +Length
|
|
||||||
socket_accept/2, % +Socket, -Stream
|
|
||||||
socket_accept/3, % +Socket, -Client, -Stream
|
|
||||||
% socket_select/5, % +TermsSockets, -NewTermsStreams,
|
|
||||||
% +TimeOut, +Streams, -ReadStreams
|
|
||||||
current_host/1, % ?HostName
|
|
||||||
hostname_address/2 % ?HostName, ?HostAddress
|
|
||||||
]).
|
|
||||||
:- use_module(library(socket)).
|
|
||||||
:- use_module(library(error)).
|
|
||||||
:- use_module(library(apply)).
|
|
||||||
|
|
||||||
%socket(+@var{DOMAIN},+@var{TYPE},+@var{PROTOCOL},-@var{SOCKET})
|
%socket(+@var{DOMAIN},+@var{TYPE},+@var{PROTOCOL},-@var{SOCKET})
|
||||||
|
|
||||||
|
@ -39,7 +39,9 @@ The <tt>time_out/3</tt> command relies on the <tt>alarm/3</tt> built-in to
|
|||||||
implement a call with a maximum time of execution. The command is
|
implement a call with a maximum time of execution. The command is
|
||||||
available with the `use_module(library(timeout))` command.
|
available with the `use_module(library(timeout))` command.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
|
||||||
@pred time_out(+ _Goal_, + _Timeout_, - _Result_)
|
@pred time_out(+ _Goal_, + _Timeout_, - _Result_)
|
||||||
|
|
||||||
|
@ -1,11 +1,10 @@
|
|||||||
/**
|
/**
|
||||||
* @file trees.yap
|
* @file trees.yap
|
||||||
* @author R.A.O'Keefe
|
* @author R.A.O'Keefe, This file has been included as an YAP library by Vitor Santos Costa, 1999
|
||||||
This file has been included as an YAP library by Vitor Santos Costa, 1999
|
*
|
||||||
|
|
||||||
* @date Wed Nov 18 01:30:42 2015
|
* @date Wed Nov 18 01:30:42 2015
|
||||||
*
|
*
|
||||||
* @brief
|
* @brief Updatable binary trees.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -19,12 +18,6 @@ This file has been included as an YAP library by Vitor Santos Costa, 1999
|
|||||||
tree_to_list/2
|
tree_to_list/2
|
||||||
]).
|
]).
|
||||||
|
|
||||||
:- meta_predicate
|
|
||||||
map_tree(2, ?, ?).
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
%
|
%
|
||||||
% File : TREES.PL
|
% File : TREES.PL
|
||||||
@ -34,8 +27,8 @@ This file has been included as an YAP library by Vitor Santos Costa, 1999
|
|||||||
|
|
||||||
|
|
||||||
/** @defgroup trees Updatable Binary Trees
|
/** @defgroup trees Updatable Binary Trees
|
||||||
@ingroup library
|
|
||||||
@{
|
@{
|
||||||
|
@ingroup library
|
||||||
|
|
||||||
The following queue manipulation routines are available once
|
The following queue manipulation routines are available once
|
||||||
included with the `use_module(library(trees))` command.
|
included with the `use_module(library(trees))` command.
|
||||||
@ -58,55 +51,9 @@ These are the routines I meant to describe in DAI-WP-150, but the
|
|||||||
to match the old tree and a pattern to match the new tree.
|
to match the old tree and a pattern to match the new tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/** @pred get_label(+ _Index_, + _Tree_, ? _Label_)
|
:- meta_predicate
|
||||||
|
map_tree(2, ?, ?).
|
||||||
|
|
||||||
|
|
||||||
Treats the tree as an array of _N_ elements and returns the
|
|
||||||
_Index_-th.
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
|
|
||||||
/** @pred list_to_tree(+ _List_, - _Tree_)
|
|
||||||
|
|
||||||
|
|
||||||
Takes a given _List_ of _N_ elements and constructs a binary
|
|
||||||
_Tree_.
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
/** @pred map_tree(+ _Pred_, + _OldTree_, - _NewTree_)
|
|
||||||
|
|
||||||
|
|
||||||
Holds when _OldTree_ and _NewTree_ are binary trees of the same shape
|
|
||||||
and `Pred(Old,New)` is true for corresponding elements of the two trees.
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
/** @pred put_label(+ _Index_, + _OldTree_, + _Label_, - _NewTree_)
|
|
||||||
|
|
||||||
|
|
||||||
constructs a new tree the same shape as the old which moreover has the
|
|
||||||
same elements except that the _Index_-th one is _Label_.
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
/** @pred tree_size(+ _Tree_, - _Size_)
|
|
||||||
|
|
||||||
|
|
||||||
Calculates the number of elements in the _Tree_.
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
/** @pred tree_to_list(+ _Tree_, - _List_)
|
|
||||||
|
|
||||||
|
|
||||||
Is the converse operation to list_to_tree.
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
/*
|
/*
|
||||||
:- mode
|
:- mode
|
||||||
get_label(+, +, ?),
|
get_label(+, +, ?),
|
||||||
@ -124,10 +71,12 @@ Is the converse operation to list_to_tree.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
% get_label(Index, Tree, Label)
|
/** @pred get_label(+ _Index_, + _Tree_, ? _Label_)
|
||||||
% treats the tree as an array of N elements and returns the Index-th.
|
|
||||||
% If Index < 1 or > N it simply fails, there is no such element.
|
|
||||||
|
|
||||||
|
Treats the tree as an array of _N_ elements and returns the
|
||||||
|
_Index_-th.
|
||||||
|
|
||||||
|
*/
|
||||||
get_label(N, Tree, Label) :-
|
get_label(N, Tree, Label) :-
|
||||||
find_node(N, Tree, t(Label,_,_)).
|
find_node(N, Tree, t(Label,_,_)).
|
||||||
|
|
||||||
@ -146,10 +95,14 @@ get_label(N, Tree, Label) :-
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
% list_to_tree(List, Tree)
|
/** @pred list_to_tree(+ _List_, - _Tree_)
|
||||||
% takes a given List of N elements and constructs a binary Tree
|
|
||||||
% where get_label(K, Tree, Lab) <=> Lab is the Kth element of List.
|
|
||||||
|
|
||||||
|
|
||||||
|
Takes a given _List_ of _N_ elements and constructs a binary
|
||||||
|
_Tree_.
|
||||||
|
|
||||||
|
|
||||||
|
*/
|
||||||
list_to_tree(List, Tree) :-
|
list_to_tree(List, Tree) :-
|
||||||
list_to_tree(List, [Tree|Tail], Tail).
|
list_to_tree(List, [Tree|Tail], Tail).
|
||||||
|
|
||||||
@ -166,27 +119,37 @@ list_to_tree(List, Tree) :-
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
% map_tree(Pred, OldTree, NewTree)
|
/** @pred map_tree(+ _Pred_, + _OldTree_, - _NewTree_)
|
||||||
% is true when OldTree and NewTree are binary trees of the same shape
|
|
||||||
% and Pred(Old,New) is true for corresponding elements of the two trees.
|
|
||||||
% In fact this routine is perfectly happy constructing either tree given
|
|
||||||
% the other, I have given it the mode I have for that bogus reason
|
|
||||||
% "efficiency" and because it is normally used this way round. This is
|
|
||||||
% really meant more as an illustration of how to map over trees than as
|
|
||||||
% a tool for everyday use.
|
|
||||||
|
|
||||||
|
|
||||||
|
Holds when _OldTree_ and _NewTree_ are binary trees of the same shape
|
||||||
|
and `Pred(Old,New)` is true for corresponding elements of the two trees.
|
||||||
|
|
||||||
|
is true when OldTree and NewTree are binary trees of the same shape
|
||||||
|
and Pred(Old,New) is true for corresponding elements of the two trees.
|
||||||
|
In fact this routine is perfectly happy constructing either tree given
|
||||||
|
the other, I have given it the mode I have for that bogus reason
|
||||||
|
"efficiency" and because it is normally used this way round. This is
|
||||||
|
really meant more as an illustration of how to map over trees than as
|
||||||
|
a tool for everyday use.
|
||||||
|
*/
|
||||||
map_tree(Pred, t(Old,OLeft,ORight), t(New,NLeft,NRight)) :-
|
map_tree(Pred, t(Old,OLeft,ORight), t(New,NLeft,NRight)) :-
|
||||||
once(call(Pred, Old, New)),
|
once(call(Pred, Old, New)),
|
||||||
map_tree(Pred, OLeft, NLeft),
|
map_tree(Pred, OLeft, NLeft),
|
||||||
map_tree(Pred, ORight, NRight).
|
map_tree(Pred, ORight, NRight).
|
||||||
map_tree(_, t, t).
|
map_tree(_, t, t).
|
||||||
|
|
||||||
% put_label(Index, OldTree, Label, NewTree)
|
/** @pred put_label(+ _Index_, + _OldTree_, + _Label_, - _NewTree_)
|
||||||
% constructs a new tree the same shape as the old which moreover has the
|
|
||||||
% same elements except that the Index-th one is Label. Unlike the
|
|
||||||
% "arrays" of Arrays.Pl, OldTree is not modified and you can hang on to
|
|
||||||
% it as long as you please. Note that O(lg N) new space is needed.
|
|
||||||
|
|
||||||
|
|
||||||
|
constructs a new tree the same shape as the old which moreover has the
|
||||||
|
same elements except that the _Index_-th one is _Label_.
|
||||||
|
|
||||||
|
It constructs a new tree the same shape as the old which moreover has the
|
||||||
|
same elements except that the Index-th one is Label. Unlike the
|
||||||
|
"arrays" of Arrays.Pl, OldTree is not modified and you can hang on to
|
||||||
|
it as long as you please. Note that O(lg N) new space is needed.
|
||||||
|
*/
|
||||||
put_label(N, Old, Label, New) :-
|
put_label(N, Old, Label, New) :-
|
||||||
find_node(N, Old, t(_,Left,Right), New, t(Label,Left,Right)).
|
find_node(N, Old, t(_,Left,Right), New, t(Label,Left,Right)).
|
||||||
|
|
||||||
@ -205,10 +168,12 @@ put_label(N, Old, Label, New) :-
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
% tree_size(Tree, Size)
|
/** @pred tree_size(+ _Tree_, - _Size_)
|
||||||
% calculates the number of elements in the Tree. All trees made by
|
|
||||||
% list_to_tree that are the same size have the same shape.
|
|
||||||
|
|
||||||
|
Calculates the number of elements in the _Tree_.
|
||||||
|
|
||||||
|
All trees made by list_to_tree that are the same size have the same shape.
|
||||||
|
*/
|
||||||
tree_size(Tree, Size) :-
|
tree_size(Tree, Size) :-
|
||||||
tree_size(Tree, 0, Total), !,
|
tree_size(Tree, 0, Total), !,
|
||||||
Size = Total.
|
Size = Total.
|
||||||
@ -222,13 +187,15 @@ tree_size(Tree, Size) :-
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
% tree_to_list(Tree, List)
|
/** @pred tree_to_list(+ _Tree_, - _List_)
|
||||||
% is the converse operation to list_to_tree. Any mapping or checking
|
|
||||||
% operation can be done by converting the tree to a list, mapping or
|
|
||||||
% checking the list, and converting the result, if any, back to a tree.
|
|
||||||
% It is also easier for a human to read a list than a tree, as the
|
|
||||||
% order in the tree goes all over the place.
|
|
||||||
|
|
||||||
|
|
||||||
|
Is the converse operation to list_to_tree.. Any mapping or checking
|
||||||
|
operation can be done by converting the tree to a list, mapping or
|
||||||
|
checking the list, and converting the result, if any, back to a tree.
|
||||||
|
It is also easier for a human to read a list than a tree, as the
|
||||||
|
order in the tree goes all over the place.
|
||||||
|
*/
|
||||||
tree_to_list(Tree, List) :-
|
tree_to_list(Tree, List) :-
|
||||||
tree_to_list([Tree|Tail], Tail, List).
|
tree_to_list([Tree|Tail], Tail, List).
|
||||||
|
|
||||||
@ -243,5 +210,7 @@ tree_to_list(Tree, List) :-
|
|||||||
list(0, []).
|
list(0, []).
|
||||||
list(N, [N|L]) :- M is N-1, list(M, L).
|
list(N, [N|L]) :- M is N-1, list(M, L).
|
||||||
|
|
||||||
%% @}/** @} */
|
%% @}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,14 +3,10 @@
|
|||||||
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP.lan>
|
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP.lan>
|
||||||
* @date 2006
|
* @date 2006
|
||||||
*
|
*
|
||||||
* @brief Directed Graph Processing Utilities.
|
* @brief Undirected Graph Processing Utilities.
|
||||||
*
|
*
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
% File : dgraphs.yap
|
|
||||||
% Author : Vitor Santos Costa
|
|
||||||
% Updated: 2006
|
|
||||||
% Purpose:
|
|
||||||
|
|
||||||
:- module( undgraphs,
|
:- module( undgraphs,
|
||||||
[
|
[
|
||||||
@ -35,33 +31,8 @@ The following graph manipulation routines use the red-black tree graph
|
|||||||
library to implement undirected graphs. Mostly, this is done by having
|
library to implement undirected graphs. Mostly, this is done by having
|
||||||
two directed edges per undirected edge.
|
two directed edges per undirected edge.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@pred undgraph_new(+ _Graph_)
|
|
||||||
|
|
||||||
|
|
||||||
Create a new directed graph. This operation must be performed before
|
|
||||||
trying to use the graph.
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
/** @pred undgraph_complement(+ _Graph_, - _NewGraph_)
|
|
||||||
|
|
||||||
|
|
||||||
Unify _NewGraph_ with the graph complementary to _Graph_.
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
/** @pred undgraph_vertices(+ _Graph_, - _Vertices_)
|
|
||||||
|
|
||||||
|
|
||||||
Unify _Vertices_ with all vertices appearing in graph
|
|
||||||
_Graph_.
|
|
||||||
|
|
||||||
|
|
||||||
*/
|
|
||||||
:- reexport( library(dgraphs),
|
:- reexport( library(dgraphs),
|
||||||
[
|
[
|
||||||
dgraph_new/1 as undgraph_new,
|
dgraph_new/1 as undgraph_new,
|
||||||
@ -106,6 +77,28 @@ Unify _Vertices_ with all vertices appearing in graph
|
|||||||
rb_partial_map/4
|
rb_partial_map/4
|
||||||
]).
|
]).
|
||||||
|
|
||||||
|
/**
|
||||||
|
|
||||||
|
@pred undgraph_new(+ _Graph_)
|
||||||
|
|
||||||
|
Create a new directed graph. This operation must be performed before
|
||||||
|
trying to use the graph.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @pred undgraph_complement(+ _Graph_, - _NewGraph_)
|
||||||
|
|
||||||
|
Unify _NewGraph_ with the graph complementary to _Graph_.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
/** @pred undgraph_vertices(+ _Graph_, - _Vertices_)
|
||||||
|
|
||||||
|
Unify _Vertices_ with all vertices appearing in graph
|
||||||
|
_Graph_.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
undgraph_add_edge(Vs0,V1,V2,Vs2) :-
|
undgraph_add_edge(Vs0,V1,V2,Vs2) :-
|
||||||
dgraphs:dgraph_new_edge(V1,V2,Vs0,Vs1),
|
dgraphs:dgraph_new_edge(V1,V2,Vs0,Vs1),
|
||||||
dgraphs:dgraph_new_edge(V2,V1,Vs1,Vs2).
|
dgraphs:dgraph_new_edge(V2,V1,Vs1,Vs2).
|
||||||
|
@ -19,7 +19,7 @@
|
|||||||
@file boot.yap
|
@file boot.yap
|
||||||
@brief YAP bootstrap
|
@brief YAP bootstrap
|
||||||
|
|
||||||
@addtogroupg YAPControl Control Predicates
|
@addtogroup YAPControl Control Predicates
|
||||||
@ingroup builtins
|
@ingroup builtins
|
||||||
|
|
||||||
@{
|
@{
|
||||||
|
@ -1312,19 +1312,18 @@ account the following observations:
|
|||||||
|
|
||||||
<ul>
|
<ul>
|
||||||
|
|
||||||
<li> The `reexport` declarations must be the first declarations to
|
+ The `reexport` declarations must be the first declarations to
|
||||||
follow the `module` declaration. </li>
|
follow the `module` declaration. </li>
|
||||||
|
|
||||||
<li> It is possible to use both `reexport` and `use_module`, but all
|
+ It is possible to use both `reexport` and `use_module`, but all
|
||||||
predicates reexported are automatically available for use in the
|
predicates reexported are automatically available for use in the
|
||||||
current module. </li>
|
current module.
|
||||||
|
|
||||||
<li> In order to obtain efficient execution, YAP compiles
|
+ In order to obtain efficient execution, YAP compiles
|
||||||
dependencies between re-exported predicates. In practice, this means
|
dependencies between re-exported predicates. In practice, this means
|
||||||
that changing a `reexport` declaration and then *just* recompiling
|
that changing a `reexport` declaration and then *just* recompiling
|
||||||
the file may result in incorrect execution. </li>
|
the file may result in incorrect execution.
|
||||||
|
|
||||||
</ul>
|
|
||||||
*/
|
*/
|
||||||
'$reexport'( TOpts, File, Reexport, Imports, OldF ) :-
|
'$reexport'( TOpts, File, Reexport, Imports, OldF ) :-
|
||||||
( Reexport == false -> true ;
|
( Reexport == false -> true ;
|
||||||
|
@ -146,7 +146,7 @@ must_bind_to_type(Type, X) :-
|
|||||||
; is_not(Type, X)
|
; is_not(Type, X)
|
||||||
).
|
).
|
||||||
|
|
||||||
%% @predicate is_not(+Type, @Term)
|
%% @predicate is_not(+Type, +Term)
|
||||||
%
|
%
|
||||||
% Throws appropriate error. It is _known_ that Term is not of type
|
% Throws appropriate error. It is _known_ that Term is not of type
|
||||||
% Type.
|
% Type.
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
*************************************************************************/
|
*************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file listing.yap
|
* @file pl/listing.yap
|
||||||
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP-2.lan>
|
* @author VITOR SANTOS COSTA <vsc@VITORs-MBP-2.lan>
|
||||||
* @date Thu Oct 19 12:05:19 2017
|
* @date Thu Oct 19 12:05:19 2017
|
||||||
*
|
*
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
/**
|
/**
|
||||||
|
|
||||||
@file newmod.yap
|
@file newmod.yap
|
||||||
@short support for creating a new module.
|
@brief support for creating a new module.
|
||||||
|
|
||||||
@ingroup ModuleBuiltins
|
@ingroup ModuleBuiltins
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
@pred module(+M) is det
|
@pred module(+M) is det
|
||||||
|
|
||||||
set the type-in module
|
set the type-in module
|
||||||
|
|
||||||
|
|
||||||
|
@ -417,7 +417,7 @@ abolish(X0) :-
|
|||||||
'$purge_clauses'(G, M), fail.
|
'$purge_clauses'(G, M), fail.
|
||||||
'$abolishs'(_, _).
|
'$abolishs'(_, _).
|
||||||
|
|
||||||
/** @pred stash_predicate(+ _Pred_) @anchor stash_predicate
|
/** @pred stash_predicate(+ _Pred_)
|
||||||
Make predicate _Pred_ invisible to new code, and to `current_predicate/2`,
|
Make predicate _Pred_ invisible to new code, and to `current_predicate/2`,
|
||||||
`listing`, and friends. New predicates with the same name and
|
`listing`, and friends. New predicates with the same name and
|
||||||
functor can be declared.
|
functor can be declared.
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
*
|
*
|
||||||
* @brief Old Style save
|
* @brief Old Style save
|
||||||
*
|
*
|
||||||
* @addtòxgroup QLY
|
* @addtogroup QLY
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user