meta stuff
This commit is contained in:
parent
124b2e9069
commit
df8b264751
@ -620,6 +620,7 @@ typedef struct pred_entry {
|
|||||||
#ifdef BEAM
|
#ifdef BEAM
|
||||||
struct Predicates *beamTable;
|
struct Predicates *beamTable;
|
||||||
#endif
|
#endif
|
||||||
|
struct yami *MetaEntryOfPred; /* allow direct access from meta-calls */
|
||||||
Term ModuleOfPred; /* module for this definition */
|
Term ModuleOfPred; /* module for this definition */
|
||||||
UInt TimeStampOfPred;
|
UInt TimeStampOfPred;
|
||||||
timestamp_type LastCallOfPred;
|
timestamp_type LastCallOfPred;
|
||||||
|
@ -1896,14 +1896,14 @@ extern X_API YAP_PredEntryPtr YAP_FunctorToPredInModule(YAP_Functor,
|
|||||||
extern X_API YAP_PredEntryPtr YAP_AtomToPredInModule(YAP_Atom, YAP_Module);
|
extern X_API YAP_PredEntryPtr YAP_AtomToPredInModule(YAP_Atom, YAP_Module);
|
||||||
|
|
||||||
/* int YAP_EnterGoal(void) */
|
/* int YAP_EnterGoal(void) */
|
||||||
extern X_API YAP_Bool YAP_EnterGoal(YAP_PredEntryPtr, YAP_handle_t,
|
extern X_API YAP_Bool YAP_EnterGoal(YAP_PredEntryPtr, YAP_Term *,
|
||||||
YAP_dogoalinfo *);
|
YAP_dogoalinfo *);
|
||||||
|
|
||||||
/* int YAP_RetryGoal(void) */
|
/* int YAP_RetryGoal(void) */
|
||||||
extern X_API YAP_Bool YAP_RetryGoal(YAP_dogoalinfo *);
|
extern X_API YAP_Bool YAP_RetryGoal(YAP_dogoalinfo *);
|
||||||
|
|
||||||
/* int YAP_LeaveGoal(void) */
|
/* int YAP_LeaveGoal(void) */
|
||||||
extern X_API YAP_Bool YAP_LeaveGoal(int, YAP_dogoalinfo *);
|
extern X_API YAP_Bool YAP_LeaveGoal(bool, YAP_dogoalinfo *);
|
||||||
|
|
||||||
/* int YAP_GoalHasException(YAP_Term *) */
|
/* int YAP_GoalHasException(YAP_Term *) */
|
||||||
extern X_API YAP_Bool YAP_GoalHasException(YAP_Term *);
|
extern X_API YAP_Bool YAP_GoalHasException(YAP_Term *);
|
||||||
|
@ -32,11 +32,14 @@ Moyle. All rights reserved.
|
|||||||
#include <Yatom.h>
|
#include <Yatom.h>
|
||||||
#include <eval.h>
|
#include <eval.h>
|
||||||
|
|
||||||
|
#include "swi.h"
|
||||||
#include <YapHeap.h>
|
#include <YapHeap.h>
|
||||||
|
|
||||||
|
#include <YapHandles.h>
|
||||||
|
|
||||||
#include <YapText.h>
|
#include <YapText.h>
|
||||||
#include <yapio.h>
|
#include <yapio.h>
|
||||||
|
|
||||||
#include "swi.h"
|
|
||||||
#if HAVE_MATH_H
|
#if HAVE_MATH_H
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#endif
|
#endif
|
||||||
@ -1976,7 +1979,8 @@ X_API int PL_is_pair(term_t ts) {
|
|||||||
|
|
||||||
X_API int PL_skip_list(term_t list, term_t tail, size_t *len) {
|
X_API int PL_skip_list(term_t list, term_t tail, size_t *len) {
|
||||||
CACHE_REGS
|
CACHE_REGS
|
||||||
Term *l = Yap_AddressFromSlot(list);
|
Term t0 = Yap_GetFromSlot(list);
|
||||||
|
Term *l = &t0;
|
||||||
Term *t;
|
Term *t;
|
||||||
intptr_t length;
|
intptr_t length;
|
||||||
|
|
||||||
@ -2412,14 +2416,15 @@ X_API int PL_next_solution(qid_t qi) {
|
|||||||
return 0;
|
return 0;
|
||||||
// don't forget, on success these guys must create slots
|
// don't forget, on success these guys must create slots
|
||||||
if (qi->q_state == 0) {
|
if (qi->q_state == 0) {
|
||||||
result = YAP_EnterGoal((YAP_PredEntryPtr)qi->q_pe, qi->q_g, &qi->q_h);
|
result = YAP_EnterGoal((YAP_PredEntryPtr)qi->q_pe,
|
||||||
|
Yap_GetPtrFromHandle(qi->q_g), &qi->q_h);
|
||||||
} else {
|
} else {
|
||||||
LOCAL_AllowRestart = qi->q_open;
|
LOCAL_AllowRestart = qi->q_open;
|
||||||
result = YAP_RetryGoal(&qi->q_h);
|
result = YAP_RetryGoal(&qi->q_h);
|
||||||
}
|
}
|
||||||
qi->q_state = 1;
|
qi->q_state = 1;
|
||||||
if (result == 0) {
|
if (result == 0) {
|
||||||
YAP_LeaveGoal(FALSE, &qi->q_h);
|
YAP_LeaveGoal(false, &qi->q_h);
|
||||||
qi->q_open = 0;
|
qi->q_open = 0;
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
@ -2430,7 +2435,7 @@ X_API void PL_cut_query(qid_t qi) {
|
|||||||
|
|
||||||
if (qi->q_open != 1 || qi->q_state == 0)
|
if (qi->q_open != 1 || qi->q_state == 0)
|
||||||
return;
|
return;
|
||||||
YAP_LeaveGoal(FALSE, &qi->q_h);
|
YAP_LeaveGoal(false, &qi->q_h);
|
||||||
qi->q_open = 0;
|
qi->q_open = 0;
|
||||||
LOCAL_execution = qi->oq;
|
LOCAL_execution = qi->oq;
|
||||||
Yap_FreeCodeSpace((char *)qi);
|
Yap_FreeCodeSpace((char *)qi);
|
||||||
|
Reference in New Issue
Block a user