Christian's patches for OPTYap.
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@707 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
8264bfeb9e
commit
e216aab2c6
@ -4,9 +4,9 @@
|
|||||||
|
|
||||||
extern int PageSize;
|
extern int PageSize;
|
||||||
|
|
||||||
#define H_BASE ((CELL *) GlobalBase)
|
#define H_BASE ((CELL *) Yap_GlobalBase)
|
||||||
#define B_BASE ((choiceptr) LocalBase)
|
#define B_BASE ((choiceptr) Yap_LocalBase)
|
||||||
#define TR_BASE ((tr_fr_ptr) TrailBase)
|
#define TR_BASE ((tr_fr_ptr) Yap_TrailBase)
|
||||||
|
|
||||||
#if SIZEOF_INT_P == 4
|
#if SIZEOF_INT_P == 4
|
||||||
#define ALIGN 3
|
#define ALIGN 3
|
||||||
@ -36,9 +36,9 @@ extern int PageSize;
|
|||||||
|
|
||||||
|
|
||||||
#define ALLOC_BLOCK(BLOCK, SIZE) \
|
#define ALLOC_BLOCK(BLOCK, SIZE) \
|
||||||
BLOCK = (void *) AllocAtomSpace(SIZE)
|
BLOCK = (void *) Yap_AllocAtomSpace(SIZE)
|
||||||
#define FREE_BLOCK(BLOCK) \
|
#define FREE_BLOCK(BLOCK) \
|
||||||
FreeCodeSpace((char *) (BLOCK))
|
Yap_FreeCodeSpace((char *) (BLOCK))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -53,15 +53,15 @@ extern int PageSize;
|
|||||||
|
|
||||||
#ifdef USE_HEAP
|
#ifdef USE_HEAP
|
||||||
|
|
||||||
#define alloc_memory_block(SIZE) (void *)AllocCodeSpace(SIZE)
|
#define alloc_memory_block(SIZE) (void *)Yap_AllocCodeSpace(SIZE)
|
||||||
#define free_memory_block(BLK) FreeCodeSpace((ADDR)BLK)
|
#define free_memory_block(BLK) Yap_FreeCodeSpace((ADDR)BLK)
|
||||||
#define reset_alloc_block_area()
|
#define reset_alloc_block_area()
|
||||||
|
|
||||||
#define ALLOC_STRUCT(STR, STR_PAGES, STR_TYPE) STR = (STR_TYPE *)AllocCodeSpace(sizeof(STR_TYPE))
|
#define ALLOC_STRUCT(STR, STR_PAGES, STR_TYPE) STR = (STR_TYPE *)Yap_AllocCodeSpace(sizeof(STR_TYPE))
|
||||||
|
|
||||||
#define ALLOC_NEXT_FREE_STRUCT(STR, STR_PAGES, STR_TYPE) STR = (STR_TYPE *)AllocCodeSpace(sizeof(STR_TYPE))
|
#define ALLOC_NEXT_FREE_STRUCT(STR, STR_PAGES, STR_TYPE) STR = (STR_TYPE *)Yap_AllocCodeSpace(sizeof(STR_TYPE))
|
||||||
|
|
||||||
#define FREE_STRUCT(STR, STR_PAGES, STR_TYPE) FreeCodeSpace((ADDR)(STR))
|
#define FREE_STRUCT(STR, STR_PAGES, STR_TYPE) Yap_FreeCodeSpace((ADDR)(STR))
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
|
@ -127,7 +127,7 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
|||||||
TrailAuxArea = ADJUST_SIZE(TrailAuxArea * KBYTES);
|
TrailAuxArea = ADJUST_SIZE(TrailAuxArea * KBYTES);
|
||||||
|
|
||||||
/* we'll need this later */
|
/* we'll need this later */
|
||||||
_YAP_GlobalBase = mmap_addr + HeapArea;
|
Yap_GlobalBase = mmap_addr + HeapArea;
|
||||||
|
|
||||||
/* model dependent */
|
/* model dependent */
|
||||||
/* shared memory allocation */
|
/* shared memory allocation */
|
||||||
@ -168,14 +168,14 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
|||||||
/* just allocate local space for stacks */
|
/* just allocate local space for stacks */
|
||||||
if ((private_fd_mapfile = open("/dev/zero", O_RDWR)) < 0)
|
if ((private_fd_mapfile = open("/dev/zero", O_RDWR)) < 0)
|
||||||
abort_optyap("open error in function map_memory: %s", strerror(errno));
|
abort_optyap("open error in function map_memory: %s", strerror(errno));
|
||||||
if (mmap(_YAP_GlobalBase, GlobalLocalArea + TrailAuxArea, PROT_READ|PROT_WRITE,
|
if (mmap(Yap_GlobalBase, GlobalLocalArea + TrailAuxArea, PROT_READ|PROT_WRITE,
|
||||||
MAP_PRIVATE|MAP_FIXED, private_fd_mapfile, 0) == (void *) -1)
|
MAP_PRIVATE|MAP_FIXED, private_fd_mapfile, 0) == (void *) -1)
|
||||||
abort_optyap("mmap error in function map_memory: %s", strerror(errno));
|
abort_optyap("mmap error in function map_memory: %s", strerror(errno));
|
||||||
close(private_fd_mapfile);
|
close(private_fd_mapfile);
|
||||||
#else /* ENV_COPY or SBA */
|
#else /* ENV_COPY or SBA */
|
||||||
for (i = 0; i < n_workers; i++) {
|
for (i = 0; i < n_workers; i++) {
|
||||||
/* initialize worker vars */
|
/* initialize worker vars */
|
||||||
worker_area(i) = _YAP_GlobalBase + i * WorkerArea;
|
worker_area(i) = Yap_GlobalBase + i * WorkerArea;
|
||||||
worker_offset(i) = worker_area(i) - worker_area(0);
|
worker_offset(i) = worker_area(i) - worker_area(0);
|
||||||
#ifdef SHM_MEMORY_MAPPING_SCHEME
|
#ifdef SHM_MEMORY_MAPPING_SCHEME
|
||||||
/* mapping worker area */
|
/* mapping worker area */
|
||||||
@ -199,22 +199,22 @@ void map_memory(long HeapArea, long GlobalLocalArea, long TrailAuxArea, int n_wo
|
|||||||
if ((CELL)binding_array & MBIT) {
|
if ((CELL)binding_array & MBIT) {
|
||||||
abort_optyap("OOPS: binding_array start address %p conflicts with tag %x used in IDB", binding_array, MBIT);
|
abort_optyap("OOPS: binding_array start address %p conflicts with tag %x used in IDB", binding_array, MBIT);
|
||||||
}
|
}
|
||||||
sba_offset = binding_array - _YAP_GlobalBase;
|
sba_offset = binding_array - Yap_GlobalBase;
|
||||||
sba_end = (int)binding_array + sba_size;
|
sba_end = (int)binding_array + sba_size;
|
||||||
#endif /* SBA */
|
#endif /* SBA */
|
||||||
_YAP_TrailBase = _YAP_GlobalBase + GlobalLocalArea;
|
Yap_TrailBase = Yap_GlobalBase + GlobalLocalArea;
|
||||||
_YAP_LocalBase = _YAP_TrailBase - CellSize;
|
Yap_LocalBase = Yap_TrailBase - CellSize;
|
||||||
|
|
||||||
|
|
||||||
if (TrailAuxArea > 262144) /* 262144 = 256 * 1024 */
|
if (TrailAuxArea > 262144) /* 262144 = 256 * 1024 */
|
||||||
TrailTop = TrailBase + TrailAuxArea - 131072; /* 131072 = 262144 / 2 */
|
Yap_TrailTop = Yap_TrailBase + TrailAuxArea - 131072; /* 131072 = 262144 / 2 */
|
||||||
else
|
else
|
||||||
TrailTop = TrailBase + TrailAuxArea / 2;
|
Yap_TrailTop = Yap_TrailBase + TrailAuxArea / 2;
|
||||||
|
|
||||||
|
|
||||||
AuxTop = _YAP_TrailBase + TrailAuxArea - CellSize;
|
AuxTop = Yap_TrailBase + TrailAuxArea - CellSize;
|
||||||
AuxSp = (CELL *) AuxTop;
|
AuxSp = (CELL *) AuxTop;
|
||||||
_YAP_InitHeap(mmap_addr);
|
Yap_InitHeap(mmap_addr);
|
||||||
BaseWorkArea = mmap_addr;
|
BaseWorkArea = mmap_addr;
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -292,10 +292,10 @@ void remap_memory(void) {
|
|||||||
/* setup workers so that they have different areas */
|
/* setup workers so that they have different areas */
|
||||||
long WorkerArea = worker_offset(1);
|
long WorkerArea = worker_offset(1);
|
||||||
|
|
||||||
_YAP_GlobalBase += worker_id * WorkerArea;
|
Yap_GlobalBase += worker_id * WorkerArea;
|
||||||
_YAP_TrailBase += worker_id * WorkerArea;
|
Yap_TrailBase += worker_id * WorkerArea;
|
||||||
_YAP_LocalBase += worker_id * WorkerArea;
|
Yap_LocalBase += worker_id * WorkerArea;
|
||||||
_YAP_TrailTop += worker_id * WorkerArea;
|
Yap_TrailTop += worker_id * WorkerArea;
|
||||||
AuxTop += worker_id * WorkerArea;
|
AuxTop += worker_id * WorkerArea;
|
||||||
AuxSp = (CELL *) AuxTop;
|
AuxSp = (CELL *) AuxTop;
|
||||||
#endif /* SBA */
|
#endif /* SBA */
|
||||||
@ -360,7 +360,7 @@ void *alloc_memory_block(int size) {
|
|||||||
void free_memory_block(void *block) {
|
void free_memory_block(void *block) {
|
||||||
#if USE_HEAP_FOR_ALLOC_MEMORY_BLOCKS
|
#if USE_HEAP_FOR_ALLOC_MEMORY_BLOCKS
|
||||||
LOCK(Pg_lock(GLOBAL_PAGES_void));
|
LOCK(Pg_lock(GLOBAL_PAGES_void));
|
||||||
FreeCodeSpace((char *) block);
|
Yap_FreeCodeSpace((char *) block);
|
||||||
UNLOCK(Pg_lock(GLOBAL_PAGES_void));
|
UNLOCK(Pg_lock(GLOBAL_PAGES_void));
|
||||||
#endif /* USE_HEAP_FOR_ALLOC_MEMORY_BLOCKS */
|
#endif /* USE_HEAP_FOR_ALLOC_MEMORY_BLOCKS */
|
||||||
}
|
}
|
||||||
|
@ -68,28 +68,28 @@ static int p_debug_prolog(void);
|
|||||||
** Global functions **
|
** Global functions **
|
||||||
** -------------------------- */
|
** -------------------------- */
|
||||||
|
|
||||||
void _YAP_init_optyap_preds(void) {
|
void Yap_init_optyap_preds(void) {
|
||||||
_YAP_InitCPred("$default_sequential", 1, p_default_sequential, SafePredFlag);
|
Yap_InitCPred("$default_sequential", 1, p_default_sequential, SafePredFlag);
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
_YAP_InitCPred("$yapor_on", 0, yapor_on, SafePredFlag);
|
Yap_InitCPred("$yapor_on", 0, yapor_on, SafePredFlag);
|
||||||
_YAP_InitCPred("$start_yapor", 0, start_yapor, SafePredFlag);
|
Yap_InitCPred("$start_yapor", 0, start_yapor, SafePredFlag);
|
||||||
_YAP_InitCPred("$sequential", 1, p_sequential, SafePredFlag);
|
Yap_InitCPred("$sequential", 1, p_sequential, SafePredFlag);
|
||||||
_YAP_InitCPred("execution_mode", 1, p_execution_mode, SafePredFlag);
|
Yap_InitCPred("execution_mode", 1, p_execution_mode, SafePredFlag);
|
||||||
_YAP_InitCPred("performance", 1, p_performance, SafePredFlag);
|
Yap_InitCPred("performance", 1, p_performance, SafePredFlag);
|
||||||
_YAP_InitCPred("$parallel_new_answer", 1, p_parallel_new_answer, SafePredFlag);
|
Yap_InitCPred("$parallel_new_answer", 1, p_parallel_new_answer, SafePredFlag);
|
||||||
_YAP_InitCPred("$parallel_yes_answer", 0, p_parallel_yes_answer, SafePredFlag);
|
Yap_InitCPred("$parallel_yes_answer", 0, p_parallel_yes_answer, SafePredFlag);
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
_YAP_InitCPred("$do_table", 2, p_table, SafePredFlag);
|
Yap_InitCPred("$do_table", 2, p_table, SafePredFlag);
|
||||||
_YAP_InitCPred("$do_abolish_trie", 2, p_abolish_trie, SafePredFlag);
|
Yap_InitCPred("$do_abolish_trie", 2, p_abolish_trie, SafePredFlag);
|
||||||
_YAP_InitCPred("$show_trie", 3, p_show_trie, SafePredFlag);
|
Yap_InitCPred("$show_trie", 3, p_show_trie, SafePredFlag);
|
||||||
_YAP_InitCPred("$resume_trie", 2, p_resume_trie, SafePredFlag);
|
Yap_InitCPred("$resume_trie", 2, p_resume_trie, SafePredFlag);
|
||||||
#endif /* TABLING */
|
#endif /* TABLING */
|
||||||
#ifdef STATISTICS
|
#ifdef STATISTICS
|
||||||
_YAP_InitCPred("show_frames", 0, p_show_frames, SafePredFlag);
|
Yap_InitCPred("show_frames", 0, p_show_frames, SafePredFlag);
|
||||||
#endif /* STATISTICS */
|
#endif /* STATISTICS */
|
||||||
#if defined(YAPOR_ERRORS) || defined(TABLING_ERRORS)
|
#if defined(YAPOR_ERRORS) || defined(TABLING_ERRORS)
|
||||||
_YAP_InitCPred("debug_prolog", 1, p_debug_prolog, SafePredFlag);
|
Yap_InitCPred("debug_prolog", 1, p_debug_prolog, SafePredFlag);
|
||||||
#endif /* YAPOR_ERRORS || TABLING_ERRORS */
|
#endif /* YAPOR_ERRORS || TABLING_ERRORS */
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -116,9 +116,9 @@ int p_default_sequential(void) {
|
|||||||
if (IsVarTerm(t)) {
|
if (IsVarTerm(t)) {
|
||||||
Term ta;
|
Term ta;
|
||||||
if (SEQUENTIAL_IS_DEFAULT)
|
if (SEQUENTIAL_IS_DEFAULT)
|
||||||
ta = MkAtomTerm(_YAP_LookupAtom("on"));
|
ta = MkAtomTerm(Yap_LookupAtom("on"));
|
||||||
else
|
else
|
||||||
ta = MkAtomTerm(_YAP_LookupAtom("off"));
|
ta = MkAtomTerm(Yap_LookupAtom("off"));
|
||||||
Bind((CELL *)t, ta);
|
Bind((CELL *)t, ta);
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
@ -147,7 +147,7 @@ realtime current_time(void) {
|
|||||||
/* to get time as Yap */
|
/* to get time as Yap */
|
||||||
/*
|
/*
|
||||||
double now, interval;
|
double now, interval;
|
||||||
_YAP_cputime_interval(&now, &interval);
|
Yap_cputime_interval(&now, &interval);
|
||||||
return ((realtime)now);
|
return ((realtime)now);
|
||||||
*/
|
*/
|
||||||
struct timeval tempo;
|
struct timeval tempo;
|
||||||
@ -196,7 +196,7 @@ int p_sequential(void) {
|
|||||||
if (IsVarTerm(tmod) || !IsAtomTerm(tmod)) {
|
if (IsVarTerm(tmod) || !IsAtomTerm(tmod)) {
|
||||||
return(FALSE);
|
return(FALSE);
|
||||||
}
|
}
|
||||||
mod = LookupModule(tmod);
|
mod = Yap_LookupModule(tmod);
|
||||||
if (IsAtomTerm(t)) {
|
if (IsAtomTerm(t)) {
|
||||||
at = AtomOfTerm(t);
|
at = AtomOfTerm(t);
|
||||||
arity = 0;
|
arity = 0;
|
||||||
@ -222,9 +222,9 @@ int p_execution_mode(void) {
|
|||||||
if (IsVarTerm(t)) {
|
if (IsVarTerm(t)) {
|
||||||
Term ta;
|
Term ta;
|
||||||
if (PARALLEL_EXECUTION_MODE)
|
if (PARALLEL_EXECUTION_MODE)
|
||||||
ta = MkAtomTerm(_YAP_LookupAtom("parallel"));
|
ta = MkAtomTerm(Yap_LookupAtom("parallel"));
|
||||||
else
|
else
|
||||||
ta = MkAtomTerm(_YAP_LookupAtom("sequential"));
|
ta = MkAtomTerm(Yap_LookupAtom("sequential"));
|
||||||
Bind((CELL *)t, ta);
|
Bind((CELL *)t, ta);
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
}
|
}
|
||||||
@ -255,9 +255,9 @@ int p_performance(void) {
|
|||||||
if (IsVarTerm(t)) {
|
if (IsVarTerm(t)) {
|
||||||
Term ta;
|
Term ta;
|
||||||
if (GLOBAL_performance_mode & PERFORMANCE_ON) {
|
if (GLOBAL_performance_mode & PERFORMANCE_ON) {
|
||||||
ta = MkAtomTerm(_YAP_LookupAtom("on"));
|
ta = MkAtomTerm(Yap_LookupAtom("on"));
|
||||||
} else {
|
} else {
|
||||||
ta = MkAtomTerm(_YAP_LookupAtom("off"));
|
ta = MkAtomTerm(Yap_LookupAtom("off"));
|
||||||
}
|
}
|
||||||
Bind((CELL *)t, ta);
|
Bind((CELL *)t, ta);
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
@ -325,7 +325,7 @@ int p_parallel_new_answer(void) {
|
|||||||
|
|
||||||
length_answer = 0;
|
length_answer = 0;
|
||||||
ALLOC_QG_ANSWER_FRAME(actual_answer);
|
ALLOC_QG_ANSWER_FRAME(actual_answer);
|
||||||
_YAP_plwrite(ARG1, parallel_new_answer_putchar, 4);
|
Yap_plwrite(ARG1, parallel_new_answer_putchar, 4);
|
||||||
AnsFr_answer(actual_answer)[length_answer] = 0;
|
AnsFr_answer(actual_answer)[length_answer] = 0;
|
||||||
AnsFr_next(actual_answer) = NULL;
|
AnsFr_next(actual_answer) = NULL;
|
||||||
leftmost_or_fr = CUT_leftmost_or_frame();
|
leftmost_or_fr = CUT_leftmost_or_frame();
|
||||||
@ -468,7 +468,7 @@ int p_table(void) {
|
|||||||
if (IsVarTerm(t2) || !IsAtomTerm(t2)) {
|
if (IsVarTerm(t2) || !IsAtomTerm(t2)) {
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
} else {
|
} else {
|
||||||
mod = LookupModule(t2);
|
mod = Yap_LookupModule(t2);
|
||||||
}
|
}
|
||||||
if (IsAtomTerm(t)) {
|
if (IsAtomTerm(t)) {
|
||||||
Atom at = AtomOfTerm(t);
|
Atom at = AtomOfTerm(t);
|
||||||
@ -502,7 +502,7 @@ int p_abolish_trie(void) {
|
|||||||
if (IsVarTerm(tmod) || !IsAtomTerm(tmod)) {
|
if (IsVarTerm(tmod) || !IsAtomTerm(tmod)) {
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
} else {
|
} else {
|
||||||
mod = LookupModule(tmod);
|
mod = Yap_LookupModule(tmod);
|
||||||
}
|
}
|
||||||
if (IsAtomTerm(t)) {
|
if (IsAtomTerm(t)) {
|
||||||
Atom at = AtomOfTerm(t);
|
Atom at = AtomOfTerm(t);
|
||||||
@ -541,7 +541,7 @@ int p_show_trie(void) {
|
|||||||
if (IsVarTerm(tmod) || !IsAtomTerm(tmod)) {
|
if (IsVarTerm(tmod) || !IsAtomTerm(tmod)) {
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
} else {
|
} else {
|
||||||
mod = LookupModule(tmod);
|
mod = Yap_LookupModule(tmod);
|
||||||
}
|
}
|
||||||
if (IsAtomTerm(t1)) {
|
if (IsAtomTerm(t1)) {
|
||||||
at = AtomOfTerm(t1);
|
at = AtomOfTerm(t1);
|
||||||
@ -557,7 +557,7 @@ int p_show_trie(void) {
|
|||||||
|
|
||||||
t2 = Deref(ARG3);
|
t2 = Deref(ARG3);
|
||||||
if (IsVarTerm(t2)) {
|
if (IsVarTerm(t2)) {
|
||||||
Term ta = MkAtomTerm(_YAP_LookupAtom("stdout"));
|
Term ta = MkAtomTerm(Yap_LookupAtom("stdout"));
|
||||||
Bind((CELL *)t2, ta);
|
Bind((CELL *)t2, ta);
|
||||||
traverse_trie(stderr, TrNode_child(TabEnt_subgoal_trie(pe->TableOfPred)), arity, at, TRUE);
|
traverse_trie(stderr, TrNode_child(TabEnt_subgoal_trie(pe->TableOfPred)), arity, at, TRUE);
|
||||||
} else if (IsAtomTerm(t2)) {
|
} else if (IsAtomTerm(t2)) {
|
||||||
@ -585,7 +585,7 @@ int p_resume_trie(void) {
|
|||||||
if (IsVarTerm(tmod) || !IsAtomTerm(tmod)) {
|
if (IsVarTerm(tmod) || !IsAtomTerm(tmod)) {
|
||||||
return (FALSE);
|
return (FALSE);
|
||||||
} else {
|
} else {
|
||||||
mod = LookupModule(tmod);
|
mod = Yap_LookupModule(tmod);
|
||||||
}
|
}
|
||||||
t1 = Deref(ARG1);
|
t1 = Deref(ARG1);
|
||||||
if (IsAtomTerm(t1)) {
|
if (IsAtomTerm(t1)) {
|
||||||
|
@ -303,7 +303,7 @@ sync_with_p:
|
|||||||
#ifdef YAPOR_ERRORS
|
#ifdef YAPOR_ERRORS
|
||||||
if ((CELL *)aux_cell < H0)
|
if ((CELL *)aux_cell < H0)
|
||||||
YAPOR_ERROR_MESSAGE("aux_cell < H0 (q_share_work)");
|
YAPOR_ERROR_MESSAGE("aux_cell < H0 (q_share_work)");
|
||||||
if ((ADDR)aux_cell > _YAP_LocalBase)
|
if ((ADDR)aux_cell > Yap_LocalBase)
|
||||||
YAPOR_ERROR_MESSAGE("aux_cell > LocalBase (q_share_work)");
|
YAPOR_ERROR_MESSAGE("aux_cell > LocalBase (q_share_work)");
|
||||||
#endif /* YAPOR_ERRORS */
|
#endif /* YAPOR_ERRORS */
|
||||||
#ifdef TABLING
|
#ifdef TABLING
|
||||||
|
@ -30,7 +30,7 @@ static inline
|
|||||||
Int bind_variable(Term t0, Term t1)
|
Int bind_variable(Term t0, Term t1)
|
||||||
{
|
{
|
||||||
tr_fr_ptr TR0 = TR;
|
tr_fr_ptr TR0 = TR;
|
||||||
if (_YAP_IUnify(t0,t1)) {
|
if (Yap_IUnify(t0,t1)) {
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
} else {
|
} else {
|
||||||
while(TR != TR0) {
|
while(TR != TR0) {
|
||||||
@ -48,7 +48,7 @@ Int unify(Term t0, Term t1)
|
|||||||
Int unify(Term t0, Term t1)
|
Int unify(Term t0, Term t1)
|
||||||
{
|
{
|
||||||
tr_fr_ptr TR0 = TR;
|
tr_fr_ptr TR0 = TR;
|
||||||
if (_YAP_IUnify(t0,t1)) {
|
if (Yap_IUnify(t0,t1)) {
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
} else {
|
} else {
|
||||||
while(TR != TR0) {
|
while(TR != TR0) {
|
||||||
|
@ -91,7 +91,7 @@
|
|||||||
x_args++; \
|
x_args++; \
|
||||||
x_args[-1] = x; \
|
x_args[-1] = x; \
|
||||||
} \
|
} \
|
||||||
Y = pt_args; \
|
YENV = pt_args; \
|
||||||
SET_BB(PROTECT_FROZEN_B(B)); \
|
SET_BB(PROTECT_FROZEN_B(B)); \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,14 +142,14 @@
|
|||||||
H = HBREG = PROTECT_FROZEN_H(B); \
|
H = HBREG = PROTECT_FROZEN_H(B); \
|
||||||
CPREG = B->cp_cp; \
|
CPREG = B->cp_cp; \
|
||||||
ENV = B->cp_env; \
|
ENV = B->cp_env; \
|
||||||
/* set_cut(Y, B->cp_b); has no effect */ \
|
/* set_cut(YENV, B->cp_b); has no effect */ \
|
||||||
PREG = (yamop *) CPREG; \
|
PREG = (yamop *) CPREG; \
|
||||||
PREFETCH_OP(PREG); \
|
PREFETCH_OP(PREG); \
|
||||||
/* load answer from table to global stack */ \
|
/* load answer from table to global stack */ \
|
||||||
init_substitution_pointer(subs_ptr, DEP_FR); \
|
init_substitution_pointer(subs_ptr, DEP_FR); \
|
||||||
load_answer_trie(ANSWER, subs_ptr); \
|
load_answer_trie(ANSWER, subs_ptr); \
|
||||||
/* procceed */ \
|
/* procceed */ \
|
||||||
Y = ENV; \
|
YENV = ENV; \
|
||||||
GONext(); \
|
GONext(); \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,14 +195,14 @@
|
|||||||
sg_fr_ptr sg_fr;
|
sg_fr_ptr sg_fr;
|
||||||
CELL *Yaddr;
|
CELL *Yaddr;
|
||||||
|
|
||||||
Yaddr = Y;
|
Yaddr = YENV;
|
||||||
check_trail();
|
check_trail();
|
||||||
tab_ent = PREG->u.ld.te;
|
tab_ent = PREG->u.ld.te;
|
||||||
#ifdef TABLE_LOCK_AT_ENTRY_LEVEL
|
#ifdef TABLE_LOCK_AT_ENTRY_LEVEL
|
||||||
LOCK(TabEnt_lock(tab_ent));
|
LOCK(TabEnt_lock(tab_ent));
|
||||||
#endif /* TABLE_LOCK_LEVEL */
|
#endif /* TABLE_LOCK_LEVEL */
|
||||||
sg_node = subgoal_search(tab_ent, PREG->u.ld.s, &Yaddr);
|
sg_node = subgoal_search(tab_ent, PREG->u.ld.s, &Yaddr);
|
||||||
Y = Yaddr;
|
YENV = Yaddr;
|
||||||
#if defined(TABLE_LOCK_AT_NODE_LEVEL)
|
#if defined(TABLE_LOCK_AT_NODE_LEVEL)
|
||||||
LOCK(TrNode_lock(sg_node));
|
LOCK(TrNode_lock(sg_node));
|
||||||
#elif defined(TABLE_LOCK_AT_WRITE_LEVEL)
|
#elif defined(TABLE_LOCK_AT_WRITE_LEVEL)
|
||||||
@ -220,10 +220,10 @@
|
|||||||
UNLOCK_TABLE(sg_node);
|
UNLOCK_TABLE(sg_node);
|
||||||
#endif /* TABLE_LOCK_LEVEL */
|
#endif /* TABLE_LOCK_LEVEL */
|
||||||
LOCAL_top_sg_fr = sg_fr;
|
LOCAL_top_sg_fr = sg_fr;
|
||||||
store_generator_node(Y, PREG->u.ld.s, COMPLETION, sg_fr);
|
store_generator_node(YENV, PREG->u.ld.s, COMPLETION, sg_fr);
|
||||||
PREG = NEXTOP(PREG, ld);
|
PREG = NEXTOP(PREG, ld);
|
||||||
PREFETCH_OP(PREG);
|
PREFETCH_OP(PREG);
|
||||||
allocate_environment(Y);
|
allocate_environment(YENV);
|
||||||
GONext();
|
GONext();
|
||||||
} else {
|
} else {
|
||||||
/* tabled subgoal not new */
|
/* tabled subgoal not new */
|
||||||
@ -248,14 +248,14 @@
|
|||||||
/* yes answer --> procceed */
|
/* yes answer --> procceed */
|
||||||
PREG = (yamop *) CPREG;
|
PREG = (yamop *) CPREG;
|
||||||
PREFETCH_OP(PREG);
|
PREFETCH_OP(PREG);
|
||||||
Y = ENV;
|
YENV = ENV;
|
||||||
GONext();
|
GONext();
|
||||||
} else {
|
} else {
|
||||||
/* answers -> load first answer */
|
/* answers -> load first answer */
|
||||||
PREG = (yamop *) TrNode_child(SgFr_answer_trie(sg_fr));
|
PREG = (yamop *) TrNode_child(SgFr_answer_trie(sg_fr));
|
||||||
PREFETCH_OP(PREG);
|
PREFETCH_OP(PREG);
|
||||||
*--Y = 0; /* vars_arity */
|
*--YENV = 0; /* vars_arity */
|
||||||
*--Y = 0; /* heap_arity */
|
*--YENV = 0; /* heap_arity */
|
||||||
GONext();
|
GONext();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -265,7 +265,7 @@
|
|||||||
find_dependency_node(sg_fr, leader_cp, leader_dep_on_stack);
|
find_dependency_node(sg_fr, leader_cp, leader_dep_on_stack);
|
||||||
UNLOCK(SgFr_lock(sg_fr));
|
UNLOCK(SgFr_lock(sg_fr));
|
||||||
find_leader_node(leader_cp, leader_dep_on_stack);
|
find_leader_node(leader_cp, leader_dep_on_stack);
|
||||||
store_consumer_node(Y, sg_fr, leader_cp, leader_dep_on_stack);
|
store_consumer_node(YENV, sg_fr, leader_cp, leader_dep_on_stack);
|
||||||
#ifdef OPTYAP_ERRORS
|
#ifdef OPTYAP_ERRORS
|
||||||
if (PARALLEL_EXECUTION_MODE) {
|
if (PARALLEL_EXECUTION_MODE) {
|
||||||
choiceptr aux_cp;
|
choiceptr aux_cp;
|
||||||
@ -294,14 +294,14 @@
|
|||||||
sg_fr_ptr sg_fr;
|
sg_fr_ptr sg_fr;
|
||||||
CELL *Yaddr;
|
CELL *Yaddr;
|
||||||
|
|
||||||
Yaddr = Y;
|
Yaddr = YENV;
|
||||||
check_trail();
|
check_trail();
|
||||||
tab_ent = PREG->u.ld.te;
|
tab_ent = PREG->u.ld.te;
|
||||||
#ifdef TABLE_LOCK_AT_ENTRY_LEVEL
|
#ifdef TABLE_LOCK_AT_ENTRY_LEVEL
|
||||||
LOCK(TabEnt_lock(tab_ent));
|
LOCK(TabEnt_lock(tab_ent));
|
||||||
#endif /* TABLE_LOCK_LEVEL */
|
#endif /* TABLE_LOCK_LEVEL */
|
||||||
sg_node = subgoal_search(tab_ent, PREG->u.ld.s, &Yaddr);
|
sg_node = subgoal_search(tab_ent, PREG->u.ld.s, &Yaddr);
|
||||||
Y = Yaddr;
|
YENV = Yaddr;
|
||||||
#if defined(TABLE_LOCK_AT_NODE_LEVEL)
|
#if defined(TABLE_LOCK_AT_NODE_LEVEL)
|
||||||
LOCK(TrNode_lock(sg_node));
|
LOCK(TrNode_lock(sg_node));
|
||||||
#elif defined(TABLE_LOCK_AT_WRITE_LEVEL)
|
#elif defined(TABLE_LOCK_AT_WRITE_LEVEL)
|
||||||
@ -319,10 +319,10 @@
|
|||||||
UNLOCK_TABLE(sg_node);
|
UNLOCK_TABLE(sg_node);
|
||||||
#endif /* TABLE_LOCK_LEVEL */
|
#endif /* TABLE_LOCK_LEVEL */
|
||||||
LOCAL_top_sg_fr = sg_fr;
|
LOCAL_top_sg_fr = sg_fr;
|
||||||
store_generator_node(Y, PREG->u.ld.s, PREG->u.ld.d, sg_fr);
|
store_generator_node(YENV, PREG->u.ld.s, PREG->u.ld.d, sg_fr);
|
||||||
PREG = NEXTOP(PREG, ld);
|
PREG = NEXTOP(PREG, ld);
|
||||||
PREFETCH_OP(PREG);
|
PREFETCH_OP(PREG);
|
||||||
allocate_environment(Y);
|
allocate_environment(YENV);
|
||||||
GONext();
|
GONext();
|
||||||
} else {
|
} else {
|
||||||
/* tabled subgoal not new */
|
/* tabled subgoal not new */
|
||||||
@ -347,14 +347,14 @@
|
|||||||
/* yes answer --> procceed */
|
/* yes answer --> procceed */
|
||||||
PREG = (yamop *) CPREG;
|
PREG = (yamop *) CPREG;
|
||||||
PREFETCH_OP(PREG);
|
PREFETCH_OP(PREG);
|
||||||
Y = ENV;
|
YENV = ENV;
|
||||||
GONext();
|
GONext();
|
||||||
} else {
|
} else {
|
||||||
/* answers -> load first answer */
|
/* answers -> load first answer */
|
||||||
PREG = (yamop *) TrNode_child(SgFr_answer_trie(sg_fr));
|
PREG = (yamop *) TrNode_child(SgFr_answer_trie(sg_fr));
|
||||||
PREFETCH_OP(PREG);
|
PREFETCH_OP(PREG);
|
||||||
*--Y = 0; /* vars_arity */
|
*--YENV = 0; /* vars_arity */
|
||||||
*--Y = 0; /* heap_arity */
|
*--YENV = 0; /* heap_arity */
|
||||||
GONext();
|
GONext();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -364,7 +364,7 @@
|
|||||||
find_dependency_node(sg_fr, leader_cp, leader_dep_on_stack);
|
find_dependency_node(sg_fr, leader_cp, leader_dep_on_stack);
|
||||||
UNLOCK(SgFr_lock(sg_fr));
|
UNLOCK(SgFr_lock(sg_fr));
|
||||||
find_leader_node(leader_cp, leader_dep_on_stack);
|
find_leader_node(leader_cp, leader_dep_on_stack);
|
||||||
store_consumer_node(Y, sg_fr, leader_cp, leader_dep_on_stack);
|
store_consumer_node(YENV, sg_fr, leader_cp, leader_dep_on_stack);
|
||||||
#ifdef OPTYAP_ERRORS
|
#ifdef OPTYAP_ERRORS
|
||||||
if (PARALLEL_EXECUTION_MODE) {
|
if (PARALLEL_EXECUTION_MODE) {
|
||||||
choiceptr aux_cp;
|
choiceptr aux_cp;
|
||||||
@ -389,10 +389,10 @@
|
|||||||
|
|
||||||
Op(table_retry_me, ld)
|
Op(table_retry_me, ld)
|
||||||
restore_generator_node(B, PREG->u.ld.s, PREG->u.ld.d);
|
restore_generator_node(B, PREG->u.ld.s, PREG->u.ld.d);
|
||||||
Y = (CELL *) PROTECT_FROZEN_B(B);
|
YENV = (CELL *) PROTECT_FROZEN_B(B);
|
||||||
set_cut(Y, B->cp_b);
|
set_cut(YENV, B->cp_b);
|
||||||
SET_BB(NORM_CP(Y));
|
SET_BB(NORM_CP(YENV));
|
||||||
allocate_environment(Y);
|
allocate_environment(YENV);
|
||||||
PREG = NEXTOP(PREG,ld);
|
PREG = NEXTOP(PREG,ld);
|
||||||
GONext();
|
GONext();
|
||||||
ENDOp();
|
ENDOp();
|
||||||
@ -401,10 +401,10 @@
|
|||||||
|
|
||||||
Op(table_trust_me, ld)
|
Op(table_trust_me, ld)
|
||||||
restore_generator_node(B, PREG->u.ld.s, COMPLETION);
|
restore_generator_node(B, PREG->u.ld.s, COMPLETION);
|
||||||
Y = (CELL *) PROTECT_FROZEN_B(B);
|
YENV = (CELL *) PROTECT_FROZEN_B(B);
|
||||||
set_cut(Y, B->cp_b);
|
set_cut(YENV, B->cp_b);
|
||||||
SET_BB(NORM_CP(Y));
|
SET_BB(NORM_CP(YENV));
|
||||||
allocate_environment(Y);
|
allocate_environment(YENV);
|
||||||
PREG = NEXTOP(PREG,ld);
|
PREG = NEXTOP(PREG,ld);
|
||||||
GONext();
|
GONext();
|
||||||
ENDOp();
|
ENDOp();
|
||||||
@ -419,7 +419,7 @@
|
|||||||
|
|
||||||
/* possible optimization: when the number of substitution variables **
|
/* possible optimization: when the number of substitution variables **
|
||||||
** is zero, an answer is sufficient to perform an early completion */
|
** is zero, an answer is sufficient to perform an early completion */
|
||||||
gcp = GEN_CP(Y[E_B]);
|
gcp = GEN_CP(YENV[E_B]);
|
||||||
sg_fr = GEN_CP_SG_FR(gcp);
|
sg_fr = GEN_CP_SG_FR(gcp);
|
||||||
subs_ptr = (CELL *)(gcp + 1) + PREG->u.s.s;
|
subs_ptr = (CELL *)(gcp + 1) + PREG->u.s.s;
|
||||||
#ifdef TABLING_ERRORS
|
#ifdef TABLING_ERRORS
|
||||||
@ -501,11 +501,11 @@
|
|||||||
}
|
}
|
||||||
#ifdef TABLING_BATCHED_SCHEDULING
|
#ifdef TABLING_BATCHED_SCHEDULING
|
||||||
/* deallocate and procceed */
|
/* deallocate and procceed */
|
||||||
PREG = (yamop *) Y[E_CP];
|
PREG = (yamop *) YENV[E_CP];
|
||||||
PREFETCH_OP(PREG);
|
PREFETCH_OP(PREG);
|
||||||
CPREG = PREG;
|
CPREG = PREG;
|
||||||
SREG = Y;
|
SREG = YENV;
|
||||||
ENV = Y = (CELL *) Y[E_E];
|
ENV = YENV = (CELL *) YENV[E_E];
|
||||||
GONext();
|
GONext();
|
||||||
#else /* TABLING_LOCAL_SCHEDULING */
|
#else /* TABLING_LOCAL_SCHEDULING */
|
||||||
/* fail */
|
/* fail */
|
||||||
@ -611,11 +611,11 @@
|
|||||||
UNLOCK(SgFr_lock(sg_fr));
|
UNLOCK(SgFr_lock(sg_fr));
|
||||||
#ifdef TABLING_BATCHED_SCHEDULING
|
#ifdef TABLING_BATCHED_SCHEDULING
|
||||||
/* deallocate and procceed */
|
/* deallocate and procceed */
|
||||||
PREG = (yamop *) Y[E_CP];
|
PREG = (yamop *) YENV[E_CP];
|
||||||
PREFETCH_OP(PREG);
|
PREFETCH_OP(PREG);
|
||||||
CPREG = PREG;
|
CPREG = PREG;
|
||||||
SREG = Y;
|
SREG = YENV;
|
||||||
ENV = Y = (CELL *) Y[E_E];
|
ENV = YENV = (CELL *) YENV[E_E];
|
||||||
GONext();
|
GONext();
|
||||||
#else /* TABLING_LOCAL_SCHEDULING */
|
#else /* TABLING_LOCAL_SCHEDULING */
|
||||||
/* fail */
|
/* fail */
|
||||||
|
@ -92,9 +92,9 @@ STD_PROTO(static inline tg_sol_fr_ptr CUT_prune_tg_solution_frames, (tg_sol_fr_p
|
|||||||
if ((STACK) <= STACK_TOP+1024) { \
|
if ((STACK) <= STACK_TOP+1024) { \
|
||||||
CELL *NEW_STACK; \
|
CELL *NEW_STACK; \
|
||||||
UInt diff; \
|
UInt diff; \
|
||||||
char *OldTrailTop = (char *)TrailTop; \
|
char *OldTrailTop = (char *)Yap_TrailTop; \
|
||||||
_YAP_growtrail(64 * 1024Lf); \
|
Yap_growtrail(64 * 1024L); \
|
||||||
diff = (char *)TrailTop - OldTrailTop; \
|
diff = (char *)Yap_TrailTop - OldTrailTop; \
|
||||||
NEW_STACK = (CELL *)((char *)(STACK)+diff); \
|
NEW_STACK = (CELL *)((char *)(STACK)+diff); \
|
||||||
memmove((void *)NEW_STACK, (void *)(STACK), (char *)OldTrailTop-(char *)STACK); \
|
memmove((void *)NEW_STACK, (void *)(STACK), (char *)OldTrailTop-(char *)STACK); \
|
||||||
(STACK) = NEW_STACK; \
|
(STACK) = NEW_STACK; \
|
||||||
@ -369,7 +369,7 @@ void unbind_variables(tr_fr_ptr unbind_tr, tr_fr_ptr end_tr) {
|
|||||||
RESET_VARIABLE(ref);
|
RESET_VARIABLE(ref);
|
||||||
} else if (IsPairTerm(ref)) {
|
} else if (IsPairTerm(ref)) {
|
||||||
ref = (CELL) RepPair(ref);
|
ref = (CELL) RepPair(ref);
|
||||||
if ((ADDR)ref >= TrailBase) {
|
if ((ADDR)ref >= Yap_TrailBase) {
|
||||||
/* avoid frozen segments */
|
/* avoid frozen segments */
|
||||||
unbind_tr = (tr_fr_ptr) ref;
|
unbind_tr = (tr_fr_ptr) ref;
|
||||||
#ifdef TABLING_ERRORS
|
#ifdef TABLING_ERRORS
|
||||||
@ -408,7 +408,7 @@ void rebind_variables(tr_fr_ptr rebind_tr, tr_fr_ptr end_tr) {
|
|||||||
*((CELL *)ref) = TrailVal(rebind_tr);
|
*((CELL *)ref) = TrailVal(rebind_tr);
|
||||||
} else if (IsPairTerm(ref)) {
|
} else if (IsPairTerm(ref)) {
|
||||||
ref = (CELL) RepPair(ref);
|
ref = (CELL) RepPair(ref);
|
||||||
if ((ADDR)ref >= TrailBase) {
|
if ((ADDR)ref >= Yap_TrailBase) {
|
||||||
/* avoid frozen segments */
|
/* avoid frozen segments */
|
||||||
rebind_tr = (tr_fr_ptr) ref;
|
rebind_tr = (tr_fr_ptr) ref;
|
||||||
#ifdef TABLING_ERRORS
|
#ifdef TABLING_ERRORS
|
||||||
@ -451,7 +451,7 @@ void restore_bindings(tr_fr_ptr unbind_tr, tr_fr_ptr rebind_tr) {
|
|||||||
RESET_VARIABLE(ref);
|
RESET_VARIABLE(ref);
|
||||||
} else if (IsPairTerm(ref)) {
|
} else if (IsPairTerm(ref)) {
|
||||||
ref = (CELL) RepPair(ref);
|
ref = (CELL) RepPair(ref);
|
||||||
if ((ADDR)ref >= TrailBase) {
|
if ((ADDR)ref >= Yap_TrailBase) {
|
||||||
unbind_tr = (tr_fr_ptr) ref;
|
unbind_tr = (tr_fr_ptr) ref;
|
||||||
#ifdef TABLING_ERRORS
|
#ifdef TABLING_ERRORS
|
||||||
if (unbind_tr > (tr_fr_ptr) TrailTop)
|
if (unbind_tr > (tr_fr_ptr) TrailTop)
|
||||||
@ -465,7 +465,7 @@ void restore_bindings(tr_fr_ptr unbind_tr, tr_fr_ptr rebind_tr) {
|
|||||||
ref = (CELL) TrailTerm(--end_tr);
|
ref = (CELL) TrailTerm(--end_tr);
|
||||||
if (IsPairTerm(ref)) {
|
if (IsPairTerm(ref)) {
|
||||||
ref = (CELL) RepPair(ref);
|
ref = (CELL) RepPair(ref);
|
||||||
if ((ADDR)ref >= TrailBase) {
|
if ((ADDR)ref >= Yap_TrailBase) {
|
||||||
end_tr = (tr_fr_ptr) ref;
|
end_tr = (tr_fr_ptr) ref;
|
||||||
#ifdef TABLING_ERRORS
|
#ifdef TABLING_ERRORS
|
||||||
if (end_tr > (tr_fr_ptr) TrailTop)
|
if (end_tr > (tr_fr_ptr) TrailTop)
|
||||||
@ -482,7 +482,7 @@ void restore_bindings(tr_fr_ptr unbind_tr, tr_fr_ptr rebind_tr) {
|
|||||||
*((CELL *)ref) = TrailVal(rebind_tr);
|
*((CELL *)ref) = TrailVal(rebind_tr);
|
||||||
} else if (IsPairTerm(ref)) {
|
} else if (IsPairTerm(ref)) {
|
||||||
ref = (CELL) RepPair(ref);
|
ref = (CELL) RepPair(ref);
|
||||||
if ((ADDR)ref >= TrailBase) {
|
if ((ADDR)ref >= Yap_TrailBase) {
|
||||||
rebind_tr = (tr_fr_ptr) ref;
|
rebind_tr = (tr_fr_ptr) ref;
|
||||||
#ifdef TABLING_ERRORS
|
#ifdef TABLING_ERRORS
|
||||||
if (rebind_tr > (tr_fr_ptr) TrailTop)
|
if (rebind_tr > (tr_fr_ptr) TrailTop)
|
||||||
|
@ -660,11 +660,11 @@ sg_node_ptr subgoal_search(tab_ent_ptr tab_ent, OPREG arity, CELL **Yaddr) {
|
|||||||
count_vars = 0;
|
count_vars = 0;
|
||||||
stack_vars = *Yaddr;
|
stack_vars = *Yaddr;
|
||||||
#ifdef YAPOR
|
#ifdef YAPOR
|
||||||
stack_terms_top = (CELL *)TrailTop;
|
stack_terms_top = (CELL *)Yap_TrailTop;
|
||||||
stack_terms_base = stack_terms = AuxSp;
|
stack_terms_base = stack_terms = AuxSp;
|
||||||
#else
|
#else
|
||||||
stack_terms_top = (CELL *)TR;
|
stack_terms_top = (CELL *)TR;
|
||||||
stack_terms_base = stack_terms = (CELL *)TrailTop;
|
stack_terms_base = stack_terms = (CELL *)Yap_TrailTop;
|
||||||
#endif
|
#endif
|
||||||
current_sg_node = TabEnt_subgoal_trie(tab_ent);
|
current_sg_node = TabEnt_subgoal_trie(tab_ent);
|
||||||
|
|
||||||
@ -680,7 +680,7 @@ sg_node_ptr subgoal_search(tab_ent_ptr tab_ent, OPREG arity, CELL **Yaddr) {
|
|||||||
current_sg_node = subgoal_trie_node_check_insert(tab_ent, current_sg_node, t);
|
current_sg_node = subgoal_trie_node_check_insert(tab_ent, current_sg_node, t);
|
||||||
} else {
|
} else {
|
||||||
if (count_vars == MAX_TABLE_VARS)
|
if (count_vars == MAX_TABLE_VARS)
|
||||||
Error(SYSTEM_ERROR,TermNil,"MAX_TABLE_VARS exceeded in function subgoal_search (%d)", count_vars);
|
Yap_Error(SYSTEM_ERROR,TermNil,"MAX_TABLE_VARS exceeded in function subgoal_search (%d)", count_vars);
|
||||||
FREE_STACK_PUSH(t, stack_vars);
|
FREE_STACK_PUSH(t, stack_vars);
|
||||||
*((CELL *)t) = GLOBAL_table_var_enumerator(count_vars);
|
*((CELL *)t) = GLOBAL_table_var_enumerator(count_vars);
|
||||||
t = MakeTableVarTerm(count_vars);
|
t = MakeTableVarTerm(count_vars);
|
||||||
@ -734,7 +734,7 @@ ans_node_ptr answer_search(sg_fr_ptr sg_fr, CELL *subs_ptr) {
|
|||||||
stack_terms_base = stack_terms = stack_vars - MAX_TABLE_VARS;
|
stack_terms_base = stack_terms = stack_vars - MAX_TABLE_VARS;
|
||||||
#else
|
#else
|
||||||
stack_terms_top = (CELL *)TR;
|
stack_terms_top = (CELL *)TR;
|
||||||
stack_terms_base = stack_terms = (CELL *)TrailTop;
|
stack_terms_base = stack_terms = (CELL *)Yap_TrailTop;
|
||||||
#endif
|
#endif
|
||||||
current_ans_node = SgFr_answer_trie(sg_fr);
|
current_ans_node = SgFr_answer_trie(sg_fr);
|
||||||
|
|
||||||
@ -754,7 +754,7 @@ ans_node_ptr answer_search(sg_fr_ptr sg_fr, CELL *subs_ptr) {
|
|||||||
current_ans_node = answer_trie_node_check_insert(sg_fr, current_ans_node, t, _trie_retry_val);
|
current_ans_node = answer_trie_node_check_insert(sg_fr, current_ans_node, t, _trie_retry_val);
|
||||||
} else {
|
} else {
|
||||||
if (count_vars == MAX_TABLE_VARS)
|
if (count_vars == MAX_TABLE_VARS)
|
||||||
Error(SYSTEM_ERROR,TermNil,"MAX_TABLE_VARS exceeded in function answer_search (%d)", count_vars);
|
Yap_Error(SYSTEM_ERROR,TermNil,"MAX_TABLE_VARS exceeded in function answer_search (%d)", count_vars);
|
||||||
FREE_STACK_PUSH(t, stack_vars);
|
FREE_STACK_PUSH(t, stack_vars);
|
||||||
*((CELL *)t) = GLOBAL_table_var_enumerator(count_vars);
|
*((CELL *)t) = GLOBAL_table_var_enumerator(count_vars);
|
||||||
t = MakeTableVarTerm(count_vars);
|
t = MakeTableVarTerm(count_vars);
|
||||||
@ -805,7 +805,7 @@ void load_answer_trie(ans_node_ptr ans_node, CELL *subs_ptr) {
|
|||||||
stack_vars = stack_terms = AuxSp - MAX_TABLE_VARS;
|
stack_vars = stack_terms = AuxSp - MAX_TABLE_VARS;
|
||||||
#else
|
#else
|
||||||
stack_top = (CELL *)TR;
|
stack_top = (CELL *)TR;
|
||||||
stack_vars = stack_terms = ((CELL *)TrailTop)-MAX_TABLE_VARS;
|
stack_vars = stack_terms = ((CELL *)Yap_TrailTop)-MAX_TABLE_VARS;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* load the new answer from the answer trie to the stack_terms */
|
/* load the new answer from the answer trie to the stack_terms */
|
||||||
@ -1494,7 +1494,7 @@ update_next_trie_branch:
|
|||||||
}
|
}
|
||||||
|
|
||||||
TrNode_or_arg(node) = ltt;
|
TrNode_or_arg(node) = ltt;
|
||||||
TrNode_instr(node) = _YAP_opcode(TrNode_instr(node));
|
TrNode_instr(node) = Yap_opcode(TrNode_instr(node));
|
||||||
return ltt;
|
return ltt;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
@ -1512,7 +1512,7 @@ int update_answer_trie_branch(ans_node_ptr node) {
|
|||||||
ltt = 1;
|
ltt = 1;
|
||||||
}
|
}
|
||||||
TrNode_or_arg(node) = ltt;
|
TrNode_or_arg(node) = ltt;
|
||||||
TrNode_instr(node) = _YAP_opcode(TrNode_instr(node));
|
TrNode_instr(node) = Yap__opcode(TrNode_instr(node));
|
||||||
return ltt;
|
return ltt;
|
||||||
}
|
}
|
||||||
#endif /* TABLING_INNER_CUTS */
|
#endif /* TABLING_INNER_CUTS */
|
||||||
@ -1528,7 +1528,7 @@ void update_answer_trie_branch(ans_node_ptr node) {
|
|||||||
} else {
|
} else {
|
||||||
TrNode_instr(node) -= 2; /* retry --> trust : try --> do */
|
TrNode_instr(node) -= 2; /* retry --> trust : try --> do */
|
||||||
}
|
}
|
||||||
TrNode_instr(node) = _YAP_opcode(TrNode_instr(node));
|
TrNode_instr(node) = Yap_opcode(TrNode_instr(node));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
} else { \
|
} else { \
|
||||||
/* procceed */ \
|
/* procceed */ \
|
||||||
PREG = (yamop *) CPREG; \
|
PREG = (yamop *) CPREG; \
|
||||||
Y = ENV; \
|
YENV = ENV; \
|
||||||
} \
|
} \
|
||||||
PREFETCH_OP(PREG); \
|
PREFETCH_OP(PREG); \
|
||||||
GONext()
|
GONext()
|
||||||
@ -82,12 +82,12 @@
|
|||||||
ENV = B->cp_env; \
|
ENV = B->cp_env; \
|
||||||
YAPOR_update_alternative(PREG, (yamop *) AP) \
|
YAPOR_update_alternative(PREG, (yamop *) AP) \
|
||||||
B->cp_ap = (yamop *) AP; \
|
B->cp_ap = (yamop *) AP; \
|
||||||
Y = (CELL *) PROTECT_FROZEN_B(B); \
|
YENV = (CELL *) PROTECT_FROZEN_B(B); \
|
||||||
SET_BB(NORM_CP(Y))
|
SET_BB(NORM_CP(YENV))
|
||||||
|
|
||||||
|
|
||||||
#define pop_trie_choice_point() \
|
#define pop_trie_choice_point() \
|
||||||
Y = (CELL *) PROTECT_FROZEN_B((B+1)); \
|
YENV = (CELL *) PROTECT_FROZEN_B((B+1)); \
|
||||||
H = PROTECT_FROZEN_H(B); \
|
H = PROTECT_FROZEN_H(B); \
|
||||||
CPREG = B->cp_cp; \
|
CPREG = B->cp_cp; \
|
||||||
TABLING_close_alt(B); \
|
TABLING_close_alt(B); \
|
||||||
@ -129,16 +129,16 @@
|
|||||||
*((CELL *) var_ptr) = var_ptr; \
|
*((CELL *) var_ptr) = var_ptr; \
|
||||||
aux_ptr += heap_arity + subs_arity + vars_arity + 1; \
|
aux_ptr += heap_arity + subs_arity + vars_arity + 1; \
|
||||||
for (i = 0; i < vars_arity; i++) \
|
for (i = 0; i < vars_arity; i++) \
|
||||||
*--Y = *aux_ptr--; \
|
*--YENV = *aux_ptr--; \
|
||||||
*--Y = var_ptr; \
|
*--YENV = var_ptr; \
|
||||||
for (i = 0; i < subs_arity; i++) \
|
for (i = 0; i < subs_arity; i++) \
|
||||||
*--Y = *aux_ptr--; \
|
*--YENV = *aux_ptr--; \
|
||||||
*--Y = subs_arity; \
|
*--YENV = subs_arity; \
|
||||||
*--Y = vars_arity + 1; \
|
*--YENV = vars_arity + 1; \
|
||||||
aux_ptr--; \
|
aux_ptr--; \
|
||||||
for (i = 1; i < heap_arity; i++) \
|
for (i = 1; i < heap_arity; i++) \
|
||||||
*--Y = *--aux_ptr; \
|
*--YENV = *--aux_ptr; \
|
||||||
*--Y = heap_arity - 1; \
|
*--YENV = heap_arity - 1; \
|
||||||
next_instruction(--heap_arity || subs_arity, node); \
|
next_instruction(--heap_arity || subs_arity, node); \
|
||||||
} else { \
|
} else { \
|
||||||
aux_ptr += 2 + subs_arity; \
|
aux_ptr += 2 + subs_arity; \
|
||||||
@ -146,17 +146,17 @@
|
|||||||
/* Bind((CELL *) var_ptr, var_ptr); */ \
|
/* Bind((CELL *) var_ptr, var_ptr); */ \
|
||||||
aux_ptr += vars_arity; \
|
aux_ptr += vars_arity; \
|
||||||
for (i = 0; i < subs_arity + vars_arity; i++) \
|
for (i = 0; i < subs_arity + vars_arity; i++) \
|
||||||
*--Y = *aux_ptr--; \
|
*--YENV = *aux_ptr--; \
|
||||||
*--Y = subs_arity - 1; \
|
*--YENV = subs_arity - 1; \
|
||||||
*--Y = vars_arity + 1; \
|
*--YENV = vars_arity + 1; \
|
||||||
*--Y = 0; \
|
*--YENV = 0; \
|
||||||
next_instruction(--subs_arity, node); \
|
next_instruction(--subs_arity, node); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define no_cp_trie_val_instr() \
|
#define no_cp_trie_val_instr() \
|
||||||
if (heap_arity) { \
|
if (heap_arity) { \
|
||||||
Y = ++aux_ptr; \
|
YENV = ++aux_ptr; \
|
||||||
subs_ptr = aux_ptr + heap_arity + 1 + subs_arity + vars_arity - var_index; \
|
subs_ptr = aux_ptr + heap_arity + 1 + subs_arity + vars_arity - var_index; \
|
||||||
aux = *aux_ptr; \
|
aux = *aux_ptr; \
|
||||||
subs = *subs_ptr; \
|
subs = *subs_ptr; \
|
||||||
@ -219,8 +219,8 @@
|
|||||||
} \
|
} \
|
||||||
aux_ptr += heap_arity + subs_arity + vars_arity + 1; \
|
aux_ptr += heap_arity + subs_arity + vars_arity + 1; \
|
||||||
for (i = 0; i < heap_arity + subs_arity + vars_arity + 1; i++) \
|
for (i = 0; i < heap_arity + subs_arity + vars_arity + 1; i++) \
|
||||||
*--Y = *aux_ptr--; \
|
*--YENV = *aux_ptr--; \
|
||||||
*--Y = heap_arity - 1; \
|
*--YENV = heap_arity - 1; \
|
||||||
next_instruction(--heap_arity || subs_arity, node); \
|
next_instruction(--heap_arity || subs_arity, node); \
|
||||||
} else { \
|
} else { \
|
||||||
aux_ptr += 2 + subs_arity; \
|
aux_ptr += 2 + subs_arity; \
|
||||||
@ -249,19 +249,19 @@
|
|||||||
} \
|
} \
|
||||||
aux_ptr += vars_arity; \
|
aux_ptr += vars_arity; \
|
||||||
for (i = 0; i < vars_arity; i++) \
|
for (i = 0; i < vars_arity; i++) \
|
||||||
*--Y = *aux_ptr--; \
|
*--YENV = *aux_ptr--; \
|
||||||
for (i = 1; i < subs_arity; i++) \
|
for (i = 1; i < subs_arity; i++) \
|
||||||
*--Y = *--aux_ptr; \
|
*--YENV = *--aux_ptr; \
|
||||||
*--Y = subs_arity - 1; \
|
*--YENV = subs_arity - 1; \
|
||||||
*--Y = vars_arity; \
|
*--YENV = vars_arity; \
|
||||||
*--Y = 0; \
|
*--YENV = 0; \
|
||||||
next_instruction(--subs_arity, node); \
|
next_instruction(--subs_arity, node); \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#define no_cp_trie_atom_instr() \
|
#define no_cp_trie_atom_instr() \
|
||||||
if (heap_arity) { \
|
if (heap_arity) { \
|
||||||
Y = ++aux_ptr; \
|
YENV = ++aux_ptr; \
|
||||||
/* *((CELL *) *aux_ptr) = TrNode_entry(node); */ \
|
/* *((CELL *) *aux_ptr) = TrNode_entry(node); */ \
|
||||||
Bind_Global((CELL *) *aux_ptr, TrNode_entry(node)); \
|
Bind_Global((CELL *) *aux_ptr, TrNode_entry(node)); \
|
||||||
*aux_ptr = heap_arity - 1; \
|
*aux_ptr = heap_arity - 1; \
|
||||||
@ -286,20 +286,20 @@
|
|||||||
Bind_Global((CELL *) *aux_ptr, TrNode_entry(node)); \
|
Bind_Global((CELL *) *aux_ptr, TrNode_entry(node)); \
|
||||||
aux_ptr += heap_arity + subs_arity + vars_arity + 1; \
|
aux_ptr += heap_arity + subs_arity + vars_arity + 1; \
|
||||||
for (i = 0; i < heap_arity + subs_arity + vars_arity + 1; i++) \
|
for (i = 0; i < heap_arity + subs_arity + vars_arity + 1; i++) \
|
||||||
*--Y = *aux_ptr--; \
|
*--YENV = *aux_ptr--; \
|
||||||
*--Y = heap_arity - 1; \
|
*--YENV = heap_arity - 1; \
|
||||||
next_instruction(--heap_arity || subs_arity, node); \
|
next_instruction(--heap_arity || subs_arity, node); \
|
||||||
} else { \
|
} else { \
|
||||||
aux_ptr += 2 + subs_arity; \
|
aux_ptr += 2 + subs_arity; \
|
||||||
Bind((CELL *) *aux_ptr, TrNode_entry(node)); \
|
Bind((CELL *) *aux_ptr, TrNode_entry(node)); \
|
||||||
aux_ptr += vars_arity; \
|
aux_ptr += vars_arity; \
|
||||||
for (i = 0; i < vars_arity; i++) \
|
for (i = 0; i < vars_arity; i++) \
|
||||||
*--Y = *aux_ptr--; \
|
*--YENV = *aux_ptr--; \
|
||||||
for (i = 1; i < subs_arity; i++) \
|
for (i = 1; i < subs_arity; i++) \
|
||||||
*--Y = *--aux_ptr; \
|
*--YENV = *--aux_ptr; \
|
||||||
*--Y = subs_arity - 1; \
|
*--YENV = subs_arity - 1; \
|
||||||
*--Y = vars_arity; \
|
*--YENV = vars_arity; \
|
||||||
*--Y = 0; \
|
*--YENV = 0; \
|
||||||
next_instruction(--subs_arity, node); \
|
next_instruction(--subs_arity, node); \
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -313,13 +313,13 @@
|
|||||||
*aux_ptr-- = (CELL) (H - 1); \
|
*aux_ptr-- = (CELL) (H - 1); \
|
||||||
*aux_ptr-- = (CELL) (H - 2); \
|
*aux_ptr-- = (CELL) (H - 2); \
|
||||||
*aux_ptr = heap_arity - 1 + 2; \
|
*aux_ptr = heap_arity - 1 + 2; \
|
||||||
Y = aux_ptr; \
|
YENV = aux_ptr; \
|
||||||
} else { \
|
} else { \
|
||||||
H += 2; \
|
H += 2; \
|
||||||
*aux_ptr-- = (CELL) (H - 1); \
|
*aux_ptr-- = (CELL) (H - 1); \
|
||||||
*aux_ptr-- = (CELL) (H - 2); \
|
*aux_ptr-- = (CELL) (H - 2); \
|
||||||
*aux_ptr = 2; \
|
*aux_ptr = 2; \
|
||||||
Y = aux_ptr; \
|
YENV = aux_ptr; \
|
||||||
aux_ptr += 2 + 2; \
|
aux_ptr += 2 + 2; \
|
||||||
*aux_ptr = subs_arity - 1; \
|
*aux_ptr = subs_arity - 1; \
|
||||||
aux_ptr += subs_arity; \
|
aux_ptr += subs_arity; \
|
||||||
@ -339,25 +339,25 @@
|
|||||||
Bind_Global((CELL *) *aux_ptr, AbsPair(H)); \
|
Bind_Global((CELL *) *aux_ptr, AbsPair(H)); \
|
||||||
aux_ptr += heap_arity + subs_arity + vars_arity + 1; \
|
aux_ptr += heap_arity + subs_arity + vars_arity + 1; \
|
||||||
for (i = 0; i < vars_arity + subs_arity + heap_arity + 1; i++) \
|
for (i = 0; i < vars_arity + subs_arity + heap_arity + 1; i++) \
|
||||||
*--Y = *aux_ptr--; \
|
*--YENV = *aux_ptr--; \
|
||||||
H += 2; \
|
H += 2; \
|
||||||
*--Y = (CELL) (H - 1); \
|
*--YENV = (CELL) (H - 1); \
|
||||||
*--Y = (CELL) (H - 2); \
|
*--YENV = (CELL) (H - 2); \
|
||||||
*--Y = heap_arity + 1; \
|
*--YENV = heap_arity + 1; \
|
||||||
} else { \
|
} else { \
|
||||||
aux_ptr += 2 + subs_arity; \
|
aux_ptr += 2 + subs_arity; \
|
||||||
Bind((CELL *) *aux_ptr, AbsPair(H)); \
|
Bind((CELL *) *aux_ptr, AbsPair(H)); \
|
||||||
aux_ptr += vars_arity; \
|
aux_ptr += vars_arity; \
|
||||||
for (i = 0; i < vars_arity; i++) \
|
for (i = 0; i < vars_arity; i++) \
|
||||||
*--Y = *aux_ptr--; \
|
*--YENV = *aux_ptr--; \
|
||||||
for (i = 1; i < subs_arity; i++) \
|
for (i = 1; i < subs_arity; i++) \
|
||||||
*--Y = *--aux_ptr; \
|
*--YENV = *--aux_ptr; \
|
||||||
*--Y = subs_arity - 1; \
|
*--YENV = subs_arity - 1; \
|
||||||
*--Y = vars_arity; \
|
*--YENV = vars_arity; \
|
||||||
H += 2; \
|
H += 2; \
|
||||||
*--Y = (CELL) (H - 1); \
|
*--YENV = (CELL) (H - 1); \
|
||||||
*--Y = (CELL) (H - 2); \
|
*--YENV = (CELL) (H - 2); \
|
||||||
*--Y = 2; \
|
*--YENV = 2; \
|
||||||
} \
|
} \
|
||||||
next_trie_instruction(node)
|
next_trie_instruction(node)
|
||||||
|
|
||||||
@ -372,14 +372,14 @@
|
|||||||
for (i = 1; i <= func_arity; i++) \
|
for (i = 1; i <= func_arity; i++) \
|
||||||
*aux_ptr-- = (CELL) (H - i); \
|
*aux_ptr-- = (CELL) (H - i); \
|
||||||
*aux_ptr = heap_arity - 1 + func_arity; \
|
*aux_ptr = heap_arity - 1 + func_arity; \
|
||||||
Y = aux_ptr; \
|
YENV = aux_ptr; \
|
||||||
} else { \
|
} else { \
|
||||||
*H++ = (CELL) func; \
|
*H++ = (CELL) func; \
|
||||||
H += func_arity; \
|
H += func_arity; \
|
||||||
for (i = 1; i <= func_arity; i++) \
|
for (i = 1; i <= func_arity; i++) \
|
||||||
*aux_ptr-- = (CELL) (H - i); \
|
*aux_ptr-- = (CELL) (H - i); \
|
||||||
*aux_ptr = func_arity; \
|
*aux_ptr = func_arity; \
|
||||||
Y = aux_ptr; \
|
YENV = aux_ptr; \
|
||||||
aux_ptr += func_arity + 2; \
|
aux_ptr += func_arity + 2; \
|
||||||
*aux_ptr = subs_arity - 1; \
|
*aux_ptr = subs_arity - 1; \
|
||||||
aux_ptr += subs_arity; \
|
aux_ptr += subs_arity; \
|
||||||
@ -399,27 +399,27 @@
|
|||||||
Bind_Global((CELL *) *aux_ptr, AbsAppl(H)); \
|
Bind_Global((CELL *) *aux_ptr, AbsAppl(H)); \
|
||||||
aux_ptr += heap_arity + subs_arity + vars_arity + 1; \
|
aux_ptr += heap_arity + subs_arity + vars_arity + 1; \
|
||||||
for (i = 0; i < vars_arity + subs_arity + heap_arity + 1; i++) \
|
for (i = 0; i < vars_arity + subs_arity + heap_arity + 1; i++) \
|
||||||
*--Y = *aux_ptr--; \
|
*--YENV = *aux_ptr--; \
|
||||||
*H++ = (CELL) func; \
|
*H++ = (CELL) func; \
|
||||||
H += func_arity; \
|
H += func_arity; \
|
||||||
for (i = 1; i <= func_arity; i++) \
|
for (i = 1; i <= func_arity; i++) \
|
||||||
*--Y = (CELL) (H - i); \
|
*--YENV = (CELL) (H - i); \
|
||||||
*--Y = heap_arity + func_arity - 1; \
|
*--YENV = heap_arity + func_arity - 1; \
|
||||||
} else { \
|
} else { \
|
||||||
aux_ptr += 2 + subs_arity; \
|
aux_ptr += 2 + subs_arity; \
|
||||||
Bind((CELL *) *aux_ptr, AbsAppl(H)); \
|
Bind((CELL *) *aux_ptr, AbsAppl(H)); \
|
||||||
aux_ptr += vars_arity; \
|
aux_ptr += vars_arity; \
|
||||||
for (i = 0; i < vars_arity; i++) \
|
for (i = 0; i < vars_arity; i++) \
|
||||||
*--Y = *aux_ptr--; \
|
*--YENV = *aux_ptr--; \
|
||||||
for (i = 1; i < subs_arity; i++) \
|
for (i = 1; i < subs_arity; i++) \
|
||||||
*--Y = *--aux_ptr; \
|
*--YENV = *--aux_ptr; \
|
||||||
*--Y = subs_arity - 1; \
|
*--YENV = subs_arity - 1; \
|
||||||
*--Y = vars_arity; \
|
*--YENV = vars_arity; \
|
||||||
*H++ = (CELL) func; \
|
*H++ = (CELL) func; \
|
||||||
H += func_arity; \
|
H += func_arity; \
|
||||||
for (i = 1; i <= func_arity; i++) \
|
for (i = 1; i <= func_arity; i++) \
|
||||||
*--Y = (CELL) (H - i); \
|
*--YENV = (CELL) (H - i); \
|
||||||
*--Y = func_arity; \
|
*--YENV = func_arity; \
|
||||||
} \
|
} \
|
||||||
next_trie_instruction(node)
|
next_trie_instruction(node)
|
||||||
|
|
||||||
@ -431,7 +431,7 @@
|
|||||||
|
|
||||||
PBOp(trie_do_var, e)
|
PBOp(trie_do_var, e)
|
||||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||||
register CELL *aux_ptr = Y;
|
register CELL *aux_ptr = YENV;
|
||||||
register CELL var_ptr;
|
register CELL var_ptr;
|
||||||
int heap_arity = *aux_ptr;
|
int heap_arity = *aux_ptr;
|
||||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||||
@ -444,14 +444,14 @@
|
|||||||
|
|
||||||
PBOp(trie_try_var, e)
|
PBOp(trie_try_var, e)
|
||||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||||
register CELL *aux_ptr = Y;
|
register CELL *aux_ptr = YENV;
|
||||||
register CELL var_ptr;
|
register CELL var_ptr;
|
||||||
int heap_arity = *aux_ptr;
|
int heap_arity = *aux_ptr;
|
||||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
store_trie_choice_point(Y, TrNode_next(node));
|
store_trie_choice_point(YENV, TrNode_next(node));
|
||||||
cp_trie_var_instr();
|
cp_trie_var_instr();
|
||||||
ENDPBOp();
|
ENDPBOp();
|
||||||
|
|
||||||
@ -487,7 +487,7 @@
|
|||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
{
|
{
|
||||||
pop_trie_choice_point();
|
pop_trie_choice_point();
|
||||||
if ((choiceptr) Y == B_FZ) {
|
if ((choiceptr) YENV == B_FZ) {
|
||||||
cp_trie_var_instr();
|
cp_trie_var_instr();
|
||||||
} else {
|
} else {
|
||||||
no_cp_trie_var_instr();
|
no_cp_trie_var_instr();
|
||||||
@ -498,7 +498,7 @@
|
|||||||
|
|
||||||
PBOp(trie_do_val, e)
|
PBOp(trie_do_val, e)
|
||||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||||
register CELL *aux_ptr = Y, *subs_ptr;
|
register CELL *aux_ptr = YENV, *subs_ptr;
|
||||||
register CELL aux, subs;
|
register CELL aux, subs;
|
||||||
int heap_arity = *aux_ptr;
|
int heap_arity = *aux_ptr;
|
||||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||||
@ -512,7 +512,7 @@
|
|||||||
|
|
||||||
PBOp(trie_try_val, e)
|
PBOp(trie_try_val, e)
|
||||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||||
register CELL *aux_ptr = Y, *subs_ptr;
|
register CELL *aux_ptr = YENV, *subs_ptr;
|
||||||
register CELL aux, subs;
|
register CELL aux, subs;
|
||||||
int heap_arity = *aux_ptr;
|
int heap_arity = *aux_ptr;
|
||||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||||
@ -520,7 +520,7 @@
|
|||||||
int var_index = VarIndexOfTableTerm(TrNode_entry(node));
|
int var_index = VarIndexOfTableTerm(TrNode_entry(node));
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
store_trie_choice_point(Y, TrNode_next(node));
|
store_trie_choice_point(YENV, TrNode_next(node));
|
||||||
cp_trie_val_instr();
|
cp_trie_val_instr();
|
||||||
ENDPBOp();
|
ENDPBOp();
|
||||||
|
|
||||||
@ -558,7 +558,7 @@
|
|||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
{
|
{
|
||||||
pop_trie_choice_point();
|
pop_trie_choice_point();
|
||||||
if ((choiceptr) Y == B_FZ) {
|
if ((choiceptr) YENV == B_FZ) {
|
||||||
cp_trie_val_instr();
|
cp_trie_val_instr();
|
||||||
} else {
|
} else {
|
||||||
no_cp_trie_val_instr();
|
no_cp_trie_val_instr();
|
||||||
@ -569,7 +569,7 @@
|
|||||||
|
|
||||||
PBOp(trie_do_atom, e)
|
PBOp(trie_do_atom, e)
|
||||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||||
register CELL *aux_ptr = Y;
|
register CELL *aux_ptr = YENV;
|
||||||
int heap_arity = *aux_ptr;
|
int heap_arity = *aux_ptr;
|
||||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||||
@ -581,13 +581,13 @@
|
|||||||
|
|
||||||
PBOp(trie_try_atom, e)
|
PBOp(trie_try_atom, e)
|
||||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||||
register CELL *aux_ptr = Y;
|
register CELL *aux_ptr = YENV;
|
||||||
int heap_arity = *aux_ptr;
|
int heap_arity = *aux_ptr;
|
||||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
store_trie_choice_point(Y, TrNode_next(node));
|
store_trie_choice_point(YENV, TrNode_next(node));
|
||||||
cp_trie_atom_instr();
|
cp_trie_atom_instr();
|
||||||
ENDPBOp();
|
ENDPBOp();
|
||||||
|
|
||||||
@ -621,7 +621,7 @@
|
|||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
{
|
{
|
||||||
pop_trie_choice_point();
|
pop_trie_choice_point();
|
||||||
if ((choiceptr) Y == B_FZ) {
|
if ((choiceptr) YENV == B_FZ) {
|
||||||
cp_trie_atom_instr();
|
cp_trie_atom_instr();
|
||||||
} else {
|
} else {
|
||||||
no_cp_trie_atom_instr();
|
no_cp_trie_atom_instr();
|
||||||
@ -632,7 +632,7 @@
|
|||||||
|
|
||||||
PBOp(trie_do_list, e)
|
PBOp(trie_do_list, e)
|
||||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||||
register CELL *aux_ptr = Y;
|
register CELL *aux_ptr = YENV;
|
||||||
int heap_arity = *aux_ptr;
|
int heap_arity = *aux_ptr;
|
||||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||||
@ -644,13 +644,13 @@
|
|||||||
|
|
||||||
PBOp(trie_try_list, e)
|
PBOp(trie_try_list, e)
|
||||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||||
register CELL *aux_ptr = Y;
|
register CELL *aux_ptr = YENV;
|
||||||
int heap_arity = *aux_ptr;
|
int heap_arity = *aux_ptr;
|
||||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
store_trie_choice_point(Y, TrNode_next(node));
|
store_trie_choice_point(YENV, TrNode_next(node));
|
||||||
cp_trie_list_instr();
|
cp_trie_list_instr();
|
||||||
ENDPBOp();
|
ENDPBOp();
|
||||||
|
|
||||||
@ -684,7 +684,7 @@
|
|||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
{
|
{
|
||||||
pop_trie_choice_point();
|
pop_trie_choice_point();
|
||||||
if ((choiceptr) Y == B_FZ) {
|
if ((choiceptr) YENV == B_FZ) {
|
||||||
cp_trie_list_instr();
|
cp_trie_list_instr();
|
||||||
} else {
|
} else {
|
||||||
no_cp_trie_list_instr();
|
no_cp_trie_list_instr();
|
||||||
@ -695,7 +695,7 @@
|
|||||||
|
|
||||||
PBOp(trie_do_struct, e)
|
PBOp(trie_do_struct, e)
|
||||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||||
register CELL *aux_ptr = Y;
|
register CELL *aux_ptr = YENV;
|
||||||
int heap_arity = *aux_ptr;
|
int heap_arity = *aux_ptr;
|
||||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||||
@ -709,7 +709,7 @@
|
|||||||
|
|
||||||
PBOp(trie_try_struct, e)
|
PBOp(trie_try_struct, e)
|
||||||
register ans_node_ptr node = (ans_node_ptr) PREG;
|
register ans_node_ptr node = (ans_node_ptr) PREG;
|
||||||
register CELL *aux_ptr = Y;
|
register CELL *aux_ptr = YENV;
|
||||||
int heap_arity = *aux_ptr;
|
int heap_arity = *aux_ptr;
|
||||||
int vars_arity = *(aux_ptr + heap_arity + 1);
|
int vars_arity = *(aux_ptr + heap_arity + 1);
|
||||||
int subs_arity = *(aux_ptr + heap_arity + 2);
|
int subs_arity = *(aux_ptr + heap_arity + 2);
|
||||||
@ -717,7 +717,7 @@
|
|||||||
int func_arity = ArityOfFunctor(func);
|
int func_arity = ArityOfFunctor(func);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
store_trie_choice_point(Y, TrNode_next(node));
|
store_trie_choice_point(YENV, TrNode_next(node));
|
||||||
cp_trie_struct_instr();
|
cp_trie_struct_instr();
|
||||||
ENDPBOp();
|
ENDPBOp();
|
||||||
|
|
||||||
@ -755,7 +755,7 @@
|
|||||||
#endif /* YAPOR */
|
#endif /* YAPOR */
|
||||||
{
|
{
|
||||||
pop_trie_choice_point();
|
pop_trie_choice_point();
|
||||||
if ((choiceptr) Y == B_FZ) {
|
if ((choiceptr) YENV == B_FZ) {
|
||||||
cp_trie_struct_instr();
|
cp_trie_struct_instr();
|
||||||
} else {
|
} else {
|
||||||
no_cp_trie_struct_instr();
|
no_cp_trie_struct_instr();
|
||||||
|
Reference in New Issue
Block a user