fixes
This commit is contained in:
parent
c1d81ea7c6
commit
3a44eb657d
50
C/errors.c
50
C/errors.c
@ -107,7 +107,7 @@ static YAP_Term add_key_i(const char *key, YAP_Int v, YAP_Term o0)
|
||||
static YAP_Term add_key_s(const char *key, const char *v, YAP_Term o0)
|
||||
{
|
||||
Term tkv[2];
|
||||
if (!v || v[0] == '\n')
|
||||
if (!v || v[0] == '\0')
|
||||
return o0;
|
||||
tkv[1] = MkStringTerm(v), tkv[0] = MkStringTerm(key);
|
||||
Term node = Yap_MkApplTerm( FunctorEq, 2, tkv);
|
||||
@ -159,11 +159,13 @@ bool Yap_Warning(const char *s, ...) {
|
||||
Term ts[2];
|
||||
const char *fmt;
|
||||
char tmpbuf[MAXPATHLEN];
|
||||
yap_error_descriptor_t olde;
|
||||
|
||||
Yap_pushErrorContext(&olde);
|
||||
LOCAL_DoingUndefp = true;
|
||||
LOCAL_within_print_message = true;
|
||||
if (LOCAL_PrologMode & InErrorMode) {
|
||||
fprintf(stderr, "%% ERROR WITHIN ERROR %d: %s\n", LOCAL_Error_TYPE, tmpbuf);
|
||||
Yap_RestartYap(1);
|
||||
}
|
||||
LOCAL_PrologMode |= InErrorMode;
|
||||
pred = RepPredProp(PredPropByFunc(FunctorPrintMessage,
|
||||
PROLOG_MODULE)); // PROCEDURE_print_message2
|
||||
va_start(ap, s);
|
||||
@ -182,7 +184,7 @@ bool Yap_Warning(const char *s, ...) {
|
||||
if (pred->OpcodeOfPred == UNDEF_OPCODE || pred->OpcodeOfPred == FAIL_OPCODE) {
|
||||
fprintf(stderr, "warning message: %s\n", tmpbuf);
|
||||
LOCAL_DoingUndefp = false;
|
||||
LOCAL_within_print_message = false;
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
Yap_popErrorContext(false);
|
||||
return false;
|
||||
}
|
||||
@ -191,6 +193,7 @@ bool Yap_Warning(const char *s, ...) {
|
||||
ts[0] = MkAtomTerm(Yap_LookupAtom(tmpbuf));
|
||||
rc = Yap_execute_pred(pred, ts, true PASS_REGS);
|
||||
Yap_popErrorContext(false);
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -235,19 +238,18 @@ bool Yap_PrintWarning(Term twarning) {
|
||||
bool rc;
|
||||
Term ts[2];
|
||||
|
||||
if (LOCAL_within_print_message) {
|
||||
/* error within error */
|
||||
fprintf(stderr, "%% WARNING WITHIN WARNING\n");
|
||||
if (LOCAL_PrologMode & InErrorMode) {
|
||||
fprintf(stderr, "%% ERROR WITHIN ERROR while processing warning: %s\n", Yap_TermToBuffer(twarning, LOCAL_encoding, 0));
|
||||
Yap_RestartYap(1);
|
||||
}
|
||||
LOCAL_PrologMode |= InErrorMode;
|
||||
LOCAL_DoingUndefp = true;
|
||||
LOCAL_within_print_message = true;
|
||||
if (pred->OpcodeOfPred == UNDEF_OPCODE || pred->OpcodeOfPred == FAIL_OPCODE) {
|
||||
fprintf(stderr, "warning message:\n");
|
||||
Yap_DebugPlWrite(twarning);
|
||||
fprintf(stderr, "\n");
|
||||
LOCAL_DoingUndefp = false;
|
||||
LOCAL_within_print_message = false;
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
CurrentModule = cmod;
|
||||
return false;
|
||||
}
|
||||
@ -257,7 +259,7 @@ bool Yap_PrintWarning(Term twarning) {
|
||||
B->cp_tr = TR;
|
||||
rc = Yap_execute_pred(pred, ts, true PASS_REGS);
|
||||
LOCAL_within_print_message = false;
|
||||
LOCAL_DoingUndefp = false;
|
||||
LOCAL_PrologMode &= ~InErrorMode;
|
||||
return rc;
|
||||
}
|
||||
|
||||
@ -422,27 +424,29 @@ static char tmpbuf[YAP_BUF_SIZE];
|
||||
#define E0(A, B) \
|
||||
case A: { \
|
||||
Term ft[2]; \
|
||||
ft[0] = MkAtomTerm(mkerrorct(A)); \
|
||||
ft[0] = MkAtomTerm(mkerrorct(B)); \
|
||||
ft[1] = info; \
|
||||
return Yap_MkApplTerm(FunctorError,2,ft); }
|
||||
|
||||
#define E(A, B, C) \
|
||||
case A: \
|
||||
{ Term ft[2], nt[2]; \
|
||||
ft[0] = Yap_MkNewApplTerm(Yap_MkFunctor(mkerrorct(B),2), 2); \
|
||||
nt[1] = MkAtomTerm(Yap_LookupAtom(C)); \
|
||||
RESET_VARIABLE(nt+2); Yap_unify(nt[2], culprit); \
|
||||
nt[0] = MkAtomTerm(Yap_LookupAtom(C)); \
|
||||
nt[1] = MkVarTerm(); \
|
||||
Yap_unify(nt[1], culprit); \
|
||||
ft[0] = Yap_MkApplTerm(Yap_MkFunctor(mkerrorct(B),2), 2, nt); \
|
||||
ft[1] = info; \
|
||||
return Yap_MkApplTerm(FunctorError,2,ft); }
|
||||
|
||||
#define E2(A, B, C, D) \
|
||||
case A: \
|
||||
{ \
|
||||
Term ft[3], nt[2]; \
|
||||
ft[0] = Yap_MkNewApplTerm(Yap_MkFunctor(mkerrorct(B),3), 3); \
|
||||
nt[1] = MkAtomTerm(Yap_LookupAtom(C)); \
|
||||
nt[2] = MkAtomTerm(Yap_LookupAtom(D)); \
|
||||
RESET_VARIABLE(nt+3); Yap_unify(nt[3], culprit); \
|
||||
Term ft[2], nt[3]; \
|
||||
nt[0] = MkAtomTerm(Yap_LookupAtom(C)); \
|
||||
nt[1] = MkAtomTerm(Yap_LookupAtom(D)); \
|
||||
nt[2] = MkVarTerm(); \
|
||||
Yap_unify(nt[2], culprit); \
|
||||
ft[0] = Yap_MkApplTerm(Yap_MkFunctor(mkerrorct(B),3), 3, nt); \
|
||||
ft[1] = info; \
|
||||
return Yap_MkApplTerm(FunctorError,2,ft); \
|
||||
}
|
||||
@ -453,7 +457,7 @@ static char tmpbuf[YAP_BUF_SIZE];
|
||||
}
|
||||
|
||||
#include "YapErrors.h"
|
||||
//
|
||||
|
||||
void Yap_pushErrorContext(yap_error_descriptor_t *new_error) {
|
||||
memset(new_error, 0, sizeof(yap_error_descriptor_t));
|
||||
new_error->top_error = LOCAL_ActiveError;
|
||||
@ -730,8 +734,6 @@ yamop *Yap_Error__(bool throw, const char *file, const char *function, int linen
|
||||
break;
|
||||
}
|
||||
|
||||
/* disable active signals at this point */
|
||||
LOCAL_Signals = 0;
|
||||
CalculateStackGap(PASS_REGS1);
|
||||
#if DEBUG
|
||||
// DumpActiveGoals( PASS_REGS1 );
|
||||
@ -740,6 +742,7 @@ yamop *Yap_Error__(bool throw, const char *file, const char *function, int linen
|
||||
it's up to her to decide */
|
||||
|
||||
if (LOCAL_DoingUndefp) {
|
||||
LOCAL_Signals = 0;
|
||||
Yap_PrintWarning(Yap_GetException());
|
||||
return P;
|
||||
}
|
||||
@ -915,6 +918,7 @@ const char *Yap_errorClassName(yap_error_class_number e) {
|
||||
Term rc = mkerrort(t->errorNo, Yap_BufferToTerm(t->culprit, TermNil), err2list(t));
|
||||
Yap_DebugPlWriteln(rc);
|
||||
Yap_ResetException(worker_id);
|
||||
save_H();
|
||||
return rc;
|
||||
}
|
||||
return 0;
|
||||
|
1
C/exec.c
1
C/exec.c
@ -1452,7 +1452,6 @@ static bool exec_absmi(bool top, yap_reset_t reset_mode USES_REGS) {
|
||||
fprintf(stderr,"HR before jmp=%p\n", HR);
|
||||
Yap_JumpToEnv();
|
||||
fprintf(stderr,"HR after jmp=%p\n", HR);
|
||||
LOCAL_PrologMode = UserMode;
|
||||
ASP = (CELL *) B;
|
||||
if (B == NULL || B->cp_b == NULL || (CELL*)(B->cp_b) > LCL0 - LOCAL_CBorder) {
|
||||
LOCAL_RestartEnv = sighold;
|
||||
|
3
C/text.c
3
C/text.c
@ -854,6 +854,9 @@ static size_t downcase(void *s0, seq_tv_t *out USES_REGS) {
|
||||
bool Yap_CVT_Text(seq_tv_t *inp, seq_tv_t *out USES_REGS) {
|
||||
unsigned char *buf;
|
||||
bool rc;
|
||||
yap_error_descriptor_t new;
|
||||
|
||||
|
||||
/*
|
||||
//printf(stderr, "[ %d ", n++) ;
|
||||
if (inp->type & (YAP_STRING_TERM|YAP_STRING_ATOM|YAP_STRING_ATOMS_CODES
|
||||
|
1805
CMakeCache.txt
1805
CMakeCache.txt
File diff suppressed because one or more lines are too long
323
H/LOCALS
323
H/LOCALS
@ -1,323 +0,0 @@
|
||||
// Stuff that must be considered local to a thread or worker
|
||||
START_WORKER_LOCAL
|
||||
|
||||
// Streams
|
||||
int c_input_stream =0
|
||||
int c_output_stream =1
|
||||
int c_error_stream =2
|
||||
|
||||
bool sockets_io =false
|
||||
|
||||
bool within_print_message =false
|
||||
|
||||
//
|
||||
|
||||
// Used by the prompts to check if they are after a newline, and then a
|
||||
// prompt should be output, or if we are in the middle of a line.
|
||||
//
|
||||
bool newline =true
|
||||
|
||||
Atom AtPrompt =AtomNil
|
||||
char Prompt[MAX_PROMPT+1] void
|
||||
|
||||
encoding_t encoding =Yap_DefaultEncoding()
|
||||
bool quasi_quotations =false
|
||||
UInt default_priority =1200
|
||||
|
||||
bool eot_before_eof =false
|
||||
UInt max_depth =0
|
||||
UInt max_list =0
|
||||
UInt max_write_args =0
|
||||
|
||||
|
||||
// Restore info
|
||||
CELL* OldASP =NULL
|
||||
CELL* OldLCL0 =NULL
|
||||
tr_fr_ptr OldTR =NULL
|
||||
CELL* OldGlobalBase =NULL
|
||||
CELL* OldH =NULL
|
||||
CELL* OldH0 =NULL
|
||||
ADDR OldTrailBase =NULL
|
||||
ADDR OldTrailTop =NULL
|
||||
ADDR OldHeapBase =NULL
|
||||
ADDR OldHeapTop =NULL
|
||||
Int ClDiff =0L
|
||||
Int GDiff =0L
|
||||
Int HDiff =0L
|
||||
Int GDiff0 =0L
|
||||
CELL* GSplit =NULL
|
||||
Int LDiff =0L
|
||||
Int TrDiff =0L
|
||||
Int XDiff =0L
|
||||
Int DelayDiff =0L
|
||||
Int BaseDiff =0L
|
||||
|
||||
// Reduction counters
|
||||
YAP_ULONG_LONG ReductionsCounter =0L
|
||||
YAP_ULONG_LONG PredEntriesCounter =0L
|
||||
YAP_ULONG_LONG RetriesCounter =0L
|
||||
int ReductionsCounterOn =0L
|
||||
int PredEntriesCounterOn =0L
|
||||
int RetriesCounterOn =0L
|
||||
|
||||
// support for consulting files
|
||||
/* current consult stack */
|
||||
union CONSULT_OBJ* ConsultSp =NULL
|
||||
/* current maximum number of cells in consult stack */
|
||||
UInt ConsultCapacity void
|
||||
/* top of consult stack */
|
||||
union CONSULT_OBJ* ConsultBase =NULL
|
||||
/* low-water mark for consult */
|
||||
union CONSULT_OBJ* ConsultLow =NULL
|
||||
Term VarNames =((Term)0)
|
||||
Atom SourceFileName =NULL
|
||||
UInt SourceFileLineno =0
|
||||
|
||||
//global variables
|
||||
Term GlobalArena =0L TermToGlobalOrAtomAdjust
|
||||
UInt GlobalArenaOverflows =0L
|
||||
Int ArenaOverflows =0L
|
||||
Int DepthArenas =0
|
||||
|
||||
struct pred_entry* LastAssertedPred =NULL
|
||||
struct pred_entry* TmpPred =NULL
|
||||
char* ScannerStack =NULL
|
||||
struct scanner_extra_alloc* ScannerExtraBlocks =NULL
|
||||
|
||||
/// worker control information
|
||||
/// stack limit after which the stack is managed by C-code.
|
||||
Int CBorder =0
|
||||
|
||||
|
||||
/// max number of signals (uint64_t)
|
||||
UInt MaxActiveSignals =64L
|
||||
/// actual life signals
|
||||
uint64_t Signals =0L
|
||||
/// indexing help data?
|
||||
UInt IPredArity =0L
|
||||
yamop* ProfEnd =NULL
|
||||
int DoingUndefp =FALSE
|
||||
Int StartCharCount =0L
|
||||
Int StartLineCount =0L
|
||||
Int StartLinePos =0L
|
||||
scratch_block ScratchPad InitScratchPad(wid)
|
||||
#ifdef COROUTINING
|
||||
Term WokenGoals =0L TermToGlobalAdjust
|
||||
Term AttsMutableList =0L TermToGlobalAdjust
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
// gc_stuff
|
||||
Term GcGeneration =0L TermToGlobalAdjust
|
||||
Term GcPhase =0L TermToGlobalAdjust
|
||||
UInt GcCurrentPhase =0L
|
||||
UInt GcCalls =0L
|
||||
Int TotGcTime =0L
|
||||
YAP_ULONG_LONG TotGcRecovered =0L
|
||||
Int LastGcTime =0L
|
||||
Int LastSSTime =0L
|
||||
CELL* OpenArray =NULL
|
||||
|
||||
/* in a single gc */
|
||||
Int total_marked =0L
|
||||
Int total_oldies =0L
|
||||
struct choicept* current_B =NULL
|
||||
CELL* prev_HB =NULL
|
||||
CELL* HGEN =NULL
|
||||
CELL** iptop =NULL
|
||||
|
||||
#if defined(GC_NO_TAGS)
|
||||
char* bp =NULL
|
||||
#endif
|
||||
tr_fr_ptr sTR =NULL
|
||||
tr_fr_ptr sTR0 =NULL
|
||||
tr_fr_ptr new_TR =NULL
|
||||
struct gc_mark_continuation* cont_top0 =NULL
|
||||
struct gc_mark_continuation* cont_top =NULL
|
||||
int discard_trail_entries =0
|
||||
gc_ma_hash_entry gc_ma_hash_table[GC_MAVARS_HASH_SIZE] void
|
||||
gc_ma_hash_entry* gc_ma_h_top =NULL
|
||||
gc_ma_hash_entry* gc_ma_h_list =NULL
|
||||
UInt gc_timestamp =0L
|
||||
ADDR db_vec =NULL
|
||||
ADDR db_vec0 =NULL
|
||||
struct RB_red_blk_node* db_root =NULL
|
||||
struct RB_red_blk_node* db_nil =NULL
|
||||
|
||||
sigjmp_buf* gc_restore void
|
||||
CELL* extra_gc_cells void
|
||||
CELL* extra_gc_cells_base void
|
||||
CELL* extra_gc_cells_top void
|
||||
UInt extra_gc_cells_size =256
|
||||
struct array_entry* DynamicArrays =NULL PtoArrayEAdjust
|
||||
struct static_array_entry* StaticArrays =NULL PtoArraySAdjust
|
||||
struct global_entry* GlobalVariables =NULL PtoGlobalEAdjust
|
||||
int AllowRestart =FALSE
|
||||
|
||||
// Thread Local Area for Fast Storage of Intermediate Compiled Code
|
||||
struct mem_blk* CMemFirstBlock =NULL
|
||||
UInt CMemFirstBlockSz =0L
|
||||
|
||||
// Variable used by the compiler to store number of permanent vars in a clause
|
||||
int nperm =0
|
||||
int jMP =0
|
||||
// Thread Local Area for Labels
|
||||
Int* LabelFirstArray =NULL
|
||||
UInt LabelFirstArraySz =0L
|
||||
|
||||
// Thread Local Area for SWI-Prolog emulation routines.
|
||||
// struct PL_local_data* PL_local_data_p =Yap_InitThreadIO(wid)
|
||||
|
||||
#ifdef THREADS
|
||||
struct thandle ThreadHandle InitThreadHandle(wid)
|
||||
#endif /* THREADS */
|
||||
|
||||
#if defined(YAPOR) || defined(TABLING)
|
||||
struct local_optyap_data optyap_data Yap_init_local_optyap_data(wid)
|
||||
UInt TabMode =0L
|
||||
#endif /* YAPOR || TABLING */
|
||||
|
||||
int InterruptsDisabled =FALSE
|
||||
|
||||
struct open_query_struct* execution =NULL
|
||||
|
||||
#if LOW_LEVEL_TRACER
|
||||
Int total_choicepoints =0
|
||||
#endif
|
||||
|
||||
int consult_level =0
|
||||
|
||||
// Variables related to memory allocation
|
||||
ADDR LocalBase void
|
||||
ADDR GlobalBase void
|
||||
ADDR TrailBase void
|
||||
ADDR TrailTop void
|
||||
|
||||
/* error handling info, designed to be easy to pass to the foreign world */
|
||||
yap_error_descriptor_t* ActiveError =calloc(sizeof(yap_error_descriptor_t),1)
|
||||
/// pointer to an exception term, from throw
|
||||
|
||||
jmp_buf* IOBotch void
|
||||
TokEntry* tokptr void
|
||||
TokEntry* toktide void
|
||||
VarEntry* VarTable void
|
||||
VarEntry* AnonVarTable void
|
||||
Term Comments void
|
||||
CELL* CommentsTail void
|
||||
CELL* CommentsNextChar void
|
||||
wchar_t* CommentsBuff void
|
||||
size_t CommentsBuffPos void
|
||||
size_t CommentsBuffLim void
|
||||
sigjmp_buf* RestartEnv void
|
||||
char FileNameBuf[YAP_FILENAME_MAX+1] void
|
||||
char FileNameBuf2[YAP_FILENAME_MAX+1] void
|
||||
|
||||
struct TextBuffer_manager* TextBuffer =Yap_InitTextAllocator()
|
||||
|
||||
// Prolog State
|
||||
UInt BreakLevel =0
|
||||
Int PrologMode =BootMode
|
||||
int CritLocks =0
|
||||
|
||||
// Prolog execution and state flags
|
||||
union flagTerm* Flags void
|
||||
UInt flagCount void
|
||||
|
||||
//analyst.c
|
||||
/* used to find out how many instructions of each kind are executed */
|
||||
#ifdef ANALYST
|
||||
YAP_ULONG_LONG opcount[_std_top+1] void
|
||||
YAP_ULONG_LONG 2opcount[_std_top+1][_std_top+1] void
|
||||
#endif /* ANALYST */
|
||||
|
||||
//dbase.c
|
||||
struct db_globs* s_dbg void
|
||||
|
||||
//eval.c
|
||||
Term mathtt void
|
||||
char* mathstring =NULL
|
||||
|
||||
//grow.c
|
||||
int heap_overflows =0
|
||||
Int total_heap_overflow_time =0
|
||||
int stack_overflows =0
|
||||
Int total_stack_overflow_time =0
|
||||
int delay_overflows =0
|
||||
Int total_delay_overflow_time =0
|
||||
int trail_overflows =0
|
||||
Int total_trail_overflow_time =0
|
||||
int atom_table_overflows =0
|
||||
Int total_atom_table_overflow_time =0
|
||||
|
||||
//load_dyld
|
||||
#ifdef LOAD_DYLD
|
||||
int dl_errno =0
|
||||
#endif
|
||||
|
||||
//tracer.c
|
||||
#ifdef LOW_LEVEL_TRACER
|
||||
int do_trace_primitives =TRUE
|
||||
#endif
|
||||
|
||||
//quick loader
|
||||
struct export_atom_hash_entry_struct *ExportAtomHashChain =NULL
|
||||
UInt ExportAtomHashTableSize =0
|
||||
UInt ExportAtomHashTableNum =0
|
||||
struct export_functor_hash_entry_struct *ExportFunctorHashChain =NULL
|
||||
UInt ExportFunctorHashTableSize =0
|
||||
UInt ExportFunctorHashTableNum =0
|
||||
struct export_pred_entry_hash_entry_struct *ExportPredEntryHashChain =NULL
|
||||
UInt ExportPredEntryHashTableSize =0
|
||||
UInt ExportPredEntryHashTableNum =0
|
||||
struct export_dbref_hash_entry_struct *ExportDBRefHashChain =NULL
|
||||
UInt ExportDBRefHashTableSize =0
|
||||
UInt ExportDBRefHashTableNum =0
|
||||
struct import_atom_hash_entry_struct **ImportAtomHashChain =NULL
|
||||
UInt ImportAtomHashTableSize =0
|
||||
UInt ImportAtomHashTableNum =0
|
||||
struct import_functor_hash_entry_struct **ImportFunctorHashChain =NULL
|
||||
UInt ImportFunctorHashTableSize =0
|
||||
UInt ImportFunctorHashTableNum =0
|
||||
struct import_opcode_hash_entry_struct **ImportOPCODEHashChain =NULL
|
||||
UInt ImportOPCODEHashTableSize =0
|
||||
struct import_pred_entry_hash_entry_struct **ImportPredEntryHashChain =NULL
|
||||
UInt ImportPredEntryHashTableSize =0
|
||||
UInt ImportPredEntryHashTableNum =0
|
||||
struct import_dbref_hash_entry_struct **ImportDBRefHashChain =NULL
|
||||
UInt ImportDBRefHashTableSize =0
|
||||
UInt ImportDBRefHashTableNum =0
|
||||
yamop *ImportFAILCODE =NULL
|
||||
|
||||
// exo indexing
|
||||
|
||||
UInt ibnds[256] void
|
||||
struct index_t* exo_it =NULL
|
||||
CELL* exo_base =NULL
|
||||
UInt exo_arity =0
|
||||
UInt exo_arg =0
|
||||
|
||||
// atom completion
|
||||
struct scan_atoms* search_atoms void
|
||||
struct pred_entry* SearchPreds void
|
||||
|
||||
/// Slots Status
|
||||
yhandle_t CurSlot =0
|
||||
yhandle_t FrozenHandles =0
|
||||
yhandle_t NSlots =0
|
||||
CELL* SlotBase =InitHandles(wid)
|
||||
|
||||
// Mutexes
|
||||
struct swi_mutex* Mutexes =NULL
|
||||
|
||||
Term SourceModule =0
|
||||
Term Including =TermNil
|
||||
|
||||
size_t MAX_SIZE =1024L
|
||||
|
||||
/* last call to walltime. */
|
||||
uint64_t LastWTime =0
|
||||
|
||||
void* shared =NULL
|
||||
|
||||
END_WORKER_LOCAL
|
@ -992,6 +992,10 @@ Term Yap_read_term(int sno, Term opts, bool clause) {
|
||||
int emacs_cares = FALSE;
|
||||
#endif
|
||||
|
||||
yap_error_descriptor_t new;
|
||||
|
||||
|
||||
Yap_pushErrorContext(&new);
|
||||
int lvl = push_text_stack();
|
||||
parser_state_t state = YAP_START_PARSING;
|
||||
while (true) {
|
||||
@ -1000,6 +1004,7 @@ Term Yap_read_term(int sno, Term opts, bool clause) {
|
||||
state = initParser(opts, &fe, &re, sno, clause);
|
||||
if (state == YAP_PARSING_FINISHED) {
|
||||
pop_text_stack(lvl);
|
||||
Yap_popErrorContext(true);
|
||||
return 0;
|
||||
}
|
||||
break;
|
||||
@ -1033,11 +1038,13 @@ Term Yap_read_term(int sno, Term opts, bool clause) {
|
||||
#if EMACS
|
||||
first_char = tokstart->TokPos;
|
||||
#endif /* EMACS */
|
||||
Yap_popErrorContext(true);
|
||||
pop_text_stack(lvl);
|
||||
return fe.t;
|
||||
}
|
||||
}
|
||||
}
|
||||
Yap_popErrorContext(true);
|
||||
pop_text_stack(lvl);
|
||||
return 0;
|
||||
}
|
||||
|
@ -299,13 +299,17 @@ bool Yap_WriteTerm(int output_stream, Term t, Term opts USES_REGS) {
|
||||
Yap_Error(LOCAL_Error_TYPE, opts, NULL);
|
||||
return false;
|
||||
}
|
||||
yap_error_descriptor_t new;
|
||||
|
||||
|
||||
Yap_pushErrorContext(&new);
|
||||
yhandle_t mySlots = Yap_StartSlots();
|
||||
LOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||
write_term(output_stream, t, args PASS_REGS);
|
||||
UNLOCK(GLOBAL_Stream[output_stream].streamlock);
|
||||
free(args);
|
||||
Yap_CloseSlots(mySlots);
|
||||
Yap_RaiseException();
|
||||
Yap_popErrorContext(true);
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,28 +0,0 @@
|
||||
// -*- c++ -*-
|
||||
//=============================================================================
|
||||
// Copyright (C) 2011 by Denys Duchier
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published by the
|
||||
// Free Software Foundation, either version 3 of the License, or (at your
|
||||
// option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
// more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//=============================================================================
|
||||
|
||||
static RestartMode gecode_RestartMode_from_term(YAP_Term);
|
||||
static FloatRelType gecode_FloatRelType_from_term(YAP_Term);
|
||||
static ReifyMode gecode_ReifyMode_from_term(YAP_Term);
|
||||
static IntRelType gecode_IntRelType_from_term(YAP_Term);
|
||||
static BoolOpType gecode_BoolOpType_from_term(YAP_Term);
|
||||
static IntPropLevel gecode_IntPropLevel_from_term(YAP_Term);
|
||||
static TaskType gecode_TaskType_from_term(YAP_Term);
|
||||
static TraceEvent gecode_TraceEvent_from_term(YAP_Term);
|
||||
static SetRelType gecode_SetRelType_from_term(YAP_Term);
|
||||
static SetOpType gecode_SetOpType_from_term(YAP_Term);
|
File diff suppressed because it is too large
Load Diff
@ -1,681 +0,0 @@
|
||||
// -*- c++ -*-
|
||||
//=============================================================================
|
||||
// Copyright (C) 2011 by Denys Duchier
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify it
|
||||
// under the terms of the GNU Lesser General Public License as published by the
|
||||
// Free Software Foundation, either version 3 of the License, or (at your
|
||||
// option) any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
// more details.
|
||||
//
|
||||
// You should have received a copy of the GNU Lesser General Public License
|
||||
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
//=============================================================================
|
||||
|
||||
{ YAP_Atom X= YAP_LookupAtom("RM_NONE");
|
||||
gecode_RM_NONE = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("RM_CONSTANT");
|
||||
gecode_RM_CONSTANT = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("RM_LINEAR");
|
||||
gecode_RM_LINEAR = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("RM_LUBY");
|
||||
gecode_RM_LUBY = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("RM_GEOMETRIC");
|
||||
gecode_RM_GEOMETRIC = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
|
||||
{ YAP_Atom X= YAP_LookupAtom("FRT_EQ");
|
||||
gecode_FRT_EQ = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("FRT_NQ");
|
||||
gecode_FRT_NQ = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("FRT_LQ");
|
||||
gecode_FRT_LQ = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("FRT_LE");
|
||||
gecode_FRT_LE = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("FRT_GQ");
|
||||
gecode_FRT_GQ = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("FRT_GR");
|
||||
gecode_FRT_GR = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
|
||||
{ YAP_Atom X= YAP_LookupAtom("RM_EQV");
|
||||
gecode_RM_EQV = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("RM_IMP");
|
||||
gecode_RM_IMP = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("RM_PMI");
|
||||
gecode_RM_PMI = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
|
||||
{ YAP_Atom X= YAP_LookupAtom("IRT_EQ");
|
||||
gecode_IRT_EQ = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("IRT_NQ");
|
||||
gecode_IRT_NQ = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("IRT_LQ");
|
||||
gecode_IRT_LQ = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("IRT_LE");
|
||||
gecode_IRT_LE = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("IRT_GQ");
|
||||
gecode_IRT_GQ = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("IRT_GR");
|
||||
gecode_IRT_GR = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
|
||||
{ YAP_Atom X= YAP_LookupAtom("BOT_AND");
|
||||
gecode_BOT_AND = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("BOT_OR");
|
||||
gecode_BOT_OR = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("BOT_IMP");
|
||||
gecode_BOT_IMP = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("BOT_EQV");
|
||||
gecode_BOT_EQV = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("BOT_XOR");
|
||||
gecode_BOT_XOR = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
|
||||
{ YAP_Atom X= YAP_LookupAtom("IPL_DEF");
|
||||
gecode_IPL_DEF = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("IPL_VAL");
|
||||
gecode_IPL_VAL = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("IPL_BND");
|
||||
gecode_IPL_BND = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("IPL_DOM");
|
||||
gecode_IPL_DOM = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("IPL_SPEED");
|
||||
gecode_IPL_SPEED = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("IPL_MEMORY");
|
||||
gecode_IPL_MEMORY = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("IPL_BASIC");
|
||||
gecode_IPL_BASIC = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("IPL_ADVANCED");
|
||||
gecode_IPL_ADVANCED = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("IPL_BASIC_ADVANCED");
|
||||
gecode_IPL_BASIC_ADVANCED = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
|
||||
{ YAP_Atom X= YAP_LookupAtom("TT_FIXP");
|
||||
gecode_TT_FIXP = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("TT_FIXS");
|
||||
gecode_TT_FIXS = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("TT_FIXE");
|
||||
gecode_TT_FIXE = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
|
||||
{ YAP_Atom X= YAP_LookupAtom("TE_INIT");
|
||||
gecode_TE_INIT = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("TE_PRUNE");
|
||||
gecode_TE_PRUNE = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("TE_FIX");
|
||||
gecode_TE_FIX = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("TE_FAIL");
|
||||
gecode_TE_FAIL = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("TE_DONE");
|
||||
gecode_TE_DONE = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("TE_PROPAGATE");
|
||||
gecode_TE_PROPAGATE = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("TE_COMMIT");
|
||||
gecode_TE_COMMIT = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
|
||||
{ YAP_Atom X= YAP_LookupAtom("SRT_EQ");
|
||||
gecode_SRT_EQ = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("SRT_NQ");
|
||||
gecode_SRT_NQ = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("SRT_SUB");
|
||||
gecode_SRT_SUB = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("SRT_SUP");
|
||||
gecode_SRT_SUP = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("SRT_DISJ");
|
||||
gecode_SRT_DISJ = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("SRT_CMPL");
|
||||
gecode_SRT_CMPL = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("SRT_LQ");
|
||||
gecode_SRT_LQ = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("SRT_LE");
|
||||
gecode_SRT_LE = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("SRT_GQ");
|
||||
gecode_SRT_GQ = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("SRT_GR");
|
||||
gecode_SRT_GR = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
|
||||
{ YAP_Atom X= YAP_LookupAtom("SOT_UNION");
|
||||
gecode_SOT_UNION = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("SOT_DUNION");
|
||||
gecode_SOT_DUNION = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("SOT_INTER");
|
||||
gecode_SOT_INTER = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
{ YAP_Atom X= YAP_LookupAtom("SOT_MINUS");
|
||||
gecode_SOT_MINUS = YAP_MkAtomTerm(X);
|
||||
YAP_AtomGetHold(X); }
|
||||
|
||||
YAP_UserCPredicate("gecode_constraint_branch_1", gecode_constraint_branch_1, 2);
|
||||
YAP_UserCPredicate("gecode_constraint_convex_2", gecode_constraint_convex_2, 2);
|
||||
YAP_UserCPredicate("gecode_constraint_convex_3", gecode_constraint_convex_3, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_abs_4", gecode_constraint_abs_4, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_abs_5", gecode_constraint_abs_5, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_abs_6", gecode_constraint_abs_6, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_argmax_7", gecode_constraint_argmax_7, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_argmax_11", gecode_constraint_argmax_11, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_argmax_8", gecode_constraint_argmax_8, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_argmax_12", gecode_constraint_argmax_12, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_argmax_9", gecode_constraint_argmax_9, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_argmax_10", gecode_constraint_argmax_10, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_argmin_13", gecode_constraint_argmin_13, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_argmin_17", gecode_constraint_argmin_17, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_argmin_14", gecode_constraint_argmin_14, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_argmin_18", gecode_constraint_argmin_18, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_argmin_15", gecode_constraint_argmin_15, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_argmin_16", gecode_constraint_argmin_16, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_19", gecode_constraint_assign_19, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_21", gecode_constraint_assign_21, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_24", gecode_constraint_assign_24, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_27", gecode_constraint_assign_27, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_30", gecode_constraint_assign_30, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_33", gecode_constraint_assign_33, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_35", gecode_constraint_assign_35, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_37", gecode_constraint_assign_37, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_20", gecode_constraint_assign_20, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_22", gecode_constraint_assign_22, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_25", gecode_constraint_assign_25, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_28", gecode_constraint_assign_28, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_31", gecode_constraint_assign_31, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_34", gecode_constraint_assign_34, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_36", gecode_constraint_assign_36, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_38", gecode_constraint_assign_38, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_23", gecode_constraint_assign_23, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_26", gecode_constraint_assign_26, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_29", gecode_constraint_assign_29, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_assign_32", gecode_constraint_assign_32, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_binpacking_39", gecode_constraint_binpacking_39, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_binpacking_40", gecode_constraint_binpacking_40, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_41", gecode_constraint_branch_41, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_85", gecode_constraint_branch_85, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_87", gecode_constraint_branch_87, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_89", gecode_constraint_branch_89, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_42", gecode_constraint_branch_42, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_43", gecode_constraint_branch_43, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_49", gecode_constraint_branch_49, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_55", gecode_constraint_branch_55, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_58", gecode_constraint_branch_58, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_64", gecode_constraint_branch_64, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_70", gecode_constraint_branch_70, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_76", gecode_constraint_branch_76, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_82", gecode_constraint_branch_82, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_86", gecode_constraint_branch_86, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_88", gecode_constraint_branch_88, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_90", gecode_constraint_branch_90, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_44", gecode_constraint_branch_44, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_46", gecode_constraint_branch_46, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_50", gecode_constraint_branch_50, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_52", gecode_constraint_branch_52, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_56", gecode_constraint_branch_56, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_59", gecode_constraint_branch_59, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_61", gecode_constraint_branch_61, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_65", gecode_constraint_branch_65, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_67", gecode_constraint_branch_67, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_71", gecode_constraint_branch_71, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_73", gecode_constraint_branch_73, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_77", gecode_constraint_branch_77, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_79", gecode_constraint_branch_79, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_83", gecode_constraint_branch_83, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_45", gecode_constraint_branch_45, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_47", gecode_constraint_branch_47, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_51", gecode_constraint_branch_51, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_53", gecode_constraint_branch_53, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_57", gecode_constraint_branch_57, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_60", gecode_constraint_branch_60, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_62", gecode_constraint_branch_62, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_66", gecode_constraint_branch_66, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_68", gecode_constraint_branch_68, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_72", gecode_constraint_branch_72, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_74", gecode_constraint_branch_74, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_78", gecode_constraint_branch_78, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_80", gecode_constraint_branch_80, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_84", gecode_constraint_branch_84, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_48", gecode_constraint_branch_48, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_54", gecode_constraint_branch_54, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_63", gecode_constraint_branch_63, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_69", gecode_constraint_branch_69, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_75", gecode_constraint_branch_75, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_branch_81", gecode_constraint_branch_81, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_cardinality_91", gecode_constraint_cardinality_91, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_cardinality_92", gecode_constraint_cardinality_92, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_channel_93", gecode_constraint_channel_93, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_channel_95", gecode_constraint_channel_95, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_channel_98", gecode_constraint_channel_98, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_channel_102", gecode_constraint_channel_102, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_channel_103", gecode_constraint_channel_103, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_channel_94", gecode_constraint_channel_94, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_channel_96", gecode_constraint_channel_96, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_channel_99", gecode_constraint_channel_99, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_channel_97", gecode_constraint_channel_97, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_channel_100", gecode_constraint_channel_100, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_channel_101", gecode_constraint_channel_101, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_circuit_104", gecode_constraint_circuit_104, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_circuit_107", gecode_constraint_circuit_107, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_circuit_110", gecode_constraint_circuit_110, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_circuit_105", gecode_constraint_circuit_105, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_circuit_108", gecode_constraint_circuit_108, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_circuit_111", gecode_constraint_circuit_111, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_circuit_106", gecode_constraint_circuit_106, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_circuit_115", gecode_constraint_circuit_115, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_circuit_109", gecode_constraint_circuit_109, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_circuit_112", gecode_constraint_circuit_112, 2);
|
||||
YAP_UserCPredicate("gecode_constraint_circuit_113", gecode_constraint_circuit_113, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_circuit_114", gecode_constraint_circuit_114, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_clause_116", gecode_constraint_clause_116, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_clause_118", gecode_constraint_clause_118, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_clause_117", gecode_constraint_clause_117, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_clause_119", gecode_constraint_clause_119, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_count_120", gecode_constraint_count_120, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_count_122", gecode_constraint_count_122, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_count_125", gecode_constraint_count_125, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_count_129", gecode_constraint_count_129, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_count_130", gecode_constraint_count_130, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_count_132", gecode_constraint_count_132, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_count_135", gecode_constraint_count_135, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_count_138", gecode_constraint_count_138, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_count_140", gecode_constraint_count_140, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_count_142", gecode_constraint_count_142, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_count_144", gecode_constraint_count_144, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_count_121", gecode_constraint_count_121, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_count_123", gecode_constraint_count_123, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_count_131", gecode_constraint_count_131, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_count_133", gecode_constraint_count_133, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_count_139", gecode_constraint_count_139, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_count_141", gecode_constraint_count_141, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_count_143", gecode_constraint_count_143, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_count_145", gecode_constraint_count_145, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_count_124", gecode_constraint_count_124, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_count_127", gecode_constraint_count_127, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_count_128", gecode_constraint_count_128, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_count_134", gecode_constraint_count_134, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_count_137", gecode_constraint_count_137, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_count_126", gecode_constraint_count_126, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_count_136", gecode_constraint_count_136, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_146", gecode_constraint_cumulative_146, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_149", gecode_constraint_cumulative_149, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_152", gecode_constraint_cumulative_152, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_156", gecode_constraint_cumulative_156, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_158", gecode_constraint_cumulative_158, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_161", gecode_constraint_cumulative_161, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_164", gecode_constraint_cumulative_164, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_168", gecode_constraint_cumulative_168, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_147", gecode_constraint_cumulative_147, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_150", gecode_constraint_cumulative_150, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_153", gecode_constraint_cumulative_153, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_154", gecode_constraint_cumulative_154, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_157", gecode_constraint_cumulative_157, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_159", gecode_constraint_cumulative_159, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_162", gecode_constraint_cumulative_162, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_165", gecode_constraint_cumulative_165, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_166", gecode_constraint_cumulative_166, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_169", gecode_constraint_cumulative_169, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_148", gecode_constraint_cumulative_148, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_160", gecode_constraint_cumulative_160, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_151", gecode_constraint_cumulative_151, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_155", gecode_constraint_cumulative_155, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_163", gecode_constraint_cumulative_163, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulative_167", gecode_constraint_cumulative_167, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_170", gecode_constraint_cumulatives_170, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_172", gecode_constraint_cumulatives_172, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_174", gecode_constraint_cumulatives_174, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_176", gecode_constraint_cumulatives_176, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_178", gecode_constraint_cumulatives_178, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_180", gecode_constraint_cumulatives_180, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_182", gecode_constraint_cumulatives_182, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_184", gecode_constraint_cumulatives_184, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_171", gecode_constraint_cumulatives_171, 9);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_173", gecode_constraint_cumulatives_173, 9);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_175", gecode_constraint_cumulatives_175, 9);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_177", gecode_constraint_cumulatives_177, 9);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_179", gecode_constraint_cumulatives_179, 9);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_181", gecode_constraint_cumulatives_181, 9);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_183", gecode_constraint_cumulatives_183, 9);
|
||||
YAP_UserCPredicate("gecode_constraint_cumulatives_185", gecode_constraint_cumulatives_185, 9);
|
||||
YAP_UserCPredicate("gecode_constraint_distinct_186", gecode_constraint_distinct_186, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_distinct_188", gecode_constraint_distinct_188, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_distinct_190", gecode_constraint_distinct_190, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_distinct_193", gecode_constraint_distinct_193, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_distinct_187", gecode_constraint_distinct_187, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_distinct_189", gecode_constraint_distinct_189, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_distinct_191", gecode_constraint_distinct_191, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_distinct_192", gecode_constraint_distinct_192, 2);
|
||||
YAP_UserCPredicate("gecode_constraint_div_194", gecode_constraint_div_194, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_div_195", gecode_constraint_div_195, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_div_196", gecode_constraint_div_196, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_divmod_197", gecode_constraint_divmod_197, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_divmod_198", gecode_constraint_divmod_198, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_199", gecode_constraint_dom_199, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_201", gecode_constraint_dom_201, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_203", gecode_constraint_dom_203, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_205", gecode_constraint_dom_205, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_206", gecode_constraint_dom_206, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_208", gecode_constraint_dom_208, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_212", gecode_constraint_dom_212, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_214", gecode_constraint_dom_214, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_220", gecode_constraint_dom_220, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_222", gecode_constraint_dom_222, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_223", gecode_constraint_dom_223, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_229", gecode_constraint_dom_229, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_235", gecode_constraint_dom_235, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_243", gecode_constraint_dom_243, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_200", gecode_constraint_dom_200, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_202", gecode_constraint_dom_202, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_204", gecode_constraint_dom_204, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_207", gecode_constraint_dom_207, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_209", gecode_constraint_dom_209, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_210", gecode_constraint_dom_210, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_213", gecode_constraint_dom_213, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_215", gecode_constraint_dom_215, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_216", gecode_constraint_dom_216, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_218", gecode_constraint_dom_218, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_221", gecode_constraint_dom_221, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_224", gecode_constraint_dom_224, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_225", gecode_constraint_dom_225, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_227", gecode_constraint_dom_227, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_230", gecode_constraint_dom_230, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_233", gecode_constraint_dom_233, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_236", gecode_constraint_dom_236, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_237", gecode_constraint_dom_237, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_239", gecode_constraint_dom_239, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_211", gecode_constraint_dom_211, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_217", gecode_constraint_dom_217, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_219", gecode_constraint_dom_219, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_226", gecode_constraint_dom_226, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_228", gecode_constraint_dom_228, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_231", gecode_constraint_dom_231, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_234", gecode_constraint_dom_234, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_238", gecode_constraint_dom_238, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_240", gecode_constraint_dom_240, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_242", gecode_constraint_dom_242, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_232", gecode_constraint_dom_232, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_dom_241", gecode_constraint_dom_241, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_element_244", gecode_constraint_element_244, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_element_246", gecode_constraint_element_246, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_element_250", gecode_constraint_element_250, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_element_254", gecode_constraint_element_254, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_element_256", gecode_constraint_element_256, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_element_258", gecode_constraint_element_258, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_element_264", gecode_constraint_element_264, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_element_245", gecode_constraint_element_245, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_element_247", gecode_constraint_element_247, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_element_251", gecode_constraint_element_251, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_element_255", gecode_constraint_element_255, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_element_257", gecode_constraint_element_257, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_element_259", gecode_constraint_element_259, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_element_265", gecode_constraint_element_265, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_element_248", gecode_constraint_element_248, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_element_252", gecode_constraint_element_252, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_element_260", gecode_constraint_element_260, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_element_262", gecode_constraint_element_262, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_element_249", gecode_constraint_element_249, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_element_253", gecode_constraint_element_253, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_element_261", gecode_constraint_element_261, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_element_263", gecode_constraint_element_263, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_extensional_266", gecode_constraint_extensional_266, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_extensional_268", gecode_constraint_extensional_268, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_extensional_270", gecode_constraint_extensional_270, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_extensional_272", gecode_constraint_extensional_272, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_extensional_267", gecode_constraint_extensional_267, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_extensional_269", gecode_constraint_extensional_269, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_extensional_271", gecode_constraint_extensional_271, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_extensional_273", gecode_constraint_extensional_273, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_ite_274", gecode_constraint_ite_274, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_ite_276", gecode_constraint_ite_276, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_ite_277", gecode_constraint_ite_277, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_ite_279", gecode_constraint_ite_279, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_ite_275", gecode_constraint_ite_275, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_ite_278", gecode_constraint_ite_278, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_280", gecode_constraint_linear_280, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_284", gecode_constraint_linear_284, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_292", gecode_constraint_linear_292, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_294", gecode_constraint_linear_294, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_312", gecode_constraint_linear_312, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_316", gecode_constraint_linear_316, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_281", gecode_constraint_linear_281, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_282", gecode_constraint_linear_282, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_285", gecode_constraint_linear_285, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_286", gecode_constraint_linear_286, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_288", gecode_constraint_linear_288, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_290", gecode_constraint_linear_290, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_293", gecode_constraint_linear_293, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_295", gecode_constraint_linear_295, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_296", gecode_constraint_linear_296, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_300", gecode_constraint_linear_300, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_304", gecode_constraint_linear_304, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_308", gecode_constraint_linear_308, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_313", gecode_constraint_linear_313, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_314", gecode_constraint_linear_314, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_317", gecode_constraint_linear_317, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_318", gecode_constraint_linear_318, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_283", gecode_constraint_linear_283, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_287", gecode_constraint_linear_287, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_289", gecode_constraint_linear_289, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_291", gecode_constraint_linear_291, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_297", gecode_constraint_linear_297, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_298", gecode_constraint_linear_298, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_301", gecode_constraint_linear_301, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_302", gecode_constraint_linear_302, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_305", gecode_constraint_linear_305, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_306", gecode_constraint_linear_306, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_309", gecode_constraint_linear_309, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_310", gecode_constraint_linear_310, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_315", gecode_constraint_linear_315, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_319", gecode_constraint_linear_319, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_299", gecode_constraint_linear_299, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_303", gecode_constraint_linear_303, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_307", gecode_constraint_linear_307, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_linear_311", gecode_constraint_linear_311, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_max_320", gecode_constraint_max_320, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_max_321", gecode_constraint_max_321, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_max_322", gecode_constraint_max_322, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_max_323", gecode_constraint_max_323, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_max_324", gecode_constraint_max_324, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_max_325", gecode_constraint_max_325, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_member_326", gecode_constraint_member_326, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_member_330", gecode_constraint_member_330, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_member_327", gecode_constraint_member_327, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_member_328", gecode_constraint_member_328, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_member_331", gecode_constraint_member_331, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_member_332", gecode_constraint_member_332, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_member_329", gecode_constraint_member_329, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_member_333", gecode_constraint_member_333, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_min_334", gecode_constraint_min_334, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_min_335", gecode_constraint_min_335, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_min_336", gecode_constraint_min_336, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_min_337", gecode_constraint_min_337, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_min_338", gecode_constraint_min_338, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_min_339", gecode_constraint_min_339, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_mod_340", gecode_constraint_mod_340, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_mod_341", gecode_constraint_mod_341, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_mult_342", gecode_constraint_mult_342, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_mult_343", gecode_constraint_mult_343, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_mult_344", gecode_constraint_mult_344, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_nooverlap_345", gecode_constraint_nooverlap_345, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_nooverlap_348", gecode_constraint_nooverlap_348, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_nooverlap_346", gecode_constraint_nooverlap_346, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_nooverlap_351", gecode_constraint_nooverlap_351, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_nooverlap_347", gecode_constraint_nooverlap_347, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_nooverlap_349", gecode_constraint_nooverlap_349, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_nooverlap_352", gecode_constraint_nooverlap_352, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_nooverlap_350", gecode_constraint_nooverlap_350, 9);
|
||||
YAP_UserCPredicate("gecode_constraint_nroot_353", gecode_constraint_nroot_353, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_nroot_354", gecode_constraint_nroot_354, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_nroot_355", gecode_constraint_nroot_355, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_nvalues_356", gecode_constraint_nvalues_356, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_nvalues_358", gecode_constraint_nvalues_358, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_nvalues_360", gecode_constraint_nvalues_360, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_nvalues_362", gecode_constraint_nvalues_362, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_nvalues_357", gecode_constraint_nvalues_357, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_nvalues_359", gecode_constraint_nvalues_359, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_nvalues_361", gecode_constraint_nvalues_361, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_nvalues_363", gecode_constraint_nvalues_363, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_path_364", gecode_constraint_path_364, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_path_367", gecode_constraint_path_367, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_path_370", gecode_constraint_path_370, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_path_365", gecode_constraint_path_365, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_path_368", gecode_constraint_path_368, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_path_371", gecode_constraint_path_371, 8);
|
||||
YAP_UserCPredicate("gecode_constraint_path_366", gecode_constraint_path_366, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_path_375", gecode_constraint_path_375, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_path_369", gecode_constraint_path_369, 9);
|
||||
YAP_UserCPredicate("gecode_constraint_path_372", gecode_constraint_path_372, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_path_373", gecode_constraint_path_373, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_path_374", gecode_constraint_path_374, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_pow_376", gecode_constraint_pow_376, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_pow_377", gecode_constraint_pow_377, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_pow_378", gecode_constraint_pow_378, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_precede_379", gecode_constraint_precede_379, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_precede_380", gecode_constraint_precede_380, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_precede_381", gecode_constraint_precede_381, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_precede_382", gecode_constraint_precede_382, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_relax_383", gecode_constraint_relax_383, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_384", gecode_constraint_rel_384, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_386", gecode_constraint_rel_386, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_392", gecode_constraint_rel_392, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_396", gecode_constraint_rel_396, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_400", gecode_constraint_rel_400, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_402", gecode_constraint_rel_402, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_404", gecode_constraint_rel_404, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_406", gecode_constraint_rel_406, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_409", gecode_constraint_rel_409, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_410", gecode_constraint_rel_410, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_411", gecode_constraint_rel_411, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_412", gecode_constraint_rel_412, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_414", gecode_constraint_rel_414, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_416", gecode_constraint_rel_416, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_418", gecode_constraint_rel_418, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_420", gecode_constraint_rel_420, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_423", gecode_constraint_rel_423, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_424", gecode_constraint_rel_424, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_426", gecode_constraint_rel_426, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_428", gecode_constraint_rel_428, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_430", gecode_constraint_rel_430, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_434", gecode_constraint_rel_434, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_438", gecode_constraint_rel_438, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_440", gecode_constraint_rel_440, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_442", gecode_constraint_rel_442, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_444", gecode_constraint_rel_444, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_385", gecode_constraint_rel_385, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_387", gecode_constraint_rel_387, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_388", gecode_constraint_rel_388, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_390", gecode_constraint_rel_390, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_393", gecode_constraint_rel_393, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_394", gecode_constraint_rel_394, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_397", gecode_constraint_rel_397, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_398", gecode_constraint_rel_398, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_401", gecode_constraint_rel_401, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_403", gecode_constraint_rel_403, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_405", gecode_constraint_rel_405, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_407", gecode_constraint_rel_407, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_413", gecode_constraint_rel_413, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_415", gecode_constraint_rel_415, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_417", gecode_constraint_rel_417, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_419", gecode_constraint_rel_419, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_421", gecode_constraint_rel_421, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_425", gecode_constraint_rel_425, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_427", gecode_constraint_rel_427, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_429", gecode_constraint_rel_429, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_431", gecode_constraint_rel_431, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_432", gecode_constraint_rel_432, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_435", gecode_constraint_rel_435, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_436", gecode_constraint_rel_436, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_439", gecode_constraint_rel_439, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_441", gecode_constraint_rel_441, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_443", gecode_constraint_rel_443, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_445", gecode_constraint_rel_445, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_389", gecode_constraint_rel_389, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_391", gecode_constraint_rel_391, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_395", gecode_constraint_rel_395, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_399", gecode_constraint_rel_399, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_433", gecode_constraint_rel_433, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_437", gecode_constraint_rel_437, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_408", gecode_constraint_rel_408, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_rel_422", gecode_constraint_rel_422, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_sequence_446", gecode_constraint_sequence_446, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_sequence_448", gecode_constraint_sequence_448, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_sequence_447", gecode_constraint_sequence_447, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_sequence_449", gecode_constraint_sequence_449, 7);
|
||||
YAP_UserCPredicate("gecode_constraint_sorted_450", gecode_constraint_sorted_450, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_sorted_453", gecode_constraint_sorted_453, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_sorted_451", gecode_constraint_sorted_451, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_sorted_452", gecode_constraint_sorted_452, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_sqr_454", gecode_constraint_sqr_454, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_sqr_455", gecode_constraint_sqr_455, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_sqr_456", gecode_constraint_sqr_456, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_sqrt_457", gecode_constraint_sqrt_457, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_sqrt_458", gecode_constraint_sqrt_458, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_sqrt_459", gecode_constraint_sqrt_459, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_unary_460", gecode_constraint_unary_460, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_unary_463", gecode_constraint_unary_463, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_unary_466", gecode_constraint_unary_466, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_unary_470", gecode_constraint_unary_470, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_unary_461", gecode_constraint_unary_461, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_unary_464", gecode_constraint_unary_464, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_unary_467", gecode_constraint_unary_467, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_unary_468", gecode_constraint_unary_468, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_unary_471", gecode_constraint_unary_471, 5);
|
||||
YAP_UserCPredicate("gecode_constraint_unary_462", gecode_constraint_unary_462, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_unary_465", gecode_constraint_unary_465, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_unary_469", gecode_constraint_unary_469, 6);
|
||||
YAP_UserCPredicate("gecode_constraint_unshare_472", gecode_constraint_unshare_472, 2);
|
||||
YAP_UserCPredicate("gecode_constraint_unshare_474", gecode_constraint_unshare_474, 2);
|
||||
YAP_UserCPredicate("gecode_constraint_unshare_473", gecode_constraint_unshare_473, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_unshare_475", gecode_constraint_unshare_475, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_when_476", gecode_constraint_when_476, 3);
|
||||
YAP_UserCPredicate("gecode_constraint_when_477", gecode_constraint_when_477, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_when_478", gecode_constraint_when_478, 4);
|
||||
YAP_UserCPredicate("gecode_constraint_when_479", gecode_constraint_when_479, 5);
|
@ -1,193 +0,0 @@
|
||||
|
||||
//@{
|
||||
|
||||
/** @brief Prolog to Python library
|
||||
*
|
||||
*
|
||||
* Please look at python.pl for more information, and to real.pl and real.c
|
||||
* for related work.
|
||||
*/
|
||||
|
||||
#ifdef _XOPEN_SOURCE
|
||||
#undef _XOPEN_SOURCE // python does its own thing
|
||||
#endif
|
||||
|
||||
#include <Python.h>
|
||||
#include <SWI-Prolog.h>
|
||||
#ifdef HAVE_STAT
|
||||
#undef HAVE_STATa
|
||||
#endif
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
#define EXTRA_MESSSAGES 1
|
||||
|
||||
#ifndef PYTHON_H
|
||||
#define PYTHON_H 1
|
||||
|
||||
PyObject *find_obj(PyObject *ob, term_t lhs, bool eval);
|
||||
|
||||
#if DEBUG_MEMORY
|
||||
#define DebugPrintf(s, op) fprintf(stderr, "%s:%d: " s, __FILE__, __LINE__, op)
|
||||
#else
|
||||
#define DebugPrintf(s, op)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* @brief A module is store as an objet plus a list of paths.
|
||||
*/
|
||||
#define PY_MAX_MODLEN 16
|
||||
typedef struct s_mod_t {
|
||||
PyObject *mod;
|
||||
int length;
|
||||
YAP_Term names[PY_MAX_MODLEN];
|
||||
} Py_mod;
|
||||
|
||||
extern X_API YAP_Term pythonToYAP(PyObject *pVal);
|
||||
extern X_API PyObject *yap_to_python(YAP_Term t, bool eval, PyObject *o);
|
||||
|
||||
typedef YAP_Arity arity_t;
|
||||
|
||||
extern atom_t ATOM_true, ATOM_false, ATOM_colon, ATOM_dot, ATOM_none, ATOM_t,
|
||||
ATOM_comma, ATOM_builtin, ATOM_V, ATOM_A, ATOM_self;
|
||||
|
||||
extern functor_t FUNCTOR_dollar1, FUNCTOR_abs1, FUNCTOR_all1, FUNCTOR_any1,
|
||||
FUNCTOR_bin1, FUNCTOR_brackets1, FUNCTOR_comma2, FUNCTOR_dir1,
|
||||
FUNCTOR_float1, FUNCTOR_int1, FUNCTOR_iter1, FUNCTOR_iter2, FUNCTOR_long1,
|
||||
FUNCTOR_len1, FUNCTOR_curly1, FUNCTOR_ord1, FUNCTOR_range1, FUNCTOR_range2,
|
||||
FUNCTOR_range3, FUNCTOR_sum1, FUNCTOR_pointer1, FUNCTOR_complex2,
|
||||
FUNCTOR_plus2, FUNCTOR_sub2, FUNCTOR_mul2, FUNCTOR_div2, FUNCTOR_hat2,
|
||||
FUNCTOR_colon2, FUNCTOR_comma2, FUNCTOR_equal2, FUNCTOR_sqbrackets2,
|
||||
FUNCTOR_dot2;
|
||||
|
||||
extern X_API PyObject *py_Main;
|
||||
extern X_API PyObject *py_Builtin;
|
||||
extern X_API PyObject *py_Yapex;
|
||||
extern X_API PyObject *py_Local;
|
||||
extern X_API PyObject *py_Global;
|
||||
extern X_API PyObject *py_Context;
|
||||
extern PyObject *py_F2P;
|
||||
extern PyObject *py_Sys;
|
||||
extern PyObject *py_ModDict;
|
||||
|
||||
extern bool python_in_python;
|
||||
|
||||
extern bool python_release_GIL(term_t state);
|
||||
extern term_t python_acquire_GIL(void);
|
||||
|
||||
static inline Py_ssize_t get_p_int(PyObject *o, Py_ssize_t def) {
|
||||
if (o == NULL)
|
||||
return def;
|
||||
if (PyLong_Check(o)) {
|
||||
return PyLong_AsLong(o);
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
} else if (PyInt_Check(o)) {
|
||||
return PyInt_AsLong(o);
|
||||
#endif
|
||||
}
|
||||
return def;
|
||||
}
|
||||
|
||||
static inline foreign_t address_to_term(PyObject *pVal, term_t t) {
|
||||
term_t to = PL_new_term_ref(), t1 = PL_new_term_ref();
|
||||
PL_put_pointer(t1, (void *)pVal);
|
||||
PL_cons_functor(to, FUNCTOR_pointer1, t1);
|
||||
Py_INCREF(pVal);
|
||||
foreign_t rc = PL_unify(t, to);
|
||||
PL_reset_term_refs(to);
|
||||
return rc;
|
||||
}
|
||||
|
||||
static inline int proper_ascii_string(const char *s) {
|
||||
unsigned char c;
|
||||
|
||||
while ((c = *s++)) {
|
||||
if (c > 127)
|
||||
return FALSE;
|
||||
}
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static inline PyObject *atom_to_python_string(term_t t) {
|
||||
// Yap_DebugPlWrite(YAP_GetFromSlot(t)); fprintf(stderr, " here I
|
||||
// am\n");
|
||||
char *s = NULL;
|
||||
if (!PL_get_atom_chars(t, &s))
|
||||
return NULL;
|
||||
/* return __main__,s */
|
||||
#if PY_MAJOR_VERSION < 3
|
||||
if (proper_ascii_string(s)) {
|
||||
return PyString_FromStringAndSize(s, strlen(s));
|
||||
} else
|
||||
#endif
|
||||
{
|
||||
PyObject *pobj = PyUnicode_DecodeUTF8(s, strlen(s), NULL);
|
||||
// fprintf(stderr, "%s\n", s);
|
||||
return pobj;
|
||||
}
|
||||
}
|
||||
|
||||
#define CHECK_CALL(rc, t, call) \
|
||||
PyErr_Clear();\
|
||||
rc = call; \
|
||||
if (rc == NULL || PyErr_Occurred()) {\
|
||||
YE(t,__LINE__,__FILE__,__FUNCTION__);\
|
||||
PyErr_Print(); PyErr_Clear();\
|
||||
}
|
||||
|
||||
#define CHECKNULL(t,rc) (rc != NULL ? rc : YE(t,__LINE__,__FILE__,__FUNCTION__) )
|
||||
#define AOK(rc, err) { if (!rc) YEM( #rc ,__LINE__,__FILE__,__FUNCTION__); }
|
||||
|
||||
|
||||
extern PyObject *YE(term_t t, int line, const char *file, const char *code);
|
||||
extern void YEM( const char *ex, int line, const char *file, const char *code);
|
||||
extern void pyErrorHandler__(int line, const char *file, const char *code);
|
||||
|
||||
#define pyErrorHandler() \
|
||||
{ \
|
||||
if (PyErr_Occurred()) { \
|
||||
pyErrorHandler__(__LINE__, __FILE__, __FUNCTION__); \
|
||||
} \
|
||||
}
|
||||
|
||||
#define pyErrorAndReturn(x, y) \
|
||||
{ \
|
||||
if (PyErr_Occurred()) { \
|
||||
pyErrorHandler__(__LINE__, __FILE__, __FUNCTION__); \
|
||||
return (x); \
|
||||
} else { \
|
||||
return (x); \
|
||||
} \
|
||||
}
|
||||
// #define pyErrorAndReturn( x, y ) return x
|
||||
|
||||
extern PyObject *compound_to_pyeval(term_t t, PyObject *context);
|
||||
extern PyObject *compound_to_pytree(term_t t, PyObject *context);
|
||||
|
||||
extern PyObject *term_to_python(term_t t, bool eval, PyObject *contextxs);
|
||||
|
||||
extern PyObject *term_to_nametuple(const char *s, int arity, term_t t);
|
||||
|
||||
extern foreign_t python_to_term(PyObject *pVal, term_t t);
|
||||
extern bool python_assign(term_t t, PyObject *exp, PyObject *context);
|
||||
extern foreign_t assign_to_symbol(term_t t, PyObject *e);
|
||||
|
||||
extern bool python_asign(term_t t, PyObject *exp, PyObject *context);
|
||||
|
||||
extern foreign_t python_builtin(term_t out);
|
||||
|
||||
extern int lookupPyModule(Py_mod *q);
|
||||
extern PyObject *lookupPySymbol(const char *s, PyObject *q, PyObject **d);
|
||||
|
||||
extern install_t install_pypreds(void);
|
||||
extern install_t install_pl2pl(void);
|
||||
|
||||
X_API extern bool init_python(void);
|
||||
extern bool do_init_python(void);
|
||||
|
||||
extern PyObject PyInit_yap(void);
|
||||
|
||||
extern PyObject *PythonLookup(const char *s, PyObject *o);
|
||||
|
||||
extern PyObject *PythonLookupSpecial(const char *s);
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user