bug fices

This commit is contained in:
Vítor Santos Costa
2016-01-03 02:06:09 +00:00
parent 7a7354fb2b
commit 661f33ac7e
133 changed files with 6000 additions and 9890 deletions

28
H/Yap.h
View File

@@ -376,6 +376,17 @@ typedef volatile int lockvar;
#include "Regs.h"
/*************************************************************************************************
OPTYAP includes
*************************************************************************************************/
#if defined(YAPOR) || defined(TABLING)
#include "opt.structs.h"
#include "opt.proto.h"
#include "opt.macros.h"
#endif /* YAPOR || TABLING */
/*************************************************************************************************
variables concerned with Error Handling
*************************************************************************************************/
@@ -733,17 +744,6 @@ typedef struct scratch_block_struct {
/* scanner types */
#include "ScannerTypes.h"
/*************************************************************************************************
OPTYAP includes
*************************************************************************************************/
#if defined(YAPOR) || defined(TABLING)
#include "opt.structs.h"
#include "opt.proto.h"
#include "opt.macros.h"
#endif /* YAPOR || TABLING */
/*************************************************************************************************
GLOBAL and LOCAL variables
*************************************************************************************************/
@@ -771,10 +771,8 @@ extern struct worker_local Yap_local;
#include <stdio.h>
#define YP_FILE FILE
#include "hglobals.h"
#include "dglobals.h"
#include "hlocals.h"
#include "dlocals.h"
#include <YapHeap.h>
/*************************************************************************************************

View File

@@ -25,37 +25,66 @@
// INLINE_ONLY inline EXTERN bool nat( Term inp );
#define SYSTEM_OPTION_0 "attributed_variables,rational_trees]"
#if THREADS
#define SYSTEM_OPTION_1 "threads,"
#endif
#if USE_GMP
#define SYSTEM_OPTION_3 "big_numbers,"
#endif
#if DEPTH_LIMIT
#define SYSTEM_OPTION_4 "depth_limit,"
#endif
#if LOW_LEVEL_TRACE
#define SYSTEM_OPTION_5 "low_level_tracer,"
#endif
#if YAPOR
#define SYSTEM_OPTION_6 "or_parallelism,"
#endif
#if USE_READLINE
#define SYSTEM_OPTION_7 "readline,"
#endif
#if TABLING
#define SYSTEM_OPTION_8 "tabling,"
#endif
static inline bool nat(Term inp) {
if (IsVarTerm(inp)) {
Yap_Error(INSTANTIATION_ERROR, inp, "set_prolog_flag: value must be %s", "bound");
Yap_Error(INSTANTIATION_ERROR, inp, "set_prolog_flag: value must be %s",
"bound");
return false;
}
if (IsIntTerm(inp)) {
Int i = IntOfTerm(inp);
if (i >= 0)
return true;
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, inp, "set_prolog_flag: value must be %s", ">= 0");
Yap_Error(DOMAIN_ERROR_NOT_LESS_THAN_ZERO, inp,
"set_prolog_flag: value must be %s", ">= 0");
return false;
}
Yap_Error(TYPE_ERROR_INTEGER, inp, "set_prolog_flag: value must be %s", "integer");
Yap_Error(TYPE_ERROR_INTEGER, inp, "set_prolog_flag: value must be %s",
"integer");
return false;
}
static inline bool at2n(Term inp) {
Yap_Error(PERMISSION_ERROR_READ_ONLY_FLAG, inp, "set_prolog_flag %s", "flag is read-only");
Yap_Error(PERMISSION_ERROR_READ_ONLY_FLAG, inp, "set_prolog_flag %s",
"flag is read-only");
return false;
}
static inline bool isfloat(Term inp) {
if (IsVarTerm(inp)) {
Yap_Error(INSTANTIATION_ERROR, inp, "set_prolog_flag: value must be %s", "integer");
Yap_Error(INSTANTIATION_ERROR, inp, "set_prolog_flag: value must be %s",
"integer");
return false;
}
if (IsFloatTerm(inp)) {
return true;
}
Yap_Error(TYPE_ERROR_FLOAT, inp, "set_prolog_flag: value must be %s", "floating-point");
Yap_Error(TYPE_ERROR_FLOAT, inp, "set_prolog_flag: value must be %s",
"floating-point");
return false;
}
@@ -63,20 +92,24 @@ INLINE_ONLY inline EXTERN bool ro(Term inp);
INLINE_ONLY inline EXTERN bool ro(Term inp) {
if (IsVarTerm(inp)) {
Yap_Error(INSTANTIATION_ERROR, inp, "set_prolog_flag: value must be %s", "bound");
Yap_Error(INSTANTIATION_ERROR, inp, "set_prolog_flag: value must be %s",
"bound");
return false;
}
Yap_Error(PERMISSION_ERROR_READ_ONLY_FLAG, inp, "set_prolog_flag %s", "flag is read-only");
Yap_Error(PERMISSION_ERROR_READ_ONLY_FLAG, inp, "set_prolog_flag %s",
"flag is read-only");
return false;
}
INLINE_ONLY inline EXTERN bool aro(Term inp) {
if (IsVarTerm(inp)) {
Yap_Error(INSTANTIATION_ERROR, inp, "set_prolog_flag %s", "value must be bound");
Yap_Error(INSTANTIATION_ERROR, inp, "set_prolog_flag %s",
"value must be bound");
return false;
}
Yap_Error(PERMISSION_ERROR_READ_ONLY_FLAG, inp, "set_prolog_flag %s", "flag is read-only");
Yap_Error(PERMISSION_ERROR_READ_ONLY_FLAG, inp, "set_prolog_flag %s",
"flag is read-only");
return false;
}
@@ -87,8 +120,9 @@ static inline bool boolean(Term inp) {
if (inp == TermTrue || inp == TermFalse || inp == TermOn || inp == TermOff)
return true;
if (IsVarTerm(inp)) {
Yap_Error(INSTANTIATION_ERROR, inp, "set_prolog_flag %s", "value must be bound");
;
Yap_Error(INSTANTIATION_ERROR, inp, "set_prolog_flag %s",
"value must be bound");
;
return false;
}
if (IsAtomTerm(inp)) {
@@ -134,7 +168,8 @@ static bool bqs(Term inp) {
static inline bool isatom(Term inp) {
if (IsVarTerm(inp)) {
Yap_Error(INSTANTIATION_ERROR, inp, "set_prolog_flag %s", "value must be bound");
Yap_Error(INSTANTIATION_ERROR, inp, "set_prolog_flag %s",
"value must be bound");
return false;
}
if (IsAtomTerm(inp))
@@ -143,6 +178,8 @@ static inline bool isatom(Term inp) {
return false;
}
static inline bool options(Term inp) { return Yap_IsGroundTerm(inp); }
// INLINE_ONLY inline EXTERN bool ok( Term inp );
static inline bool ok(Term inp) { return true; }

View File

@@ -63,7 +63,7 @@ Prolog exceptions. If enabled:
~~~~
?- X is 2/0.
ERROR!!
ZERO DIVISOR ERROR- X is Exp
ZERO DIVISO]]R ERROR- X is Exp
~~~~
If disabled:
@@ -364,7 +364,7 @@ bound to `off` disable strict mode, and keep the current language
mode. The default for YAP is `off`.
Under strict ISO Prolog mode all calls to non-ISO built-ins generate an
error. Compilation of clauses that would call non-ISO built-ins will
§§also generate errors. Pre-processing for grammar rules is also
also generate errors. Pre-processing for grammar rules is also
disabled. Module expansion is still performed.
Arguably, ISO Prolog does not provide all the functionality required
from a modern Prolog system. Moreover, because most Prolog
@@ -376,10 +376,9 @@ will work the same way in every Prolog and in every platform. We thus
believe this mode is mostly useful when investigating how a program
depends on a Prolog's platform specific features.
*/
YAP_FLAG(SYSTEM_OPTIONS_FLAG, "system_options", false, ro,
"[big_numbers,coroutining,depth_limit,low_level_tracer,rational_"
"trees,threads,tabling]",
*/
YAP_FLAG(SYSTEM_OPTIONS_FLAG, "system_options", false, options,
SYSTEM_OPTIONS,
NULL), /**< `system_options `
This read only flag tells which options were used to compile
@@ -411,8 +410,8 @@ presented. Only the first solution is considered and the goal is not
backtracked into.
*/
YAP_FLAG(TOPLEVEL_PROMPT_FLAG, "toplevel_prompt", true, isatom,
"?- ", mkprompt),
YAP_FLAG(TOPLEVEL_PROMPT_FLAG, "toplevel_prompt", true, isatom, "?- ",
mkprompt),
YAP_FLAG(TTY_CONTROL_FLAG, "tty_control", true, boolean, "true", NULL),
YAP_FLAG(UNIX_FLAG, "unix", false, ro, "true", NULL), /**< `unix`
@@ -445,7 +444,8 @@ follows immediate semantics.
Yap_unknown), /**< `unknown is iso`
Corresponds to calling the unknown/2 built-in. Possible ISO values
are `error`, `fail`, and `warning`. Yap includes the following extensions: `fast_fail` does not invoke any handler.
are `error`, `fail`, and `warning`. Yap includes the following extensions:
`fast_fail` does not invoke any handler.
*/
YAP_FLAG(VARIABLE_NAMES_MAY_END_WITH_QUOTES_FLAG,
"variable_names_may_end_with_quotes", true, boolean, "false",

View File

@@ -67,61 +67,80 @@ static inline void Yap_RebootSlots__(int wid USES_REGS) {
/// @brief declares a new set of slots.
/// Used to tell how many slots we had when we entered a segment of code.
//#define Yap_StartSlots() ( printf("[<<<%s,%s,%d-%ld\n",__FILE__,__FUNCTION__,__LINE__,LOCAL_CurSlot)?Yap_StartSlots__(PASS_REGS1): -1)
//#define Yap_StartSlots() (
// printf("[<<<%s,%s,%d-%ld\n",__FILE__,__FUNCTION__,__LINE__,LOCAL_CurSlot)?Yap_StartSlots__(PASS_REGS1):
//-1)
#define Yap_StartSlots() Yap_StartSlots__(PASS_REGS1)
static inline yhandle_t Yap_StartSlots__(USES_REGS1) {
INLINE_ONLY inline EXTERN yhandle_t Yap_StartSlots__(USES_REGS1);
INLINE_ONLY inline EXTERN yhandle_t Yap_StartSlots__(USES_REGS1) {
// // fprintf(stderr, " StartSlots = %ld", LOCAL_CurSlot);
// fprintf(stderr,"SS %s:%d\n", __FUNCTION__, __LINE__);;
// fprintf(stderr,"SS %s:%d\n", __FILE__, __LINE__);;
if (LOCAL_CurSlot < 0) {
Yap_Error(SYSTEM_ERROR_INTERNAL, 0L, " StartSlots = %ld", LOCAL_CurSlot);
}
return LOCAL_CurSlot;
}
/// @brief reset slots to a well-known position in the stack
//#define Yap_CloseSlots(slot) ( printf("- %s,%s,%d %ld>>>]\n",__FILE__,__FUNCTION__,__LINE__, slot)?Yap_CloseSlots__(slot PASS_REGS):-1)
//#define Yap_CloseSlots(slot) ( printf("- %s,%s,%d
//%ld>>>]\n",__FILE__,__FUNCTION__,__LINE__, slot)?Yap_CloseSlots__(slot
// PASS_REGS):-1)
#define Yap_CloseSlots(slot) Yap_CloseSlots__(slot PASS_REGS)
static inline void Yap_CloseSlots__(yhandle_t slot USES_REGS) {
// fprintf(stderr,"CS %s:%d\n", __FUNCTION__, __LINE__);;
INLINE_ONLY inline EXTERN void Yap_CloseSlots__(yhandle_t slot USES_REGS);
INLINE_ONLY inline EXTERN void Yap_CloseSlots__(yhandle_t slot USES_REGS) {
// fprintf(stderr,"CS %s:%d\n", __FILE__, __LINE__);;
LOCAL_CurSlot = slot;
}
#define Yap_CurrentSlot() Yap_CurrentSlot__(PASS_REGS1)
/// @brief report the current position of the slots, assuming that they occupy
/// the top of the stack.
static inline yhandle_t Yap_CurrentSlot(USES_REGS1) { return LOCAL_CurSlot; }
INLINE_ONLY inline EXTERN yhandle_t Yap_CurrentSlot__(USES_REGS1);
INLINE_ONLY inline EXTERN yhandle_t Yap_CurrentSlot__(USES_REGS1) {
return LOCAL_CurSlot;
}
#define Yap_GetFromSlot(slot) Yap_GetFromSlot__(slot PASS_REGS)
/// @brief read from a slot.
static inline Term Yap_GetFromSlot__(yhandle_t slot USES_REGS) {
// fprintf(stderr,"GS %s:%d\n", __FUNCTION__, __LINE__);;
return (Deref(LOCAL_SlotBase[slot]));
INLINE_ONLY inline EXTERN Term Yap_GetFromSlot__(yhandle_t slot USES_REGS);
INLINE_ONLY inline EXTERN Term Yap_GetFromSlot__(yhandle_t slot USES_REGS) {
// fprintf(stderr, "GS %s:%d\n", __FILE__, __LINE__);
return Deref(LOCAL_SlotBase[slot]);
}
#define Yap_GetDerefedFromSlot( slot ) Yap_GetDerefedFromSlot__(slot PASS_REGS)
/// @brief read from a slot. but does not try to dereference the slot.
static inline Term Yap_GetDerefedFromSlot(yhandle_t slot USES_REGS) {
// fprintf(stderr,"GDS %s:%d\n", __FUNCTION__, __LINE__);
INLINE_ONLY inline EXTERN Term Yap_GetDerefedFromSlot__(yhandle_t slot USES_REGS);
INLINE_ONLY inline EXTERN Term Yap_GetDerefedFromSlot__(yhandle_t slot USES_REGS) {
// fprintf(stderr,"GDS %s:%d\n", __FILE__, __LINE__);
return LOCAL_SlotBase[slot];
}
#define Yap_GetPtrFromSlot( slot ) Yap_GetPtrFromSlot__(slot PASS_REGS)
/// @brief read the object in a slot. but do not try to dereference the slot.
static inline Term Yap_GetPtrFromSlot(yhandle_t slot USES_REGS) {
// fprintf(stderr,"GPS %s:%d\n", __FUNCTION__, __LINE__);
return LOCAL_SlotBase[slot];
INLINE_ONLY inline EXTERN Term *Yap_GetPtrFromSlot__(yhandle_t slot USES_REGS);
INLINE_ONLY inline EXTERN Term *Yap_GetPtrFromSlot__(yhandle_t slot USES_REGS) {
// fprintf(stderr,"GPS %s:%d\n", __FILE__, __LINE__);
return (Term *)LOCAL_SlotBase[slot];
}
#define Yap_AddressFromSlot(slot) Yap_AddressFromSlot__(slot PASS_REGS)
/// @brief get the memory address of a slot
static inline Term *Yap_AddressFromSlot__(yhandle_t slot USES_REGS) {
INLINE_ONLY inline EXTERN CELL *Yap_AddressFromSlot__(yhandle_t slot USES_REGS);
INLINE_ONLY inline EXTERN CELL *Yap_AddressFromSlot__(yhandle_t slot USES_REGS) {
/// @brief get the memory address of a slot
return LOCAL_SlotBase + slot;
}
#define Yap_PutInSlot(slot, t) Yap_PutInSlot__(slot, t PASS_REGS)
/// @brief store term in a slot
static inline void Yap_PutInSlot(yhandle_t slot, Term t USES_REGS) {
// fprintf(stderr,"PS %s:%d\n", __FUNCTION__, __LINE__);
INLINE_ONLY inline EXTERN void Yap_PutInSlot__(yhandle_t slot, Term t USES_REGS);
INLINE_ONLY inline EXTERN void Yap_PutInSlot__(yhandle_t slot, Term t USES_REGS) {
// fprintf(stderr,"PS %s:%d\n", __FILE__, __LINE__);
LOCAL_SlotBase[slot] = t;
}
@@ -129,7 +148,7 @@ static inline void Yap_PutInSlot(yhandle_t slot, Term t USES_REGS) {
#define max(X, Y) (X > Y ? X : Y)
#endif
static inline void ensure_slots(int N USES_REGS) {
INLINE_ONLY inline EXTERN void ensure_slots(int N USES_REGS) {
if (LOCAL_CurSlot + N >= LOCAL_NSlots) {
size_t inc = max(16 * 1024, LOCAL_NSlots / 2); // measured in cells
inc = max(inc, N + 16); // measured in cells
@@ -147,12 +166,15 @@ static inline void ensure_slots(int N USES_REGS) {
}
/// @brief create a new slot with term t
//#define Yap_InitSlot(t) ( printf("+%d %s,%s,%d>>>]\n",1,__FILE__,__FUNCTION__,__LINE__)?Yap_InitSlot__(t PASS_REGS):-1)
// #define Yap_InitSlot(t) \
// (printf("+%d %ld %s,%s,%d>>>]\n", 1, LOCAL_CurSlot,__FILE__, __FUNCTION__, __LINE__) \
// ? Yap_InitSlot__(t PASS_REGS) \
// : -1)
#define Yap_InitSlot(t) Yap_InitSlot__(t PASS_REGS)
static inline yhandle_t Yap_InitSlot__(Term t USES_REGS) {
INLINE_ONLY inline EXTERN yhandle_t Yap_InitSlot__(Term t USES_REGS);
INLINE_ONLY inline EXTERN yhandle_t Yap_InitSlot__(Term t USES_REGS) {
yhandle_t old_slots = LOCAL_CurSlot;
// fprintf(stderr,"IS %s:%d\n", __FUNCTION__, __LINE__);
ensure_slots(1 PASS_REGS);
LOCAL_SlotBase[old_slots] = t;
@@ -160,14 +182,14 @@ static inline yhandle_t Yap_InitSlot__(Term t USES_REGS) {
return old_slots;
}
//#define Yap_NewSlots(n) ( printf("+%d %s,%s,%d>>>]\n",n,__FILE__,__FUNCTION__,__LINE__)?Yap_NewSlots__(n PASS_REGS):-1)
#define Yap_NewSlots(n) Yap_NewSlots__(n PASS_REGS)
//#define Yap_NewSlots(n) ( printf("+%d %ld %s,%s,%d>>>]\n",n,LOCAL_CurSlot,__FILE__,__FUNCTION__,__LINE__) ?Yap_NewSlots__(n PASS_REGS):-1)
#define Yap_NewSlots(n) Yap_NewSlots__(n PASS_REGS)
/// @brief allocate n empty new slots
static inline yhandle_t Yap_NewSlots__(int n USES_REGS) {
INLINE_ONLY inline EXTERN yhandle_t Yap_NewSlots__(int n USES_REGS);
INLINE_ONLY inline EXTERN yhandle_t Yap_NewSlots__(int n USES_REGS) {
yhandle_t old_slots = LOCAL_CurSlot;
int i;
// fprintf(stderr,"NS %s:%d\n", __FUNCTION__, __LINE__);
//fprintf(stderr, "NS %s:%d\n", __FILE__, __LINE__);
ensure_slots(n PASS_REGS);
for (i = 0; i < n; i++) {
@@ -177,15 +199,17 @@ static inline yhandle_t Yap_NewSlots__(int n USES_REGS) {
return old_slots;
}
//#define Yap_InitSlots(n, ts) ( printf("+%d %s,%s,%d>>>]\n",n,__FILE__,__FUNCTION__,__LINE__)?Yap_InitSlots__(n, ts PASS_REGS):-1)
//#define Yap_InitSlots(n, ts) \
// (printf("+%d %d %s,%s,%d>>>]\n", n, LOCAL_CurSlot, __FILE__, __FUNCTION__, __LINE__) \
// ? Yap_InitSlots__(n, ts PASS_REGS) \
// : -1)
#define Yap_InitSlots(n, ts) Yap_InitSlots__(n, ts PASS_REGS)
/// @brief create n new slots with terms ts[]
static inline yhandle_t Yap_InitSlots__(int n, Term *ts USES_REGS) {
INLINE_ONLY inline EXTERN yhandle_t Yap_InitSlots__(int n, Term *ts USES_REGS);
INLINE_ONLY inline EXTERN yhandle_t Yap_InitSlots__(int n, Term *ts USES_REGS) {
yhandle_t old_slots = LOCAL_CurSlot;
int i;
// fprintf(stderr,"1S %s:%d\n", __FUNCTION__, __LINE__);
ensure_slots(n PASS_REGS);
for (i = 0; i < n; i++)
LOCAL_SlotBase[old_slots + i] = ts[i];
@@ -193,19 +217,23 @@ static inline yhandle_t Yap_InitSlots__(int n, Term *ts USES_REGS) {
return old_slots;
}
#define Yap_RecoverSlots(n, ts) Yap_RecoverSlots__(n, ts PASS_REGS)
/// @brief Succeeds if it is to recover the space allocated for $n$ contiguos
/// slots starting at topSlot.
static inline bool Yap_RecoverSlots(int n, yhandle_t topSlot USES_REGS) {
if (topSlot+n < LOCAL_CurSlot)
static inline bool Yap_RecoverSlots__(int n, yhandle_t topSlot USES_REGS);
static inline bool Yap_RecoverSlots__(int n, yhandle_t topSlot USES_REGS) {
if (topSlot + n < LOCAL_CurSlot)
return false;
#ifdef DEBUG
if (n > LOCAL_CurSlot) {
Yap_Error(SYSTEM_ERROR_INTERNAL, 0 , "Inconsistent slot state in Yap_RecoverSlots.", 0);
Yap_Error(SYSTEM_ERROR_INTERNAL, 0,
"Inconsistent slot state in Yap_RecoverSlots.", 0);
return false;
}
#endif
LOCAL_CurSlot -= n;
// fprintf(stderr,"RS %s:%d\n", __FUNCTION__, __LINE__);
//fprintf(stderr,"RS %ld %s:%d\n", LOCAL_CurSlot, __FILE__, __LINE__);
return true;
}

View File

@@ -72,7 +72,7 @@ typedef struct swi_reverse_hash {
//#define GC_MAVARS_HASH_SIZE 512
//
//typedef struct gc_ma_hash_entry_struct {
// typedef struct gc_ma_hash_entry_struct {
// UInt timestmp;
//#ifdef TABLING
// tr_fr_ptr loc;
@@ -85,12 +85,12 @@ typedef struct swi_reverse_hash {
typedef void (*HaltHookFunc)(int, void *);
typedef struct halt_hook {
void * environment;
void *environment;
HaltHookFunc hook;
struct halt_hook *next;
} halt_hook_entry;
int Yap_HaltRegisterHook(HaltHookFunc, void *);
int Yap_HaltRegisterHook(HaltHookFunc, void *);
typedef struct atom_hash_entry {
#if defined(YAPOR) || defined(THREADS)
@@ -99,7 +99,7 @@ typedef struct atom_hash_entry {
Atom Entry;
} AtomHashEntry;
//typedef struct scratch_block_struct {
// typedef struct scratch_block_struct {
// char *ptr;
// UInt sz, msz;
//} scratch_block;
@@ -112,7 +112,7 @@ typedef struct record_list {
/* SWI Emulation */
#define SWI_BUF_SIZE 512
#define SWI_TMP_BUF_SIZE 2*SWI_BUF_SIZE
#define SWI_TMP_BUF_SIZE 2 * SWI_BUF_SIZE
#define SWI_BUF_RINGS 16
/* ricardo
@@ -151,21 +151,51 @@ typedef struct thandle {
} yap_thandle;
#endif */
//typedef int (*Agc_hook)(Atom);
// typedef int (*Agc_hook)(Atom);
/*******************
this is the data base: everything here should be possible to restore
********************/
#if YAPOR
typedef struct various_codes {
/* memory allocation and management */
special_functors funcs;
#include "hstruct.h"
#include "heap/hstruct.h"
} all_heap_codes;
//#include "hglobals.h"
//#include "hlocals.h"
#include "heap/hglobals.h"
#include "heap/dhstruct.h"
#include "heap/dglobals.h"
#else
typedef struct various_codes {
/* memory allocation and management */
special_functors funcs;
#include "tatoms.h"
} all_heap_codes;
#if __INIT_C__
#define EXTERNAL
#else
#define EXTERNAL extern
#endif
#include "heap/h0struct.h"
#include "heap/h0globals.h"
#endif
#include "heap/hlocals.h"
#include "heap/dlocals.h"
/* ricardo
#if defined(YAPOR_COPY) || defined(YAPOR_COW) || defined(YAPOR_SBA)
@@ -191,74 +221,56 @@ extern struct worker_local Yap_local;
#ifdef USE_SYSTEM_MALLOC
extern struct various_codes *Yap_heap_regs;
#else
#define Yap_heap_regs ((all_heap_codes *)HEAP_INIT_BASE)
#define Yap_heap_regs ((all_heap_codes *)HEAP_INIT_BASE)
#endif
#include "dhstruct.h"
//#include "dglobals.h"
//#include "dlocals.h"
/**
* gc-P: how to start-up the grbage collector in C-code
*/
static inline
yamop *
gc_P(yamop *p, yamop *cp)
{
return (p->opc == EXECUTE_CPRED_OPCODE ? cp : p);
static inline yamop *gc_P(yamop *p, yamop *cp) {
return (p && p->opc == EXECUTE_CPRED_OPCODE ? cp : p);
}
/**
Yap_CurrentModule: access the current module for looking
up predicates
*/
#define Yap_CurrentModule() Yap_CurrentModule__ (PASS_REGS1)
#define Yap_CurrentModule() Yap_CurrentModule__(PASS_REGS1)
INLINE_ONLY inline EXTERN Term Yap_CurrentModule__ (USES_REGS1) ;
INLINE_ONLY inline EXTERN Term Yap_CurrentModule__(USES_REGS1);
INLINE_ONLY inline EXTERN Term
Yap_CurrentModule__ (USES_REGS1)
{
if (CurrentModule) return CurrentModule;
INLINE_ONLY inline EXTERN Term Yap_CurrentModule__(USES_REGS1) {
if (CurrentModule)
return CurrentModule;
return TermProlog;
}
/*******************
these are the global variables: they need not be restored...
********************/
#define UPDATE_MODE_IMMEDIATE 0
#define UPDATE_MODE_LOGICAL 1
#define UPDATE_MODE_LOGICAL_ASSERT 2
#define UPDATE_MODE_IMMEDIATE 0
#define UPDATE_MODE_LOGICAL 1
#define UPDATE_MODE_LOGICAL_ASSERT 2
/* initially allow for files with up to 1024 predicates. This number
is extended whenever needed */
#define InitialConsultCapacity 1024
#define InitialConsultCapacity 1024
#if (defined(USE_SYSTEM_MALLOC) && HAVE_MALLINFO)||USE_DL_MALLOC
#if (defined(USE_SYSTEM_MALLOC) && HAVE_MALLINFO) || USE_DL_MALLOC
UInt Yap_givemallinfo(void);
#endif
ADDR Yap_ExpandPreAllocCodeSpace(UInt, void *, int);
ADDR Yap_ExpandPreAllocCodeSpace(UInt, void *, int);
#define Yap_ReleasePreAllocCodeSpace(x)
ADDR Yap_InitPreAllocCodeSpace(int);
ADDR Yap_InitPreAllocCodeSpace(int);
#include "inline-only.h"
INLINE_ONLY EXTERN inline ADDR
Yap_PreAllocCodeSpace(void);
INLINE_ONLY EXTERN inline ADDR Yap_PreAllocCodeSpace(void);
INLINE_ONLY EXTERN inline ADDR
Yap_PreAllocCodeSpace(void)
{
INLINE_ONLY EXTERN inline ADDR Yap_PreAllocCodeSpace(void) {
CACHE_REGS
return AuxBase;
}

View File

@@ -22,7 +22,7 @@
YAP_FLAG( AUTOLOAD_FLAG, "autoload", true, boolean, "false" , NULL ),
YAP_FLAG( BREAK_LEVEL_FLAG, "break_level", true, nat, "0" , NULL ),
YAP_FLAG( ENCODING_FLAG, "encoding", true, isatom, "text" , getenc ),
YAP_FLAG( ENCODING_FLAG, "encoding", true, isatom, "utf-8" , getenc ),
YAP_FLAG( FILEERRORS_FLAG, "fileerrors", true, boolean, "true" , NULL ), /**< `fileerrors`
If `on` `fileerrors` is `on`, if `off` (default)

View File

@@ -56,7 +56,7 @@ typedef enum {
extern char_kind_t Yap_chtype0[];
#define Yap_chtype (Yap_chtype0+1)
#define Yap_chtype (Yap_chtype0 + 1)
char_kind_t Yap_wide_chtype(int ch);
@@ -483,8 +483,7 @@ static inline Term Yap_AtomToNumber(Term t0 USES_REGS) {
inp.val.t = t0;
inp.type = YAP_STRING_ATOM;
out.val.uc = NULL;
out.type =
YAP_STRING_INT | YAP_STRING_FLOAT | YAP_STRING_BIG;
out.type = YAP_STRING_INT | YAP_STRING_FLOAT | YAP_STRING_BIG;
if (!Yap_CVT_Text(&inp, &out PASS_REGS))
return 0L;
return out.val.t;
@@ -1213,11 +1212,9 @@ static inline Term Yap_StringToNumber(Term t0 USES_REGS) {
}
static inline Term Yap_UTF8ToString(const char *s USES_REGS) {
return MkStringTerm( s );
return MkStringTerm(s);
}
static inline Term Yap_WCharsToListOfCodes(const wchar_t *s USES_REGS) {
seq_tv_t inp, out;
inp.val.w0 = s;

View File

@@ -124,7 +124,7 @@ Atom Yap_ConsultingFile(USES_REGS1);
struct pred_entry *Yap_PredForChoicePt(choiceptr bptr, op_numbers *op);
void Yap_InitCdMgr(void);
struct pred_entry *Yap_PredFromClause(Term t USES_REGS);
bool Yap_discontiguous(struct pred_entry *ap USES_REGS);
bool Yap_discontiguous(struct pred_entry *ap, Term mode USES_REGS);
bool Yap_multiple(struct pred_entry *ap, int mode USES_REGS);
void Yap_init_consult(int, const char *);
void Yap_end_consult(void);
@@ -136,6 +136,7 @@ void Yap_AssertzClause(struct pred_entry *, yamop *);
void Yap_HidePred(struct pred_entry *pe);
int Yap_SetNoTrace(char *name, UInt arity, Term tmod);
bool Yap_unknown(Term tflagvalue);
struct pred_entry *Yap_MkLogPred(struct pred_entry *pe);
/* cmppreds.c */
Int Yap_compare_terms(Term, Term);
@@ -319,7 +320,7 @@ void Yap_InitModulesC(void);
struct mod_entry *Yap_GetModuleEntry(Term tmod);
Term Yap_GetModuleFromEntry(struct mod_entry *me);
bool Yap_CharacterEscapes(Term mt);
bool Yap_constPred( struct pred_entry *pt);
bool Yap_constPred(struct pred_entry *pt);
bool Yap_isSystemModule(Term mod);
#if HAVE_MPI

1971
H/Yatom.h

File diff suppressed because it is too large Load Diff

View File

@@ -26,127 +26,126 @@
typedef union CONSULT_OBJ {
const unsigned char *filename;
int mode;
Prop p;
Prop p;
UInt c;
} consult_obj;
/* Either we are assembling clauses or indexing code */
#define ASSEMBLING_CLAUSE 0
#define ASSEMBLING_INDEX 1
#define ASSEMBLING_EINDEX 2
#define ASSEMBLING_CLAUSE 0
#define ASSEMBLING_INDEX 1
#define ASSEMBLING_EINDEX 2
#define NextDynamicClause(X) (((yamop *)X)->y_u.Otapl.d)
#define NextDynamicClause(X) (((yamop *)X)->y_u.Otapl.d)
#define PredFirstClause 0
#define PredMiddleClause 1
#define PredLastClause 2
#define PredFirstClause 0
#define PredMiddleClause 1
#define PredLastClause 2
typedef struct logic_upd_index {
CELL ClFlags;
UInt ClRefCount;
CELL ClFlags;
UInt ClRefCount;
#if defined(YAPOR) || defined(THREADS)
/* A lock for manipulating the clause */
// lockvar ClLock;
/* A lock for manipulating the clause */
// lockvar ClLock;
#endif
UInt ClSize;
UInt ClSize;
struct logic_upd_index *ParentIndex;
struct logic_upd_index *SiblingIndex;
struct logic_upd_index *PrevSiblingIndex;
struct logic_upd_index *ChildIndex;
/* The instructions, at least one of the form sl */
PredEntry *ClPred;
yamop ClCode[MIN_ARRAY];
yamop ClCode[MIN_ARRAY];
} LogUpdIndex;
/* The ordering of the first 3 fields should be compatible with dbrefs */
typedef struct logic_upd_clause {
Functor Id; /* allow pointers to this struct to id */
/* as dbref */
Functor Id; /* allow pointers to this struct to id */
/* as dbref */
/* A set of flags describing info on the clause */
/* A set of flags describing info on the clause */
CELL ClFlags;
CELL ClFlags;
#if defined(YAPOR) || defined(THREADS)
/* A lock for manipulating the clause */
// lockvar ClLock;
/* A lock for manipulating the clause */
// lockvar ClLock;
#endif
UInt ClSize;
UInt ClSize;
/* extra clause information for logical update indices and facts */
/* indices that may still backtrack to this clause */
UInt ClRefCount;
UInt ClRefCount;
/* data for clauses with environments */
yamop *ClExt;
yamop *ClExt;
union {
DBTerm *ClSource;
Int ClLine;
DBTerm *ClSource;
Int ClLine;
} lusl;
/* doubly linked list of clauses */
struct logic_upd_clause *ClPrev, *ClNext;
struct logic_upd_clause *ClPrev, *ClNext;
/* parent pointer */
PredEntry *ClPred;
UInt ClTimeStart, ClTimeEnd;
PredEntry *ClPred;
UInt ClTimeStart, ClTimeEnd;
/* The instructions, at least one of the form sl */
yamop ClCode[MIN_ARRAY];
yamop ClCode[MIN_ARRAY];
} LogUpdClause;
#include "inline-only.h"
INLINE_ONLY inline EXTERN int VALID_TIMESTAMP(UInt, struct logic_upd_clause *);
INLINE_ONLY inline EXTERN int
VALID_TIMESTAMP(UInt timestamp, struct logic_upd_clause *cl)
{
INLINE_ONLY inline EXTERN int VALID_TIMESTAMP(UInt timestamp,
struct logic_upd_clause *cl) {
return IN_BETWEEN(cl->ClTimeStart, timestamp, cl->ClTimeEnd);
}
typedef struct dynamic_clause {
/* A set of flags describing info on the clause */
CELL ClFlags;
CELL ClFlags;
#if defined(YAPOR) || defined(THREADS)
/* A lock for manipulating the clause */
lockvar ClLock;
lockvar ClLock;
#endif
UInt ClSize;
Int ClLine;
UInt ClRefCount;
yamop *ClPrevious; /* immediate update clause */
UInt ClSize;
Int ClLine;
UInt ClRefCount;
yamop *ClPrevious; /* immediate update clause */
/* The instructions, at least one of the form sl */
yamop ClCode[MIN_ARRAY];
yamop ClCode[MIN_ARRAY];
} DynamicClause;
typedef struct static_index {
/* A set of flags describing info on the clause */
CELL ClFlags;
UInt ClSize;
CELL ClFlags;
UInt ClSize;
struct static_index *SiblingIndex;
struct static_index *ChildIndex;
/* The instructions, at least one of the form sl */
PredEntry *ClPred;
yamop ClCode[MIN_ARRAY];
yamop ClCode[MIN_ARRAY];
} StaticIndex;
typedef struct static_clause {
/* A set of flags describing info on the clause */
CELL ClFlags;
UInt ClSize;
CELL ClFlags;
UInt ClSize;
union {
DBTerm *ClSource;
Int ClLine;
DBTerm *ClSource;
Int ClLine;
} usc;
struct static_clause *ClNext;
struct static_clause *ClNext;
/* The instructions, at least one of the form sl */
yamop ClCode[MIN_ARRAY];
yamop ClCode[MIN_ARRAY];
} StaticClause;
typedef struct static_mega_clause {
/* A set of flags describing info on the clause */
CELL ClFlags;
UInt ClSize;
PredEntry *ClPred;
UInt ClItemSize;
Int ClLine;
struct static_mega_clause *ClNext;
CELL ClFlags;
UInt ClSize;
PredEntry *ClPred;
UInt ClItemSize;
Int ClLine;
struct static_mega_clause *ClNext;
/* The instructions, at least one of the form sl */
yamop ClCode[MIN_ARRAY];
yamop ClCode[MIN_ARRAY];
} MegaClause;
typedef union clause_obj {
@@ -191,43 +190,43 @@ typedef struct index_t {
UInt udi_arg;
} Index_t;
INLINE_ONLY EXTERN inline BITS32 EXO_ADDRESS_TO_OFFSET(struct index_t *it, CELL *ptr);
INLINE_ONLY EXTERN inline BITS32 EXO_ADDRESS_TO_OFFSET(struct index_t *it,
CELL *ptr);
INLINE_ONLY EXTERN inline BITS32
EXO_ADDRESS_TO_OFFSET(struct index_t *it, CELL* ptr)
{
return (ptr-it->cls)/it->arity+1;
INLINE_ONLY EXTERN inline BITS32 EXO_ADDRESS_TO_OFFSET(struct index_t *it,
CELL *ptr) {
return (ptr - it->cls) / it->arity + 1;
}
INLINE_ONLY EXTERN inline CELL *EXO_OFFSET_TO_ADDRESS(struct index_t *it, BITS32 off);
INLINE_ONLY EXTERN inline CELL *EXO_OFFSET_TO_ADDRESS(struct index_t *it,
BITS32 off);
INLINE_ONLY EXTERN inline CELL *
EXO_OFFSET_TO_ADDRESS(struct index_t *it, BITS32 off)
{
INLINE_ONLY EXTERN inline CELL *EXO_OFFSET_TO_ADDRESS(struct index_t *it,
BITS32 off) {
if (off == 0L)
return (CELL *)NULL;
return (it->cls)+(off-1)*it->arity;
return (it->cls) + (off - 1) * it->arity;
}
INLINE_ONLY EXTERN inline BITS32 ADDRESS_TO_LINK(struct index_t *it, BITS32 *ptr);
INLINE_ONLY EXTERN inline BITS32 ADDRESS_TO_LINK(struct index_t *it,
BITS32 *ptr);
INLINE_ONLY EXTERN inline BITS32
ADDRESS_TO_LINK(struct index_t *it, BITS32* ptr)
{
return ptr-it->links;
INLINE_ONLY EXTERN inline BITS32 ADDRESS_TO_LINK(struct index_t *it,
BITS32 *ptr) {
return ptr - it->links;
}
INLINE_ONLY EXTERN inline BITS32 *LINK_TO_ADDRESS(struct index_t *it, BITS32 off);
INLINE_ONLY EXTERN inline BITS32 *LINK_TO_ADDRESS(struct index_t *it,
BITS32 off);
INLINE_ONLY EXTERN inline BITS32 *
LINK_TO_ADDRESS(struct index_t *it, BITS32 off)
{
return it->links+off;
INLINE_ONLY EXTERN inline BITS32 *LINK_TO_ADDRESS(struct index_t *it,
BITS32 off) {
return it->links + off;
}
typedef void (*CRefitExoIndex)(struct index_t **ip, UInt b[] USES_REGS);
typedef yamop * (*CEnterExoIndex)(struct index_t *it USES_REGS);
typedef int (*CRetryExoIndex)(struct index_t *it USES_REGS);
typedef yamop *(*CEnterExoIndex)(struct index_t *it USES_REGS);
typedef int (*CRetryExoIndex)(struct index_t *it USES_REGS);
typedef struct dbterm_list {
/* a list of dbterms associated with a clause */
@@ -237,72 +236,81 @@ typedef struct dbterm_list {
struct dbterm_list *next_dbl;
} DBTermList;
#define ClauseCodeToDynamicClause(p) ((DynamicClause *)((CODEADDR)(p)-(CELL)(((DynamicClause *)NULL)->ClCode)))
#define ClauseCodeToStaticClause(p) ((StaticClause *)((CODEADDR)(p)-(CELL)(((StaticClause *)NULL)->ClCode)))
#define ClauseCodeToLogUpdClause(p) ((LogUpdClause *)((CODEADDR)(p)-(CELL)(((LogUpdClause *)NULL)->ClCode)))
#define ClauseCodeToMegaClause(p) ((MegaClause *)((CODEADDR)(p)-(CELL)(((MegaClause *)NULL)->ClCode)))
#define ClauseCodeToLogUpdIndex(p) ((LogUpdIndex *)((CODEADDR)(p)-(CELL)(((LogUpdIndex *)NULL)->ClCode)))
#define ClauseCodeToStaticIndex(p) ((StaticIndex *)((CODEADDR)(p)-(CELL)(((StaticIndex *)NULL)->ClCode)))
#define ClauseCodeToDynamicClause(p) \
((DynamicClause *)((CODEADDR)(p) - (CELL)(((DynamicClause *)NULL)->ClCode)))
#define ClauseCodeToStaticClause(p) \
((StaticClause *)((CODEADDR)(p) - (CELL)(((StaticClause *)NULL)->ClCode)))
#define ClauseCodeToLogUpdClause(p) \
((LogUpdClause *)((CODEADDR)(p) - (CELL)(((LogUpdClause *)NULL)->ClCode)))
#define ClauseCodeToMegaClause(p) \
((MegaClause *)((CODEADDR)(p) - (CELL)(((MegaClause *)NULL)->ClCode)))
#define ClauseCodeToLogUpdIndex(p) \
((LogUpdIndex *)((CODEADDR)(p) - (CELL)(((LogUpdIndex *)NULL)->ClCode)))
#define ClauseCodeToStaticIndex(p) \
((StaticIndex *)((CODEADDR)(p) - (CELL)(((StaticIndex *)NULL)->ClCode)))
#define ClauseFlagsToDynamicClause(p) ((DynamicClause *)(p))
#define ClauseFlagsToLogUpdClause(p) ((LogUpdClause *)((CODEADDR)(p)-(CELL)(&(((LogUpdClause *)NULL)->ClFlags))))
#define ClauseFlagsToLogUpdIndex(p) ((LogUpdIndex *)((CODEADDR)(p)-(CELL)(&(((LogUpdIndex *)NULL)->ClFlags))))
#define ClauseFlagsToStaticClause(p) ((StaticClause *)(p))
#define ClauseFlagsToDynamicClause(p) ((DynamicClause *)(p))
#define ClauseFlagsToLogUpdClause(p) \
((LogUpdClause *)((CODEADDR)(p) - (CELL)(&(((LogUpdClause *)NULL)->ClFlags))))
#define ClauseFlagsToLogUpdIndex(p) \
((LogUpdIndex *)((CODEADDR)(p) - (CELL)(&(((LogUpdIndex *)NULL)->ClFlags))))
#define ClauseFlagsToStaticClause(p) ((StaticClause *)(p))
#define DynamicFlags(X) (ClauseCodeToDynamicClause(X)->ClFlags)
#define DynamicFlags(X) (ClauseCodeToDynamicClause(X)->ClFlags)
#define DynamicLock(X) (ClauseCodeToDynamicClause(X)->ClLock)
#define DynamicLock(X) (ClauseCodeToDynamicClause(X)->ClLock)
#if MULTIPLE_STACKS
#define INIT_CLREF_COUNT(X) (X)->ClRefCount = 0
#define INC_CLREF_COUNT(X) (X)->ClRefCount++
#define DEC_CLREF_COUNT(X) (X)->ClRefCount--
#define INC_CLREF_COUNT(X) (X)->ClRefCount++
#define DEC_CLREF_COUNT(X) (X)->ClRefCount--
#define CL_IN_USE(X) ((X)->ClRefCount)
#define CL_IN_USE(X) ((X)->ClRefCount)
#else
#define INIT_CLREF_COUNT(X)
#define INC_CLREF_COUNT(X)
#define DEC_CLREF_COUNT(X)
#define CL_IN_USE(X) ((X)->ClFlags & InUseMask || (X)->ClRefCount)
#define INC_CLREF_COUNT(X)
#define DEC_CLREF_COUNT(X)
#define CL_IN_USE(X) ((X)->ClFlags & InUseMask || (X)->ClRefCount)
#endif
/* amasm.c */
wamreg Yap_emit_x(CELL);
COUNT Yap_compile_cmp_flags(PredEntry *);
void Yap_InitComma(void);
wamreg Yap_emit_x(CELL);
COUNT Yap_compile_cmp_flags(PredEntry *);
void Yap_InitComma(void);
/* cdmgr.c */
void Yap_IPred(PredEntry *, UInt, yamop *);
int Yap_addclause(Term,yamop *,int,Term,Term*);
void Yap_add_logupd_clause(PredEntry *,LogUpdClause *,int);
void Yap_kill_iblock(ClauseUnion *,ClauseUnion *,PredEntry *);
void Yap_EraseStaticClause(StaticClause *, PredEntry *, Term);
void Yap_IPred(PredEntry *, UInt, yamop *);
bool Yap_addclause(Term, yamop *, int, Term, Term *);
void Yap_add_logupd_clause(PredEntry *, LogUpdClause *, int);
void Yap_kill_iblock(ClauseUnion *, ClauseUnion *, PredEntry *);
void Yap_EraseStaticClause(StaticClause *, PredEntry *, Term);
ClauseUnion *Yap_find_owner_index(yamop *, PredEntry *);
/* dbase.c */
void Yap_ErCl(DynamicClause *);
void Yap_ErLogUpdCl(LogUpdClause *);
void Yap_ErLogUpdIndex(LogUpdIndex *);
Int Yap_Recordz(Atom, Term);
Int Yap_db_nth_recorded( PredEntry *, Int USES_REGS );
Int Yap_unify_immediate_ref(DBRef ref USES_REGS );
void Yap_ErCl(DynamicClause *);
void Yap_ErLogUpdCl(LogUpdClause *);
void Yap_ErLogUpdIndex(LogUpdIndex *);
Int Yap_Recordz(Atom, Term);
Int Yap_db_nth_recorded(PredEntry *, Int USES_REGS);
Int Yap_unify_immediate_ref(DBRef ref USES_REGS);
/* exec.c */
Term Yap_cp_as_integer(choiceptr);
Term Yap_cp_as_integer(choiceptr);
/* index.c */
yamop *Yap_PredIsIndexable(PredEntry *, UInt, yamop *);
yamop *Yap_ExpandIndex(PredEntry *, UInt);
void Yap_CleanUpIndex(struct logic_upd_index *);
void Yap_CleanKids(struct logic_upd_index *);
void Yap_AddClauseToIndex(PredEntry *,yamop *,int);
void Yap_RemoveClauseFromIndex(PredEntry *,yamop *);
LogUpdClause *Yap_NthClause(PredEntry *,Int);
LogUpdClause *Yap_FollowIndexingCode(PredEntry *,yamop *, Term *, yamop *,yamop *);
yamop *Yap_PredIsIndexable(PredEntry *, UInt, yamop *);
yamop *Yap_ExpandIndex(PredEntry *, UInt);
void Yap_CleanUpIndex(struct logic_upd_index *);
void Yap_CleanKids(struct logic_upd_index *);
void Yap_AddClauseToIndex(PredEntry *, yamop *, int);
void Yap_RemoveClauseFromIndex(PredEntry *, yamop *);
LogUpdClause *Yap_NthClause(PredEntry *, Int);
LogUpdClause *Yap_FollowIndexingCode(PredEntry *, yamop *, Term *, yamop *,
yamop *);
/* exo.c */
yamop *Yap_ExoLookup(PredEntry *ap USES_REGS);
CELL Yap_NextExo(choiceptr cpt, struct index_t *it);
yamop *Yap_ExoLookup(PredEntry *ap USES_REGS);
CELL Yap_NextExo(choiceptr cpt, struct index_t *it);
#
#if USE_THREADED_CODE
@@ -311,24 +319,21 @@ CELL Yap_NextExo(choiceptr cpt, struct index_t *it);
INLINE_ONLY inline EXTERN int rtable_hash_op(OPCODE opc, int hash_mask);
INLINE_ONLY inline EXTERN int
rtable_hash_op(OPCODE opc, int hash_mask) {
return((((CELL)opc) >> 3) & hash_mask);
INLINE_ONLY inline EXTERN int rtable_hash_op(OPCODE opc, int hash_mask) {
return ((((CELL)opc) >> 3) & hash_mask);
}
INLINE_ONLY inline EXTERN op_numbers Yap_op_from_opcode(OPCODE opc);
/* given an opcode find the corresponding opnumber. This should make
switches on ops a much easier operation */
INLINE_ONLY inline EXTERN op_numbers
Yap_op_from_opcode(OPCODE opc)
{
int j = rtable_hash_op(opc,OP_HASH_SIZE-1);
INLINE_ONLY inline EXTERN op_numbers Yap_op_from_opcode(OPCODE opc) {
int j = rtable_hash_op(opc, OP_HASH_SIZE - 1);
while (OP_RTABLE[j].opc != opc) {
if (!OP_RTABLE[j].opc)
return _Nstop;
if (j == OP_HASH_SIZE-1) {
if (j == OP_HASH_SIZE - 1) {
j = 0;
} else {
j++;
@@ -337,26 +342,23 @@ Yap_op_from_opcode(OPCODE opc)
return OP_RTABLE[j].opnum;
}
#else
static inline op_numbers
Yap_op_from_opcode(OPCODE opc)
{
return((op_numbers)opc);
static inline op_numbers Yap_op_from_opcode(OPCODE opc) {
return ((op_numbers)opc);
}
#endif /* USE_THREADED_CODE */
#if defined(YAPOR) || defined(THREADS)
static inline int same_lu_block(yamop **, yamop *);
static inline int
same_lu_block(yamop **paddr, yamop *p)
{
static inline int same_lu_block(yamop **paddr, yamop *p) {
yamop *np = *paddr;
if (np != p) {
OPCODE jmp_op = Yap_opcode(_jump_if_nonvar);
while (np->opc == jmp_op) {
np = NEXTOP(np, xll);
if (np == p) return TRUE;
if (np == p)
return TRUE;
}
return FALSE;
} else {
@@ -365,86 +367,69 @@ same_lu_block(yamop **paddr, yamop *p)
}
#endif
#define Yap_MkStaticRefTerm(cp, ap) __Yap_MkStaticRefTerm((cp), (ap) PASS_REGS)
#define Yap_MkStaticRefTerm(cp, ap) __Yap_MkStaticRefTerm((cp), (ap)PASS_REGS)
static inline Term
__Yap_MkStaticRefTerm(StaticClause *cp, PredEntry *ap USES_REGS)
{
static inline Term __Yap_MkStaticRefTerm(StaticClause *cp,
PredEntry *ap USES_REGS) {
Term t[2];
t[0] = MkIntegerTerm((Int)cp);
t[1] = MkIntegerTerm((Int)ap);
return Yap_MkApplTerm(FunctorStaticClause,2,t);
return Yap_MkApplTerm(FunctorStaticClause, 2, t);
}
static inline StaticClause *
Yap_ClauseFromTerm(Term t)
{
return (StaticClause *)IntegerOfTerm(ArgOfTerm(1,t));
static inline StaticClause *Yap_ClauseFromTerm(Term t) {
return (StaticClause *)IntegerOfTerm(ArgOfTerm(1, t));
}
#define Yap_MkMegaRefTerm(ap, ipc) __Yap_MkMegaRefTerm((ap), (ipc) PASS_REGS)
#define Yap_MkMegaRefTerm(ap, ipc) __Yap_MkMegaRefTerm((ap), (ipc)PASS_REGS)
static inline Term
__Yap_MkMegaRefTerm(PredEntry *ap,yamop *ipc USES_REGS)
{
static inline Term __Yap_MkMegaRefTerm(PredEntry *ap, yamop *ipc USES_REGS) {
Term t[2];
t[0] = MkIntegerTerm((Int)ap);
t[1] = MkIntegerTerm((Int)ipc);
return Yap_MkApplTerm(FunctorMegaClause,2,t);
return Yap_MkApplTerm(FunctorMegaClause, 2, t);
}
static inline yamop *
Yap_MegaClauseFromTerm(Term t)
{
return (yamop *)IntegerOfTerm(ArgOfTerm(2,t));
static inline yamop *Yap_MegaClauseFromTerm(Term t) {
return (yamop *)IntegerOfTerm(ArgOfTerm(2, t));
}
static inline PredEntry *
Yap_MegaClausePredicateFromTerm(Term t)
{
return (PredEntry *)IntegerOfTerm(ArgOfTerm(1,t));
static inline PredEntry *Yap_MegaClausePredicateFromTerm(Term t) {
return (PredEntry *)IntegerOfTerm(ArgOfTerm(1, t));
}
#define Yap_MkExoRefTerm(ap, i) __Yap_MkExoRefTerm((ap), (i) PASS_REGS)
#define Yap_MkExoRefTerm(ap, i) __Yap_MkExoRefTerm((ap), (i)PASS_REGS)
static inline Term
__Yap_MkExoRefTerm(PredEntry *ap,Int i USES_REGS)
{
static inline Term __Yap_MkExoRefTerm(PredEntry *ap, Int i USES_REGS) {
Term t[2];
t[0] = MkIntegerTerm((Int)ap);
t[1] = MkIntegerTerm((Int)i);
return Yap_MkApplTerm(FunctorExoClause,2,t);
return Yap_MkApplTerm(FunctorExoClause, 2, t);
}
static inline Int
Yap_ExoClauseFromTerm(Term t)
{
return IntegerOfTerm(ArgOfTerm(2,t));
static inline Int Yap_ExoClauseFromTerm(Term t) {
return IntegerOfTerm(ArgOfTerm(2, t));
}
static inline PredEntry *
Yap_ExoClausePredicateFromTerm(Term t)
{
return (PredEntry *)IntegerOfTerm(ArgOfTerm(1,t));
static inline PredEntry *Yap_ExoClausePredicateFromTerm(Term t) {
return (PredEntry *)IntegerOfTerm(ArgOfTerm(1, t));
}
/******************************************************************
EXECUTING PROLOG CLAUSES
EXECUTING PROLOG CLAUSES
******************************************************************/
bool
Yap_search_for_static_predicate_in_use(PredEntry *p, bool check_everything);
bool Yap_search_for_static_predicate_in_use(PredEntry *p,
bool check_everything);
static inline bool
Yap_static_in_use(PredEntry *p, bool check_everything)
{
static inline bool Yap_static_in_use(PredEntry *p, bool check_everything) {
#if defined(YAPOR) || defined(THREADS)
return TRUE;
#else
pred_flags_t pflags = p->PredFlags;
if (pflags & (DynamicPredFlag|LogUpdatePredFlag)) {
if (pflags & (DynamicPredFlag | LogUpdatePredFlag)) {
return FALSE;
}
if (STATIC_PREDICATES_MARKED) {
@@ -464,24 +449,24 @@ typedef enum {
FIND_PRED_FROM_ENV
} find_pred_type;
Int Yap_PredForCode(yamop *, find_pred_type, Atom *, UInt *, Term *);
PredEntry *Yap_PredEntryForCode(yamop *, find_pred_type, void* *, void* *);
LogUpdClause *Yap_new_ludbe(Term, PredEntry *, UInt);
Term Yap_LUInstance(LogUpdClause *, UInt);
Int Yap_PredForCode(yamop *, find_pred_type, Atom *, UInt *, Term *);
PredEntry *Yap_PredEntryForCode(yamop *, find_pred_type, void **, void **);
LogUpdClause *Yap_new_ludbe(Term, PredEntry *, UInt);
Term Yap_LUInstance(LogUpdClause *, UInt);
/* udi.c */
int Yap_new_udi_clause(PredEntry *, yamop *, Term);
yamop *Yap_udi_search(PredEntry *);
int Yap_new_udi_clause(PredEntry *, yamop *, Term);
yamop *Yap_udi_search(PredEntry *);
Term Yap_bug_location(yamop *p, yamop *cp, choiceptr b_ptr, CELL *env);
Term Yap_pc_location(yamop *p, choiceptr b_ptr, CELL *env);
Term Yap_env_location(yamop *p, choiceptr b_ptr, CELL *env, Int ignore_first);
Term Yap_bug_location(yamop *p, yamop *cp, choiceptr b_ptr, CELL *env);
Term Yap_pc_location(yamop *p, choiceptr b_ptr, CELL *env);
Term Yap_env_location(yamop *p, choiceptr b_ptr, CELL *env, Int ignore_first);
#if LOW_PROF
void Yap_InformOfRemoval(void *);
void Yap_dump_code_area_for_profiler(void);
#if LOW_PROF
void Yap_InformOfRemoval(void *);
void Yap_dump_code_area_for_profiler(void);
#else
#define Yap_InformOfRemoval(X)
#define Yap_InformOfRemoval(X)
#endif
#endif

View File

@@ -1,146 +0,0 @@
/* This file, dglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/GLOBALS instead */
#define GLOBAL_Initialised Yap_global->Initialised_
#define GLOBAL_InitialisedFromPL Yap_global->InitialisedFromPL_
#define GLOBAL_PL_Argc Yap_global->PL_Argc_
#define GLOBAL_PL_Argv Yap_global->PL_Argv_
#define GLOBAL_FAST_BOOT_FLAG Yap_global->FAST_BOOT_FLAG_
#define GLOBAL_HaltHooks Yap_global->HaltHooks_
#define GLOBAL_JIT_finalizer Yap_global->JIT_finalizer_
#define GLOBAL_AllowLocalExpansion Yap_global->AllowLocalExpansion_
#define GLOBAL_AllowGlobalExpansion Yap_global->AllowGlobalExpansion_
#define GLOBAL_AllowTrailExpansion Yap_global->AllowTrailExpansion_
#define GLOBAL_SizeOfOverflow Yap_global->SizeOfOverflow_
#define GLOBAL_AGcThreshold Yap_global->AGcThreshold_
#define GLOBAL_AGCHook Yap_global->AGCHook_
#if __ANDROID__
#define GLOBAL_assetManager Yap_global->assetManager_
#define GLOBAL_AssetsWD Yap_global->AssetsWD_
#endif
#if THREADS
#define GLOBAL_NOfThreads Yap_global->NOfThreads_
#define GLOBAL_NOfThreadsCreated Yap_global->NOfThreadsCreated_
#define GLOBAL_ThreadsTotalTime Yap_global->ThreadsTotalTime_
#define GLOBAL_ThreadHandlesLock Yap_global->ThreadHandlesLock_
#endif
#if defined(YAPOR) || defined(THREADS)
#define GLOBAL_BGL Yap_global->BGL_
#endif
#if defined(YAPOR) || defined(TABLING)
#define GLOBAL_optyap_data Yap_global->optyap_data_
#endif /* YAPOR || TABLING */
#define GLOBAL_PrologShouldHandleInterrupts Yap_global->PrologShouldHandleInterrupts_
#if defined(THREADS)
#define GLOBAL_master_thread Yap_global->master_thread_
#define GLOBAL_named_mboxes Yap_global->named_mboxes_
#define GLOBAL_mboxq_lock Yap_global->mboxq_lock_
#define GLOBAL_mbox_count Yap_global->mbox_count_
#define GLOBAL_WithMutex Yap_global->WithMutex_
#endif /* THREADS */
#define GLOBAL_Stream Yap_global->Stream_
#if defined(THREADS)||defined(YAPOR)
#define GLOBAL_StreamDescLock Yap_global->StreamDescLock_
#endif
#define GLOBAL_argv Yap_global->argv_
#define GLOBAL_argc Yap_global->argc_
#ifdef COROUTINING
#define GLOBAL_attas Yap_global->attas_
#endif
#define GLOBAL_agc_calls Yap_global->agc_calls_
#define GLOBAL_agc_collected Yap_global->agc_collected_
#define GLOBAL_tot_agc_time Yap_global->tot_agc_time_
#define GLOBAL_tot_agc_recovered Yap_global->tot_agc_recovered_
#if HAVE_MMAP
#define GLOBAL_mmap_arrays Yap_global->mmap_arrays_
#endif
#ifdef DEBUG
#define GLOBAL_Option Yap_global->Option_
#define GLOBAL_logfile Yap_global->logfile_
#endif
#if defined(COFF) || defined(A_OUT)
#define GLOBAL_Executable Yap_global->Executable_
#endif
#define GLOBAL_OpaqueHandlersCount Yap_global->OpaqueHandlersCount_
#define GLOBAL_OpaqueHandlers Yap_global->OpaqueHandlers_
#if __simplescalar__
#define GLOBAL_pwd Yap_global->pwd_
#endif
#define GLOBAL_RestoreFile Yap_global->RestoreFile_
#define GLOBAL_ProfCalls Yap_global->ProfCalls_
#define GLOBAL_ProfGCs Yap_global->ProfGCs_
#define GLOBAL_ProfHGrows Yap_global->ProfHGrows_
#define GLOBAL_ProfSGrows Yap_global->ProfSGrows_
#define GLOBAL_ProfMallocs Yap_global->ProfMallocs_
#define GLOBAL_ProfIndexing Yap_global->ProfIndexing_
#define GLOBAL_ProfOn Yap_global->ProfOn_
#define GLOBAL_ProfOns Yap_global->ProfOns_
#define GLOBAL_ProfilerRoot Yap_global->ProfilerRoot_
#define GLOBAL_ProfilerNil Yap_global->ProfilerNil_
#define GLOBAL_DIRNAME Yap_global->DIRNAME_
#if LOW_PROF
#define GLOBAL_ProfilerOn Yap_global->ProfilerOn_
#define GLOBAL_FProf Yap_global->FProf_
#define GLOBAL_FPreds Yap_global->FPreds_
#endif /* LOW_PROF */
#if THREADS
#define GLOBAL_FreeMutexes Yap_global->FreeMutexes_
#define GLOBAL_mutex_backbone Yap_global->mutex_backbone_
#define GLOBAL_MUT_ACCESS Yap_global->MUT_ACCESS_
#endif
#define GLOBAL_Home Yap_global->Home_
#define GLOBAL_CharConversionTable Yap_global->CharConversionTable_
#define GLOBAL_CharConversionTable2 Yap_global->CharConversionTable2_
#define GLOBAL_LastWTimePtr Yap_global->LastWTimePtr_
#define GLOBAL_MaxPriority Yap_global->MaxPriority_

View File

@@ -1,493 +0,0 @@
/* This file, dlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/LOCALS instead */
#define LOCAL_FileAliases LOCAL->FileAliases_
#define REMOTE_FileAliases(wid) REMOTE(wid)->FileAliases_
#define LOCAL_NOfFileAliases LOCAL->NOfFileAliases_
#define REMOTE_NOfFileAliases(wid) REMOTE(wid)->NOfFileAliases_
#define LOCAL_SzOfFileAliases LOCAL->SzOfFileAliases_
#define REMOTE_SzOfFileAliases(wid) REMOTE(wid)->SzOfFileAliases_
#define LOCAL_c_input_stream LOCAL->c_input_stream_
#define REMOTE_c_input_stream(wid) REMOTE(wid)->c_input_stream_
#define LOCAL_c_output_stream LOCAL->c_output_stream_
#define REMOTE_c_output_stream(wid) REMOTE(wid)->c_output_stream_
#define LOCAL_c_error_stream LOCAL->c_error_stream_
#define REMOTE_c_error_stream(wid) REMOTE(wid)->c_error_stream_
#define LOCAL_sockets_io LOCAL->sockets_io_
#define REMOTE_sockets_io(wid) REMOTE(wid)->sockets_io_
#define LOCAL_within_print_message LOCAL->within_print_message_
#define REMOTE_within_print_message(wid) REMOTE(wid)->within_print_message_
#define LOCAL_newline LOCAL->newline_
#define REMOTE_newline(wid) REMOTE(wid)->newline_
#define LOCAL_AtPrompt LOCAL->AtPrompt_
#define REMOTE_AtPrompt(wid) REMOTE(wid)->AtPrompt_
#define LOCAL_Prompt LOCAL->Prompt_
#define REMOTE_Prompt(wid) REMOTE(wid)->Prompt_
#define LOCAL_encoding LOCAL->encoding_
#define REMOTE_encoding(wid) REMOTE(wid)->encoding_
#define LOCAL_quasi_quotations LOCAL->quasi_quotations_
#define REMOTE_quasi_quotations(wid) REMOTE(wid)->quasi_quotations_
#define LOCAL_default_priority LOCAL->default_priority_
#define REMOTE_default_priority(wid) REMOTE(wid)->default_priority_
#define LOCAL_eot_before_eof LOCAL->eot_before_eof_
#define REMOTE_eot_before_eof(wid) REMOTE(wid)->eot_before_eof_
#define LOCAL_max_depth LOCAL->max_depth_
#define REMOTE_max_depth(wid) REMOTE(wid)->max_depth_
#define LOCAL_max_list LOCAL->max_list_
#define REMOTE_max_list(wid) REMOTE(wid)->max_list_
#define LOCAL_max_write_args LOCAL->max_write_args_
#define REMOTE_max_write_args(wid) REMOTE(wid)->max_write_args_
#define LOCAL_OldASP LOCAL->OldASP_
#define REMOTE_OldASP(wid) REMOTE(wid)->OldASP_
#define LOCAL_OldLCL0 LOCAL->OldLCL0_
#define REMOTE_OldLCL0(wid) REMOTE(wid)->OldLCL0_
#define LOCAL_OldTR LOCAL->OldTR_
#define REMOTE_OldTR(wid) REMOTE(wid)->OldTR_
#define LOCAL_OldGlobalBase LOCAL->OldGlobalBase_
#define REMOTE_OldGlobalBase(wid) REMOTE(wid)->OldGlobalBase_
#define LOCAL_OldH LOCAL->OldH_
#define REMOTE_OldH(wid) REMOTE(wid)->OldH_
#define LOCAL_OldH0 LOCAL->OldH0_
#define REMOTE_OldH0(wid) REMOTE(wid)->OldH0_
#define LOCAL_OldTrailBase LOCAL->OldTrailBase_
#define REMOTE_OldTrailBase(wid) REMOTE(wid)->OldTrailBase_
#define LOCAL_OldTrailTop LOCAL->OldTrailTop_
#define REMOTE_OldTrailTop(wid) REMOTE(wid)->OldTrailTop_
#define LOCAL_OldHeapBase LOCAL->OldHeapBase_
#define REMOTE_OldHeapBase(wid) REMOTE(wid)->OldHeapBase_
#define LOCAL_OldHeapTop LOCAL->OldHeapTop_
#define REMOTE_OldHeapTop(wid) REMOTE(wid)->OldHeapTop_
#define LOCAL_ClDiff LOCAL->ClDiff_
#define REMOTE_ClDiff(wid) REMOTE(wid)->ClDiff_
#define LOCAL_GDiff LOCAL->GDiff_
#define REMOTE_GDiff(wid) REMOTE(wid)->GDiff_
#define LOCAL_HDiff LOCAL->HDiff_
#define REMOTE_HDiff(wid) REMOTE(wid)->HDiff_
#define LOCAL_GDiff0 LOCAL->GDiff0_
#define REMOTE_GDiff0(wid) REMOTE(wid)->GDiff0_
#define LOCAL_GSplit LOCAL->GSplit_
#define REMOTE_GSplit(wid) REMOTE(wid)->GSplit_
#define LOCAL_LDiff LOCAL->LDiff_
#define REMOTE_LDiff(wid) REMOTE(wid)->LDiff_
#define LOCAL_TrDiff LOCAL->TrDiff_
#define REMOTE_TrDiff(wid) REMOTE(wid)->TrDiff_
#define LOCAL_XDiff LOCAL->XDiff_
#define REMOTE_XDiff(wid) REMOTE(wid)->XDiff_
#define LOCAL_DelayDiff LOCAL->DelayDiff_
#define REMOTE_DelayDiff(wid) REMOTE(wid)->DelayDiff_
#define LOCAL_BaseDiff LOCAL->BaseDiff_
#define REMOTE_BaseDiff(wid) REMOTE(wid)->BaseDiff_
#define LOCAL_ReductionsCounter LOCAL->ReductionsCounter_
#define REMOTE_ReductionsCounter(wid) REMOTE(wid)->ReductionsCounter_
#define LOCAL_PredEntriesCounter LOCAL->PredEntriesCounter_
#define REMOTE_PredEntriesCounter(wid) REMOTE(wid)->PredEntriesCounter_
#define LOCAL_RetriesCounter LOCAL->RetriesCounter_
#define REMOTE_RetriesCounter(wid) REMOTE(wid)->RetriesCounter_
#define LOCAL_ReductionsCounterOn LOCAL->ReductionsCounterOn_
#define REMOTE_ReductionsCounterOn(wid) REMOTE(wid)->ReductionsCounterOn_
#define LOCAL_PredEntriesCounterOn LOCAL->PredEntriesCounterOn_
#define REMOTE_PredEntriesCounterOn(wid) REMOTE(wid)->PredEntriesCounterOn_
#define LOCAL_RetriesCounterOn LOCAL->RetriesCounterOn_
#define REMOTE_RetriesCounterOn(wid) REMOTE(wid)->RetriesCounterOn_
#define LOCAL_ConsultSp LOCAL->ConsultSp_
#define REMOTE_ConsultSp(wid) REMOTE(wid)->ConsultSp_
#define LOCAL_ConsultCapacity LOCAL->ConsultCapacity_
#define REMOTE_ConsultCapacity(wid) REMOTE(wid)->ConsultCapacity_
#define LOCAL_ConsultBase LOCAL->ConsultBase_
#define REMOTE_ConsultBase(wid) REMOTE(wid)->ConsultBase_
#define LOCAL_ConsultLow LOCAL->ConsultLow_
#define REMOTE_ConsultLow(wid) REMOTE(wid)->ConsultLow_
#define LOCAL_VarNames LOCAL->VarNames_
#define REMOTE_VarNames(wid) REMOTE(wid)->VarNames_
#define LOCAL_SourceFileName LOCAL->SourceFileName_
#define REMOTE_SourceFileName(wid) REMOTE(wid)->SourceFileName_
#define LOCAL_SourceFileLineno LOCAL->SourceFileLineno_
#define REMOTE_SourceFileLineno(wid) REMOTE(wid)->SourceFileLineno_
#define LOCAL_GlobalArena LOCAL->GlobalArena_
#define REMOTE_GlobalArena(wid) REMOTE(wid)->GlobalArena_
#define LOCAL_GlobalArenaOverflows LOCAL->GlobalArenaOverflows_
#define REMOTE_GlobalArenaOverflows(wid) REMOTE(wid)->GlobalArenaOverflows_
#define LOCAL_ArenaOverflows LOCAL->ArenaOverflows_
#define REMOTE_ArenaOverflows(wid) REMOTE(wid)->ArenaOverflows_
#define LOCAL_DepthArenas LOCAL->DepthArenas_
#define REMOTE_DepthArenas(wid) REMOTE(wid)->DepthArenas_
#define LOCAL_ArithError LOCAL->ArithError_
#define REMOTE_ArithError(wid) REMOTE(wid)->ArithError_
#define LOCAL_LastAssertedPred LOCAL->LastAssertedPred_
#define REMOTE_LastAssertedPred(wid) REMOTE(wid)->LastAssertedPred_
#define LOCAL_TmpPred LOCAL->TmpPred_
#define REMOTE_TmpPred(wid) REMOTE(wid)->TmpPred_
#define LOCAL_ScannerStack LOCAL->ScannerStack_
#define REMOTE_ScannerStack(wid) REMOTE(wid)->ScannerStack_
#define LOCAL_ScannerExtraBlocks LOCAL->ScannerExtraBlocks_
#define REMOTE_ScannerExtraBlocks(wid) REMOTE(wid)->ScannerExtraBlocks_
#define LOCAL_BallTerm LOCAL->BallTerm_
#define REMOTE_BallTerm(wid) REMOTE(wid)->BallTerm_
#define LOCAL_MaxActiveSignals LOCAL->MaxActiveSignals_
#define REMOTE_MaxActiveSignals(wid) REMOTE(wid)->MaxActiveSignals_
#define LOCAL_Signals LOCAL->Signals_
#define REMOTE_Signals(wid) REMOTE(wid)->Signals_
#define LOCAL_IPredArity LOCAL->IPredArity_
#define REMOTE_IPredArity(wid) REMOTE(wid)->IPredArity_
#define LOCAL_ProfEnd LOCAL->ProfEnd_
#define REMOTE_ProfEnd(wid) REMOTE(wid)->ProfEnd_
#define LOCAL_UncaughtThrow LOCAL->UncaughtThrow_
#define REMOTE_UncaughtThrow(wid) REMOTE(wid)->UncaughtThrow_
#define LOCAL_DoingUndefp LOCAL->DoingUndefp_
#define REMOTE_DoingUndefp(wid) REMOTE(wid)->DoingUndefp_
#define LOCAL_StartCharCount LOCAL->StartCharCount_
#define REMOTE_StartCharCount(wid) REMOTE(wid)->StartCharCount_
#define LOCAL_StartLineCount LOCAL->StartLineCount_
#define REMOTE_StartLineCount(wid) REMOTE(wid)->StartLineCount_
#define LOCAL_StartLinePos LOCAL->StartLinePos_
#define REMOTE_StartLinePos(wid) REMOTE(wid)->StartLinePos_
#define LOCAL_ScratchPad LOCAL->ScratchPad_
#define REMOTE_ScratchPad(wid) REMOTE(wid)->ScratchPad_
#ifdef COROUTINING
#define LOCAL_WokenGoals LOCAL->WokenGoals_
#define REMOTE_WokenGoals(wid) REMOTE(wid)->WokenGoals_
#define LOCAL_AttsMutableList LOCAL->AttsMutableList_
#define REMOTE_AttsMutableList(wid) REMOTE(wid)->AttsMutableList_
#endif
#define LOCAL_GcGeneration LOCAL->GcGeneration_
#define REMOTE_GcGeneration(wid) REMOTE(wid)->GcGeneration_
#define LOCAL_GcPhase LOCAL->GcPhase_
#define REMOTE_GcPhase(wid) REMOTE(wid)->GcPhase_
#define LOCAL_GcCurrentPhase LOCAL->GcCurrentPhase_
#define REMOTE_GcCurrentPhase(wid) REMOTE(wid)->GcCurrentPhase_
#define LOCAL_GcCalls LOCAL->GcCalls_
#define REMOTE_GcCalls(wid) REMOTE(wid)->GcCalls_
#define LOCAL_TotGcTime LOCAL->TotGcTime_
#define REMOTE_TotGcTime(wid) REMOTE(wid)->TotGcTime_
#define LOCAL_TotGcRecovered LOCAL->TotGcRecovered_
#define REMOTE_TotGcRecovered(wid) REMOTE(wid)->TotGcRecovered_
#define LOCAL_LastGcTime LOCAL->LastGcTime_
#define REMOTE_LastGcTime(wid) REMOTE(wid)->LastGcTime_
#define LOCAL_LastSSTime LOCAL->LastSSTime_
#define REMOTE_LastSSTime(wid) REMOTE(wid)->LastSSTime_
#define LOCAL_OpenArray LOCAL->OpenArray_
#define REMOTE_OpenArray(wid) REMOTE(wid)->OpenArray_
#define LOCAL_total_marked LOCAL->total_marked_
#define REMOTE_total_marked(wid) REMOTE(wid)->total_marked_
#define LOCAL_total_oldies LOCAL->total_oldies_
#define REMOTE_total_oldies(wid) REMOTE(wid)->total_oldies_
#define LOCAL_current_B LOCAL->current_B_
#define REMOTE_current_B(wid) REMOTE(wid)->current_B_
#define LOCAL_prev_HB LOCAL->prev_HB_
#define REMOTE_prev_HB(wid) REMOTE(wid)->prev_HB_
#define LOCAL_HGEN LOCAL->HGEN_
#define REMOTE_HGEN(wid) REMOTE(wid)->HGEN_
#define LOCAL_iptop LOCAL->iptop_
#define REMOTE_iptop(wid) REMOTE(wid)->iptop_
#if defined(GC_NO_TAGS)
#define LOCAL_bp LOCAL->bp_
#define REMOTE_bp(wid) REMOTE(wid)->bp_
#endif
#define LOCAL_sTR LOCAL->sTR_
#define REMOTE_sTR(wid) REMOTE(wid)->sTR_
#define LOCAL_sTR0 LOCAL->sTR0_
#define REMOTE_sTR0(wid) REMOTE(wid)->sTR0_
#define LOCAL_new_TR LOCAL->new_TR_
#define REMOTE_new_TR(wid) REMOTE(wid)->new_TR_
#define LOCAL_cont_top0 LOCAL->cont_top0_
#define REMOTE_cont_top0(wid) REMOTE(wid)->cont_top0_
#define LOCAL_cont_top LOCAL->cont_top_
#define REMOTE_cont_top(wid) REMOTE(wid)->cont_top_
#define LOCAL_discard_trail_entries LOCAL->discard_trail_entries_
#define REMOTE_discard_trail_entries(wid) REMOTE(wid)->discard_trail_entries_
#define LOCAL_gc_ma_hash_table LOCAL->gc_ma_hash_table_
#define REMOTE_gc_ma_hash_table(wid) REMOTE(wid)->gc_ma_hash_table_
#define LOCAL_gc_ma_h_top LOCAL->gc_ma_h_top_
#define REMOTE_gc_ma_h_top(wid) REMOTE(wid)->gc_ma_h_top_
#define LOCAL_gc_ma_h_list LOCAL->gc_ma_h_list_
#define REMOTE_gc_ma_h_list(wid) REMOTE(wid)->gc_ma_h_list_
#define LOCAL_gc_timestamp LOCAL->gc_timestamp_
#define REMOTE_gc_timestamp(wid) REMOTE(wid)->gc_timestamp_
#define LOCAL_db_vec LOCAL->db_vec_
#define REMOTE_db_vec(wid) REMOTE(wid)->db_vec_
#define LOCAL_db_vec0 LOCAL->db_vec0_
#define REMOTE_db_vec0(wid) REMOTE(wid)->db_vec0_
#define LOCAL_db_root LOCAL->db_root_
#define REMOTE_db_root(wid) REMOTE(wid)->db_root_
#define LOCAL_db_nil LOCAL->db_nil_
#define REMOTE_db_nil(wid) REMOTE(wid)->db_nil_
#define LOCAL_gc_restore LOCAL->gc_restore_
#define REMOTE_gc_restore(wid) REMOTE(wid)->gc_restore_
#define LOCAL_extra_gc_cells LOCAL->extra_gc_cells_
#define REMOTE_extra_gc_cells(wid) REMOTE(wid)->extra_gc_cells_
#define LOCAL_extra_gc_cells_base LOCAL->extra_gc_cells_base_
#define REMOTE_extra_gc_cells_base(wid) REMOTE(wid)->extra_gc_cells_base_
#define LOCAL_extra_gc_cells_top LOCAL->extra_gc_cells_top_
#define REMOTE_extra_gc_cells_top(wid) REMOTE(wid)->extra_gc_cells_top_
#define LOCAL_extra_gc_cells_size LOCAL->extra_gc_cells_size_
#define REMOTE_extra_gc_cells_size(wid) REMOTE(wid)->extra_gc_cells_size_
#define LOCAL_DynamicArrays LOCAL->DynamicArrays_
#define REMOTE_DynamicArrays(wid) REMOTE(wid)->DynamicArrays_
#define LOCAL_StaticArrays LOCAL->StaticArrays_
#define REMOTE_StaticArrays(wid) REMOTE(wid)->StaticArrays_
#define LOCAL_GlobalVariables LOCAL->GlobalVariables_
#define REMOTE_GlobalVariables(wid) REMOTE(wid)->GlobalVariables_
#define LOCAL_AllowRestart LOCAL->AllowRestart_
#define REMOTE_AllowRestart(wid) REMOTE(wid)->AllowRestart_
#define LOCAL_CMemFirstBlock LOCAL->CMemFirstBlock_
#define REMOTE_CMemFirstBlock(wid) REMOTE(wid)->CMemFirstBlock_
#define LOCAL_CMemFirstBlockSz LOCAL->CMemFirstBlockSz_
#define REMOTE_CMemFirstBlockSz(wid) REMOTE(wid)->CMemFirstBlockSz_
#define LOCAL_nperm LOCAL->nperm_
#define REMOTE_nperm(wid) REMOTE(wid)->nperm_
#define LOCAL_LabelFirstArray LOCAL->LabelFirstArray_
#define REMOTE_LabelFirstArray(wid) REMOTE(wid)->LabelFirstArray_
#define LOCAL_LabelFirstArraySz LOCAL->LabelFirstArraySz_
#define REMOTE_LabelFirstArraySz(wid) REMOTE(wid)->LabelFirstArraySz_
#ifdef THREADS
#define LOCAL_ThreadHandle LOCAL->ThreadHandle_
#define REMOTE_ThreadHandle(wid) REMOTE(wid)->ThreadHandle_
#endif /* THREADS */
#if defined(YAPOR) || defined(TABLING)
#define LOCAL_optyap_data LOCAL->optyap_data_
#define REMOTE_optyap_data(wid) REMOTE(wid)->optyap_data_
#define LOCAL_TabMode LOCAL->TabMode_
#define REMOTE_TabMode(wid) REMOTE(wid)->TabMode_
#endif /* YAPOR || TABLING */
#define LOCAL_InterruptsDisabled LOCAL->InterruptsDisabled_
#define REMOTE_InterruptsDisabled(wid) REMOTE(wid)->InterruptsDisabled_
#define LOCAL_execution LOCAL->execution_
#define REMOTE_execution(wid) REMOTE(wid)->execution_
#if LOW_LEVEL_TRACER
#define LOCAL_total_choicepoints LOCAL->total_choicepoints_
#define REMOTE_total_choicepoints(wid) REMOTE(wid)->total_choicepoints_
#endif
#define LOCAL_consult_level LOCAL->consult_level_
#define REMOTE_consult_level(wid) REMOTE(wid)->consult_level_
#define LOCAL_LocalBase LOCAL->LocalBase_
#define REMOTE_LocalBase(wid) REMOTE(wid)->LocalBase_
#define LOCAL_GlobalBase LOCAL->GlobalBase_
#define REMOTE_GlobalBase(wid) REMOTE(wid)->GlobalBase_
#define LOCAL_TrailBase LOCAL->TrailBase_
#define REMOTE_TrailBase(wid) REMOTE(wid)->TrailBase_
#define LOCAL_TrailTop LOCAL->TrailTop_
#define REMOTE_TrailTop(wid) REMOTE(wid)->TrailTop_
#define LOCAL_ErrorMessage LOCAL->ErrorMessage_
#define REMOTE_ErrorMessage(wid) REMOTE(wid)->ErrorMessage_
#define LOCAL_Error_Term LOCAL->Error_Term_
#define REMOTE_Error_Term(wid) REMOTE(wid)->Error_Term_
#define LOCAL_Error_TYPE LOCAL->Error_TYPE_
#define REMOTE_Error_TYPE(wid) REMOTE(wid)->Error_TYPE_
#define LOCAL_Error_File LOCAL->Error_File_
#define REMOTE_Error_File(wid) REMOTE(wid)->Error_File_
#define LOCAL_Error_Function LOCAL->Error_Function_
#define REMOTE_Error_Function(wid) REMOTE(wid)->Error_Function_
#define LOCAL_Error_Lineno LOCAL->Error_Lineno_
#define REMOTE_Error_Lineno(wid) REMOTE(wid)->Error_Lineno_
#define LOCAL_Error_Size LOCAL->Error_Size_
#define REMOTE_Error_Size(wid) REMOTE(wid)->Error_Size_
#define LOCAL_ErrorSay LOCAL->ErrorSay_
#define REMOTE_ErrorSay(wid) REMOTE(wid)->ErrorSay_
#define LOCAL_IOBotch LOCAL->IOBotch_
#define REMOTE_IOBotch(wid) REMOTE(wid)->IOBotch_
#define LOCAL_tokptr LOCAL->tokptr_
#define REMOTE_tokptr(wid) REMOTE(wid)->tokptr_
#define LOCAL_toktide LOCAL->toktide_
#define REMOTE_toktide(wid) REMOTE(wid)->toktide_
#define LOCAL_VarTable LOCAL->VarTable_
#define REMOTE_VarTable(wid) REMOTE(wid)->VarTable_
#define LOCAL_AnonVarTable LOCAL->AnonVarTable_
#define REMOTE_AnonVarTable(wid) REMOTE(wid)->AnonVarTable_
#define LOCAL_Comments LOCAL->Comments_
#define REMOTE_Comments(wid) REMOTE(wid)->Comments_
#define LOCAL_CommentsTail LOCAL->CommentsTail_
#define REMOTE_CommentsTail(wid) REMOTE(wid)->CommentsTail_
#define LOCAL_CommentsNextChar LOCAL->CommentsNextChar_
#define REMOTE_CommentsNextChar(wid) REMOTE(wid)->CommentsNextChar_
#define LOCAL_CommentsBuff LOCAL->CommentsBuff_
#define REMOTE_CommentsBuff(wid) REMOTE(wid)->CommentsBuff_
#define LOCAL_CommentsBuffPos LOCAL->CommentsBuffPos_
#define REMOTE_CommentsBuffPos(wid) REMOTE(wid)->CommentsBuffPos_
#define LOCAL_CommentsBuffLim LOCAL->CommentsBuffLim_
#define REMOTE_CommentsBuffLim(wid) REMOTE(wid)->CommentsBuffLim_
#define LOCAL_RestartEnv LOCAL->RestartEnv_
#define REMOTE_RestartEnv(wid) REMOTE(wid)->RestartEnv_
#define LOCAL_FileNameBuf LOCAL->FileNameBuf_
#define REMOTE_FileNameBuf(wid) REMOTE(wid)->FileNameBuf_
#define LOCAL_FileNameBuf2 LOCAL->FileNameBuf2_
#define REMOTE_FileNameBuf2(wid) REMOTE(wid)->FileNameBuf2_
#define LOCAL_BreakLevel LOCAL->BreakLevel_
#define REMOTE_BreakLevel(wid) REMOTE(wid)->BreakLevel_
#define LOCAL_PrologMode LOCAL->PrologMode_
#define REMOTE_PrologMode(wid) REMOTE(wid)->PrologMode_
#define LOCAL_CritLocks LOCAL->CritLocks_
#define REMOTE_CritLocks(wid) REMOTE(wid)->CritLocks_
#define LOCAL_Flags LOCAL->Flags_
#define REMOTE_Flags(wid) REMOTE(wid)->Flags_
#define LOCAL_flagCount LOCAL->flagCount_
#define REMOTE_flagCount(wid) REMOTE(wid)->flagCount_
#ifdef ANALYST
#define LOCAL_opcount LOCAL->opcount_
#define REMOTE_opcount(wid) REMOTE(wid)->opcount_
#define LOCAL_2opcount LOCAL->2opcount_
#define REMOTE_2opcount(wid) REMOTE(wid)->2opcount_
#endif /* ANALYST */
#define LOCAL_s_dbg LOCAL->s_dbg_
#define REMOTE_s_dbg(wid) REMOTE(wid)->s_dbg_
#define LOCAL_matherror LOCAL->matherror_
#define REMOTE_matherror(wid) REMOTE(wid)->matherror_
#define LOCAL_mathtt LOCAL->mathtt_
#define REMOTE_mathtt(wid) REMOTE(wid)->mathtt_
#define LOCAL_mathstring LOCAL->mathstring_
#define REMOTE_mathstring(wid) REMOTE(wid)->mathstring_
#define LOCAL_CurrentError LOCAL->CurrentError_
#define REMOTE_CurrentError(wid) REMOTE(wid)->CurrentError_
#define LOCAL_heap_overflows LOCAL->heap_overflows_
#define REMOTE_heap_overflows(wid) REMOTE(wid)->heap_overflows_
#define LOCAL_total_heap_overflow_time LOCAL->total_heap_overflow_time_
#define REMOTE_total_heap_overflow_time(wid) REMOTE(wid)->total_heap_overflow_time_
#define LOCAL_stack_overflows LOCAL->stack_overflows_
#define REMOTE_stack_overflows(wid) REMOTE(wid)->stack_overflows_
#define LOCAL_total_stack_overflow_time LOCAL->total_stack_overflow_time_
#define REMOTE_total_stack_overflow_time(wid) REMOTE(wid)->total_stack_overflow_time_
#define LOCAL_delay_overflows LOCAL->delay_overflows_
#define REMOTE_delay_overflows(wid) REMOTE(wid)->delay_overflows_
#define LOCAL_total_delay_overflow_time LOCAL->total_delay_overflow_time_
#define REMOTE_total_delay_overflow_time(wid) REMOTE(wid)->total_delay_overflow_time_
#define LOCAL_trail_overflows LOCAL->trail_overflows_
#define REMOTE_trail_overflows(wid) REMOTE(wid)->trail_overflows_
#define LOCAL_total_trail_overflow_time LOCAL->total_trail_overflow_time_
#define REMOTE_total_trail_overflow_time(wid) REMOTE(wid)->total_trail_overflow_time_
#define LOCAL_atom_table_overflows LOCAL->atom_table_overflows_
#define REMOTE_atom_table_overflows(wid) REMOTE(wid)->atom_table_overflows_
#define LOCAL_total_atom_table_overflow_time LOCAL->total_atom_table_overflow_time_
#define REMOTE_total_atom_table_overflow_time(wid) REMOTE(wid)->total_atom_table_overflow_time_
#ifdef LOAD_DYLD
#define LOCAL_dl_errno LOCAL->dl_errno_
#define REMOTE_dl_errno(wid) REMOTE(wid)->dl_errno_
#endif
#ifdef LOW_LEVEL_TRACER
#define LOCAL_do_trace_primitives LOCAL->do_trace_primitives_
#define REMOTE_do_trace_primitives(wid) REMOTE(wid)->do_trace_primitives_
#endif
#define LOCAL_ExportAtomHashChain LOCAL->ExportAtomHashChain_
#define REMOTE_ExportAtomHashChain(wid) REMOTE(wid)->ExportAtomHashChain_
#define LOCAL_ExportAtomHashTableSize LOCAL->ExportAtomHashTableSize_
#define REMOTE_ExportAtomHashTableSize(wid) REMOTE(wid)->ExportAtomHashTableSize_
#define LOCAL_ExportAtomHashTableNum LOCAL->ExportAtomHashTableNum_
#define REMOTE_ExportAtomHashTableNum(wid) REMOTE(wid)->ExportAtomHashTableNum_
#define LOCAL_ExportFunctorHashChain LOCAL->ExportFunctorHashChain_
#define REMOTE_ExportFunctorHashChain(wid) REMOTE(wid)->ExportFunctorHashChain_
#define LOCAL_ExportFunctorHashTableSize LOCAL->ExportFunctorHashTableSize_
#define REMOTE_ExportFunctorHashTableSize(wid) REMOTE(wid)->ExportFunctorHashTableSize_
#define LOCAL_ExportFunctorHashTableNum LOCAL->ExportFunctorHashTableNum_
#define REMOTE_ExportFunctorHashTableNum(wid) REMOTE(wid)->ExportFunctorHashTableNum_
#define LOCAL_ExportPredEntryHashChain LOCAL->ExportPredEntryHashChain_
#define REMOTE_ExportPredEntryHashChain(wid) REMOTE(wid)->ExportPredEntryHashChain_
#define LOCAL_ExportPredEntryHashTableSize LOCAL->ExportPredEntryHashTableSize_
#define REMOTE_ExportPredEntryHashTableSize(wid) REMOTE(wid)->ExportPredEntryHashTableSize_
#define LOCAL_ExportPredEntryHashTableNum LOCAL->ExportPredEntryHashTableNum_
#define REMOTE_ExportPredEntryHashTableNum(wid) REMOTE(wid)->ExportPredEntryHashTableNum_
#define LOCAL_ExportDBRefHashChain LOCAL->ExportDBRefHashChain_
#define REMOTE_ExportDBRefHashChain(wid) REMOTE(wid)->ExportDBRefHashChain_
#define LOCAL_ExportDBRefHashTableSize LOCAL->ExportDBRefHashTableSize_
#define REMOTE_ExportDBRefHashTableSize(wid) REMOTE(wid)->ExportDBRefHashTableSize_
#define LOCAL_ExportDBRefHashTableNum LOCAL->ExportDBRefHashTableNum_
#define REMOTE_ExportDBRefHashTableNum(wid) REMOTE(wid)->ExportDBRefHashTableNum_
#define LOCAL_ImportAtomHashChain LOCAL->ImportAtomHashChain_
#define REMOTE_ImportAtomHashChain(wid) REMOTE(wid)->ImportAtomHashChain_
#define LOCAL_ImportAtomHashTableSize LOCAL->ImportAtomHashTableSize_
#define REMOTE_ImportAtomHashTableSize(wid) REMOTE(wid)->ImportAtomHashTableSize_
#define LOCAL_ImportAtomHashTableNum LOCAL->ImportAtomHashTableNum_
#define REMOTE_ImportAtomHashTableNum(wid) REMOTE(wid)->ImportAtomHashTableNum_
#define LOCAL_ImportFunctorHashChain LOCAL->ImportFunctorHashChain_
#define REMOTE_ImportFunctorHashChain(wid) REMOTE(wid)->ImportFunctorHashChain_
#define LOCAL_ImportFunctorHashTableSize LOCAL->ImportFunctorHashTableSize_
#define REMOTE_ImportFunctorHashTableSize(wid) REMOTE(wid)->ImportFunctorHashTableSize_
#define LOCAL_ImportFunctorHashTableNum LOCAL->ImportFunctorHashTableNum_
#define REMOTE_ImportFunctorHashTableNum(wid) REMOTE(wid)->ImportFunctorHashTableNum_
#define LOCAL_ImportOPCODEHashChain LOCAL->ImportOPCODEHashChain_
#define REMOTE_ImportOPCODEHashChain(wid) REMOTE(wid)->ImportOPCODEHashChain_
#define LOCAL_ImportOPCODEHashTableSize LOCAL->ImportOPCODEHashTableSize_
#define REMOTE_ImportOPCODEHashTableSize(wid) REMOTE(wid)->ImportOPCODEHashTableSize_
#define LOCAL_ImportPredEntryHashChain LOCAL->ImportPredEntryHashChain_
#define REMOTE_ImportPredEntryHashChain(wid) REMOTE(wid)->ImportPredEntryHashChain_
#define LOCAL_ImportPredEntryHashTableSize LOCAL->ImportPredEntryHashTableSize_
#define REMOTE_ImportPredEntryHashTableSize(wid) REMOTE(wid)->ImportPredEntryHashTableSize_
#define LOCAL_ImportPredEntryHashTableNum LOCAL->ImportPredEntryHashTableNum_
#define REMOTE_ImportPredEntryHashTableNum(wid) REMOTE(wid)->ImportPredEntryHashTableNum_
#define LOCAL_ImportDBRefHashChain LOCAL->ImportDBRefHashChain_
#define REMOTE_ImportDBRefHashChain(wid) REMOTE(wid)->ImportDBRefHashChain_
#define LOCAL_ImportDBRefHashTableSize LOCAL->ImportDBRefHashTableSize_
#define REMOTE_ImportDBRefHashTableSize(wid) REMOTE(wid)->ImportDBRefHashTableSize_
#define LOCAL_ImportDBRefHashTableNum LOCAL->ImportDBRefHashTableNum_
#define REMOTE_ImportDBRefHashTableNum(wid) REMOTE(wid)->ImportDBRefHashTableNum_
#define LOCAL_ImportFAILCODE LOCAL->ImportFAILCODE_
#define REMOTE_ImportFAILCODE(wid) REMOTE(wid)->ImportFAILCODE_
#if __ANDROID__
#define LOCAL_assetManager LOCAL->assetManager_
#define REMOTE_assetManager(wid) REMOTE(wid)->assetManager_
#define LOCAL_InAssetDir LOCAL->InAssetDir_
#define REMOTE_InAssetDir(wid) REMOTE(wid)->InAssetDir_
#endif
#define LOCAL_ibnds LOCAL->ibnds_
#define REMOTE_ibnds(wid) REMOTE(wid)->ibnds_
#define LOCAL_exo_it LOCAL->exo_it_
#define REMOTE_exo_it(wid) REMOTE(wid)->exo_it_
#define LOCAL_exo_base LOCAL->exo_base_
#define REMOTE_exo_base(wid) REMOTE(wid)->exo_base_
#define LOCAL_exo_arity LOCAL->exo_arity_
#define REMOTE_exo_arity(wid) REMOTE(wid)->exo_arity_
#define LOCAL_exo_arg LOCAL->exo_arg_
#define REMOTE_exo_arg(wid) REMOTE(wid)->exo_arg_
#define LOCAL_search_atoms LOCAL->search_atoms_
#define REMOTE_search_atoms(wid) REMOTE(wid)->search_atoms_
#define LOCAL_CurSlot LOCAL->CurSlot_
#define REMOTE_CurSlot(wid) REMOTE(wid)->CurSlot_
#define LOCAL_NSlots LOCAL->NSlots_
#define REMOTE_NSlots(wid) REMOTE(wid)->NSlots_
#define LOCAL_SlotBase LOCAL->SlotBase_
#define REMOTE_SlotBase(wid) REMOTE(wid)->SlotBase_
#define LOCAL_Mutexes LOCAL->Mutexes_
#define REMOTE_Mutexes(wid) REMOTE(wid)->Mutexes_
#define LOCAL_SourceModule LOCAL->SourceModule_
#define REMOTE_SourceModule(wid) REMOTE(wid)->SourceModule_
#define LOCAL_Including LOCAL->Including_
#define REMOTE_Including(wid) REMOTE(wid)->Including_
#define LOCAL_MAX_SIZE LOCAL->MAX_SIZE_
#define REMOTE_MAX_SIZE(wid) REMOTE(wid)->MAX_SIZE_

View File

@@ -20,6 +20,7 @@
AtomArrayOverflow = Yap_LookupAtom("array_overflow");
AtomArrayType = Yap_LookupAtom("array_type");
AtomArrow = Yap_LookupAtom("->");
AtomAttributedModule = Yap_LookupAtom("attributes_module");
AtomDoubleArrow = Yap_LookupAtom("-->");
AtomAssert = Yap_LookupAtom(":-");
AtomEmptyBrackets = Yap_LookupAtom("()");
@@ -509,6 +510,7 @@
FunctorPlus = Yap_MkFunctor(AtomPlus,2);
FunctorPortray = Yap_MkFunctor(AtomPortray,1);
FunctorPrintMessage = Yap_MkFunctor(AtomPrintMessage,2);
FunctorProcedure = Yap_MkFunctor(AtomProcedure,5);
FunctorPrologConstraint = Yap_MkFunctor(AtomProlog,2);
FunctorQuery = Yap_MkFunctor(AtomQuery,1);
FunctorRecordedWithKey = Yap_MkFunctor(AtomRecordedWithKey,6);

View File

@@ -1,301 +0,0 @@
/* This file, ihstruct.h, was generated automatically by "yap -L misc/buildheap"
please do not update, update misc/HEAPFIELDS instead */
#if USE_DL_MALLOC
#if defined(YAPOR) || defined(THREADS)
INIT_LOCK(DLMallocLock);
#endif
#endif
#if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO)
#ifndef HeapUsed
#define HeapUsed Yap_givemallinfo()
#endif
#else
#endif
#if defined(YAPOR) || defined(THREADS)
INIT_LOCK(FreeBlocksLock);
INIT_LOCK(HeapUsedLock);
INIT_LOCK(HeapTopLock);
HeapTopOwner = -1;
#endif
MaxStack = 0;
MaxTrail = 0;
#if USE_THREADED_CODE
#endif
EXECUTE_CPRED_OP_CODE = Yap_opcode(_execute_cpred);
EXPAND_OP_CODE = Yap_opcode(_expand_index);
FAIL_OPCODE = Yap_opcode(_op_fail);
INDEX_OPCODE = Yap_opcode(_index_pred);
LOCKPRED_OPCODE = Yap_opcode(_lock_pred);
ORLAST_OPCODE = Yap_opcode(_or_last);
UNDEF_OPCODE = Yap_opcode(_undef_p);
RETRY_USERC_OPCODE = Yap_opcode(_retry_userc);
EXECUTE_CPRED_OPCODE = Yap_opcode(_execute_cpred);
InitInvisibleAtoms();
InitWideAtoms();
InitAtoms();
#include "iatoms.h"
#ifdef EUROTRA
TermDollarU = MkAtomTerm(AtomDollarU);
#endif
USER_MODULE = MkAtomTerm(AtomUser);
IDB_MODULE = MkAtomTerm(AtomIDB);
ATTRIBUTES_MODULE = MkAtomTerm(AtomAttributes);
CHARSIO_MODULE = MkAtomTerm(AtomCharsio);
CHTYPE_MODULE = MkAtomTerm(AtomChType);
TERMS_MODULE = MkAtomTerm(AtomTerms);
SYSTEM_MODULE = MkAtomTerm(AtomSystem);
READUTIL_MODULE = MkAtomTerm(AtomReadutil);
HACKS_MODULE = MkAtomTerm(AtomYapHacks);
ARG_MODULE = MkAtomTerm(AtomArg);
GLOBALS_MODULE = MkAtomTerm(AtomNb);
SWI_MODULE = MkAtomTerm(AtomSwi);
DBLOAD_MODULE = MkAtomTerm(AtomDBLoad);
RANGE_MODULE = MkAtomTerm(AtomRange);
ERROR_MODULE = MkAtomTerm(AtomError);
CurrentModules = NULL;
Yap_InitModules();
HIDDEN_PREDICATES = NULL;
Yap_InitPlIO();
GLOBAL_Flags = 0;
Yap_InitFlags(true);
Yap_ExecutionMode = INTERPRETED;
InitPredHash();
#if defined(YAPOR) || defined(THREADS)
#endif
PredsInHashTable = 0;
CreepCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomCreep,1),PROLOG_MODULE));
UndefCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomUndefp,2),PROLOG_MODULE));
SpyCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomSpy,1),PROLOG_MODULE));
PredFail = RepPredProp(PredPropByAtom(AtomFail,PROLOG_MODULE));
PredTrue = RepPredProp(PredPropByAtom(AtomTrue,PROLOG_MODULE));
#ifdef COROUTINING
WakeUpCode = RepPredProp(PredPropByFunc(Yap_MkFunctor(AtomWakeUpGoal,2),PROLOG_MODULE));
#endif
PredGoalExpansion = RepPredProp(PredPropByFunc(FunctorGoalExpansion,USER_MODULE));
PredMetaCall = RepPredProp(PredPropByFunc(FunctorMetaCall,PROLOG_MODULE));
PredTraceMetaCall = RepPredProp(PredPropByFunc(FunctorTraceMetaCall,PROLOG_MODULE));
PredDollarCatch = RepPredProp(PredPropByFunc(FunctorCatch,PROLOG_MODULE));
PredRecordedWithKey = RepPredProp(PredPropByFunc(FunctorRecordedWithKey,PROLOG_MODULE));
PredLogUpdClause = RepPredProp(PredPropByFunc(FunctorDoLogUpdClause,PROLOG_MODULE));
PredLogUpdClauseErase = RepPredProp(PredPropByFunc(FunctorDoLogUpdClauseErase,PROLOG_MODULE));
PredLogUpdClause0 = RepPredProp(PredPropByFunc(FunctorDoLogUpdClause,PROLOG_MODULE));
PredStaticClause = RepPredProp(PredPropByFunc(FunctorDoStaticClause,PROLOG_MODULE));
PredThrow = RepPredProp(PredPropByFunc(FunctorThrow,PROLOG_MODULE));
PredHandleThrow = RepPredProp(PredPropByFunc(FunctorHandleThrow,PROLOG_MODULE));
PredIs = RepPredProp(PredPropByFunc(FunctorIs,PROLOG_MODULE));
PredSafeCallCleanup = RepPredProp(PredPropByFunc(FunctorSafeCallCleanup,PROLOG_MODULE));
PredRestoreRegs = RepPredProp(PredPropByFunc(FunctorRestoreRegs,PROLOG_MODULE));
PredCommentHook = RepPredProp(PredPropByFunc(FunctorCommentHook,PROLOG_MODULE));
#ifdef YAPOR
PredGetwork = RepPredProp(PredPropByAtom(AtomGetwork,PROLOG_MODULE));
PredGetworkSeq = RepPredProp(PredPropByAtom(AtomGetworkSeq,PROLOG_MODULE));
#endif /* YAPOR */
#ifdef LOW_LEVEL_TRACER
Yap_do_low_level_trace = FALSE;
#if defined(YAPOR) || defined(THREADS)
INIT_LOCK(Yap_low_level_trace_lock);
#endif
#endif
Yap_ClauseSpace = 0;
Yap_IndexSpace_Tree = 0;
Yap_IndexSpace_EXT = 0;
Yap_IndexSpace_SW = 0;
Yap_LUClauseSpace = 0;
Yap_LUIndexSpace_Tree = 0;
Yap_LUIndexSpace_CP = 0;
Yap_LUIndexSpace_EXT = 0;
Yap_LUIndexSpace_SW = 0;
DUMMYCODE->opc = Yap_opcode(_op_fail);
FAILCODE->opc = Yap_opcode(_op_fail);
NOCODE->opc = Yap_opcode(_Nstop);
InitEnvInst(ENV_FOR_TRUSTFAIL,&TRUSTFAILCODE,_trust_fail,PredFail);
InitEnvInst(ENV_FOR_YESCODE,&YESCODE,_Ystop,PredFail);
InitOtaplInst(RTRYCODE,_retry_and_mark,PredFail);
#ifdef BEAM
BEAM_RETRY_CODE->opc = Yap_opcode(_beam_retry_code);
#endif /* BEAM */
#ifdef YAPOR
InitOtaplInst(GETWORK,_getwork,PredGetwork);
InitOtaplInst(GETWORK_SEQ,_getwork_seq,PredGetworkSeq);
GETWORK_FIRST_TIME->opc = Yap_opcode(_getwork_first_time);
#endif /* YAPOR */
#ifdef TABLING
InitOtaplInst(LOAD_ANSWER,_table_load_answer,PredFail);
InitOtaplInst(TRY_ANSWER,_table_try_answer,PredFail);
InitOtaplInst(ANSWER_RESOLUTION,_table_answer_resolution,PredFail);
InitOtaplInst(COMPLETION,_table_completion,PredFail);
#ifdef THREADS_CONSUMER_SHARING
InitOtaplInst(ANSWER_RESOLUTION_COMPLETION,_table_answer_resolution_completion,PredFail);
#endif /* THREADS_CONSUMER_SHARING */
#endif /* TABLING */
P_before_spy = NULL;
RETRY_C_RECORDEDP_CODE = NULL;
RETRY_C_RECORDED_K_CODE = NULL;
PROFILING = FALSE;
CALL_COUNTING = FALSE;
optimizer_on = TRUE;
compile_mode = 0;
profiling = FALSE;
call_counting = FALSE;
compile_arrays = FALSE;
#if defined(YAPOR) || defined(THREADS)
INIT_LOCK(DBTermsListLock);
#endif
DBTermsList = NULL;
ExpandClausesFirst = NULL;
ExpandClausesLast = NULL;
Yap_ExpandClauses = 0;
#if defined(YAPOR) || defined(THREADS)
INIT_LOCK(ExpandClausesListLock);
INIT_LOCK(OpListLock);
#endif
#ifdef DEBUG
Yap_NewCps = 0L;
Yap_LiveCps = 0L;
Yap_DirtyCps = 0L;
Yap_FreedCps = 0L;
#endif
Yap_expand_clauses_sz = 0L;
UdiControlBlocks = NULL;
STATIC_PREDICATES_MARKED = FALSE;
INT_KEYS = NULL;
INT_LU_KEYS = NULL;
INT_BB_KEYS = NULL;
INT_KEYS_SIZE = INT_KEYS_DEFAULT_SIZE;
INT_KEYS_TIMESTAMP = 0L;
INT_BB_KEYS_SIZE = INT_KEYS_DEFAULT_SIZE;
UPDATE_MODE = UPDATE_MODE_LOGICAL;
InitDBErasedMarker();
InitLogDBErasedMarker();
DeadStaticClauses = NULL;
DeadMegaClauses = NULL;
DeadStaticIndices = NULL;
DBErasedList = NULL;
DBErasedIList = NULL;
#if defined(YAPOR) || defined(THREADS)
INIT_LOCK(DeadStaticClausesLock);
INIT_LOCK(DeadMegaClausesLock);
INIT_LOCK(DeadStaticIndicesLock);
#endif
#ifdef COROUTINING
NUM_OF_ATTS = 1;
#endif
OpList = NULL;
ForeignCodeLoaded = NULL;
ForeignCodeBase = NULL;
ForeignCodeTop = NULL;
ForeignCodeMax = NULL;
Yap_Records = NULL;
InitSWIAtoms();
InitEmptyWakeups();
MaxEmptyWakeups = 0;
BlobTypes = NULL;
Blobs = NULL;
NOfBlobs = 0;
NOfBlobsMax = 256;
#if defined(YAPOR) || defined(THREADS)
INIT_LOCK(Blobs_Lock);
#endif

View File

@@ -1,277 +0,0 @@
/* This file, ilocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/LOCALS instead */
static void InitWorker(int wid) {
REMOTE_FileAliases(wid) = Yap_InitStandardAliases();
REMOTE_c_input_stream(wid) = 0;
REMOTE_c_output_stream(wid) = 1;
REMOTE_c_error_stream(wid) = 2;
REMOTE_sockets_io(wid) = false;
REMOTE_within_print_message(wid) = false;
REMOTE_newline(wid) = true;
REMOTE_AtPrompt(wid) = AtomNil;
REMOTE_encoding(wid) = Yap_DefaultEncoding();
REMOTE_quasi_quotations(wid) = false;
REMOTE_default_priority(wid) = 1200;
REMOTE_eot_before_eof(wid) = false;
REMOTE_max_depth(wid) = 0;
REMOTE_max_list(wid) = 0;
REMOTE_max_write_args(wid) = 0;
REMOTE_OldASP(wid) = NULL;
REMOTE_OldLCL0(wid) = NULL;
REMOTE_OldTR(wid) = NULL;
REMOTE_OldGlobalBase(wid) = NULL;
REMOTE_OldH(wid) = NULL;
REMOTE_OldH0(wid) = NULL;
REMOTE_OldTrailBase(wid) = NULL;
REMOTE_OldTrailTop(wid) = NULL;
REMOTE_OldHeapBase(wid) = NULL;
REMOTE_OldHeapTop(wid) = NULL;
REMOTE_ClDiff(wid) = 0L;
REMOTE_GDiff(wid) = 0L;
REMOTE_HDiff(wid) = 0L;
REMOTE_GDiff0(wid) = 0L;
REMOTE_GSplit(wid) = NULL;
REMOTE_LDiff(wid) = 0L;
REMOTE_TrDiff(wid) = 0L;
REMOTE_XDiff(wid) = 0L;
REMOTE_DelayDiff(wid) = 0L;
REMOTE_BaseDiff(wid) = 0L;
REMOTE_ReductionsCounter(wid) = 0L;
REMOTE_PredEntriesCounter(wid) = 0L;
REMOTE_RetriesCounter(wid) = 0L;
REMOTE_ReductionsCounterOn(wid) = 0L;
REMOTE_PredEntriesCounterOn(wid) = 0L;
REMOTE_RetriesCounterOn(wid) = 0L;
REMOTE_ConsultSp(wid) = NULL;
REMOTE_ConsultBase(wid) = NULL;
REMOTE_ConsultLow(wid) = NULL;
REMOTE_VarNames(wid) = ((Term)0);
REMOTE_SourceFileName(wid) = NULL;
REMOTE_SourceFileLineno(wid) = 0;
REMOTE_GlobalArena(wid) = 0L;
REMOTE_GlobalArenaOverflows(wid) = 0L;
REMOTE_ArenaOverflows(wid) = 0L;
REMOTE_DepthArenas(wid) = 0;
REMOTE_ArithError(wid) = FALSE;
REMOTE_LastAssertedPred(wid) = NULL;
REMOTE_TmpPred(wid) = NULL;
REMOTE_ScannerStack(wid) = NULL;
REMOTE_ScannerExtraBlocks(wid) = NULL;
REMOTE_BallTerm(wid) = NULL;
REMOTE_MaxActiveSignals(wid) = 64L;
REMOTE_Signals(wid) = 0L;
REMOTE_IPredArity(wid) = 0L;
REMOTE_ProfEnd(wid) = NULL;
REMOTE_UncaughtThrow(wid) = FALSE;
REMOTE_DoingUndefp(wid) = FALSE;
REMOTE_StartCharCount(wid) = 0L;
REMOTE_StartLineCount(wid) = 0L;
REMOTE_StartLinePos(wid) = 0L;
InitScratchPad(wid);
#ifdef COROUTINING
REMOTE_WokenGoals(wid) = 0L;
REMOTE_AttsMutableList(wid) = 0L;
#endif
REMOTE_GcGeneration(wid) = 0L;
REMOTE_GcPhase(wid) = 0L;
REMOTE_GcCurrentPhase(wid) = 0L;
REMOTE_GcCalls(wid) = 0L;
REMOTE_TotGcTime(wid) = 0L;
REMOTE_TotGcRecovered(wid) = 0L;
REMOTE_LastGcTime(wid) = 0L;
REMOTE_LastSSTime(wid) = 0L;
REMOTE_OpenArray(wid) = NULL;
REMOTE_total_marked(wid) = 0L;
REMOTE_total_oldies(wid) = 0L;
REMOTE_current_B(wid) = NULL;
REMOTE_prev_HB(wid) = NULL;
REMOTE_HGEN(wid) = NULL;
REMOTE_iptop(wid) = NULL;
#if defined(GC_NO_TAGS)
REMOTE_bp(wid) = NULL;
#endif
REMOTE_sTR(wid) = NULL;
REMOTE_sTR0(wid) = NULL;
REMOTE_new_TR(wid) = NULL;
REMOTE_cont_top0(wid) = NULL;
REMOTE_cont_top(wid) = NULL;
REMOTE_discard_trail_entries(wid) = 0;
REMOTE_gc_ma_h_top(wid) = NULL;
REMOTE_gc_ma_h_list(wid) = NULL;
REMOTE_gc_timestamp(wid) = 0L;
REMOTE_db_vec(wid) = NULL;
REMOTE_db_vec0(wid) = NULL;
REMOTE_db_root(wid) = NULL;
REMOTE_db_nil(wid) = NULL;
REMOTE_extra_gc_cells_size(wid) = 256;
REMOTE_DynamicArrays(wid) = NULL;
REMOTE_StaticArrays(wid) = NULL;
REMOTE_GlobalVariables(wid) = NULL;
REMOTE_AllowRestart(wid) = FALSE;
REMOTE_CMemFirstBlock(wid) = NULL;
REMOTE_CMemFirstBlockSz(wid) = 0L;
REMOTE_nperm(wid) = 0L;
REMOTE_LabelFirstArray(wid) = NULL;
REMOTE_LabelFirstArraySz(wid) = 0L;
#ifdef THREADS
InitThreadHandle(wid);
#endif /* THREADS */
#if defined(YAPOR) || defined(TABLING)
Yap_init_local_optyap_data(wid);
REMOTE_TabMode(wid) = 0L;
#endif /* YAPOR || TABLING */
REMOTE_InterruptsDisabled(wid) = FALSE;
REMOTE_execution(wid) = NULL;
#if LOW_LEVEL_TRACER
REMOTE_total_choicepoints(wid) = 0;
#endif
REMOTE_consult_level(wid) = 0;
REMOTE_BreakLevel(wid) = 0;
REMOTE_PrologMode(wid) = BootMode;
REMOTE_CritLocks(wid) = 0;
#ifdef ANALYST
#endif /* ANALYST */
REMOTE_matherror(wid) = YAP_NO_ERROR;
REMOTE_mathstring(wid) = NULL;
REMOTE_CurrentError(wid) = YAP_NO_ERROR;
REMOTE_heap_overflows(wid) = 0;
REMOTE_total_heap_overflow_time(wid) = 0;
REMOTE_stack_overflows(wid) = 0;
REMOTE_total_stack_overflow_time(wid) = 0;
REMOTE_delay_overflows(wid) = 0;
REMOTE_total_delay_overflow_time(wid) = 0;
REMOTE_trail_overflows(wid) = 0;
REMOTE_total_trail_overflow_time(wid) = 0;
REMOTE_atom_table_overflows(wid) = 0;
REMOTE_total_atom_table_overflow_time(wid) = 0;
#ifdef LOAD_DYLD
REMOTE_dl_errno(wid) = 0;
#endif
#ifdef LOW_LEVEL_TRACER
REMOTE_do_trace_primitives(wid) = TRUE;
#endif
REMOTE_ExportAtomHashChain(wid) = NULL;
REMOTE_ExportAtomHashTableSize(wid) = 0;
REMOTE_ExportAtomHashTableNum(wid) = 0;
REMOTE_ExportFunctorHashChain(wid) = NULL;
REMOTE_ExportFunctorHashTableSize(wid) = 0;
REMOTE_ExportFunctorHashTableNum(wid) = 0;
REMOTE_ExportPredEntryHashChain(wid) = NULL;
REMOTE_ExportPredEntryHashTableSize(wid) = 0;
REMOTE_ExportPredEntryHashTableNum(wid) = 0;
REMOTE_ExportDBRefHashChain(wid) = NULL;
REMOTE_ExportDBRefHashTableSize(wid) = 0;
REMOTE_ExportDBRefHashTableNum(wid) = 0;
REMOTE_ImportAtomHashChain(wid) = NULL;
REMOTE_ImportAtomHashTableSize(wid) = 0;
REMOTE_ImportAtomHashTableNum(wid) = 0;
REMOTE_ImportFunctorHashChain(wid) = NULL;
REMOTE_ImportFunctorHashTableSize(wid) = 0;
REMOTE_ImportFunctorHashTableNum(wid) = 0;
REMOTE_ImportOPCODEHashChain(wid) = NULL;
REMOTE_ImportOPCODEHashTableSize(wid) = 0;
REMOTE_ImportPredEntryHashChain(wid) = NULL;
REMOTE_ImportPredEntryHashTableSize(wid) = 0;
REMOTE_ImportPredEntryHashTableNum(wid) = 0;
REMOTE_ImportDBRefHashChain(wid) = NULL;
REMOTE_ImportDBRefHashTableSize(wid) = 0;
REMOTE_ImportDBRefHashTableNum(wid) = 0;
REMOTE_ImportFAILCODE(wid) = NULL;
#if __ANDROID__
REMOTE_assetManager(wid) = GLOBAL_assetManager;
REMOTE_InAssetDir(wid) = NULL;
#endif
REMOTE_exo_it(wid) = NULL;
REMOTE_exo_base(wid) = NULL;
REMOTE_exo_arity(wid) = 0;
REMOTE_exo_arg(wid) = 0;
REMOTE_CurSlot(wid) = 0;
REMOTE_NSlots(wid) = 0;
REMOTE_SlotBase(wid) = InitHandles(wid);
REMOTE_Mutexes(wid) = NULL;
REMOTE_SourceModule(wid) = 0;
REMOTE_Including(wid) = TermNil;
REMOTE_MAX_SIZE(wid) = 1024L;
}

View File

@@ -104,7 +104,7 @@ typedef enum {
#define STATIC_PRED_FLAGS (SourcePredFlag|DynamicPredFlag|LogUpdatePredFlag|CompiledPredFlag|MultiFileFlag|TabledPredFlag|MegaClausePredFlag|CountPredFlag|ProfiledPredFlag|ThreadLocalPredFlag|AtomDBPredFlag|ModuleTransparentPredFlag|NumberDBPredFlag|MetaPredFlag|SyncPredFlag|BackCPredFlag)
#define EXTRA_PRED_FLAGS (QuasiQuotationPredFlag|NoTracePredFlag|NoSpyPredFlag)
#define SYSTEM_PRED_FLAGS (BackCPredFlag|UserCPredFlag|CArgsPredFlag|AsmPredFlag|CPredFlag|BinaryPredFlag|StandardPredFlag)
#define SYSTEM_PRED_FLAGS (BackCPredFlag|UserCPredFlag|CArgsPredFlag|AsmPredFlag|CPredFlag|BinaryPredFlag)
#define CHECK(F) { size_t r = (F); if (!r) return r; }
#define RCHECK(F) if(!(F)) { QLYR_ERROR(MISMATCH); return; }

View File

@@ -20,6 +20,7 @@
AtomArrayOverflow = AtomAdjust(AtomArrayOverflow);
AtomArrayType = AtomAdjust(AtomArrayType);
AtomArrow = AtomAdjust(AtomArrow);
AtomAttributedModule = AtomAdjust(AtomAttributedModule);
AtomDoubleArrow = AtomAdjust(AtomDoubleArrow);
AtomAssert = AtomAdjust(AtomAssert);
AtomEmptyBrackets = AtomAdjust(AtomEmptyBrackets);
@@ -509,6 +510,7 @@
FunctorPlus = FuncAdjust(FunctorPlus);
FunctorPortray = FuncAdjust(FunctorPortray);
FunctorPrintMessage = FuncAdjust(FunctorPrintMessage);
FunctorProcedure = FuncAdjust(FunctorProcedure);
FunctorPrologConstraint = FuncAdjust(FunctorPrologConstraint);
FunctorQuery = FuncAdjust(FunctorQuery);
FunctorRecordedWithKey = FuncAdjust(FunctorRecordedWithKey);

View File

@@ -1,146 +0,0 @@
/* This file, rglobals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/GLOBALS instead */
static void RestoreGlobal(void) {
#if __ANDROID__
#endif
#if THREADS
REINIT_LOCK(GLOBAL_ThreadHandlesLock);
#endif
#if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(GLOBAL_BGL);
#endif
#if defined(YAPOR) || defined(TABLING)
#endif /* YAPOR || TABLING */
#if defined(THREADS)
REINIT_LOCK(GLOBAL_mboxq_lock);
#endif /* THREADS */
#if defined(THREADS)||defined(YAPOR)
REINIT_LOCK(GLOBAL_StreamDescLock);
#endif
#ifdef COROUTINING
#endif
#if HAVE_MMAP
#endif
#ifdef DEBUG
#endif
#if defined(COFF) || defined(A_OUT)
#endif
#if __simplescalar__
#endif
#if LOW_PROF
#endif /* LOW_PROF */
#if THREADS
REINIT_LOCK(GLOBAL_MUT_ACCESS);
#endif
}

1296
H/rheap.h

File diff suppressed because it is too large Load Diff

View File

@@ -1,301 +0,0 @@
/* This file, rhstruct.h, was generated automatically by "yap -L misc/buildheap"
please do not update, update misc/HEAPFIELDS instead */
#if USE_DL_MALLOC
#if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(DLMallocLock);
#endif
#endif
#if USE_DL_MALLOC || (USE_SYSTEM_MALLOC && HAVE_MALLINFO)
#ifndef HeapUsed
#define HeapUsed Yap_givemallinfo()
#endif
#else
#endif
#if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(FreeBlocksLock);
REINIT_LOCK(HeapUsedLock);
REINIT_LOCK(HeapTopLock);
#endif
#if USE_THREADED_CODE
OP_RTABLE = OpRTableAdjust(OP_RTABLE);
#endif
EXECUTE_CPRED_OP_CODE = Yap_opcode(_execute_cpred);
EXPAND_OP_CODE = Yap_opcode(_expand_index);
FAIL_OPCODE = Yap_opcode(_op_fail);
INDEX_OPCODE = Yap_opcode(_index_pred);
LOCKPRED_OPCODE = Yap_opcode(_lock_pred);
ORLAST_OPCODE = Yap_opcode(_or_last);
UNDEF_OPCODE = Yap_opcode(_undef_p);
RETRY_USERC_OPCODE = Yap_opcode(_retry_userc);
EXECUTE_CPRED_OPCODE = Yap_opcode(_execute_cpred);
RestoreInvisibleAtoms();
RestoreWideAtoms();
RestoreAtoms();
#include "ratoms.h"
#ifdef EUROTRA
TermDollarU = AtomTermAdjust(TermDollarU);
#endif
USER_MODULE = AtomTermAdjust(USER_MODULE);
IDB_MODULE = AtomTermAdjust(IDB_MODULE);
ATTRIBUTES_MODULE = AtomTermAdjust(ATTRIBUTES_MODULE);
CHARSIO_MODULE = AtomTermAdjust(CHARSIO_MODULE);
CHTYPE_MODULE = AtomTermAdjust(CHTYPE_MODULE);
TERMS_MODULE = AtomTermAdjust(TERMS_MODULE);
SYSTEM_MODULE = AtomTermAdjust(SYSTEM_MODULE);
READUTIL_MODULE = AtomTermAdjust(READUTIL_MODULE);
HACKS_MODULE = AtomTermAdjust(HACKS_MODULE);
ARG_MODULE = AtomTermAdjust(ARG_MODULE);
GLOBALS_MODULE = AtomTermAdjust(GLOBALS_MODULE);
SWI_MODULE = AtomTermAdjust(SWI_MODULE);
DBLOAD_MODULE = AtomTermAdjust(DBLOAD_MODULE);
RANGE_MODULE = AtomTermAdjust(RANGE_MODULE);
ERROR_MODULE = AtomTermAdjust(ERROR_MODULE);
CurrentModules = ModEntryPtrAdjust(CurrentModules);
RestoreHiddenPredicates();
RestoreFlags(GLOBAL_flagCount);
RestorePredHash();
#if defined(YAPOR) || defined(THREADS)
#endif
CreepCode = PtoPredAdjust(CreepCode);
UndefCode = PtoPredAdjust(UndefCode);
SpyCode = PtoPredAdjust(SpyCode);
PredFail = PtoPredAdjust(PredFail);
PredTrue = PtoPredAdjust(PredTrue);
#ifdef COROUTINING
WakeUpCode = PtoPredAdjust(WakeUpCode);
#endif
PredGoalExpansion = PtoPredAdjust(PredGoalExpansion);
PredMetaCall = PtoPredAdjust(PredMetaCall);
PredTraceMetaCall = PtoPredAdjust(PredTraceMetaCall);
PredDollarCatch = PtoPredAdjust(PredDollarCatch);
PredRecordedWithKey = PtoPredAdjust(PredRecordedWithKey);
PredLogUpdClause = PtoPredAdjust(PredLogUpdClause);
PredLogUpdClauseErase = PtoPredAdjust(PredLogUpdClauseErase);
PredLogUpdClause0 = PtoPredAdjust(PredLogUpdClause0);
PredStaticClause = PtoPredAdjust(PredStaticClause);
PredThrow = PtoPredAdjust(PredThrow);
PredHandleThrow = PtoPredAdjust(PredHandleThrow);
PredIs = PtoPredAdjust(PredIs);
PredSafeCallCleanup = PtoPredAdjust(PredSafeCallCleanup);
PredRestoreRegs = PtoPredAdjust(PredRestoreRegs);
PredCommentHook = PtoPredAdjust(PredCommentHook);
#ifdef YAPOR
PredGetwork = PtoPredAdjust(PredGetwork);
PredGetworkSeq = PtoPredAdjust(PredGetworkSeq);
#endif /* YAPOR */
#ifdef LOW_LEVEL_TRACER
#if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(Yap_low_level_trace_lock);
#endif
#endif
DUMMYCODE->opc = Yap_opcode(_op_fail);
FAILCODE->opc = Yap_opcode(_op_fail);
NOCODE->opc = Yap_opcode(_Nstop);
RestoreEnvInst(ENV_FOR_TRUSTFAIL,&TRUSTFAILCODE,_trust_fail,PredFail);
RestoreEnvInst(ENV_FOR_YESCODE,&YESCODE,_Ystop,PredFail);
RestoreOtaplInst(RTRYCODE,_retry_and_mark,PredFail);
#ifdef BEAM
BEAM_RETRY_CODE->opc = Yap_opcode(_beam_retry_code);
#endif /* BEAM */
#ifdef YAPOR
RestoreOtaplInst(GETWORK,_getwork,PredGetwork);
RestoreOtaplInst(GETWORK_SEQ,_getwork_seq,PredGetworkSeq);
GETWORK_FIRST_TIME->opc = Yap_opcode(_getwork_first_time);
#endif /* YAPOR */
#ifdef TABLING
RestoreOtaplInst(LOAD_ANSWER,_table_load_answer,PredFail);
RestoreOtaplInst(TRY_ANSWER,_table_try_answer,PredFail);
RestoreOtaplInst(ANSWER_RESOLUTION,_table_answer_resolution,PredFail);
RestoreOtaplInst(COMPLETION,_table_completion,PredFail);
#ifdef THREADS_CONSUMER_SHARING
RestoreOtaplInst(ANSWER_RESOLUTION_COMPLETION,_table_answer_resolution_completion,PredFail);
#endif /* THREADS_CONSUMER_SHARING */
#endif /* TABLING */
P_before_spy = PtoOpAdjust(P_before_spy);
RETRY_C_RECORDEDP_CODE = PtoOpAdjust(RETRY_C_RECORDEDP_CODE);
RETRY_C_RECORDED_K_CODE = PtoOpAdjust(RETRY_C_RECORDED_K_CODE);
#if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(DBTermsListLock);
#endif
RestoreDBTermsList();
RestoreExpandList();
#if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(ExpandClausesListLock);
REINIT_LOCK(OpListLock);
#endif
#ifdef DEBUG
#endif
RestoreUdiControlBlocks();
RestoreIntKeys();
RestoreIntLUKeys();
RestoreIntBBKeys();
RestoreDBErasedMarker();
RestoreLogDBErasedMarker();
RestoreDeadStaticClauses();
RestoreDeadMegaClauses();
RestoreDeadStaticIndices();
RestoreDBErasedList();
RestoreDBErasedIList();
#if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(DeadStaticClausesLock);
REINIT_LOCK(DeadMegaClausesLock);
REINIT_LOCK(DeadStaticIndicesLock);
#endif
#ifdef COROUTINING
#endif
OpList = OpListAdjust(OpList);
RestoreForeignCode();
RestoreYapRecords();
RestoreSWIAtoms();
RestoreEmptyWakeups();
RestoreBlobTypes();
RestoreBlobs();
#if defined(YAPOR) || defined(THREADS)
REINIT_LOCK(Blobs_Lock);
#endif

View File

@@ -1,277 +0,0 @@
/* This file, rlocals.h, was generated automatically by "yap -L misc/buildlocalglobal"
please do not update, update misc/LOCALS instead */
static void RestoreWorker(int wid USES_REGS) {
REMOTE_GlobalArena(wid) = TermToGlobalOrAtomAdjust(REMOTE_GlobalArena(wid));
RestoreBallTerm(wid);
#ifdef COROUTINING
REMOTE_WokenGoals(wid) = TermToGlobalAdjust(REMOTE_WokenGoals(wid));
REMOTE_AttsMutableList(wid) = TermToGlobalAdjust(REMOTE_AttsMutableList(wid));
#endif
REMOTE_GcGeneration(wid) = TermToGlobalAdjust(REMOTE_GcGeneration(wid));
REMOTE_GcPhase(wid) = TermToGlobalAdjust(REMOTE_GcPhase(wid));
#if defined(GC_NO_TAGS)
#endif
REMOTE_DynamicArrays(wid) = PtoArrayEAdjust(REMOTE_DynamicArrays(wid));
REMOTE_StaticArrays(wid) = PtoArraySAdjust(REMOTE_StaticArrays(wid));
REMOTE_GlobalVariables(wid) = PtoGlobalEAdjust(REMOTE_GlobalVariables(wid));
#ifdef THREADS
#endif /* THREADS */
#if defined(YAPOR) || defined(TABLING)
#endif /* YAPOR || TABLING */
#if LOW_LEVEL_TRACER
#endif
#ifdef ANALYST
#endif /* ANALYST */
#ifdef LOAD_DYLD
#endif
#ifdef LOW_LEVEL_TRACER
#endif
#if __ANDROID__
#endif
}

View File

@@ -56,6 +56,9 @@
Atom AtomArrow_;
#define AtomArrow Yap_heap_regs->AtomArrow_
#define TermArrow MkAtomTerm( Yap_heap_regs->AtomArrow_ )
Atom AtomAttributedModule_;
#define AtomAttributedModule Yap_heap_regs->AtomAttributedModule_
#define TermAttributedModule MkAtomTerm( Yap_heap_regs->AtomAttributedModule_ )
Atom AtomDoubleArrow_;
#define AtomDoubleArrow Yap_heap_regs->AtomDoubleArrow_
#define TermDoubleArrow MkAtomTerm( Yap_heap_regs->AtomDoubleArrow_ )
@@ -1426,6 +1429,8 @@
#define FunctorPortray Yap_heap_regs->FunctorPortray_
Functor FunctorPrintMessage_;
#define FunctorPrintMessage Yap_heap_regs->FunctorPrintMessage_
Functor FunctorProcedure_;
#define FunctorProcedure Yap_heap_regs->FunctorProcedure_
Functor FunctorPrologConstraint_;
#define FunctorPrologConstraint Yap_heap_regs->FunctorPrologConstraint_
Functor FunctorQuery_;