diff --git a/C/absmi.c b/C/absmi.c index 783c15ce7..0d9a357dd 100644 --- a/C/absmi.c +++ b/C/absmi.c @@ -1679,18 +1679,18 @@ Yap_absmi(int inp) *****************************************************************/ /* ensure_space */ - BOp(ensure_space, Osbpi); + BOp(ensure_space, Osbpa); { - Int sz = PREG->u.Osbpi.i; - UInt arity = PREG->u.Osbpi.p->ArityOfPE; + Int sz = PREG->u.Osbpa.i; + UInt arity = PREG->u.Osbpa.p->ArityOfPE; if (Unsigned(H) + sz > Unsigned(YREG)-CreepFlag) { YENV[E_CP] = (CELL) CPREG; YENV[E_E] = (CELL) ENV; #ifdef DEPTH_LIMIT YENV[E_DEPTH] = DEPTH; #endif /* DEPTH_LIMIT */ - SET_ASP(YREG, PREG->u.Osbpi.s); - PREG = NEXTOP(PREG,Osbpi); + SET_ASP(YREG, PREG->u.Osbpa.s); + PREG = NEXTOP(PREG,Osbpa); saveregs(); if (!Yap_gcl(sz, arity, YENV, PREG)) { Yap_Error(OUT_OF_STACK_ERROR,TermNil,LOCAL_ErrorMessage); @@ -1700,7 +1700,7 @@ Yap_absmi(int inp) setregs(); } } else { - PREG = NEXTOP(PREG,Osbpi); + PREG = NEXTOP(PREG,Osbpa); } } JMPNext(); diff --git a/C/adtdefs.c b/C/adtdefs.c index 5ad14cf86..4fc916cc7 100644 --- a/C/adtdefs.c +++ b/C/adtdefs.c @@ -69,9 +69,9 @@ InlinedUnlockedMkFunctor(AtomEntry *ae, unsigned int arity) p->NameOfFE = AbsAtom(ae); p->ArityOfFE = arity; p->PropsOfFE = NIL; - p->NextOfPE = ae->PropsOfAE; INIT_RWLOCK(p->FRWLock); - ae->PropsOfAE = AbsProp((PropEntry *) p); + /* respect the first property, in case this is a wide atom */ + AddPropToAtom(ae, (PropEntry *)p); return ((Functor) p); } @@ -104,8 +104,7 @@ Yap_MkFunctorWithAddress(Atom ap, unsigned int arity, FunctorEntry *p) p->KindOfPE = FunctorProperty; p->NameOfFE = ap; p->ArityOfFE = arity; - p->NextOfPE = RepAtom(ap)->PropsOfAE; - ae->PropsOfAE = AbsProp((PropEntry *) p); + AddPropToAtom(ae, (PropEntry *)p); WRITE_UNLOCK(ae->ARWLock); } @@ -493,6 +492,7 @@ Yap_GetOpProp(Atom a, op_type type USES_REGS) { /* look property list of atom a for kind */ AtomEntry *ae = RepAtom(a); PropEntry *pp; + OpEntry *oinfo = NULL; READ_LOCK(ae->ARWLock); pp = RepProp(ae->PropsOfAE); @@ -524,9 +524,21 @@ Yap_GetOpProp(Atom a, op_type type USES_REGS) continue; } } - READ_LOCK(info->OpRWLock); + /* if it is not the latest module */ + if (info->OpModule == PROLOG_MODULE) { + /* cannot commit now */ + oinfo = info; + pp = RepProp(pp->NextOfPE); + } else { + READ_LOCK(info->OpRWLock); + READ_UNLOCK(ae->ARWLock); + return info; + } + } + if (oinfo) { + READ_LOCK(oinfo->OpRWLock); READ_UNLOCK(ae->ARWLock); - return info; + return oinfo; } READ_UNLOCK(ae->ARWLock); return NULL; @@ -898,7 +910,6 @@ Yap_NewPredPropByAtom(AtomEntry *ae, Term cur_mod) p->beamTable = NULL; #endif /* careful that they don't cross MkFunctor */ - p->NextOfPE = ae->PropsOfAE; if (PRED_GOAL_EXPANSION_FUNC) { Prop p1 = ae->PropsOfAE; @@ -914,7 +925,8 @@ Yap_NewPredPropByAtom(AtomEntry *ae, Term cur_mod) p1 = pe->NextOfPE; } } - ae->PropsOfAE = p0 = AbsPredProp(p); + AddPropToAtom(ae, (PropEntry *)p); + p0 = AbsPredProp(p); p->FunctorOfPred = (Functor)AbsAtom(ae); WRITE_UNLOCK(ae->ARWLock); #ifdef LOW_PROF @@ -1033,10 +1045,9 @@ Yap_PutValue(Atom a, Term v) WRITE_UNLOCK(ae->ARWLock); return; } - p->NextOfPE = RepAtom(a)->PropsOfAE; - RepAtom(a)->PropsOfAE = AbsValProp(p); p->KindOfPE = ValProperty; p->ValueOfVE = TermNil; + AddPropToAtom(RepAtom(a), (PropEntry *)p); /* take care that the lock for the property will be inited even if someone else searches for the property */ INIT_RWLOCK(p->VRWLock); @@ -1431,30 +1442,6 @@ Yap_RecoverSlots(int n USES_REGS) return TRUE; } -Term -Yap_GetFromSlot(Int slot USES_REGS) -{ - return(Deref(LCL0[slot])); -} - -Term -Yap_GetPtrFromSlot(Int slot USES_REGS) -{ - return(LCL0[slot]); -} - -Term * -Yap_AddressFromSlot(Int slot USES_REGS) -{ - return(LCL0+slot); -} - -void -Yap_PutInSlot(Int slot, Term t USES_REGS) -{ - LCL0[slot] = t; -} - static HoldEntry * InitAtomHold(void) { diff --git a/C/alloc.c b/C/alloc.c index 0f7d72e66..50c07a06c 100644 --- a/C/alloc.c +++ b/C/alloc.c @@ -944,7 +944,6 @@ InitWorkSpace(Int s) #else a = mmap(NULL, (size_t) s, PROT_READ | PROT_WRITE | PROT_EXEC, MAP_PRIVATE | MAP_ANON, -1, 0); - fprintf(stderr,"a=%p\n",a); #endif #else fd = open("/dev/zero", O_RDWR, S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH); diff --git a/C/amasm.c b/C/amasm.c index 04753e537..72c54d7d1 100644 --- a/C/amasm.c +++ b/C/amasm.c @@ -1104,12 +1104,12 @@ a_ensure_space(op_numbers opcode, yamop *code_p, int pass_no, struct intermediat if (cip->cpc->rnd1 > 4096) { if (pass_no) { code_p->opc = emit_op(opcode); - code_p->u.Osbpi.i = sizeof(CELL) * cip->cpc->rnd1; - code_p->u.Osbpi.p = clinfo->CurrentPred; - code_p->u.Osbpi.bmap = NULL; - code_p->u.Osbpi.s = emit_count(-Signed(RealEnvSize)); + code_p->u.Osbpa.i = sizeof(CELL) * cip->cpc->rnd1; + code_p->u.Osbpa.p = clinfo->CurrentPred; + code_p->u.Osbpa.bmap = NULL; + code_p->u.Osbpa.s = emit_count(-Signed(RealEnvSize)); } - GONEXT(Osbpi); + GONEXT(Osbpa); } return code_p; } diff --git a/C/arith0.c b/C/arith0.c index bd0a1f718..1c780717f 100644 --- a/C/arith0.c +++ b/C/arith0.c @@ -198,8 +198,7 @@ Yap_InitConstExps(void) p->ArityOfEE = 0; p->ENoOfEE = 0; p->FOfEE = InitConstTab[i].f; - p->NextOfPE = ae->PropsOfAE; - ae->PropsOfAE = AbsExpProp(p); + AddPropToAtom(ae, (PropEntry *)p); WRITE_UNLOCK(ae->ARWLock); } } diff --git a/C/arith1.c b/C/arith1.c index 4c14bc5b7..6d7c7601a 100644 --- a/C/arith1.c +++ b/C/arith1.c @@ -835,8 +835,7 @@ Yap_InitUnaryExps(void) p->ArityOfEE = 1; p->ENoOfEE = 1; p->FOfEE = InitUnTab[i].f; - p->NextOfPE = ae->PropsOfAE; - ae->PropsOfAE = AbsExpProp(p); + AddPropToAtom(ae, (PropEntry *)p); WRITE_UNLOCK(ae->ARWLock); } Yap_InitCPred("is", 3, p_unary_is, TestPredFlag | SafePredFlag); diff --git a/C/arith2.c b/C/arith2.c index 23303e4ac..e6d9e9966 100644 --- a/C/arith2.c +++ b/C/arith2.c @@ -1217,8 +1217,7 @@ Yap_InitBinaryExps(void) p->ArityOfEE = 2; p->ENoOfEE = 2; p->FOfEE = InitBinTab[i].f; - p->NextOfPE = ae->PropsOfAE; - ae->PropsOfAE = AbsExpProp(p); + AddPropToAtom(ae, (PropEntry *)p); WRITE_UNLOCK(ae->ARWLock); } Yap_InitCPred("is", 4, p_binary_is, TestPredFlag | SafePredFlag); diff --git a/C/arrays.c b/C/arrays.c index 52af62739..fcf8f2b6c 100644 --- a/C/arrays.c +++ b/C/arrays.c @@ -566,9 +566,8 @@ CreateNamedArray(PropEntry * pp, Int dim, AtomEntry *ae USES_REGS) p = (ArrayEntry *) Yap_AllocAtomSpace(sizeof(*p)); p->KindOfPE = ArrayProperty; - p->NextOfPE = ae->PropsOfAE; + AddPropToAtom(ae, (PropEntry *)p); INIT_RWLOCK(p->ArRWLock); - ae->PropsOfAE = AbsArrayProp(p); #if THREADS p->owner_id = worker_id; #endif @@ -629,15 +628,14 @@ CreateStaticArray(AtomEntry *ae, Int dim, static_array_types type, CODEADDR star } } p->KindOfPE = ArrayProperty; - p->NextOfPE = ae->PropsOfAE; INIT_RWLOCK(p->ArRWLock); + AddPropToAtom(ae, (PropEntry *)p); p->NextAE = LOCAL_StaticArrays; LOCAL_StaticArrays = p; } WRITE_LOCK(p->ArRWLock); p->ArrayEArity = -dim; p->ArrayType = type; - ae->PropsOfAE = AbsArrayProp((ArrayEntry *)p); if (start_addr == NULL) { int i; diff --git a/C/bb.c b/C/bb.c index 38356f55d..a42034fba 100644 --- a/C/bb.c +++ b/C/bb.c @@ -43,8 +43,7 @@ PutBBProp(AtomEntry *ae, Term mod USES_REGS) /* get BBentry for at; */ Yap_Error(OUT_OF_HEAP_ERROR,ARG1,"could not allocate space in bb_put/2"); return(NULL); } - p->NextOfPE = ae->PropsOfAE; - ae->PropsOfAE = AbsBBProp(p); + AddPropToAtom(ae, (PropEntry *)p); p->ModuleOfBB = mod; p->Element = 0L; p->KeyOfBB = AbsAtom(ae); diff --git a/C/bignum.c b/C/bignum.c index b4c22f132..40e81b3b7 100644 --- a/C/bignum.c +++ b/C/bignum.c @@ -183,6 +183,77 @@ int Yap_CleanOpaqueVariable(CELL *pt) return (GLOBAL_OpaqueHandlers[blob_info].fail_handler)((void *)(blobp+1)); } +Opaque_CallOnWrite +Yap_blob_write_handler_from_slot(Int slot) +{ + CELL blob_info, blob_tag; + MP_INT *blobp; + Term t = Yap_GetFromSlot(slot); + CELL *pt = RepAppl(t); + +#ifdef DEBUG + /* sanity checking */ + if (pt[0] != (CELL)FunctorBigInt) { + Yap_Error(SYSTEM_ERROR, TermNil, "CleanOpaqueVariable bad call"); + return FALSE; + } +#endif + blob_tag = pt[1]; + if (blob_tag < USER_BLOB_START || + blob_tag >= USER_BLOB_END) { + Yap_Error(SYSTEM_ERROR, AbsAppl(pt), "clean opaque: bad blob with tag " UInt_FORMAT ,blob_tag); + return FALSE; + } + blob_info = blob_tag - USER_BLOB_START; + if (!GLOBAL_OpaqueHandlers) + return NULL; + blobp = (MP_INT *)(pt+2); + return GLOBAL_OpaqueHandlers[blob_info].write_handler; +} + +extern Int Yap_blob_tag_from_slot(Int slot) +{ + Term t = Yap_GetFromSlot(slot); + CELL *pt = RepAppl(t); + +#ifdef DEBUG + /* sanity checking */ + if (pt[0] != (CELL)FunctorBigInt) { + Yap_Error(SYSTEM_ERROR, TermNil, "CleanOpaqueVariable bad call"); + return FALSE; + } +#endif + return pt[1]; +} + +void * +Yap_blob_info_from_slot(Int slot) +{ + CELL blob_info, blob_tag; + MP_INT *blobp; + Term t = Yap_GetFromSlot(slot); + CELL *pt = RepAppl(t); + +#ifdef DEBUG + /* sanity checking */ + if (pt[0] != (CELL)FunctorBigInt) { + Yap_Error(SYSTEM_ERROR, TermNil, "CleanOpaqueVariable bad call"); + return FALSE; + } +#endif + blob_tag = pt[1]; + if (blob_tag < USER_BLOB_START || + blob_tag >= USER_BLOB_END) { + Yap_Error(SYSTEM_ERROR, AbsAppl(pt), "clean opaque: bad blob with tag " UInt_FORMAT ,blob_tag); + return FALSE; + } + blob_info = blob_tag - USER_BLOB_START; + if (!GLOBAL_OpaqueHandlers) + return FALSE; + blobp = (MP_INT *)(pt+2); + return (void *)(blobp+1); +} + Term Yap_MkULLIntTerm(YAP_ULONG_LONG n) { diff --git a/C/dbase.c b/C/dbase.c index 7b473b8a1..a755c2d54 100644 --- a/C/dbase.c +++ b/C/dbase.c @@ -2896,8 +2896,7 @@ FetchDBPropFromKey(Term twork, int flag, int new, char *error_mssg) p->FunctorOfDB = (Functor) At; else p->FunctorOfDB = Yap_UnlockedMkFunctor(ae,arity); - p->NextOfPE = ae->PropsOfAE; - ae->PropsOfAE = AbsDBProp(p); + AddPropToAtom(ae, (PropEntry *)p); } WRITE_UNLOCK(ae->ARWLock); return diff --git a/C/globals.c b/C/globals.c index 5c2851796..07769bdf5 100644 --- a/C/globals.c +++ b/C/globals.c @@ -858,8 +858,7 @@ GetGlobalEntry(Atom at USES_REGS) new->NextGE = LOCAL_GlobalVariables; LOCAL_GlobalVariables = new; new->AtomOfGE = ae; - new->NextOfPE = ae->PropsOfAE; - ae->PropsOfAE = AbsGlobalProp(new); + AddPropToAtom(ae, (PropEntry *)new); RESET_VARIABLE(&new->global); WRITE_UNLOCK(ae->ARWLock); return new; diff --git a/C/heapgc.c b/C/heapgc.c index 27848ef8c..d505a7d1f 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -3225,7 +3225,7 @@ compact_heap( USES_REGS1 ) */ #ifdef TABLING - if (depfr != NULL && gc_B >= DepFr_cons_cp(depfr)) { + if (depfr && gc_B >= DepFr_cons_cp(depfr)) { gc_B = DepFr_cons_cp(depfr); depfr = DepFr_next(depfr); } @@ -3408,7 +3408,7 @@ icompact_heap( USES_REGS1 ) */ #ifdef TABLING - if (depfr != NULL && gc_B >= DepFr_cons_cp(depfr)) { + if (depfr && gc_B >= DepFr_cons_cp(depfr)) { gc_B = DepFr_cons_cp(depfr); depfr = DepFr_next(depfr); } diff --git a/C/init.c b/C/init.c index 5a3ff9cb5..2daa79290 100644 --- a/C/init.c +++ b/C/init.c @@ -151,14 +151,13 @@ OpDec(int p, char *type, Atom a, Term m) if (EndOfPAEntr(info)) { info = (OpEntry *) Yap_AllocAtomSpace(sizeof(OpEntry)); info->KindOfPE = Ord(OpProperty); - info->NextOfPE = RepAtom(a)->PropsOfAE; info->OpModule = m; info->OpName = a; LOCK(OpListLock); info->OpNext = OpList; OpList = info; UNLOCK(OpListLock); - RepAtom(a)->PropsOfAE = AbsOpProp(info); + AddPropToAtom(ae, (PropEntry *)info); INIT_RWLOCK(info->OpRWLock); WRITE_LOCK(info->OpRWLock); WRITE_UNLOCK(ae->ARWLock); @@ -391,8 +390,6 @@ update_flags_from_prolog(UInt flags, PredEntry *pe) flags |= SourcePredFlag; if (pe->PredFlags & SequentialPredFlag) flags |= SequentialPredFlag; - if (pe->PredFlags & MyddasPredFlag) - flags |= MyddasPredFlag; if (pe->PredFlags & UDIPredFlag) flags |= UDIPredFlag; if (pe->PredFlags & ModuleTransparentPredFlag) @@ -1205,9 +1202,11 @@ InitCodes(void) #include "ihstruct.h" #if THREADS Yap_InitThread(0); -#endif +#endif /* THREADS */ InitGlobal(); +#if !THREADS InitWorker(0); +#endif /* THREADS */ InitFirstWorkerThreadHandle(); /* make sure no one else can use these two atoms */ CurrentModule = 0; diff --git a/C/iopreds.c b/C/iopreds.c index 9f2c17bf6..44ce076d5 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -754,8 +754,10 @@ p_read2 ( USES_REGS1 ) Int out; if (!Yap_getInputStream(Yap_InitSlot(Deref(ARG8) PASS_REGS), &inp_stream)) { + Yap_RecoverSlots(1 PASS_REGS); return(FALSE); } + Yap_RecoverSlots(1 PASS_REGS); out = do_read(inp_stream, 8 PASS_REGS); return out; } @@ -1094,8 +1096,10 @@ p_encoding ( USES_REGS1 ) IOSTREAM *st; Term t = Deref(ARG2); if (!PL_get_stream_handle(Yap_InitSlot(Deref(ARG1) PASS_REGS), &st)) { + Yap_RecoverSlots(1 PASS_REGS); return FALSE; } + Yap_RecoverSlots(1 PASS_REGS); if (IsVarTerm(t)) { return Yap_unify(ARG2, MkIntegerTerm(st->encoding)); } @@ -1129,7 +1133,7 @@ Yap_InitIOPreds(void) Yap_InitCPred ("$force_char_conversion", 0, p_force_char_conversion, SyncPredFlag|HiddenPredFlag); Yap_InitCPred ("$disable_char_conversion", 0, p_disable_char_conversion, SyncPredFlag|HiddenPredFlag); Yap_InitCPred ("$get_default_encoding", 1, p_get_default_encoding, SafePredFlag|TestPredFlag); - Yap_InitCPred ("$encoding", 2, p_encoding, SafePredFlag|SyncPredFlag), + Yap_InitCPred ("$encoding", 2, p_encoding, SafePredFlag|SyncPredFlag|UserCPredFlag), #if HAVE_SELECT // Yap_InitCPred ("stream_select", 3, p_stream_select, SafePredFlag|SyncPredFlag); #endif diff --git a/C/modules.c b/C/modules.c index d588b5914..0c9e64b16 100644 --- a/C/modules.c +++ b/C/modules.c @@ -72,8 +72,7 @@ GetModuleEntry(Atom at) new->NextME = CurrentModules; CurrentModules = new; new->AtomOfME = ae; - new->NextOfPE = ae->PropsOfAE; - ae->PropsOfAE = AbsModProp(new); + AddPropToAtom(ae, (PropEntry *)new); return new; } diff --git a/C/qlyw.c b/C/qlyw.c new file mode 100644 index 000000000..51f1a8583 --- /dev/null +++ b/C/qlyw.c @@ -0,0 +1,451 @@ +/************************************************************************* +* * +* YAP Prolog * +* * +* Yap Prolog was developed at NCCUP - Universidade do Porto * +* * +* Copyright L.Damas, V. Santos Costa and Universidade do Porto 1985-- * +* * +************************************************************************** +* * +* File: stdpreds.c * +* comments: quick saver/loader * +* * +* Last rev: $Date: 2011-08-29$,$Author: vsc $ * +* $Log: not supported by cvs2svn $ * +* * +*************************************************************************/ + +#if DEBUG + +#include "absmi.h" +#include "Foreign.h" +#include "alloc.h" +#include "yapio.h" +#include "iopreds.h" +#include "attvar.h" +#if HAVE_STRING_H +#include +#endif +#include + +STATIC_PROTO(void RestoreEntries, (PropEntry *, int USES_REGS)); +STATIC_PROTO(void CleanCode, (PredEntry * USES_REGS)); + +#define EXPORT_ATOM_TABLE_SIZE (16*4096) +#define EXPORT_FUNCTOR_TABLE_SIZE (16*4096) + +typedef struct export_atom_hash_entry_struct { + Atom val; + struct export_atom_hash_entry_struct *next; +} export_atom_hash_entry_t; + +static void +LookupAtom(Atom at) +{ + char *p = RepAtom(at)->StrOfAE; + CELL hash = HashFunction((unsigned char *)p) % LOCAL_ExportAtomHashTableSize; + export_atom_hash_entry_t *a; + + a = LOCAL_ExportAtomHashChain[hash]; + while (a) { + if (a->val == at) { + return; + } + a = a->next; + } + a = (export_atom_hash_entry_t *)malloc(sizeof(export_atom_hash_entry_t)); + if (!a) { + return; + } + a->val = at; + fprintf(stderr,"+%s\n",RepAtom(at)->StrOfAE); + a->next = LOCAL_ExportAtomHashChain[hash]; + LOCAL_ExportAtomHashChain[hash] = a; + LOCAL_ExportAtomHashTableNum++; +} + +typedef struct export_functor_hash_entry_struct { + Atom name; + UInt arity; + struct export_functor_hash_entry_struct *next; +} export_functor_hash_entry_t; + +static void +LookupFunctor(Functor fun) +{ + CELL hash = (CELL)(fun) % LOCAL_ExportFunctorHashTableSize; + export_functor_hash_entry_t *f; + Atom name = NameOfFunctor(fun); + UInt arity = ArityOfFunctor(fun); + + f = LOCAL_ExportFunctorHashChain[hash]; + while (f) { + if (f->name == name && f->arity == arity) { + return; + } + f = f->next; + } + f = (export_functor_hash_entry_t *)malloc(sizeof(export_functor_hash_entry_t)); + if (!f) { + return; + } + LookupAtom(name); + f->name = name; + f->arity = arity; + f->next = LOCAL_ExportFunctorHashChain[hash]; + LOCAL_ExportFunctorHashChain[hash] = f; + LOCAL_ExportFunctorHashTableNum++; +} + +static void +InitHash(void) +{ + LOCAL_ExportFunctorHashTableSize = EXPORT_FUNCTOR_TABLE_SIZE; + LOCAL_ExportFunctorHashChain = (export_functor_hash_entry_t **)calloc(1, sizeof(export_functor_hash_entry_t *)* LOCAL_ExportFunctorHashTableSize); + LOCAL_ExportAtomHashTableSize = EXPORT_ATOM_TABLE_SIZE; + LOCAL_ExportAtomHashChain = (export_atom_hash_entry_t **)calloc(1, sizeof(export_atom_hash_entry_t *)* LOCAL_ExportAtomHashTableSize); +} + +static inline Atom +AtomAdjust(Atom a) +{ + LookupAtom(a); + return a; +} + +static inline Functor +FuncAdjust(Functor f) +{ + LookupFunctor(f); + return f; +} + + +static inline Term +AtomTermAdjust(Term t) +{ + LookupAtom(AtomOfTerm(t)); + return t; +} + +static inline Term +TermToGlobalOrAtomAdjust(Term t) +{ + if (t && IsAtomTerm(t)) + return AtomTermAdjust(t); + return t; +} + + +#define IsOldCode(P) FALSE +#define IsOldCodeCellPtr(P) FALSE +#define IsOldDelay(P) FALSE +#define IsOldDelayPtr(P) FALSE +#define IsOldLocalInTR(P) FALSE +#define IsOldLocalInTRPtr(P) FALSE +#define IsOldGlobal(P) FALSE +#define IsOldGlobalPtr(P) FALSE +#define IsOldTrail(P) FALSE +#define IsOldTrailPtr(P) FALSE + +#define CharP(X) ((char *)(X)) + +#define REINIT_LOCK(P) +#define REINIT_RWLOCK(P) +#define BlobTypeAdjust(P) (P) +#define NoAGCAtomAdjust(P) (P) +#define OrArgAdjust(P) +#define TabEntryAdjust(P) +#define IntegerAdjust(D) (D) +#define AddrAdjust(P) (P) +#define MFileAdjust(P) (P) +#define CodeVarAdjust(P) (P) +#define ConstantAdjust(P) (P) +#define ArityAdjust(P) (P) +#define DoubleInCodeAdjust(P) +#define IntegerInCodeAdjust(P) +#define OpcodeAdjust(P) (P) +#define ModuleAdjust(P) (P) +#define ExternalFunctionAdjust(P) (P) +#define DBRecordAdjust(P) (P) +#define PredEntryAdjust(P) (P) +#define ModEntryPtrAdjust(P) (P) +#define AtomEntryAdjust(P) (P) +#define GlobalEntryAdjust(P) (P) +#define BlobTermInCodeAdjust(P) (P) +#define CellPtoHeapAdjust(P) (P) +#define PtoAtomHashEntryAdjust(P) (P) +#define CellPtoHeapCellAdjust(P) (P) +#define CellPtoTRAdjust(P) (P) +#define CodeAddrAdjust(P) (P) +#define ConsultObjAdjust(P) (P) +#define DelayAddrAdjust(P) (P) +#define DelayAdjust(P) (P) +#define GlobalAdjust(P) (P) +#define DBRefAdjust(P) (P) +#define DBRefPAdjust(P) (P) +#define DBTermAdjust(P) (P) +#define LUIndexAdjust(P) (P) +#define SIndexAdjust(P) (P) +#define LocalAddrAdjust(P) (P) +#define GlobalAddrAdjust(P) (P) +#define OpListAdjust(P) (P) +#define PtoLUCAdjust(P) (P) +#define PtoStCAdjust(P) (P) +#define PtoArrayEAdjust(P) (P) +#define PtoArraySAdjust(P) (P) +#define PtoGlobalEAdjust(P) (P) +#define PtoDelayAdjust(P) (P) +#define PtoGloAdjust(P) (P) +#define PtoLocAdjust(P) (P) +#define PtoHeapCellAdjust(P) (P) +#define TermToGlobalAdjust(P) (P) +#define PtoOpAdjust(P) (P) +#define PtoLUClauseAdjust(P) (P) +#define PtoLUIndexAdjust(P) (P) +#define PtoDBTLAdjust(P) (P) +#define PtoPredAdjust(P) (P) +#define PtoPtoPredAdjust(P) (P) +#define OpRTableAdjust(P) (P) +#define OpEntryAdjust(P) (P) +#define PropAdjust(P) (P) +#define TrailAddrAdjust(P) (P) +#define XAdjust(P) (P) +#define YAdjust(P) (P) +#define HoldEntryAdjust(P) (P) +#define CodeCharPAdjust(P) (P) +#define CodeVoidPAdjust(P) (P) +#define HaltHookAdjust(P) (P) + +#define recompute_mask(dbr) + +#define rehash(oldcode, NOfE, KindOfEntries) + +#define RestoreSWIHash() + +#include "rheap.h" + +static void +RestoreHashPreds( USES_REGS1 ) +{ +} + + +static void init_reg_copies(USES_REGS1) +{ +} + + +static void +RestoreAtomList(Atom atm USES_REGS) +{ +} + +static void +mark_trail(USES_REGS1) +{ +} + +static void +mark_registers(USES_REGS1) +{ +} + +#define NEXTOP(V,TYPE) ((yamop *)(&((V)->u.TYPE.next))) + +typedef enum { + QLY_START_PREDICATE, + QLY_END_PREDICATE, + QLY_START_CLAUSE, + QLY_END_CLAUSES, + QLY_FUNCTORS, + QLY_ATOMS, + QLY_ATOM_WIDE, + QLY_ATOM +} qlf_tag_t; + +#define CHECK(F) { size_t r = (F); if (!r) return r; } + +static size_t save_bytes(IOSTREAM *stream, void *ptr, size_t sz) +{ + return Sfwrite(ptr, sz, 1, stream); +} + +static size_t save_byte(IOSTREAM *stream, int byte) +{ + return Sputc(byte, stream); +} + +static size_t save_uint(IOSTREAM *stream, UInt val) +{ + UInt v = val; + return save_bytes(stream, &v, sizeof(UInt)); +} + +static size_t save_tag(IOSTREAM *stream, qlf_tag_t tag) +{ + return save_byte(stream, tag); +} + +static int +SaveHash(IOSTREAM *stream) +{ + UInt i; + CHECK(save_tag(stream, QLY_ATOMS)); + CHECK(save_uint(stream, LOCAL_ExportAtomHashTableNum)); + for (i = 0; i < LOCAL_ExportAtomHashTableSize; i++) { + export_atom_hash_entry_t *a = LOCAL_ExportAtomHashChain[i]; + while (a) { + export_atom_hash_entry_t *a0 = a; + Atom at = a->val; + CHECK(save_uint(stream, (UInt)at)); + if (IsWideAtom(at)) { + CHECK(save_tag(stream, QLY_ATOM_WIDE)); + CHECK(save_uint(stream, wcslen(RepAtom(at)->WStrOfAE))); + CHECK(save_bytes(stream, at->WStrOfAE, wcslen(at->WStrOfAE)*sizeof(wchar_t))); + } else { + CHECK(save_tag(stream, QLY_ATOM)); + CHECK(save_uint(stream, strlen(RepAtom(at)->StrOfAE))); + CHECK(save_bytes(stream, at->StrOfAE, (strlen(at->StrOfAE)+1)*sizeof(char))); + } + a = a->next; + free(a0); + } + } + save_tag(stream, QLY_FUNCTORS); + save_uint(stream, LOCAL_ExportFunctorHashTableNum); + for (i = 0; i < LOCAL_ExportFunctorHashTableSize; i++) { + export_functor_hash_entry_t *f = LOCAL_ExportFunctorHashChain[i]; + while (f) { + export_functor_hash_entry_t *f0 = f; + CHECK(save_uint(stream, f->arity)); + CHECK(save_uint(stream, (CELL)(f->name))); + f = f->next; + free(f0); + } + } +} + +static size_t +save_clauses(IOSTREAM *stream, PredEntry *pp) { + yamop *FirstC, *LastC; + + FirstC = pp->cs.p_code.FirstClause; + LastC = pp->cs.p_code.LastClause; + if (FirstC == NULL && LastC == NULL) { + return save_tag(stream, QLY_END_CLAUSES); + } + if (pp->PredFlags & LogUpdatePredFlag) { + LogUpdClause *cl = ClauseCodeToLogUpdClause(FirstC); + + while (cl != NULL) { + UInt size = cl->ClSize; + CHECK(save_bytes(stream, cl, size)); + cl = cl->ClNext; + } + } else if (pp->PredFlags & MegaClausePredFlag) { + MegaClause *cl = ClauseCodeToMegaClause(FirstC); + UInt size = cl->ClSize; + + CHECK(save_bytes(stream, cl, size)); + } else if (pp->PredFlags & DynamicPredFlag) { + yamop *cl = FirstC; + + do { + DynamicClause *dcl = ClauseCodeToDynamicClause(cl); + UInt size = dcl->ClSize; + + CHECK(save_bytes(stream, dcl, size)); + if (cl == LastC) return 1; + cl = NextDynamicClause(cl); + } while (TRUE); + } else { + StaticClause *cl = ClauseCodeToStaticClause(FirstC); + + do { + UInt size = cl->ClSize; + + CHECK(save_bytes(stream, cl, size)); + if (cl->ClCode == LastC) return 1; + cl = cl->ClNext; + } while (TRUE); + } + return save_tag(stream, QLY_END_CLAUSES); +} + +static size_t +save_pred(IOSTREAM *stream, PredEntry *ap) { + CHECK(save_uint(stream, (UInt)(ap->FunctorOfPred))); + CHECK(save_uint(stream, ap->ArityOfPE)); + CHECK(save_uint(stream, ap->PredFlags)); + CHECK(save_uint(stream, ap->cs.p_code.NOfClauses)); + return save_clauses(stream, ap); +} + +static int +clean_pred(PredEntry *pp USES_REGS) { + if (pp->PredFlags & (AsmPredFlag|CPredFlag)) { + /* assembly */ + if (pp->CodeOfPred) { + CleanClauses(pp->CodeOfPred, pp->CodeOfPred, pp PASS_REGS); + } + } else { + CleanClauses(pp->cs.p_code.FirstClause, pp->cs.p_code.LastClause, pp PASS_REGS); + } + return TRUE; +} + +static size_t +save_module(IOSTREAM *stream, Term mod) { + CACHE_REGS + PredEntry *ap = Yap_ModulePred(mod); + InitHash(); + while (ap) { + fprintf(stderr,"P %s\n",RepAtom(NameOfFunctor(ap->FunctorOfPred))->StrOfAE); + if (ap->ArityOfPE) { + FuncAdjust(ap->FunctorOfPred); + } else { + AtomAdjust((Atom)(ap->FunctorOfPred)); + } + CHECK(clean_pred(ap PASS_REGS)); + ap = ap->NextPredOfModule; + } + SaveHash(stream); + ap = Yap_ModulePred(mod); + while (ap) { + CHECK(save_pred(stream, ap)); + ap = ap->NextPredOfModule; + } + return 1; +} + +static Int +p_save_module_preds( USES_REGS1 ) +{ + IOSTREAM *stream; + Term tmod = Deref(ARG2); + + if (!Yap_getOutputStream(Yap_InitSlot(Deref(ARG1) PASS_REGS), &stream)) { + return FALSE; + } + if (IsVarTerm(tmod)) { + Yap_Error(INSTANTIATION_ERROR,tmod,"save_module/2"); + return FALSE; + } + if (!IsAtomTerm(tmod)) { + Yap_Error(TYPE_ERROR_ATOM,tmod,"save_module/2"); + return FALSE; + } + return save_module(stream, tmod) != 0; +} + +#endif + +void Yap_InitQLY(void) +{ +#if DEBUG + Yap_InitCPred("$save_module_preds", 2, p_save_module_preds, SyncPredFlag|HiddenPredFlag|UserCPredFlag); +#endif +} + diff --git a/C/scanner.c b/C/scanner.c index b093e8131..1bb8c89d4 100644 --- a/C/scanner.c +++ b/C/scanner.c @@ -1260,13 +1260,32 @@ Yap_tokenizer(IOSTREAM *inp_stream, int store_comments, Term *tposp) while ((ch = getchr(inp_stream)) != 10 && chtype(ch) != EF); t->Tok = Ord(kind = eot_tok); } else { + Atom ae; TokImage = ((AtomEntry *) ( Yap_PreAllocCodeSpace()))->StrOfAE; charp = TokImage; - *charp++ = och; - for (; chtype(ch) == SY; ch = getchr(inp_stream)) - *charp++ = ch; - *charp = '\0'; - t->TokInfo = Unsigned(Yap_LookupAtom(TokImage)); + wcharp = NULL; + add_ch_to_buff(och); + for (; chtype(ch) == SY; ch = getchr(inp_stream)) { + if (charp == (char *)AuxSp-1024) { + goto huge_var_error; + } + add_ch_to_buff(ch); + } + add_ch_to_buff('\0'); + if (wcharp) { + ae = Yap_LookupWideAtom((wchar_t *)TokImage); + } else { + ae = Yap_LookupAtom(TokImage); + } + if (ae == NIL) { + LOCAL_Error_TYPE = OUT_OF_HEAP_ERROR; + LOCAL_ErrorMessage = "Code Space Overflow"; + if (p) + t->Tok = Ord(kind = eot_tok); + /* serious error now */ + return l; + } + t->TokInfo = Unsigned(ae); if (t->TokInfo == (CELL)NIL) { LOCAL_Error_TYPE = OUT_OF_HEAP_ERROR; LOCAL_ErrorMessage = "Code Space Overflow"; diff --git a/C/stdpreds.c b/C/stdpreds.c index 853a8e7e9..4c249587c 100644 --- a/C/stdpreds.c +++ b/C/stdpreds.c @@ -4481,6 +4481,7 @@ Yap_InitCPreds(void) Yap_InitSavePreds(); Yap_InitSysPreds(); Yap_InitUnify(); + Yap_InitQLY(); #if defined CUT_C && defined MYDDAS_MYSQL Yap_InitMYDDAS_MySQLPreds(); #endif diff --git a/C/threads.c b/C/threads.c index 2e4a69658..d9e2701e7 100644 --- a/C/threads.c +++ b/C/threads.c @@ -191,6 +191,9 @@ setup_engine(int myworker_id, int init_thread) GLOBAL_NOfThreadsCreated++; DEBUG_TLOCK_ACCESS(2, myworker_id); pthread_mutex_unlock(&(REMOTE_ThreadHandle(myworker_id).tlock)); +#ifdef TABLING + DepFr_cons_cp(LOCAL_top_dep_fr) = B; /* same as in Yap_init_root_frames() */ +#endif /* TABLING */ } static void diff --git a/C/userpreds.c b/C/userpreds.c index dc29f4ee8..325693a55 100644 --- a/C/userpreds.c +++ b/C/userpreds.c @@ -686,9 +686,8 @@ p_softfunctor() WRITE_LOCK(RepAtom(a)->ARWLock); if ((p0 = Yap_GetAProp(a, SFProperty)) == NIL) { pe = (SFEntry *) Yap_AllocAtomSpace(sizeof(*pe)); - pe->NextOfPE = RepAtom(a)->PropsOfAE; pe->KindOfPE = SFProperty; - RepAtom(a)->PropsOfAE = AbsSFProp(pe); + AddPropToAtom(RepAtom(a), (PropEntry *)pe); } else pe = RepSFProp(p0); WRITE_UNLOCK(RepAtom(a)->ARWLock); diff --git a/H/Yap.h b/H/Yap.h index c812cd044..11d19ed25 100644 --- a/H/Yap.h +++ b/H/Yap.h @@ -1186,44 +1186,6 @@ typedef enum } yap_exec_mode; -/************************************************************************************************* - slots -*************************************************************************************************/ - - -static inline void -Yap_StartSlots( USES_REGS1 ) { - *--ASP = MkIntegerTerm(CurSlot); - *--ASP = MkIntTerm(0); - CurSlot = LCL0-ASP; -} - -static inline void -Yap_CloseSlots( USES_REGS1 ) { - Int old_slots; - old_slots = IntOfTerm(ASP[0]); - ASP += (old_slots+1); - CurSlot = IntOfTerm(*ASP); - ASP++; -} - -static inline Int -Yap_CurrentSlot( USES_REGS1 ) { - return IntOfTerm(ASP[0]); -} - -/* pop slots when pruning */ -static inline void -Yap_PopSlots( USES_REGS1 ) { - while (LCL0-CurSlot < ASP) { - Int old_slots; - CELL *ptr = LCL0-CurSlot; - old_slots = IntOfTerm(ptr[0]); - ptr += (old_slots+1); - CurSlot = IntOfTerm(*ptr); - } -} - /************************/ #ifdef THREADS typedef struct thandle { @@ -1400,4 +1362,68 @@ TailOfTermCell (Term t) return (Term) ((CELL) (RepPair (t) + 1)); } +/************************************************************************************************* + slots +*************************************************************************************************/ + + +static inline void +Yap_StartSlots( USES_REGS1 ) { + *--ASP = MkIntegerTerm(CurSlot); + *--ASP = MkIntTerm(0); + CurSlot = LCL0-ASP; +} + +static inline void +Yap_CloseSlots( USES_REGS1 ) { + Int old_slots; + old_slots = IntOfTerm(ASP[0]); + ASP += (old_slots+1); + CurSlot = IntOfTerm(*ASP); + ASP++; +} + +static inline Int +Yap_CurrentSlot( USES_REGS1 ) { + return IntOfTerm(ASP[0]); +} + +/* pop slots when pruning */ +static inline void +Yap_PopSlots( USES_REGS1 ) { + while (LCL0-CurSlot < ASP) { + Int old_slots; + CELL *ptr = LCL0-CurSlot; + old_slots = IntOfTerm(ptr[0]); + ptr += (old_slots+1); + CurSlot = IntOfTerm(*ptr); + } +} + +static inline Term +Yap_GetFromSlot(Int slot USES_REGS) +{ + return(Deref(LCL0[slot])); +} + +static inline Term +Yap_GetPtrFromSlot(Int slot USES_REGS) +{ + return(LCL0[slot]); +} + +static inline Term * +Yap_AddressFromSlot(Int slot USES_REGS) +{ + return(LCL0+slot); +} + +static inline void +Yap_PutInSlot(Int slot, Term t USES_REGS) +{ + LCL0[slot] = t; +} + + #endif /* YAP_H */ + diff --git a/H/YapHeap.h b/H/YapHeap.h index 4d98d077d..b8a715838 100644 --- a/H/YapHeap.h +++ b/H/YapHeap.h @@ -34,11 +34,17 @@ typedef int (*SWI_PLGetStreamPositionFunction)(void *); #include "../include/dswiatoms.h" typedef int (*Opaque_CallOnFail)(void *); +typedef int (*Opaque_CallOnWrite)(void *, int, void *, int); typedef struct opaque_handler_struct { Opaque_CallOnFail fail_handler; + Opaque_CallOnWrite write_handler; } opaque_handler_t; +extern Opaque_CallOnWrite Yap_blob_write_handler_from_slot(Int slot); +extern Int Yap_blob_tag_from_slot(Int slot); +extern void *Yap_blob_info_from_slot(Int slot); + #ifndef INT_KEYS_DEFAULT_SIZE #define INT_KEYS_DEFAULT_SIZE 256 #endif diff --git a/H/YapOpcodes.h b/H/YapOpcodes.h index 2515b3bba..0710fd7cf 100644 --- a/H/YapOpcodes.h +++ b/H/YapOpcodes.h @@ -24,7 +24,7 @@ OPCODE(alloc_for_logical_pred ,L), OPCODE(copy_idb_term ,e), OPCODE(unify_idb_term ,e), - OPCODE(ensure_space ,Osbpi), + OPCODE(ensure_space ,Osbpa), OPCODE(spy_or_trymark ,Otapl), OPCODE(try_and_mark ,Otapl), OPCODE(count_retry_and_mark ,Otapl), diff --git a/H/Yapproto.h b/H/Yapproto.h index 0676c4bc4..49fe4695f 100644 --- a/H/Yapproto.h +++ b/H/Yapproto.h @@ -61,11 +61,7 @@ int STD_PROTO(Yap_AtomDecreaseHold,(Atom)); Int STD_PROTO(Yap_InitSlot,(Term CACHE_TYPE)); Int STD_PROTO(Yap_NewSlots,(int CACHE_TYPE)); -Term STD_PROTO(Yap_GetFromSlot,(Int CACHE_TYPE)); int STD_PROTO(Yap_RecoverSlots,(int CACHE_TYPE)); -Term STD_PROTO(Yap_GetPtrFromSlot,(Int CACHE_TYPE)); -Term *STD_PROTO(Yap_AddressFromSlot,(Int CACHE_TYPE)); -void STD_PROTO(Yap_PutInSlot,(Int, Term CACHE_TYPE)); #ifdef SFUNC @@ -311,6 +307,9 @@ Term STD_PROTO(Yap_Parse,(void)); /* readutil.c */ void STD_PROTO(Yap_InitReadUtil,(void)); +/* qly.c */ +void STD_PROTO(Yap_InitQLY,(void)); + /* save.c */ int STD_PROTO(Yap_SavedInfo,(char *,char *,CELL *,CELL *,CELL *)); int STD_PROTO(Yap_Restore,(char *, char *)); @@ -491,3 +490,9 @@ gc_P(yamop *p, yamop *cp) { return (p->opc == Yap_opcode(_execute_cpred) ? cp : p); } + +#ifdef _PL_STREAM_H +extern int Yap_getInputStream(Int t, IOSTREAM **s); +extern int Yap_getOutputStream(Int t, IOSTREAM **s); +#endif + diff --git a/H/Yatom.h b/H/Yatom.h index 4add68733..b4f583566 100644 --- a/H/Yatom.h +++ b/H/Yatom.h @@ -674,7 +674,7 @@ typedef enum TabledPredFlag = 0x00000040L, /* is tabled */ SequentialPredFlag = 0x00000020L, /* may not create parallel choice points! */ ProfiledPredFlag = 0x00000010L, /* pred is being profiled */ - MyddasPredFlag = 0x00000008L, /* Myddas Imported pred */ + /* MyddasPredFlag = 0x00000008L, Myddas Imported pred */ ModuleTransparentPredFlag = 0x00000004L, /* ModuleTransparent pred */ SWIEnvPredFlag = 0x00000002L, /* new SWI interface */ UDIPredFlag = 0x00000001L /* User Defined Indexing */ @@ -708,7 +708,7 @@ typedef struct pred_entry struct yami *CodeOfPred; OPCODE OpcodeOfPred; /* undefcode, indexcode, spycode, .... */ CELL PredFlags; - unsigned int ArityOfPE; /* arity of property */ + UInt ArityOfPE; /* arity of property */ union { struct @@ -1606,5 +1606,22 @@ PredPropByAtom (Atom at, Term cur_mod) #define UNLOCKPE(I,Z) UNLOCK((Z)->PELock) #endif +EXTERN inline void STD_PROTO(AddPropToAtom, (AtomEntry *, PropEntry *p)); + +EXTERN inline void +AddPropToAtom(AtomEntry *ae, PropEntry *p) +{ + /* old properties should be always last, and wide atom properties + should always be first */ + if (ae->PropsOfAE != NIL && + RepProp(ae->PropsOfAE)->KindOfPE == WideAtomProperty) { + PropEntry *pp = RepProp(ae->PropsOfAE); + p->NextOfPE = pp->NextOfPE; + pp->NextOfPE = AbsProp(p); + } else { + p->NextOfPE = ae->PropsOfAE; + ae->PropsOfAE = AbsProp(p); + } +} #endif diff --git a/H/amidefs.h b/H/amidefs.h index 6a99d1621..cf424bc22 100644 --- a/H/amidefs.h +++ b/H/amidefs.h @@ -693,7 +693,7 @@ typedef struct yami { struct pred_entry *p; Int i; CELL next; - } Osbpi; + } Osbpa; struct { #ifdef YAPOR unsigned int or_arg; diff --git a/H/dlocals.h b/H/dlocals.h index 1b3091937..7f816ee1d 100644 --- a/H/dlocals.h +++ b/H/dlocals.h @@ -329,3 +329,16 @@ #define REMOTE_do_trace_primitives(wid) REMOTE(wid)->do_trace_primitives_ #endif +#define LOCAL_ExportAtomHashChain LOCAL->ExportAtomHashChain_ +#define REMOTE_ExportAtomHashChain(wid) REMOTE(wid)->ExportAtomHashChain_ +#define LOCAL_ExportAtomHashTableSize LOCAL->ExportAtomHashTableSize_ +#define REMOTE_ExportAtomHashTableSize(wid) REMOTE(wid)->ExportAtomHashTableSize_ +#define LOCAL_ExportAtomHashTableNum LOCAL->ExportAtomHashTableNum_ +#define REMOTE_ExportAtomHashTableNum(wid) REMOTE(wid)->ExportAtomHashTableNum_ +#define LOCAL_ExportFunctorHashChain LOCAL->ExportFunctorHashChain_ +#define REMOTE_ExportFunctorHashChain(wid) REMOTE(wid)->ExportFunctorHashChain_ +#define LOCAL_ExportFunctorHashTableSize LOCAL->ExportFunctorHashTableSize_ +#define REMOTE_ExportFunctorHashTableSize(wid) REMOTE(wid)->ExportFunctorHashTableSize_ +#define LOCAL_ExportFunctorHashTableNum LOCAL->ExportFunctorHashTableNum_ +#define REMOTE_ExportFunctorHashTableNum(wid) REMOTE(wid)->ExportFunctorHashTableNum_ + diff --git a/H/findclause.h b/H/findclause.h index bcc965c75..4a5c4199a 100644 --- a/H/findclause.h +++ b/H/findclause.h @@ -16,7 +16,7 @@ cl = NEXTOP(cl,N); break; case _ensure_space: - cl = NEXTOP(cl,Osbpi); + cl = NEXTOP(cl,Osbpa); break; case _native_me: cl = NEXTOP(cl,aFlp); diff --git a/H/hlocals.h b/H/hlocals.h index 956702b9b..dad310f4d 100644 --- a/H/hlocals.h +++ b/H/hlocals.h @@ -182,10 +182,17 @@ typedef struct worker_local { Int total_atom_table_overflow_time_; #ifdef LOAD_DYLD - static dl_errno_; + int dl_errno_; #endif #ifdef LOW_LEVEL_TRACER int do_trace_primitives_; #endif + + struct export_atom_hash_entry_struct **ExportAtomHashChain_; + UInt ExportAtomHashTableSize_; + UInt ExportAtomHashTableNum_; + struct export_functor_hash_entry_struct **ExportFunctorHashChain_; + UInt ExportFunctorHashTableSize_; + UInt ExportFunctorHashTableNum_; } w_local; diff --git a/H/ilocals.h b/H/ilocals.h index ea7377dd3..52259ec90 100644 --- a/H/ilocals.h +++ b/H/ilocals.h @@ -188,4 +188,11 @@ static void InitWorker(int wid) { #ifdef LOW_LEVEL_TRACER REMOTE_do_trace_primitives(wid) = TRUE; #endif + + REMOTE_ExportAtomHashChain(wid) = NULL; + REMOTE_ExportAtomHashTableSize(wid) = 0; + REMOTE_ExportAtomHashTableNum(wid) = 0; + REMOTE_ExportFunctorHashChain(wid) = NULL; + REMOTE_ExportFunctorHashTableSize(wid) = 0; + REMOTE_ExportFunctorHashTableNum(wid) = 0; } diff --git a/H/rclause.h b/H/rclause.h index a701f1dc4..9541aa78b 100644 --- a/H/rclause.h +++ b/H/rclause.h @@ -60,14 +60,14 @@ restore_opcodes(yamop *pc, yamop *max USES_REGS) pc->u.Osbmp.p0 = PtoPredAdjust(pc->u.Osbmp.p0); pc = NEXTOP(pc,Osbmp); break; - /* instructions type Osbpi */ + /* instructions type Osbpa */ case _ensure_space: - OrArgAdjust(pc->u.Osbpi.or_arg); - pc->u.Osbpi.s = ConstantAdjust(pc->u.Osbpi.s); - pc->u.Osbpi.bmap = CellPtoHeapAdjust(pc->u.Osbpi.bmap); - pc->u.Osbpi.p = PtoPredAdjust(pc->u.Osbpi.p); - IntegerInCodeAdjust(pc->u.Osbpi.i); - pc = NEXTOP(pc,Osbpi); + OrArgAdjust(pc->u.Osbpa.or_arg); + pc->u.Osbpa.s = ConstantAdjust(pc->u.Osbpa.s); + pc->u.Osbpa.bmap = CellPtoHeapAdjust(pc->u.Osbpa.bmap); + pc->u.Osbpa.p = PtoPredAdjust(pc->u.Osbpa.p); + pc->u.Osbpa.i = ArityAdjust(pc->u.Osbpa.i); + pc = NEXTOP(pc,Osbpa); break; /* instructions type Osbpp */ case _call: diff --git a/H/rlocals.h b/H/rlocals.h index 5d3c24b01..dc37cb10a 100644 --- a/H/rlocals.h +++ b/H/rlocals.h @@ -188,4 +188,11 @@ static void RestoreWorker(int wid USES_REGS) { #ifdef LOW_LEVEL_TRACER #endif + + + + + + + } diff --git a/H/saveclause.h b/H/saveclause.h new file mode 100644 index 000000000..4a49f7126 --- /dev/null +++ b/H/saveclause.h @@ -0,0 +1,938 @@ + + /* This file was generated automatically by "yap -L misc/buildops" + please do not update */ + + + while (TRUE) { + op_numbers op; + if (max && pc >= max) return 1; + op = Yap_op_from_opcode(pc->opc); + save_Opcode(stream, op); + + /* C-code, maybe indexing */ + switch (op) { + /* instructions type D */ + case _write_dbterm: + CHECK(save_DBGroundTerm(stream, pc->u.D.D)); + pc = NEXTOP(pc,D); + break; + /* instructions type Illss */ + case _enter_lu_pred: + CHECK(save_PtoLUIndex(stream, pc->u.Illss.I)); + CHECK(save_PtoOp(stream, pc->u.Illss.l1)); + CHECK(save_PtoOp(stream, pc->u.Illss.l2)); + CHECK(save_Constant(stream, pc->u.Illss.s)); + CHECK(save_Constant(stream, pc->u.Illss.e)); + pc = NEXTOP(pc,Illss); + break; + /* instructions type L */ + case _alloc_for_logical_pred: + CHECK(save_PtoLUClause(stream, pc->u.L.ClBase)); + pc = NEXTOP(pc,L); + break; + /* instructions type N */ + case _write_bigint: + CHECK(save_BlobTermInCode(stream, pc->u.N.b)); + pc = NEXTOP(pc,N); + break; + /* instructions type Osblp */ + case _either: + case _or_else: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->u.Osblp.or_arg)); +#endif + CHECK(save_Constant(stream, pc->u.Osblp.s)); + CHECK(save_CellPtoHeap(stream, pc->u.Osblp.bmap)); + CHECK(save_PtoOp(stream, pc->u.Osblp.l)); + CHECK(save_PtoPred(stream, pc->u.Osblp.p0)); + pc = NEXTOP(pc,Osblp); + break; + /* instructions type Osbmp */ + case _p_execute: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->u.Osbmp.or_arg)); +#endif + CHECK(save_Constant(stream, pc->u.Osbmp.s)); + CHECK(save_CellPtoHeap(stream, pc->u.Osbmp.bmap)); + CHECK(save_Module(stream, pc->u.Osbmp.mod)); + CHECK(save_PtoPred(stream, pc->u.Osbmp.p0)); + pc = NEXTOP(pc,Osbmp); + break; + /* instructions type Osbpa */ + case _ensure_space: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->u.Osbpa.or_arg)); +#endif + CHECK(save_Constant(stream, pc->u.Osbpa.s)); + CHECK(save_CellPtoHeap(stream, pc->u.Osbpa.bmap)); + CHECK(save_PtoPred(stream, pc->u.Osbpa.p)); + CHECK(save_Arity(stream, pc->u.Osbpa.i)); + pc = NEXTOP(pc,Osbpa); + break; + /* instructions type Osbpp */ + case _call: + case _call_cpred: + case _call_usercpred: + case _fcall: + case _p_execute2: + case _p_execute_tail: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->u.Osbpp.or_arg)); +#endif + CHECK(save_Constant(stream, pc->u.Osbpp.s)); + CHECK(save_CellPtoHeap(stream, pc->u.Osbpp.bmap)); + CHECK(save_PtoPred(stream, pc->u.Osbpp.p)); + CHECK(save_PtoPred(stream, pc->u.Osbpp.p0)); + pc = NEXTOP(pc,Osbpp); + break; + /* instructions type OtILl */ + case _count_trust_logical: + case _profiled_trust_logical: + case _trust_logical: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->u.OtILl.or_arg)); +#endif +#ifdef TABLING + CHECK(save_TabEntry(stream, pc->u.OtILl.te)); +#endif + CHECK(save_PtoLUIndex(stream, pc->u.OtILl.block)); + CHECK(save_PtoLUClause(stream, pc->u.OtILl.d)); + CHECK(save_PtoOp(stream, pc->u.OtILl.n)); + pc = NEXTOP(pc,OtILl); + break; + /* instructions type OtaLl */ + case _count_retry_logical: + case _profiled_retry_logical: + case _retry_logical: + case _try_logical: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->u.OtaLl.or_arg)); +#endif +#ifdef TABLING + CHECK(save_TabEntry(stream, pc->u.OtaLl.te)); +#endif + CHECK(save_Arity(stream, pc->u.OtaLl.s)); + CHECK(save_PtoLUClause(stream, pc->u.OtaLl.d)); + CHECK(save_PtoOp(stream, pc->u.OtaLl.n)); + pc = NEXTOP(pc,OtaLl); + break; + /* instructions type OtapFs */ +#ifdef CUT_C + case _cut_c: +#endif +#ifdef CUT_C + case _cut_userc: +#endif + case _retry_c: + case _retry_userc: + case _try_c: + case _try_userc: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->u.OtapFs.or_arg)); +#endif +#ifdef TABLING + CHECK(save_TabEntry(stream, pc->u.OtapFs.te)); +#endif + CHECK(save_Arity(stream, pc->u.OtapFs.s)); + CHECK(save_PtoPred(stream, pc->u.OtapFs.p)); + CHECK(save_ExternalFunction(stream, pc->u.OtapFs.f)); + CHECK(save_Constant(stream, pc->u.OtapFs.extra)); + pc = NEXTOP(pc,OtapFs); + break; + /* instructions type Otapl */ + case _count_retry_and_mark: + case _count_retry_me: + case _count_trust_me: + case _profiled_retry_and_mark: + case _profiled_retry_me: + case _profiled_trust_me: + case _retry: + case _retry_and_mark: + case _retry_me: + case _spy_or_trymark: + case _trust: + case _trust_me: + case _try_and_mark: + case _try_clause: + case _try_me: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->u.Otapl.or_arg)); +#endif +#ifdef TABLING + CHECK(save_TabEntry(stream, pc->u.Otapl.te)); +#endif + CHECK(save_Arity(stream, pc->u.Otapl.s)); + CHECK(save_PtoPred(stream, pc->u.Otapl.p)); + CHECK(save_PtoOp(stream, pc->u.Otapl.d)); + pc = NEXTOP(pc,Otapl); + break; + /* instructions type aFlp */ + case _native_me: + CHECK(save_Arity(stream, pc->u.aFlp.n)); + CHECK(save_ExternalFunction(stream, pc->u.aFlp.native)); + CHECK(save_PtoOp(stream, pc->u.aFlp.native_next)); + CHECK(save_PtoPred(stream, pc->u.aFlp.p)); + pc = NEXTOP(pc,aFlp); + break; + /* instructions type c */ + case _write_atom: + CHECK(save_ConstantTerm(stream, pc->u.c.c)); + pc = NEXTOP(pc,c); + break; + /* instructions type cc */ + case _get_2atoms: + CHECK(save_ConstantTerm(stream, pc->u.cc.c1)); + CHECK(save_ConstantTerm(stream, pc->u.cc.c2)); + pc = NEXTOP(pc,cc); + break; + /* instructions type ccc */ + case _get_3atoms: + CHECK(save_ConstantTerm(stream, pc->u.ccc.c1)); + CHECK(save_ConstantTerm(stream, pc->u.ccc.c2)); + CHECK(save_ConstantTerm(stream, pc->u.ccc.c3)); + pc = NEXTOP(pc,ccc); + break; + /* instructions type cccc */ + case _get_4atoms: + CHECK(save_ConstantTerm(stream, pc->u.cccc.c1)); + CHECK(save_ConstantTerm(stream, pc->u.cccc.c2)); + CHECK(save_ConstantTerm(stream, pc->u.cccc.c3)); + CHECK(save_ConstantTerm(stream, pc->u.cccc.c4)); + pc = NEXTOP(pc,cccc); + break; + /* instructions type ccccc */ + case _get_5atoms: + CHECK(save_ConstantTerm(stream, pc->u.ccccc.c1)); + CHECK(save_ConstantTerm(stream, pc->u.ccccc.c2)); + CHECK(save_ConstantTerm(stream, pc->u.ccccc.c3)); + CHECK(save_ConstantTerm(stream, pc->u.ccccc.c4)); + CHECK(save_ConstantTerm(stream, pc->u.ccccc.c5)); + pc = NEXTOP(pc,ccccc); + break; + /* instructions type cccccc */ + case _get_6atoms: + CHECK(save_ConstantTerm(stream, pc->u.cccccc.c1)); + CHECK(save_ConstantTerm(stream, pc->u.cccccc.c2)); + CHECK(save_ConstantTerm(stream, pc->u.cccccc.c3)); + CHECK(save_ConstantTerm(stream, pc->u.cccccc.c4)); + CHECK(save_ConstantTerm(stream, pc->u.cccccc.c5)); + CHECK(save_ConstantTerm(stream, pc->u.cccccc.c6)); + pc = NEXTOP(pc,cccccc); + break; + /* instructions type clll */ + case _if_not_then: + CHECK(save_ConstantTerm(stream, pc->u.clll.c)); + CHECK(save_PtoOp(stream, pc->u.clll.l1)); + CHECK(save_PtoOp(stream, pc->u.clll.l2)); + CHECK(save_PtoOp(stream, pc->u.clll.l3)); + pc = NEXTOP(pc,clll); + break; + /* instructions type d */ + case _write_float: + CHECK(save_DoubleInCode(stream, pc->u.d.d)); + pc = NEXTOP(pc,d); + break; + /* instructions type e */ + case _Nstop: + case _allocate: + case _copy_idb_term: + case _expand_index: + case _index_blob: + case _index_dbref: + case _index_long: + case _index_pred: + case _lock_pred: + case _op_fail: + case _p_equal: + case _p_functor: + case _pop: +#ifdef BEAM + case _retry_eam: +#endif + case _spy_pred: +#ifdef THREADS + case _thread_local: +#endif + case _trust_fail: + case _undef_p: + case _unify_idb_term: + case _unlock_lu: + case _write_l_list: + case _write_list: + case _write_void: + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return 1; + pc = NEXTOP(pc,e); + break; + /* instructions type fa */ + case _write_l_struc: + case _write_struct: + CHECK(save_Func(stream, pc->u.fa.f)); + CHECK(save_Arity(stream, pc->u.fa.a)); + pc = NEXTOP(pc,fa); + break; + /* instructions type i */ + case _write_longint: + CHECK(save_IntegerInCode(stream, pc->u.i.i)); + pc = NEXTOP(pc,i); + break; + /* instructions type l */ + case _Ystop: + case _jump: + case _jump_if_var: + case _move_back: + case _p_dif: + case _p_eq: + case _retry2: + case _retry3: + case _retry4: + case _skip: + case _try_clause2: + case _try_clause3: + case _try_clause4: + case _try_in: + CHECK(save_PtoOp(stream, pc->u.l.l)); + pc = NEXTOP(pc,l); + break; + /* instructions type llll */ + case _switch_on_type: + CHECK(save_PtoOp(stream, pc->u.llll.l1)); + CHECK(save_PtoOp(stream, pc->u.llll.l2)); + CHECK(save_PtoOp(stream, pc->u.llll.l3)); + CHECK(save_PtoOp(stream, pc->u.llll.l4)); + pc = NEXTOP(pc,llll); + break; + /* instructions type lp */ + case _user_switch: + CHECK(save_PtoOp(stream, pc->u.lp.l)); + CHECK(save_PtoPred(stream, pc->u.lp.p)); + pc = NEXTOP(pc,lp); + break; + /* instructions type o */ + case _unify_l_list: + case _unify_l_list_write: + case _unify_l_void: + case _unify_l_void_write: + case _unify_list: + case _unify_list_write: + case _unify_void: + case _unify_void_write: + CHECK(save_Opcode(stream, pc->u.o.opcw)); + pc = NEXTOP(pc,o); + break; + /* instructions type oD */ + case _unify_dbterm: + case _unify_l_dbterm: + CHECK(save_Opcode(stream, pc->u.oD.opcw)); + CHECK(save_DBGroundTerm(stream, pc->u.oD.D)); + pc = NEXTOP(pc,oD); + break; + /* instructions type oN */ + case _unify_bigint: + case _unify_l_bigint: + CHECK(save_Opcode(stream, pc->u.oN.opcw)); + CHECK(save_BlobTermInCode(stream, pc->u.oN.b)); + pc = NEXTOP(pc,oN); + break; + /* instructions type oc */ + case _unify_atom: + case _unify_atom_write: + case _unify_l_atom: + case _unify_l_atom_write: + CHECK(save_Opcode(stream, pc->u.oc.opcw)); + CHECK(save_ConstantTerm(stream, pc->u.oc.c)); + pc = NEXTOP(pc,oc); + break; + /* instructions type od */ + case _unify_float: + case _unify_float_write: + case _unify_l_float: + case _unify_l_float_write: + CHECK(save_Opcode(stream, pc->u.od.opcw)); + CHECK(save_DoubleInCode(stream, pc->u.od.d)); + pc = NEXTOP(pc,od); + break; + /* instructions type ofa */ + case _unify_l_struc: + case _unify_l_struc_write: + case _unify_struct: + case _unify_struct_write: + CHECK(save_Opcode(stream, pc->u.ofa.opcw)); + CHECK(save_Func(stream, pc->u.ofa.f)); + CHECK(save_Arity(stream, pc->u.ofa.a)); + pc = NEXTOP(pc,ofa); + break; + /* instructions type oi */ + case _unify_l_longint: + case _unify_l_longint_write: + case _unify_longint: + case _unify_longint_write: + CHECK(save_Opcode(stream, pc->u.oi.opcw)); + CHECK(save_IntegerInCode(stream, pc->u.oi.i)); + pc = NEXTOP(pc,oi); + break; + /* instructions type ollll */ + case _switch_list_nl: + CHECK(save_Opcode(stream, pc->u.ollll.pop)); + CHECK(save_PtoOp(stream, pc->u.ollll.l1)); + CHECK(save_PtoOp(stream, pc->u.ollll.l2)); + CHECK(save_PtoOp(stream, pc->u.ollll.l3)); + CHECK(save_PtoOp(stream, pc->u.ollll.l4)); + pc = NEXTOP(pc,ollll); + break; + /* instructions type os */ +#ifdef BEAM + case _run_eam: +#endif + case _unify_l_n_voids: + case _unify_l_n_voids_write: + case _unify_n_voids: + case _unify_n_voids_write: + CHECK(save_Opcode(stream, pc->u.os.opcw)); + CHECK(save_Constant(stream, pc->u.os.s)); + pc = NEXTOP(pc,os); + break; + /* instructions type osc */ + case _unify_n_atoms: + case _unify_n_atoms_write: + CHECK(save_Opcode(stream, pc->u.osc.opcw)); + CHECK(save_Constant(stream, pc->u.osc.s)); + CHECK(save_ConstantTerm(stream, pc->u.osc.c)); + pc = NEXTOP(pc,osc); + break; + /* instructions type ox */ + case _save_appl_x: + case _save_appl_x_write: + case _save_pair_x: + case _save_pair_x_write: + case _unify_l_x_loc: + case _unify_l_x_loc_write: + case _unify_l_x_val: + case _unify_l_x_val_write: + case _unify_l_x_var: + case _unify_l_x_var_write: + case _unify_x_loc: + case _unify_x_loc_write: + case _unify_x_val: + case _unify_x_val_write: + case _unify_x_var: + case _unify_x_var_write: + CHECK(save_Opcode(stream, pc->u.ox.opcw)); + CHECK(save_X(stream, pc->u.ox.x)); + pc = NEXTOP(pc,ox); + break; + /* instructions type oxx */ + case _unify_l_x_var2: + case _unify_l_x_var2_write: + case _unify_x_var2: + case _unify_x_var2_write: + CHECK(save_Opcode(stream, pc->u.oxx.opcw)); + CHECK(save_X(stream, pc->u.oxx.xl)); + CHECK(save_X(stream, pc->u.oxx.xr)); + pc = NEXTOP(pc,oxx); + break; + /* instructions type oy */ + case _save_appl_y: + case _save_appl_y_write: + case _save_pair_y: + case _save_pair_y_write: + case _unify_l_y_loc: + case _unify_l_y_loc_write: + case _unify_l_y_val: + case _unify_l_y_val_write: + case _unify_l_y_var: + case _unify_l_y_var_write: + case _unify_y_loc: + case _unify_y_loc_write: + case _unify_y_val: + case _unify_y_val_write: + case _unify_y_var: + case _unify_y_var_write: + CHECK(save_Opcode(stream, pc->u.oy.opcw)); + CHECK(save_Y(stream, pc->u.oy.y)); + pc = NEXTOP(pc,oy); + break; + /* instructions type p */ + case _count_call: + case _count_retry: + case _deallocate: + case _enter_profiling: + case _lock_lu: + case _procceed: + case _retry_profiled: + CHECK(save_PtoPred(stream, pc->u.p.p)); + pc = NEXTOP(pc,p); + break; + /* instructions type plxxs */ + case _call_bfunc_xx: + CHECK(save_PtoPred(stream, pc->u.plxxs.p)); + CHECK(save_PtoOp(stream, pc->u.plxxs.f)); + CHECK(save_X(stream, pc->u.plxxs.x1)); + CHECK(save_X(stream, pc->u.plxxs.x2)); + CHECK(save_Constant(stream, pc->u.plxxs.flags)); + pc = NEXTOP(pc,plxxs); + break; + /* instructions type plxys */ + case _call_bfunc_xy: + case _call_bfunc_yx: + CHECK(save_PtoPred(stream, pc->u.plxys.p)); + CHECK(save_PtoOp(stream, pc->u.plxys.f)); + CHECK(save_X(stream, pc->u.plxys.x)); + CHECK(save_Y(stream, pc->u.plxys.y)); + CHECK(save_Constant(stream, pc->u.plxys.flags)); + pc = NEXTOP(pc,plxys); + break; + /* instructions type plyys */ + case _call_bfunc_yy: + CHECK(save_PtoPred(stream, pc->u.plyys.p)); + CHECK(save_PtoOp(stream, pc->u.plyys.f)); + CHECK(save_Y(stream, pc->u.plyys.y1)); + CHECK(save_Y(stream, pc->u.plyys.y2)); + CHECK(save_Constant(stream, pc->u.plyys.flags)); + pc = NEXTOP(pc,plyys); + break; + /* instructions type pp */ + case _dexecute: + case _execute: + case _execute_cpred: + CHECK(save_PtoPred(stream, pc->u.pp.p)); + CHECK(save_PtoPred(stream, pc->u.pp.p0)); + pc = NEXTOP(pc,pp); + break; + /* instructions type s */ + case _cut: + case _cut_e: + case _cut_t: + case _pop_n: + case _write_n_voids: + CHECK(save_Constant(stream, pc->u.s.s)); + pc = NEXTOP(pc,s); + break; + /* instructions type sc */ + case _write_n_atoms: + CHECK(save_Constant(stream, pc->u.sc.s)); + CHECK(save_ConstantTerm(stream, pc->u.sc.c)); + pc = NEXTOP(pc,sc); + break; + /* instructions type sllll */ + case _switch_on_sub_arg_type: + CHECK(save_Constant(stream, pc->u.sllll.s)); + CHECK(save_PtoOp(stream, pc->u.sllll.l1)); + CHECK(save_PtoOp(stream, pc->u.sllll.l2)); + CHECK(save_PtoOp(stream, pc->u.sllll.l3)); + CHECK(save_PtoOp(stream, pc->u.sllll.l4)); + pc = NEXTOP(pc,sllll); + break; + /* instructions type slp */ + case _call_c_wfail: + CHECK(save_Constant(stream, pc->u.slp.s)); + CHECK(save_PtoOp(stream, pc->u.slp.l)); + CHECK(save_PtoPred(stream, pc->u.slp.p)); + pc = NEXTOP(pc,slp); + break; + /* instructions type sssl */ + case _go_on_cons: + case _go_on_func: + case _if_cons: + case _if_func: + case _switch_on_cons: + case _switch_on_func: + CHECK(save_Constant(stream, pc->u.sssl.s)); + CHECK(save_Constant(stream, pc->u.sssl.e)); + CHECK(save_Constant(stream, pc->u.sssl.w)); + CHECK(save_PtoOp(stream, pc->u.sssl.l)); + pc = NEXTOP(pc,sssl); + break; + /* instructions type sssllp */ + case _expand_clauses: + CHECK(save_Constant(stream, pc->u.sssllp.s1)); + CHECK(save_Constant(stream, pc->u.sssllp.s2)); + CHECK(save_Constant(stream, pc->u.sssllp.s3)); + CHECK(save_PtoOp(stream, pc->u.sssllp.sprev)); + CHECK(save_PtoOp(stream, pc->u.sssllp.snext)); + CHECK(save_PtoPred(stream, pc->u.sssllp.p)); + pc = NEXTOP(pc,sssllp); + break; + /* instructions type x */ + case _get_list: + case _put_list: + case _save_b_x: + case _write_x_loc: + case _write_x_val: + case _write_x_var: + CHECK(save_X(stream, pc->u.x.x)); + pc = NEXTOP(pc,x); + break; + /* instructions type xD */ + case _get_dbterm: + case _put_dbterm: + CHECK(save_X(stream, pc->u.xD.x)); + CHECK(save_DBGroundTerm(stream, pc->u.xD.D)); + pc = NEXTOP(pc,xD); + break; + /* instructions type xN */ + case _get_bigint: + case _put_bigint: + CHECK(save_X(stream, pc->u.xN.x)); + CHECK(save_BlobTermInCode(stream, pc->u.xN.b)); + pc = NEXTOP(pc,xN); + break; + /* instructions type xc */ + case _get_atom: + case _put_atom: + CHECK(save_X(stream, pc->u.xc.x)); + CHECK(save_ConstantTerm(stream, pc->u.xc.c)); + pc = NEXTOP(pc,xc); + break; + /* instructions type xd */ + case _get_float: + case _put_float: + CHECK(save_X(stream, pc->u.xd.x)); + CHECK(save_DoubleInCode(stream, pc->u.xd.d)); + pc = NEXTOP(pc,xd); + break; + /* instructions type xfa */ + case _get_struct: + case _put_struct: + CHECK(save_X(stream, pc->u.xfa.x)); + CHECK(save_Func(stream, pc->u.xfa.f)); + CHECK(save_Arity(stream, pc->u.xfa.a)); + pc = NEXTOP(pc,xfa); + break; + /* instructions type xi */ + case _get_longint: + case _put_longint: + CHECK(save_X(stream, pc->u.xi.x)); + CHECK(save_IntegerInCode(stream, pc->u.xi.i)); + pc = NEXTOP(pc,xi); + break; + /* instructions type xl */ + case _p_atom_x: + case _p_atomic_x: + case _p_compound_x: + case _p_db_ref_x: + case _p_float_x: + case _p_integer_x: + case _p_nonvar_x: + case _p_number_x: + case _p_primitive_x: + case _p_var_x: + CHECK(save_X(stream, pc->u.xl.x)); + CHECK(save_PtoOp(stream, pc->u.xl.F)); + pc = NEXTOP(pc,xl); + break; + /* instructions type xll */ + case _jump_if_nonvar: + CHECK(save_X(stream, pc->u.xll.x)); + CHECK(save_PtoOp(stream, pc->u.xll.l1)); + CHECK(save_PtoOp(stream, pc->u.xll.l2)); + pc = NEXTOP(pc,xll); + break; + /* instructions type xllll */ + case _switch_on_arg_type: + CHECK(save_X(stream, pc->u.xllll.x)); + CHECK(save_PtoOp(stream, pc->u.xllll.l1)); + CHECK(save_PtoOp(stream, pc->u.xllll.l2)); + CHECK(save_PtoOp(stream, pc->u.xllll.l3)); + CHECK(save_PtoOp(stream, pc->u.xllll.l4)); + pc = NEXTOP(pc,xllll); + break; + /* instructions type xps */ + case _commit_b_x: + CHECK(save_X(stream, pc->u.xps.x)); + CHECK(save_PtoPred(stream, pc->u.xps.p0)); + CHECK(save_Constant(stream, pc->u.xps.s)); + pc = NEXTOP(pc,xps); + break; + /* instructions type xx */ + case _get_x_val: + case _get_x_var: + case _gl_void_valx: + case _gl_void_varx: + case _glist_valx: + case _put_x_val: + case _put_x_var: + CHECK(save_X(stream, pc->u.xx.xl)); + CHECK(save_X(stream, pc->u.xx.xr)); + pc = NEXTOP(pc,xx); + break; + /* instructions type xxc */ + case _p_func2s_cv: + CHECK(save_X(stream, pc->u.xxc.x)); + CHECK(save_X(stream, pc->u.xxc.xi)); + CHECK(save_ConstantTerm(stream, pc->u.xxc.c)); + pc = NEXTOP(pc,xxc); + break; + /* instructions type xxn */ + case _p_and_vc: + case _p_arg_cv: + case _p_div_cv: + case _p_div_vc: + case _p_func2s_vc: + case _p_minus_cv: + case _p_or_vc: + case _p_plus_vc: + case _p_sll_cv: + case _p_sll_vc: + case _p_slr_cv: + case _p_slr_vc: + case _p_times_vc: + CHECK(save_X(stream, pc->u.xxn.x)); + CHECK(save_X(stream, pc->u.xxn.xi)); + CHECK(save_Integer(stream, pc->u.xxn.c)); + pc = NEXTOP(pc,xxn); + break; + /* instructions type xxx */ + case _p_and_vv: + case _p_arg_vv: + case _p_div_vv: + case _p_func2f_xx: + case _p_func2s_vv: + case _p_minus_vv: + case _p_or_vv: + case _p_plus_vv: + case _p_sll_vv: + case _p_slr_vv: + case _p_times_vv: + CHECK(save_X(stream, pc->u.xxx.x)); + CHECK(save_X(stream, pc->u.xxx.x1)); + CHECK(save_X(stream, pc->u.xxx.x2)); + pc = NEXTOP(pc,xxx); + break; + /* instructions type xxxx */ + case _put_xx_val: + CHECK(save_X(stream, pc->u.xxxx.xl1)); + CHECK(save_X(stream, pc->u.xxxx.xl2)); + CHECK(save_X(stream, pc->u.xxxx.xr1)); + CHECK(save_X(stream, pc->u.xxxx.xr2)); + pc = NEXTOP(pc,xxxx); + break; + /* instructions type xxy */ + case _p_func2f_xy: + CHECK(save_X(stream, pc->u.xxy.x)); + CHECK(save_X(stream, pc->u.xxy.x1)); + CHECK(save_Y(stream, pc->u.xxy.y2)); + pc = NEXTOP(pc,xxy); + break; + /* instructions type y */ + case _save_b_y: + case _write_y_loc: + case _write_y_val: + case _write_y_var: + CHECK(save_Y(stream, pc->u.y.y)); + pc = NEXTOP(pc,y); + break; + /* instructions type yl */ + case _p_atom_y: + case _p_atomic_y: + case _p_compound_y: + case _p_db_ref_y: + case _p_float_y: + case _p_integer_y: + case _p_nonvar_y: + case _p_number_y: + case _p_primitive_y: + case _p_var_y: + CHECK(save_Y(stream, pc->u.yl.y)); + CHECK(save_PtoOp(stream, pc->u.yl.F)); + pc = NEXTOP(pc,yl); + break; + /* instructions type yps */ + case _commit_b_y: + CHECK(save_Y(stream, pc->u.yps.y)); + CHECK(save_PtoPred(stream, pc->u.yps.p0)); + CHECK(save_Constant(stream, pc->u.yps.s)); + pc = NEXTOP(pc,yps); + break; + /* instructions type yx */ + case _get_y_val: + case _get_y_var: + case _gl_void_valy: + case _gl_void_vary: + case _glist_valy: + case _put_unsafe: + case _put_y_val: + case _put_y_var: + CHECK(save_Y(stream, pc->u.yx.y)); + CHECK(save_X(stream, pc->u.yx.x)); + pc = NEXTOP(pc,yx); + break; + /* instructions type yxn */ + case _p_and_y_vc: + case _p_arg_y_cv: + case _p_div_y_cv: + case _p_div_y_vc: + case _p_func2s_y_cv: + case _p_func2s_y_vc: + case _p_minus_y_cv: + case _p_or_y_vc: + case _p_plus_y_vc: + case _p_sll_y_cv: + case _p_sll_y_vc: + case _p_slr_y_cv: + case _p_slr_y_vc: + case _p_times_y_vc: + CHECK(save_Y(stream, pc->u.yxn.y)); + CHECK(save_X(stream, pc->u.yxn.xi)); + CHECK(save_Integer(stream, pc->u.yxn.c)); + pc = NEXTOP(pc,yxn); + break; + /* instructions type yxx */ + case _p_and_y_vv: + case _p_arg_y_vv: + case _p_div_y_vv: + case _p_func2f_yx: + case _p_func2s_y_vv: + case _p_minus_y_vv: + case _p_or_y_vv: + case _p_plus_y_vv: + case _p_sll_y_vv: + case _p_slr_y_vv: + case _p_times_y_vv: + CHECK(save_Y(stream, pc->u.yxx.y)); + CHECK(save_X(stream, pc->u.yxx.x1)); + CHECK(save_X(stream, pc->u.yxx.x2)); + pc = NEXTOP(pc,yxx); + break; + /* instructions type yyx */ + case _p_func2f_yy: + CHECK(save_Y(stream, pc->u.yyx.y1)); + CHECK(save_Y(stream, pc->u.yyx.y2)); + CHECK(save_X(stream, pc->u.yyx.x)); + pc = NEXTOP(pc,yyx); + break; + /* instructions type yyxx */ + case _get_yy_var: + case _put_y_vals: + CHECK(save_Y(stream, pc->u.yyxx.y1)); + CHECK(save_Y(stream, pc->u.yyxx.y2)); + CHECK(save_X(stream, pc->u.yyxx.x1)); + CHECK(save_X(stream, pc->u.yyxx.x2)); + pc = NEXTOP(pc,yyxx); + break; +#ifdef YAPOR + /* instructions type Otapl */ + case _getwork: + case _getwork_seq: + case _sync: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->u.Otapl.or_arg)); +#endif +#ifdef TABLING + CHECK(save_TabEntry(stream, pc->u.Otapl.te)); +#endif + CHECK(save_Arity(stream, pc->u.Otapl.s)); + CHECK(save_PtoPred(stream, pc->u.Otapl.p)); + CHECK(save_PtoOp(stream, pc->u.Otapl.d)); + pc = NEXTOP(pc,Otapl); + break; + /* instructions type e */ + case _getwork_first_time: + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return 1; + pc = NEXTOP(pc,e); + break; +#endif +#ifdef TABLING + /* instructions type Otapl */ + case _table_answer_resolution: + case _table_completion: + case _table_load_answer: + case _table_retry: + case _table_retry_me: + case _table_trust: + case _table_trust_me: + case _table_try: + case _table_try_answer: + case _table_try_me: + case _table_try_single: +#ifdef YAPOR + CHECK(save_OrArg(stream, pc->u.Otapl.or_arg)); +#endif +#ifdef TABLING + CHECK(save_TabEntry(stream, pc->u.Otapl.te)); +#endif + CHECK(save_Arity(stream, pc->u.Otapl.s)); + CHECK(save_PtoPred(stream, pc->u.Otapl.p)); + CHECK(save_PtoOp(stream, pc->u.Otapl.d)); + pc = NEXTOP(pc,Otapl); + break; + /* instructions type e */ +#ifdef TABLING_INNER_CUTS + case _clause_with_cut: +#endif + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return 1; + pc = NEXTOP(pc,e); + break; + /* instructions type s */ + case _table_new_answer: + CHECK(save_Constant(stream, pc->u.s.s)); + pc = NEXTOP(pc,s); + break; + /* instructions type e */ + case _trie_do_appl: + case _trie_do_appl_in_pair: + case _trie_do_atom: + case _trie_do_atom_in_pair: + case _trie_do_double: + case _trie_do_extension: + case _trie_do_gterm: + case _trie_do_longint: + case _trie_do_null: + case _trie_do_null_in_pair: + case _trie_do_pair: + case _trie_do_val: + case _trie_do_val_in_pair: + case _trie_do_var: + case _trie_do_var_in_pair: + case _trie_retry_appl: + case _trie_retry_appl_in_pair: + case _trie_retry_atom: + case _trie_retry_atom_in_pair: + case _trie_retry_double: + case _trie_retry_extension: + case _trie_retry_gterm: + case _trie_retry_longint: + case _trie_retry_null: + case _trie_retry_null_in_pair: + case _trie_retry_pair: + case _trie_retry_val: + case _trie_retry_val_in_pair: + case _trie_retry_var: + case _trie_retry_var_in_pair: + case _trie_trust_appl: + case _trie_trust_appl_in_pair: + case _trie_trust_atom: + case _trie_trust_atom_in_pair: + case _trie_trust_double: + case _trie_trust_extension: + case _trie_trust_gterm: + case _trie_trust_longint: + case _trie_trust_null: + case _trie_trust_null_in_pair: + case _trie_trust_pair: + case _trie_trust_val: + case _trie_trust_val_in_pair: + case _trie_trust_var: + case _trie_trust_var_in_pair: + case _trie_try_appl: + case _trie_try_appl_in_pair: + case _trie_try_atom: + case _trie_try_atom_in_pair: + case _trie_try_double: + case _trie_try_extension: + case _trie_try_gterm: + case _trie_try_longint: + case _trie_try_null: + case _trie_try_null_in_pair: + case _trie_try_pair: + case _trie_try_val: + case _trie_try_val_in_pair: + case _trie_try_var: + case _trie_try_var_in_pair: + if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return 1; + pc = NEXTOP(pc,e); + break; +#endif +default: + return -1; + } + } diff --git a/H/walkclause.h b/H/walkclause.h index ad08e3806..286a67e00 100644 --- a/H/walkclause.h +++ b/H/walkclause.h @@ -34,9 +34,9 @@ case _p_execute: pc = NEXTOP(pc,Osbmp); break; - /* instructions type Osbpi */ + /* instructions type Osbpa */ case _ensure_space: - pc = NEXTOP(pc,Osbpi); + pc = NEXTOP(pc,Osbpa); break; /* instructions type Osbpp */ case _call_cpred: diff --git a/Makefile.in b/Makefile.in index 306c886f8..f37e8f5c7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -248,6 +248,7 @@ C_SOURCES= \ $(srcdir)/C/load_shl.c $(srcdir)/C/load_dyld.c \ $(srcdir)/C/mavar.c $(srcdir)/C/modules.c $(srcdir)/C/other.c \ $(srcdir)/C/parser.c \ + $(srcdir)/C/qlyw.c \ $(srcdir)/C/save.c $(srcdir)/C/scanner.c \ $(srcdir)/C/sort.c $(srcdir)/C/stdpreds.c $(srcdir)/C/sysbits.c \ $(srcdir)/C/threads.c \ @@ -315,6 +316,7 @@ PL_SOURCES= \ $(srcdir)/pl/modules.yap $(srcdir)/pl/preds.yap \ $(srcdir)/pl/profile.yap \ $(srcdir)/pl/protect.yap \ + $(srcdir)/pl/qly.yap \ $(srcdir)/pl/save.yap \ $(srcdir)/pl/setof.yap \ $(srcdir)/pl/signals.yap \ @@ -356,7 +358,7 @@ ENGINE_OBJECTS = \ myddas_mysql.o myddas_odbc.o myddas_shared.o myddas_initialization.o \ myddas_util.o myddas_statistics.o myddas_top_level.o \ myddas_wkb2prolog.o modules.o other.o \ - parser.o save.o scanner.o sort.o stdpreds.o \ + parser.o qlyw.o save.o scanner.o sort.o stdpreds.o \ sysbits.o threads.o tracer.o \ udi.o rtree.o rtree_udi.o\ unify.o userpreds.o utilpreds.o \ @@ -442,6 +444,9 @@ init.o: $(srcdir)/C/init.c config.h load_foreign.o: $(srcdir)/C/load_foreign.c config.h $(CC) -c $(CFLAGS) $(srcdir)/C/load_foreign.c -o $@ +qlyw.o: $(srcdir)/C/qlyw.c config.h + $(CC) -c $(CFLAGS) $(srcdir)/C/qlyw.c -o $@ + save.o: $(srcdir)/C/save.c config.h $(CC) -c $(CFLAGS) $(srcdir)/C/save.c -o $@ @@ -672,6 +677,7 @@ mycb: $(srcdir)/mycb.c $(CC) $(CFLAGS) $(srcdir)/mycb.c -o mycb all: startup.yss + @ENABLE_GECODE@ @INSTALL_DLLS@ (cd library/gecode; $(MAKE)) @INSTALL_DLLS@ (cd library/lammpi; $(MAKE)) @INSTALL_MATLAB@ (cd library/matlab; $(MAKE)) @INSTALL_DLLS@ (cd library/matrix; $(MAKE)) @@ -744,6 +750,7 @@ install_unix: startup.yss libYap.a @INSTALL_DLLS@ (cd library/rltree; $(MAKE) install) @INSTALL_DLLS@ (cd library/system; $(MAKE) install) @INSTALL_DLLS@ (cd library/tries; $(MAKE) install) + @ENABLE_GECODE@ @INSTALL_DLLS@ (cd library/gecode; $(MAKE) install) @ENABLE_CLIB@ @INSTALL_DLLS@ (cd packages/clib; $(MAKE) install) @ENABLE_HTTP@ @INSTALL_DLLS@ (cd packages/http; $(MAKE) install) @ENABLE_PLDOC@ @INSTALL_DLLS@ (cd packages/pldoc; $(MAKE) install) @@ -851,6 +858,7 @@ depend: $(HEADERS) $(C_SOURCES) clean: clean_docs rm -f *.o *~ *.BAK *.a + @ENABLE_GECODE@ @INSTALL_DLLS@ (cd library/gecode; $(MAKE) clean) @INSTALL_DLLS@ (cd library/lammpi; $(MAKE) clean) @INSTALL_MATLAB@ (cd library/matlab; $(MAKE) clean) @INSTALL_DLLS@ (cd library/matrix; $(MAKE) clean) diff --git a/OPTYap/opt.init.c b/OPTYap/opt.init.c index 45a84a846..e7104482d 100644 --- a/OPTYap/opt.init.c +++ b/OPTYap/opt.init.c @@ -140,7 +140,9 @@ void Yap_init_global_optyap_data(int max_table_size, int n_workers, int sch_loop GLOBAL_last_sg_fr = NULL; GLOBAL_check_sg_fr = NULL; #endif /* LIMIT_TABLING */ +#ifdef YAPOR new_dependency_frame(GLOBAL_root_dep_fr, FALSE, NULL, NULL, NULL, NULL, NULL); +#endif /* YAPOR */ for (i = 0; i < MAX_TABLE_VARS; i++) { CELL *pt = GLOBAL_table_var_enumerator_addr(i); RESET_VARIABLE(pt); @@ -175,10 +177,12 @@ void Yap_init_local_optyap_data(int wid) { /* local data related to tabling */ REMOTE_next_free_ans_node(wid) = NULL; REMOTE_top_sg_fr(wid) = NULL; - REMOTE_top_dep_fr(wid) = GLOBAL_root_dep_fr; #ifdef YAPOR + REMOTE_top_dep_fr(wid) = GLOBAL_root_dep_fr; Set_REMOTE_top_cp_on_stack(wid, (choiceptr) LOCAL_LocalBase); /* ??? */ REMOTE_top_susp_or_fr(wid) = GLOBAL_root_or_fr; +#else + new_dependency_frame(REMOTE_top_dep_fr(wid), FALSE, NULL, NULL, NULL, NULL, NULL); #endif /* YAPOR */ #endif /* TABLING */ return; @@ -214,7 +218,11 @@ void Yap_init_root_frames(void) { #ifdef TABLING /* root dependency frame */ +#ifdef YAPOR DepFr_cons_cp(GLOBAL_root_dep_fr) = B; +#else + DepFr_cons_cp(LOCAL_top_dep_fr) = B; +#endif /* YAPOR */ #endif /* TABLING */ } diff --git a/OPTYap/opt.preds.c b/OPTYap/opt.preds.c index b6e0ca10f..0e49cf70c 100644 --- a/OPTYap/opt.preds.c +++ b/OPTYap/opt.preds.c @@ -393,17 +393,17 @@ static Int p_show_tabled_predicates( USES_REGS1 ) { IOSTREAM *out; tab_ent_ptr tab_ent; - if ((out = YAP_TermToStream(Deref(ARG1))) == NULL) + if (!PL_get_stream_handle(Yap_InitSlot(Deref(ARG1) PASS_REGS), &out)) return (FALSE); tab_ent = GLOBAL_root_tab_ent; Sfprintf(out, "Tabled predicates\n"); if (tab_ent == NULL) Sfprintf(out, " NONE\n"); - else - while(tab_ent) { - Sfprintf(out, " %s/%d\n", AtomName(TabEnt_atom(tab_ent)), TabEnt_arity(tab_ent)); - tab_ent = TabEnt_next(tab_ent); - } + else while(tab_ent) { + Sfprintf(out, " %s/%d\n", AtomName(TabEnt_atom(tab_ent)), TabEnt_arity(tab_ent)); + tab_ent = TabEnt_next(tab_ent); + } + PL_release_stream(out); return (TRUE); } @@ -413,7 +413,7 @@ static Int p_show_table( USES_REGS1 ) { Term mod, t; tab_ent_ptr tab_ent; - if ((out = YAP_TermToStream(Deref(ARG1))) == NULL) + if (!PL_get_stream_handle(Yap_InitSlot(Deref(ARG1) PASS_REGS), &out)) return (FALSE); mod = Deref(ARG2); t = Deref(ARG3); @@ -421,9 +421,12 @@ static Int p_show_table( USES_REGS1 ) { tab_ent = RepPredProp(PredPropByAtom(AtomOfTerm(t), mod))->TableOfPred; else if (IsApplTerm(t)) tab_ent = RepPredProp(PredPropByFunc(FunctorOfTerm(t), mod))->TableOfPred; - else + else { + PL_release_stream(out); return (FALSE); + } show_table(tab_ent, SHOW_MODE_STRUCTURE, out); + PL_release_stream(out); return (TRUE); } @@ -432,20 +435,31 @@ static Int p_show_all_tables( USES_REGS1 ) { IOSTREAM *out; tab_ent_ptr tab_ent; - if ((out = YAP_TermToStream(Deref(ARG1))) == NULL) + if (!PL_get_stream_handle(Yap_InitSlot(Deref(ARG1) PASS_REGS), &out)) return (FALSE); tab_ent = GLOBAL_root_tab_ent; while(tab_ent) { show_table(tab_ent, SHOW_MODE_STRUCTURE, out); tab_ent = TabEnt_next(tab_ent); } + PL_release_stream(out); return (TRUE); } static Int p_show_all_local_tables( USES_REGS1 ) { #ifdef THREADS + IOSTREAM *out; + tab_ent_ptr tab_ent; + if (!PL_get_stream_handle(Yap_InitSlot(Deref(ARG1) PASS_REGS), &out)) + return (FALSE); + tab_ent = GLOBAL_root_tab_ent; + while(tab_ent) { + show_table(tab_ent, SHOW_MODE_STRUCTURE, out); + tab_ent = TabEnt_next(tab_ent); + } + PL_release_stream(out); #else p_show_all_tables(); #endif /* THREADS */ @@ -456,9 +470,10 @@ static Int p_show_all_local_tables( USES_REGS1 ) { static Int p_show_global_trie( USES_REGS1 ) { IOSTREAM *out; - if ((out = YAP_TermToStream(Deref(ARG1))) == NULL) + if (!PL_get_stream_handle(Yap_InitSlot(Deref(ARG1) PASS_REGS), &out)) return (FALSE); show_global_trie(SHOW_MODE_STRUCTURE, out); + PL_release_stream(out); return (TRUE); } @@ -468,7 +483,7 @@ static Int p_show_statistics_table( USES_REGS1 ) { Term mod, t; tab_ent_ptr tab_ent; - if ((out = YAP_TermToStream(Deref(ARG1))) == NULL) + if (!PL_get_stream_handle(Yap_InitSlot(Deref(ARG1) PASS_REGS), &out)) return (FALSE); mod = Deref(ARG2); t = Deref(ARG3); @@ -476,9 +491,12 @@ static Int p_show_statistics_table( USES_REGS1 ) { tab_ent = RepPredProp(PredPropByAtom(AtomOfTerm(t), mod))->TableOfPred; else if (IsApplTerm(t)) tab_ent = RepPredProp(PredPropByFunc(FunctorOfTerm(t), mod))->TableOfPred; - else + else { + PL_release_stream(out); return (FALSE); + } show_table(tab_ent, SHOW_MODE_STATISTICS, out); + PL_release_stream(out); return (TRUE); } @@ -487,7 +505,7 @@ static Int p_show_statistics_tabling( USES_REGS1 ) { IOSTREAM *out; long total_bytes = 0, aux_bytes; - if ((out = YAP_TermToStream(Deref(ARG1))) == NULL) + if (!PL_get_stream_handle(Yap_InitSlot(Deref(ARG1) PASS_REGS), &out)) return (FALSE); aux_bytes = 0; Sfprintf(out, "Execution data structures\n"); @@ -518,15 +536,17 @@ static Int p_show_statistics_tabling( USES_REGS1 ) { #else Sfprintf(out, "Total memory in use (I+II+III): %10ld bytes\n", total_bytes); #endif /* USE_PAGES_MALLOC */ + PL_release_stream(out); return (TRUE); } static Int p_show_statistics_global_trie( USES_REGS1 ) { IOSTREAM *out; - if ((out = YAP_TermToStream(Deref(ARG1))) == NULL) + if (!PL_get_stream_handle(Yap_InitSlot(Deref(ARG1) PASS_REGS), &out)) return (FALSE); show_global_trie(SHOW_MODE_STATISTICS, out); + PL_release_stream(out); return (TRUE); } #endif /* TABLING */ @@ -592,7 +612,7 @@ static Int p_yapor_workers( USES_REGS1 ) { return Yap_unify(MkIntegerTerm(GLOBAL_number_workers),ARG1); #else return FALSE; -#endif +#endif /* YAPOR_THREADS */ } @@ -628,7 +648,7 @@ static Int p_show_statistics_or( USES_REGS1 ) { IOSTREAM *out; long total_bytes = 0, aux_bytes; - if ((out = YAP_TermToStream(Deref(ARG1))) == NULL) + if (!PL_get_stream_handle(Yap_InitSlot(Deref(ARG1) PASS_REGS), &out)) return (FALSE); aux_bytes = 0; Sfprintf(out, "Execution data structures\n"); @@ -649,6 +669,7 @@ static Int p_show_statistics_or( USES_REGS1 ) { #else Sfprintf(out, "Total memory in use (I+II): %10ld bytes\n", total_bytes); #endif /* USE_PAGES_MALLOC */ + PL_release_stream(out); return (TRUE); } #endif /* YAPOR */ @@ -664,7 +685,7 @@ static Int p_show_statistics_opt( USES_REGS1 ) { IOSTREAM *out; long total_bytes = 0, aux_bytes; - if ((out = YAP_TermToStream(Deref(ARG1))) == NULL) + if (!PL_get_stream_handle(Yap_InitSlot(Deref(ARG1) PASS_REGS), &out)) return (FALSE); aux_bytes = 0; Sfprintf(out, "Execution data structures\n"); @@ -707,6 +728,7 @@ static Int p_show_statistics_opt( USES_REGS1 ) { #else Sfprintf(out, "Total memory in use (I+II+III+IV): %10ld bytes\n", total_bytes); #endif /* USE_PAGES_MALLOC */ + PL_release_stream(out); return (TRUE); } #endif /* YAPOR && TABLING */ diff --git a/OPTYap/opt.structs.h b/OPTYap/opt.structs.h index 59db85dca..9ac8bf3ee 100644 --- a/OPTYap/opt.structs.h +++ b/OPTYap/opt.structs.h @@ -209,7 +209,9 @@ struct global_optyap_data { struct subgoal_frame *last_subgoal_frame; struct subgoal_frame *check_subgoal_frame; #endif /* LIMIT_TABLING */ +#ifdef YAPOR struct dependency_frame *root_dependency_frame; +#endif /* YAPOR */ CELL table_var_enumerator[MAX_TABLE_VARS]; #ifdef TABLE_LOCK_AT_WRITE_LEVEL lockvar table_lock[TABLE_LOCK_BUCKETS]; diff --git a/config.h.in b/config.h.in index b6c216c59..19d719fb5 100644 --- a/config.h.in +++ b/config.h.in @@ -1,6 +1,9 @@ #include "parms.h" +/* are dynamic arrays supported? */ +#undef HAVE_DYNARRAY + /* are we using gcc */ #undef HAVE_GCC diff --git a/configure b/configure index 938f743ef..018950ad1 100644 --- a/configure +++ b/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.65. +# Generated by GNU Autoconf 2.68. # # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation, -# Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software +# Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -89,6 +89,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -214,11 +215,18 @@ IFS=$as_save_IFS # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. + # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; + esac + exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} fi if test x$as_have_required = xno; then : @@ -316,7 +324,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -356,19 +364,19 @@ else fi # as_fn_arith -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -530,7 +538,7 @@ test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` @@ -681,9 +689,7 @@ CPLINT_SHLIB_LD CPLINT_LDFLAGS CPLINT_CFLAGS CPLINT_LIBS -EGREP -GREP -CPP +ENABLE_GECODE INSTALL_INFO MPI_CC AR @@ -708,6 +714,10 @@ build DefTrailSpace DefStackSpace DefHeapSpace +PYTHON +EGREP +GREP +CPP C_PARSER_FLAGS C_INTERF_FLAGS GCC @@ -763,6 +773,7 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +enable_gecode enable_tabling enable_or_parallelism enable_rational_trees @@ -883,8 +894,9 @@ do fi case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; + *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *=) ac_optarg= ;; + *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. @@ -929,7 +941,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -955,7 +967,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid feature name: $ac_useropt" + as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1159,7 +1171,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1175,7 +1187,7 @@ do ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - as_fn_error "invalid package name: $ac_useropt" + as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in @@ -1205,8 +1217,8 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) as_fn_error "unrecognized option: \`$ac_option' -Try \`$0 --help' for more information." + -*) as_fn_error $? "unrecognized option: \`$ac_option' +Try \`$0 --help' for more information" ;; *=*) @@ -1214,7 +1226,7 @@ Try \`$0 --help' for more information." # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) - as_fn_error "invalid variable name: \`$ac_envvar'" ;; + as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; @@ -1224,7 +1236,7 @@ Try \`$0 --help' for more information." $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac @@ -1232,13 +1244,13 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - as_fn_error "missing argument to $ac_option" + as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; - fatal) as_fn_error "unrecognized options: $ac_unrecognized_opts" ;; + fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi @@ -1261,7 +1273,7 @@ do [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - as_fn_error "expected an absolute directory name for --$ac_var: $ac_val" + as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' @@ -1275,8 +1287,8 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 + $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1291,9 +1303,9 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - as_fn_error "working directory cannot be determined" + as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - as_fn_error "pwd does not report name of working directory" + as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. @@ -1332,11 +1344,11 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - as_fn_error "cannot find sources ($ac_unique_file) in $srcdir" + as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error "$ac_msg" + cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then @@ -1376,7 +1388,7 @@ Configuration: --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages + -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files @@ -1434,6 +1446,7 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-gecode install gecode library --enable-tabling support tabling --enable-or-parallelism support or-parallelism as: copy,sba,a-cow,threads --enable-rational-trees support infinite rational trees @@ -1459,7 +1472,7 @@ Optional Features: --enable-dlcompat use dlcompat library for dynamic loading on Mac OS X --enable-cplint=DIR enable the cplint library using the glu library in DIR/lib --enable-clpbn-bp enable belief propagation solver in CLPBN. -v --enable-myddas[=DIR] enable the MYDDAS library + --enable-myddas[=DIR] enable the MYDDAS library --enable-myddas-stats enable the MYDDAS library statistics support --enable-myddas-top-level enable the MYDDAS top-level support to MySQL --enable-mimecharset=charset Default MIME charset to set on new messages @@ -1563,9 +1576,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.65 +generated by GNU Autoconf 2.68 -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1609,7 +1622,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile @@ -1647,11 +1660,208 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile +# ac_fn_c_try_cpp LINENO +# ---------------------- +# Try to preprocess conftest.$ac_ext, and return whether this succeeded. +ac_fn_c_try_cpp () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err + ac_status=$? + if test -s conftest.err; then + grep -v '^ *+' conftest.err >conftest.er1 + cat conftest.er1 >&5 + mv -f conftest.er1 conftest.err + fi + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } > conftest.i && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : + ac_retval=0 +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=1 +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_cpp + +# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists, giving a warning if it cannot be compiled using +# the include files in INCLUDES and setting the cache variable VAR +# accordingly. +ac_fn_c_check_header_mongrel () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if eval \${$3+:} false; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +else + # Is the header compilable? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 +$as_echo_n "checking $2 usability... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_header_compiler=yes +else + ac_header_compiler=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 +$as_echo_n "checking $2 presence... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include <$2> +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + ac_header_preproc=yes +else + ac_header_preproc=no +fi +rm -f conftest.err conftest.i conftest.$ac_ext +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( + yes:no: ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; + no:yes:* ) + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} + ;; +esac + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + eval "$3=\$ac_header_compiler" +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +fi + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_mongrel + +# ac_fn_c_try_run LINENO +# ---------------------- +# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes +# that executables *can* be run. +ac_fn_c_try_run () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + if { { ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' + { { case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" +$as_echo "$ac_try_echo"; } >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; }; then : + ac_retval=0 +else + $as_echo "$as_me: program exited with status $ac_status" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_retval=$ac_status +fi + rm -rf conftest.dSYM conftest_ipa8_conftest.oo + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + as_fn_set_status $ac_retval + +} # ac_fn_c_try_run + +# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES +# ------------------------------------------------------- +# Tests whether HEADER exists and can be compiled using the include files in +# INCLUDES, setting the cache variable VAR accordingly. +ac_fn_c_check_header_compile () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 +$as_echo_n "checking for $2... " >&6; } +if eval \${$3+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$4 +#include <$2> +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$3=yes" +else + eval "$3=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$3 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno + +} # ac_fn_c_check_header_compile + # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. @@ -1693,208 +1903,11 @@ fi # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link -# ac_fn_c_try_cpp LINENO -# ---------------------- -# Try to preprocess conftest.$ac_ext, and return whether this succeeded. -ac_fn_c_try_cpp () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err - ac_status=$? - if test -s conftest.err; then - grep -v '^ *+' conftest.err >conftest.er1 - cat conftest.er1 >&5 - mv -f conftest.er1 conftest.err - fi - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then : - ac_retval=0 -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=1 -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_cpp - -# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists, giving a warning if it cannot be compiled using -# the include files in INCLUDES and setting the cache variable VAR -# accordingly. -ac_fn_c_check_header_mongrel () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 -$as_echo_n "checking $2 usability... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_header_compiler=yes -else - ac_header_compiler=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 -$as_echo_n "checking $2 presence... " >&6; } -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include <$2> -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - ac_header_preproc=yes -else - ac_header_preproc=no -fi -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( - yes:no: ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; - no:yes:* ) - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} - ;; -esac - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - eval "$3=\$ac_header_compiler" -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_mongrel - -# ac_fn_c_try_run LINENO -# ---------------------- -# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes -# that executables *can* be run. -ac_fn_c_try_run () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - if { { ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' - { { case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" -$as_echo "$ac_try_echo"; } >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 - test $ac_status = 0; }; }; then : - ac_retval=0 -else - $as_echo "$as_me: program exited with status $ac_status" >&5 - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_retval=$ac_status -fi - rm -rf conftest.dSYM conftest_ipa8_conftest.oo - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - as_fn_set_status $ac_retval - -} # ac_fn_c_try_run - -# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES -# ------------------------------------------------------- -# Tests whether HEADER exists and can be compiled using the include files in -# INCLUDES, setting the cache variable VAR accordingly. -ac_fn_c_check_header_compile () -{ - as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 -$as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -$4 -#include <$2> -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - eval "$3=yes" -else - eval "$3=no" -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -eval ac_res=\$$3 - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} - -} # ac_fn_c_check_header_compile - # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly @@ -1903,7 +1916,7 @@ ac_fn_c_check_func () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -1958,7 +1971,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func @@ -2135,7 +2148,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ rm -f conftest.val fi - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_compute_int @@ -2149,7 +2162,7 @@ ac_fn_c_check_member () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 $as_echo_n "checking for $2.$3... " >&6; } -if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$4+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -2193,7 +2206,7 @@ fi eval ac_res=\$$4 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_member @@ -2206,7 +2219,7 @@ ac_fn_c_check_type () as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } -if { as_var=$3; eval "test \"\${$as_var+set}\" = set"; }; then : +if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" @@ -2247,7 +2260,7 @@ fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } - eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type cat >config.log <<_ACEOF @@ -2255,7 +2268,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was $ $0 $@ @@ -2365,11 +2378,9 @@ trap 'exit_status=$? { echo - cat <<\_ASBOX -## ---------------- ## + $as_echo "## ---------------- ## ## Cache variables. ## -## ---------------- ## -_ASBOX +## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( @@ -2403,11 +2414,9 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; ) echo - cat <<\_ASBOX -## ----------------- ## + $as_echo "## ----------------- ## ## Output variables. ## -## ----------------- ## -_ASBOX +## ----------------- ##" echo for ac_var in $ac_subst_vars do @@ -2420,11 +2429,9 @@ _ASBOX echo if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## + $as_echo "## ------------------- ## ## File substitutions. ## -## ------------------- ## -_ASBOX +## ------------------- ##" echo for ac_var in $ac_subst_files do @@ -2438,11 +2445,9 @@ _ASBOX fi if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## + $as_echo "## ----------- ## ## confdefs.h. ## -## ----------- ## -_ASBOX +## ----------- ##" echo cat confdefs.h echo @@ -2497,7 +2502,12 @@ _ACEOF ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + # We do not want a PATH search for config.site. + case $CONFIG_SITE in #(( + -*) ac_site_file1=./$CONFIG_SITE;; + */*) ac_site_file1=$CONFIG_SITE;; + *) ac_site_file1=./$CONFIG_SITE;; + esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site @@ -2512,7 +2522,11 @@ do { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" + . "$ac_site_file" \ + || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "failed to load site script $ac_site_file +See \`config.log' for more details" "$LINENO" 5; } fi done @@ -2588,7 +2602,7 @@ if $ac_cache_corrupted; then $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - as_fn_error "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 + as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## @@ -2616,7 +2630,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2656,7 +2670,7 @@ if test -z "$ac_cv_prog_CC"; then set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2709,7 +2723,7 @@ if test -z "$CC"; then set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2749,7 +2763,7 @@ if test -z "$CC"; then set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2808,7 +2822,7 @@ if test -z "$CC"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CC+set}" = set; then : +if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then @@ -2852,7 +2866,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then @@ -2906,8 +2920,8 @@ fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "no acceptable C compiler found in \$PATH -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "no acceptable C compiler found in \$PATH +See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 @@ -3021,9 +3035,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "C compiler cannot create executables -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "C compiler cannot create executables +See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } @@ -3065,8 +3078,8 @@ done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of executables: cannot compile and link +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 @@ -3123,9 +3136,9 @@ $as_echo "$ac_try_echo"; } >&5 else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run C compiled programs. +as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. -See \`config.log' for more details." "$LINENO" 5; } +See \`config.log' for more details" "$LINENO" 5; } fi fi fi @@ -3136,7 +3149,7 @@ rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } -if test "${ac_cv_objext+set}" = set; then : +if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3176,8 +3189,8 @@ sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot compute suffix of object files: cannot compile -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot compute suffix of object files: cannot compile +See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi @@ -3187,7 +3200,7 @@ OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then : +if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3224,7 +3237,7 @@ ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then : +if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag @@ -3302,7 +3315,7 @@ else fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then : +if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no @@ -3413,7 +3426,7 @@ if test -z "$CXX"; then set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_CXX+set}" = set; then : +if ${ac_cv_prog_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CXX"; then @@ -3457,7 +3470,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then : +if ${ac_cv_prog_ac_ct_CXX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CXX"; then @@ -3535,7 +3548,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5 $as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; } -if test "${ac_cv_cxx_compiler_gnu+set}" = set; then : +if ${ac_cv_cxx_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -3572,7 +3585,7 @@ ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 $as_echo_n "checking whether $CXX accepts -g... " >&6; } -if test "${ac_cv_prog_cxx_g+set}" = set; then : +if ${ac_cv_prog_cxx_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_cxx_werror_flag=$ac_cxx_werror_flag @@ -3660,7 +3673,7 @@ do set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then : +if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then @@ -3699,6 +3712,516 @@ done +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if ${ac_cv_prog_CPP+:} false; then : + $as_echo_n "(cached) " >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 +$as_echo "$CPP" >&6; } +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # Prefer to if __STDC__ is defined, since + # exists even on freestanding compilers. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#ifdef __STDC__ +# include +#else +# include +#endif + Syntax error +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + +else + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.i conftest.$ac_ext + + # OK, works on sane cases. Now check whether nonexistent headers + # can be detected and how. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +_ACEOF +if ac_fn_c_try_cpp "$LINENO"; then : + # Broken: success on invalid input. +continue +else + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.i conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.i conftest.err conftest.$ac_ext +if $ac_preproc_ok; then : + +else + { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +if ${ac_cv_path_GREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -z "$GREP"; then + ac_path_GREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_GREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_GREP"; then + as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_GREP=$GREP +fi + +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } +if ${ac_cv_path_EGREP+:} false; then : + $as_echo_n "(cached) " >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + if test -z "$EGREP"; then + ac_path_EGREP_found=false + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + $as_echo_n 0123456789 >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + as_fn_arith $ac_count + 1 && ac_count=$as_val + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + $ac_path_EGREP_found && break 3 + done + done + done +IFS=$as_save_IFS + if test -z "$ac_cv_path_EGREP"; then + as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 + fi +else + ac_cv_path_EGREP=$EGREP +fi + + fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } +if ${ac_cv_header_stdc+:} false; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#include +#include + +int +main () +{ + + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + ac_cv_header_stdc=yes +else + ac_cv_header_stdc=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "memchr" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + $EGREP "free" >/dev/null 2>&1; then : + +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then : + : +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +#include +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) \ + (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + return 2; + return 0; +} +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + +else + ac_cv_header_stdc=no +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + +fi +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } +if test $ac_cv_header_stdc = yes; then + +$as_echo "#define STDC_HEADERS 1" >>confdefs.h + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do : + as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default +" +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : + cat >>confdefs.h <<_ACEOF +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + +ac_fn_c_check_header_mongrel "$LINENO" "gecode/support/config.hpp" "ac_cv_header_gecode_support_config_hpp" "$ac_includes_default" +if test "x$ac_cv_header_gecode_support_config_hpp" = xyes; then : + have_gecode=yes +else + have_gecode=no +fi + + +use_gecode_default=no + +if test "$have_gecode" = yes; then + for ac_prog in python2.78 python +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } +if ${ac_cv_prog_PYTHON+:} false; then : + $as_echo_n "(cached) " >&6 +else + if test -n "$PYTHON"; then + ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_PYTHON="$ac_prog" + $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done + done +IFS=$as_save_IFS + +fi +fi +PYTHON=$ac_cv_prog_PYTHON +if test -n "$PYTHON"; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 +$as_echo "$PYTHON" >&6; } +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi + + + test -n "$PYTHON" && break +done +test -n "$PYTHON" || PYTHON="none" + + if test "$PYTHON" != none; then + use_gecode_default=yes + fi +else + PYTHON=none +fi +# Check whether --enable-gecode was given. +if test "${enable_gecode+set}" = set; then : + enableval=$enable_gecode; use_gecode="$enableval" + if test "$use_gecode" = yes; then + if test "$have_gecode" = no; then + as_fn_error $? "cannot enable gecode: gecode library not found" "$LINENO" 5 + fi + if test "$PYTHON" = none; then + as_fn_error $? "cannot enable gecode: python not found" "$LINENO" 5 + fi + fi +else + use_gecode=$use_gecode_default +fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if dynamic arrays are supported" >&5 +$as_echo_n "checking if dynamic arrays are supported... " >&6; } +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + + void foo(int n) { int a[n]; a[1]=0; } +int +main () +{ +foo(3); + ; + return 0; +} + +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_DYNARRAY 1" >>confdefs.h + + +else + + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } + +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Check whether --enable-tabling was given. if test "${enable_tabling+set}" = set; then : @@ -4215,16 +4738,22 @@ _ACEOF ac_aux_dir= for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - for ac_t in install-sh install.sh shtool; do - if test -f "$ac_dir/$ac_t"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/$ac_t -c" - break 2 - fi - done + if test -f "$ac_dir/install-sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f "$ac_dir/install.sh"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f "$ac_dir/shtool"; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi done if test -z "$ac_aux_dir"; then - as_fn_error "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 + as_fn_error $? "cannot find install-sh, install.sh, or shtool in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" "$LINENO" 5 fi # These three variables are undocumented and unsupported, @@ -4238,27 +4767,27 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - as_fn_error "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 + as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } -if test "${ac_cv_build+set}" = set; then : +if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - as_fn_error "cannot guess build type; you must specify one" "$LINENO" 5 + as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) as_fn_error "invalid value of canonical build" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' @@ -4276,14 +4805,14 @@ case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } -if test "${ac_cv_host+set}" = set; then : +if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi @@ -4291,7 +4820,7 @@ fi $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) as_fn_error "invalid value of canonical host" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' @@ -4309,14 +4838,14 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5 $as_echo_n "checking target system type... " >&6; } -if test "${ac_cv_target+set}" = set; then : +if ${ac_cv_target+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - as_fn_error "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 + as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5 fi fi @@ -4324,7 +4853,7 @@ fi $as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; -*) as_fn_error "invalid value of canonical target" "$LINENO" 5;; +*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;; esac target=$ac_cv_target ac_save_IFS=$IFS; IFS='-' @@ -4443,11 +4972,11 @@ if test "$GCC" = "yes" then if test "$debugyap" = "yes" then - CXXFLAGS="-O -g -Wall $CFLAGS" + CXXFLAGS="-O -g -Wall $CXXFLAGS" C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" else - CXXFLAGS="-O3 -fomit-frame-pointer -Wall $CFLAGS" + CXXFLAGS="-O3 -fomit-frame-pointer -Wall $CXXFLAGS" C_INTERF_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" C_PARSER_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" CFLAGS="-O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" @@ -4462,7 +4991,7 @@ then sparc*) case "$target_os" in *solaris2-9*) CFLAGS="-mno-app-regs -DOPTIMISE_ALL_REGS_FOR_SPARC=1 $CFLAGS" - CXXFLAGS="-mno-app-regs -DOPTIMISE_ALL_REGS_FOR_SPARC=1 $CFPPLAGS" + CXXFLAGS="-mno-app-regs -DOPTIMISE_ALL_REGS_FOR_SPARC=1 $CXXFLAGS" ;; esac ;; @@ -4511,7 +5040,7 @@ else CFLAGS="-A -A $CFLAGS" elif test "$CC" = "cl" then - CXXFLAGS="-/nologo $CFLAGS" + CXXFLAGS="-/nologo $CXXFLAGS" CFLAGS="/nologo $CFLAGS" CPP="/nologo /E" fi @@ -4521,10 +5050,10 @@ else then if test "$debugyap" = "yes" then - CXXFLAGS="-Ae -g -O $CFLAGS" + CXXFLAGS="-Ae -g -O $CXXFLAGS" CFLAGS="-Ae -g -O $CFLAGS" else - CXXFLAGS="-Ae +O3 +Onolimit $CFLAGS" + CXXFLAGS="-Ae +O3 +Onolimit $CXXFLAGS" CFLAGS="-Ae +O3 +Onolimit $CFLAGS" fi fi @@ -4562,7 +5091,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then : +if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -4643,7 +5172,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_RANLIB+set}" = set; then : +if ${ac_cv_prog_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$RANLIB"; then @@ -4683,7 +5212,7 @@ if test -z "$ac_cv_prog_RANLIB"; then set dummy ranlib; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then : +if ${ac_cv_prog_ac_ct_RANLIB+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_RANLIB"; then @@ -4735,7 +5264,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}indent; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_INDENT+set}" = set; then : +if ${ac_cv_prog_INDENT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$INDENT"; then @@ -4775,7 +5304,7 @@ if test -z "$ac_cv_prog_INDENT"; then set dummy indent; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_INDENT+set}" = set; then : +if ${ac_cv_prog_ac_ct_INDENT+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_INDENT"; then @@ -4827,7 +5356,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_AR+set}" = set; then : +if ${ac_cv_prog_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AR"; then @@ -4867,7 +5396,7 @@ if test -z "$ac_cv_prog_AR"; then set dummy ar; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_AR+set}" = set; then : +if ${ac_cv_prog_ac_ct_AR+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_AR"; then @@ -4919,7 +5448,7 @@ if test -n "$ac_tool_prefix"; then set dummy ${ac_tool_prefix}mpicc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_MPI_CC+set}" = set; then : +if ${ac_cv_prog_MPI_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$MPI_CC"; then @@ -4959,7 +5488,7 @@ if test -z "$ac_cv_prog_MPI_CC"; then set dummy mpicc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_prog_ac_ct_MPI_CC+set}" = set; then : +if ${ac_cv_prog_ac_ct_MPI_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_MPI_CC"; then @@ -5010,7 +5539,7 @@ fi set dummy install-info; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_INSTALL_INFO+set}" = set; then : +if ${ac_cv_path_INSTALL_INFO+:} false; then : $as_echo_n "(cached) " >&6 else case $INSTALL_INFO in @@ -5052,7 +5581,7 @@ fi set dummy sh; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } -if test "${ac_cv_path_SHELL+set}" = set; then : +if ${ac_cv_path_SHELL+:} false; then : $as_echo_n "(cached) " >&6 else case $SHELL in @@ -5097,10 +5626,9 @@ then then if test "$target_win64" = yes then - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5 + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lws2_32" >&5 $as_echo_n "checking for main in -lws2_32... " >&6; } -if test "${ac_cv_lib_ws2_32_main+set}" = set; then : +if ${ac_cv_lib_ws2_32_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5128,7 +5656,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ws2_32_main" >&5 $as_echo "$ac_cv_lib_ws2_32_main" >&6; } -if test "x$ac_cv_lib_ws2_32_main" = x""yes; then : +if test "x$ac_cv_lib_ws2_32_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBWS2_32 1 _ACEOF @@ -5144,7 +5672,7 @@ fi CXX="${CXX} -mno-cygwin" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lwsock32" >&5 $as_echo_n "checking for main in -lwsock32... " >&6; } -if test "${ac_cv_lib_wsock32_main+set}" = set; then : +if ${ac_cv_lib_wsock32_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5172,7 +5700,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wsock32_main" >&5 $as_echo "$ac_cv_lib_wsock32_main" >&6; } -if test "x$ac_cv_lib_wsock32_main" = x""yes; then : +if test "x$ac_cv_lib_wsock32_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBWSOCK32 1 _ACEOF @@ -5184,7 +5712,7 @@ fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lwsock32" >&5 $as_echo_n "checking for main in -lwsock32... " >&6; } -if test "${ac_cv_lib_wsock32_main+set}" = set; then : +if ${ac_cv_lib_wsock32_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5212,7 +5740,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_wsock32_main" >&5 $as_echo "$ac_cv_lib_wsock32_main" >&6; } -if test "x$ac_cv_lib_wsock32_main" = x""yes; then : +if test "x$ac_cv_lib_wsock32_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBWSOCK32 1 _ACEOF @@ -5225,7 +5753,7 @@ fi EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS \$(abs_top_builddir)/yap.dll" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lpsapi" >&5 $as_echo_n "checking for main in -lpsapi... " >&6; } -if test "${ac_cv_lib_psapi_main+set}" = set; then : +if ${ac_cv_lib_psapi_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5253,7 +5781,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_psapi_main" >&5 $as_echo "$ac_cv_lib_psapi_main" >&6; } -if test "x$ac_cv_lib_psapi_main" = x""yes; then : +if test "x$ac_cv_lib_psapi_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPSAPI 1 _ACEOF @@ -5286,7 +5814,7 @@ else ENABLE_WINCONSOLE="#" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sin in -lm" >&5 $as_echo_n "checking for sin in -lm... " >&6; } -if test "${ac_cv_lib_m_sin+set}" = set; then : +if ${ac_cv_lib_m_sin+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5320,7 +5848,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_sin" >&5 $as_echo "$ac_cv_lib_m_sin" >&6; } -if test "x$ac_cv_lib_m_sin" = x""yes; then : +if test "x$ac_cv_lib_m_sin" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBM 1 _ACEOF @@ -5331,7 +5859,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for socket in -lsocket" >&5 $as_echo_n "checking for socket in -lsocket... " >&6; } -if test "${ac_cv_lib_socket_socket+set}" = set; then : +if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5365,7 +5893,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = x""yes; then : +if test "x$ac_cv_lib_socket_socket" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSOCKET 1 _ACEOF @@ -5376,7 +5904,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for getsockname in -lxnet" >&5 $as_echo_n "checking for getsockname in -lxnet... " >&6; } -if test "${ac_cv_lib_xnet_getsockname+set}" = set; then : +if ${ac_cv_lib_xnet_getsockname+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5410,7 +5938,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_xnet_getsockname" >&5 $as_echo "$ac_cv_lib_xnet_getsockname" >&6; } -if test "x$ac_cv_lib_xnet_getsockname" = x""yes; then : +if test "x$ac_cv_lib_xnet_getsockname" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBXNET 1 _ACEOF @@ -5421,7 +5949,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lstdc++" >&5 $as_echo_n "checking for main in -lstdc++... " >&6; } -if test "${ac_cv_lib_stdcpp_main+set}" = set; then : +if ${ac_cv_lib_stdcpp_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5449,7 +5977,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_stdcpp_main" >&5 $as_echo "$ac_cv_lib_stdcpp_main" >&6; } -if test "x$ac_cv_lib_stdcpp_main" = x""yes; then : +if test "x$ac_cv_lib_stdcpp_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBSTDC__ 1 _ACEOF @@ -5460,7 +5988,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnsl" >&5 $as_echo_n "checking for main in -lnsl... " >&6; } -if test "${ac_cv_lib_nsl_main+set}" = set; then : +if ${ac_cv_lib_nsl_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5488,7 +6016,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_main" >&5 $as_echo "$ac_cv_lib_nsl_main" >&6; } -if test "x$ac_cv_lib_nsl_main" = x""yes; then : +if test "x$ac_cv_lib_nsl_main" = xyes; then : have_nsl=yes else @@ -5497,7 +6025,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lcrypt" >&5 $as_echo_n "checking for main in -lcrypt... " >&6; } -if test "${ac_cv_lib_crypt_main+set}" = set; then : +if ${ac_cv_lib_crypt_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5525,7 +6053,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_main" >&5 $as_echo "$ac_cv_lib_crypt_main" >&6; } -if test "x$ac_cv_lib_crypt_main" = x""yes; then : +if test "x$ac_cv_lib_crypt_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBCRYPT 1 _ACEOF @@ -5536,7 +6064,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnss_files" >&5 $as_echo_n "checking for main in -lnss_files... " >&6; } -if test "${ac_cv_lib_nss_files_main+set}" = set; then : +if ${ac_cv_lib_nss_files_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5564,7 +6092,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss_files_main" >&5 $as_echo "$ac_cv_lib_nss_files_main" >&6; } -if test "x$ac_cv_lib_nss_files_main" = x""yes; then : +if test "x$ac_cv_lib_nss_files_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSS_FILES 1 _ACEOF @@ -5575,7 +6103,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lnss_dns" >&5 $as_echo_n "checking for main in -lnss_dns... " >&6; } -if test "${ac_cv_lib_nss_dns_main+set}" = set; then : +if ${ac_cv_lib_nss_dns_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5603,7 +6131,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nss_dns_main" >&5 $as_echo "$ac_cv_lib_nss_dns_main" >&6; } -if test "x$ac_cv_lib_nss_dns_main" = x""yes; then : +if test "x$ac_cv_lib_nss_dns_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBNSS_DNS 1 _ACEOF @@ -5614,7 +6142,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lresolv" >&5 $as_echo_n "checking for main in -lresolv... " >&6; } -if test "${ac_cv_lib_resolv_main+set}" = set; then : +if ${ac_cv_lib_resolv_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5642,7 +6170,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_resolv_main" >&5 $as_echo "$ac_cv_lib_resolv_main" >&6; } -if test "x$ac_cv_lib_resolv_main" = x""yes; then : +if test "x$ac_cv_lib_resolv_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRESOLV 1 _ACEOF @@ -5657,7 +6185,7 @@ if test "$yap_cv_readline" != "no" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lreadline" >&5 $as_echo_n "checking for main in -lreadline... " >&6; } -if test "${ac_cv_lib_readline_main+set}" = set; then : +if ${ac_cv_lib_readline_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5685,7 +6213,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_readline_main" >&5 $as_echo "$ac_cv_lib_readline_main" >&6; } -if test "x$ac_cv_lib_readline_main" = x""yes; then : +if test "x$ac_cv_lib_readline_main" = xyes; then : $as_echo "#define HAVE_LIBREADLINE 1" >>confdefs.h @@ -5696,8 +6224,8 @@ else if test "x$with_readline" != xcheck; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "--with-readline was given, but test for readline failed -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "--with-readline was given, but test for readline failed +See \`config.log' for more details" "$LINENO" 5; } fi fi @@ -5707,7 +6235,7 @@ if test "$yap_cv_gmp" != "no" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lgmp" >&5 $as_echo_n "checking for main in -lgmp... " >&6; } -if test "${ac_cv_lib_gmp_main+set}" = set; then : +if ${ac_cv_lib_gmp_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5735,7 +6263,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gmp_main" >&5 $as_echo "$ac_cv_lib_gmp_main" >&6; } -if test "x$ac_cv_lib_gmp_main" = x""yes; then : +if test "x$ac_cv_lib_gmp_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBGMP 1 _ACEOF @@ -5750,7 +6278,7 @@ if test "$yap_cv_yapr" != "no" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lR" >&5 $as_echo_n "checking for main in -lR... " >&6; } -if test "${ac_cv_lib_R_main+set}" = set; then : +if ${ac_cv_lib_R_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5778,7 +6306,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_R_main" >&5 $as_echo "$ac_cv_lib_R_main" >&6; } -if test "x$ac_cv_lib_R_main" = x""yes; then : +if test "x$ac_cv_lib_R_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBR 1 _ACEOF @@ -5789,7 +6317,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lRmath" >&5 $as_echo_n "checking for main in -lRmath... " >&6; } -if test "${ac_cv_lib_Rmath_main+set}" = set; then : +if ${ac_cv_lib_Rmath_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5817,7 +6345,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_Rmath_main" >&5 $as_echo "$ac_cv_lib_Rmath_main" >&6; } -if test "x$ac_cv_lib_Rmath_main" = x""yes; then : +if test "x$ac_cv_lib_Rmath_main" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBRMATH 1 _ACEOF @@ -5833,7 +6361,7 @@ if test "$yap_cv_myddas" != "no" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lmysqlclient" >&5 $as_echo_n "checking for main in -lmysqlclient... " >&6; } - if test "${yap_cv_mysql+set}" = set; then : + if ${yap_cv_mysql+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5870,7 +6398,7 @@ $as_echo "$yap_cv_mysql" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lodbc" >&5 $as_echo_n "checking for main in -lodbc... " >&6; } - if test "${yap_cv_odbc+set}" = set; then : + if ${yap_cv_odbc+:} false; then : $as_echo_n "(cached) " >&6 else @@ -5929,7 +6457,7 @@ if test "$threads" = yes then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then : +if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -5963,7 +6491,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then : +if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_LIBPTHREAD 1 _ACEOF @@ -5972,408 +6500,10 @@ _ACEOF fi - ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 -$as_echo "$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - -else - # Broken: fails on valid input. -continue -fi -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -_ACEOF -if ac_fn_c_try_cpp "$LINENO"; then : - # Broken: success on invalid input. -continue -else - # Passes both tests. -ac_preproc_ok=: -break -fi -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then : - -else - { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } -if test "${ac_cv_path_GREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if test -z "$GREP"; then - ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_GREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - as_fn_error "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_GREP=$GREP -fi - -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - if test -z "$EGREP"; then - ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - $as_echo_n 0123456789 >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - as_fn_arith $ac_count + 1 && ac_count=$as_val - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - $ac_path_EGREP_found && break 3 - done - done - done -IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - as_fn_error "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 - fi -else - ac_cv_path_EGREP=$EGREP -fi - - fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -if ac_fn_c_try_compile "$LINENO"; then : - ac_cv_header_stdc=yes -else - ac_cv_header_stdc=no -fi -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then : - -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then : - : -else - cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -if ac_fn_c_try_run "$LINENO"; then : - -else - ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ - conftest.$ac_objext conftest.beam conftest.$ac_ext -fi - -fi -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -$as_echo "#define STDC_HEADERS 1" >>confdefs.h - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do : - as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default -" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : - cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -for ac_header in pthread.h + for ac_header in pthread.h do : ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default" -if test "x$ac_cv_header_pthread_h" = x""yes; then : +if test "x$ac_cv_header_pthread_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_PTHREAD_H 1 _ACEOF @@ -6386,8 +6516,7 @@ done do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -6413,6 +6542,13 @@ fi CMFLAGS=-fpic CIFLAGS=-I. +if test "$use_gecode" = no; then + ENABLE_GECODE="@# " +else + ENABLE_GECODE="" +fi + + if test "$use_chr" = no; then ENABLE_CHR="@# " elif test -e "$srcdir"/packages/chr/Makefile.in; then @@ -6549,7 +6685,7 @@ then CC=${MPI_CC} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI_Init in -lmpi" >&5 $as_echo_n "checking for MPI_Init in -lmpi... " >&6; } -if test "${ac_cv_lib_mpi_MPI_Init+set}" = set; then : +if ${ac_cv_lib_mpi_MPI_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6583,7 +6719,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpi_MPI_Init" >&5 $as_echo "$ac_cv_lib_mpi_MPI_Init" >&6; } -if test "x$ac_cv_lib_mpi_MPI_Init" = x""yes; then : +if test "x$ac_cv_lib_mpi_MPI_Init" = xyes; then : $as_echo "#define HAVE_LIBMPI 1" >>confdefs.h else @@ -6598,7 +6734,7 @@ fi else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPI_Init in -lmpich" >&5 $as_echo_n "checking for MPI_Init in -lmpich... " >&6; } -if test "${ac_cv_lib_mpich_MPI_Init+set}" = set; then : +if ${ac_cv_lib_mpich_MPI_Init+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6632,7 +6768,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpich_MPI_Init" >&5 $as_echo "$ac_cv_lib_mpich_MPI_Init" >&6; } -if test "x$ac_cv_lib_mpich_MPI_Init" = x""yes; then : +if test "x$ac_cv_lib_mpich_MPI_Init" = xyes; then : $as_echo "#define HAVE_LIBMPICH 1" >>confdefs.h else @@ -6663,7 +6799,7 @@ then CC=${MPI_CC} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MPE_Init_log in -lmpe" >&5 $as_echo_n "checking for MPE_Init_log in -lmpe... " >&6; } -if test "${ac_cv_lib_mpe_MPE_Init_log+set}" = set; then : +if ${ac_cv_lib_mpe_MPE_Init_log+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -6697,7 +6833,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_mpe_MPE_Init_log" >&5 $as_echo "$ac_cv_lib_mpe_MPE_Init_log" >&6; } -if test "x$ac_cv_lib_mpe_MPE_Init_log" = x""yes; then : +if test "x$ac_cv_lib_mpe_MPE_Init_log" = xyes; then : $as_echo "#define HAVE_LIBMPE 1" >>confdefs.h else @@ -6725,7 +6861,7 @@ if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then : + if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded @@ -6755,7 +6891,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -6771,11 +6907,11 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi @@ -6814,7 +6950,7 @@ else # Broken: fails on valid input. continue fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. @@ -6830,18 +6966,18 @@ else ac_preproc_ok=: break fi -rm -f conftest.err conftest.$ac_ext +rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext +rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "C preprocessor \"$CPP\" fails sanity check +See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c @@ -6857,7 +6993,7 @@ then else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if test "${ac_cv_header_sys_wait_h+set}" = set; then : +if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -6898,14 +7034,14 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for restartable system calls" >&5 $as_echo_n "checking for restartable system calls... " >&6; } -if test "${ac_cv_sys_restartable_syscalls+set}" = set; then : +if ${ac_cv_sys_restartable_syscalls+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "cannot run test program while cross compiling -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "cannot run test program while cross compiling +See \`config.log' for more details" "$LINENO" 5; } else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ @@ -6987,7 +7123,7 @@ case "$target_os" in then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -7021,7 +7157,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : have_dl=yes else @@ -7153,7 +7289,7 @@ fi then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -7187,7 +7323,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : have_dl=yes else @@ -7225,7 +7361,7 @@ fi then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -7259,7 +7395,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : have_dl=yes else @@ -7376,7 +7512,7 @@ fi *) { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5 $as_echo_n "checking for dlopen in -ldl... " >&6; } -if test "${ac_cv_lib_dl_dlopen+set}" = set; then : +if ${ac_cv_lib_dl_dlopen+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -7410,7 +7546,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5 $as_echo "$ac_cv_lib_dl_dlopen" >&6; } -if test "x$ac_cv_lib_dl_dlopen" = x""yes; then : +if test "x$ac_cv_lib_dl_dlopen" = xyes; then : have_dl=yes else @@ -7510,20 +7646,20 @@ if test "$threads" = "yes" sba) { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "--or-parallelism=sba incompatible with threads -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "--or-parallelism=sba incompatible with threads +See \`config.log' for more details" "$LINENO" 5; } ;; a-cow) { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "--or-parallelism=a-cow incompatible with threads -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "--or-parallelism=a-cow incompatible with threads +See \`config.log' for more details" "$LINENO" 5; } ;; copy) { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -as_fn_error "--or-parallelism=copy incompatible with threads -See \`config.log' for more details." "$LINENO" 5; } +as_fn_error $? "--or-parallelism=copy incompatible with threads +See \`config.log' for more details" "$LINENO" 5; } ;; yes|threads) YAP_EXTRAS="$YAP_EXTRAS -DYAPOR_THREADS=1" @@ -7600,7 +7736,7 @@ then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for zlibVersion in -lz" >&5 $as_echo_n "checking for zlibVersion in -lz... " >&6; } -if test "${ac_cv_lib_z_zlibVersion+set}" = set; then : +if ${ac_cv_lib_z_zlibVersion+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -7634,7 +7770,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_zlibVersion" >&5 $as_echo "$ac_cv_lib_z_zlibVersion" >&6; } -if test "x$ac_cv_lib_z_zlibVersion" = x""yes; then : +if test "x$ac_cv_lib_z_zlibVersion" = xyes; then : ZLIBS="-lz" ZLIB=yes else @@ -7670,7 +7806,7 @@ OLD_CC=${CC} CC=${LAM_MPI_CC} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -llam" >&5 $as_echo_n "checking for main in -llam... " >&6; } -if test "${ac_cv_lib_lam_main+set}" = set; then : +if ${ac_cv_lib_lam_main+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -7698,7 +7834,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lam_main" >&5 $as_echo "$ac_cv_lib_lam_main" >&6; } -if test "x$ac_cv_lib_lam_main" = x""yes; then : +if test "x$ac_cv_lib_lam_main" = xyes; then : LAMOBJS=yap_mpi."$SO" else LAMOBJS=no @@ -7708,7 +7844,7 @@ CC=${OLD_CC} { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } -if test "${ac_cv_header_stdc+set}" = set; then : +if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7820,7 +7956,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sys/wait.h that is POSIX.1 compatible" >&5 $as_echo_n "checking for sys/wait.h that is POSIX.1 compatible... " >&6; } -if test "${ac_cv_header_sys_wait_h+set}" = set; then : +if ${ac_cv_header_sys_wait_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -7863,8 +7999,7 @@ for ac_header in arpa/inet.h alloca.h crypt.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7877,8 +8012,7 @@ for ac_header in ctype.h direct.h dirent.h dlfcn.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7891,8 +8025,7 @@ for ac_header in errno.h execinfo.h fcntl.h fenv.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7905,8 +8038,7 @@ for ac_header in float.h fpu_control.h ieeefp.h io.h limits.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7919,8 +8051,7 @@ for ac_header in locale.h malloc.h math.h memory.h mpi.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7933,8 +8064,7 @@ for ac_header in netdb.h netinet/in.h netinet/tcp.h pwd.h regex.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7947,8 +8077,7 @@ for ac_header in siginfo.h signal.h stdarg.h stdint.h string.h stropts.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7961,8 +8090,7 @@ for ac_header in sys/conf.h sys/dir.h sys/file.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7975,8 +8103,7 @@ for ac_header in sys/mman.h sys/ndir.h sys/param.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -7989,8 +8116,7 @@ for ac_header in sys/resource.h sys/select.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -8003,8 +8129,7 @@ for ac_header in sys/shm.h sys/socket.h sys/stat.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -8017,8 +8142,7 @@ for ac_header in sys/time.h sys/times.h sys/types.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -8031,8 +8155,7 @@ for ac_header in sys/ucontext.h sys/un.h sys/wait.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -8045,8 +8168,7 @@ for ac_header in time.h unistd.h utime.h wctype.h winsock.h winsock2.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -8059,8 +8181,7 @@ for ac_header in zlib.h zutil.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" -eval as_val=\$$as_ac_Header - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF @@ -8072,7 +8193,7 @@ done for ac_header in mach-o/dyld.h do : ac_fn_c_check_header_mongrel "$LINENO" "mach-o/dyld.h" "ac_cv_header_mach_o_dyld_h" "$ac_includes_default" -if test "x$ac_cv_header_mach_o_dyld_h" = x""yes; then : +if test "x$ac_cv_header_mach_o_dyld_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MACH_O_DYLD_H 1 _ACEOF @@ -8086,7 +8207,7 @@ then for ac_header in gmp.h do : ac_fn_c_check_header_mongrel "$LINENO" "gmp.h" "ac_cv_header_gmp_h" "$ac_includes_default" -if test "x$ac_cv_header_gmp_h" = x""yes; then : +if test "x$ac_cv_header_gmp_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_GMP_H 1 _ACEOF @@ -8101,7 +8222,7 @@ then for ac_header in cudd.h do : ac_fn_c_check_header_mongrel "$LINENO" "cudd.h" "ac_cv_header_cudd_h" "$ac_includes_default" -if test "x$ac_cv_header_cudd_h" = x""yes; then : +if test "x$ac_cv_header_cudd_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CUDD_H 1 _ACEOF @@ -8116,7 +8237,7 @@ then for ac_header in mysql/mysql.h do : ac_fn_c_check_header_mongrel "$LINENO" "mysql/mysql.h" "ac_cv_header_mysql_mysql_h" "$ac_includes_default" -if test "x$ac_cv_header_mysql_mysql_h" = x""yes; then : +if test "x$ac_cv_header_mysql_mysql_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MYSQL_MYSQL_H 1 _ACEOF @@ -8131,7 +8252,7 @@ then for ac_header in readline/readline.h do : ac_fn_c_check_header_mongrel "$LINENO" "readline/readline.h" "ac_cv_header_readline_readline_h" "$ac_includes_default" -if test "x$ac_cv_header_readline_readline_h" = x""yes; then : +if test "x$ac_cv_header_readline_readline_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_READLINE_READLINE_H 1 _ACEOF @@ -8143,7 +8264,7 @@ done for ac_header in readline/history.h do : ac_fn_c_check_header_mongrel "$LINENO" "readline/history.h" "ac_cv_header_readline_history_h" "$ac_includes_default" -if test "x$ac_cv_header_readline_history_h" = x""yes; then : +if test "x$ac_cv_header_readline_history_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_READLINE_HISTORY_H 1 _ACEOF @@ -8156,8 +8277,7 @@ done do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -8169,7 +8289,7 @@ fi for ac_header in mpi.h do : ac_fn_c_check_header_mongrel "$LINENO" "mpi.h" "ac_cv_header_mpi_h" "$ac_includes_default" -if test "x$ac_cv_header_mpi_h" = x""yes; then : +if test "x$ac_cv_header_mpi_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MPI_H 1 _ACEOF @@ -8181,7 +8301,7 @@ done for ac_header in mpe.h do : ac_fn_c_check_header_mongrel "$LINENO" "mpe.h" "ac_cv_header_mpe_h" "$ac_includes_default" -if test "x$ac_cv_header_mpe_h" = x""yes; then : +if test "x$ac_cv_header_mpe_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MPE_H 1 _ACEOF @@ -8193,7 +8313,7 @@ done { $as_echo "$as_me:${as_lineno-$LINENO}: checking for inline" >&5 $as_echo_n "checking for inline... " >&6; } -if test "${ac_cv_c_inline+set}" = set; then : +if ${ac_cv_c_inline+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_c_inline=no @@ -8235,7 +8355,7 @@ esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct tm is in sys/time.h or time.h" >&5 $as_echo_n "checking whether struct tm is in sys/time.h or time.h... " >&6; } -if test "${ac_cv_struct_tm+set}" = set; then : +if ${ac_cv_struct_tm+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -8274,7 +8394,7 @@ fi # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int *" >&5 $as_echo_n "checking size of int *... " >&6; } -if test "${ac_cv_sizeof_int_p+set}" = set; then : +if ${ac_cv_sizeof_int_p+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int *))" "ac_cv_sizeof_int_p" "$ac_includes_default"; then : @@ -8283,9 +8403,8 @@ else if test "$ac_cv_type_int_p" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (int *) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (int *) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int_p=0 fi @@ -8308,7 +8427,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of short int" >&5 $as_echo_n "checking size of short int... " >&6; } -if test "${ac_cv_sizeof_short_int+set}" = set; then : +if ${ac_cv_sizeof_short_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (short int))" "ac_cv_sizeof_short_int" "$ac_includes_default"; then : @@ -8317,9 +8436,8 @@ else if test "$ac_cv_type_short_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (short int) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (short int) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_short_int=0 fi @@ -8342,7 +8460,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of int" >&5 $as_echo_n "checking size of int... " >&6; } -if test "${ac_cv_sizeof_int+set}" = set; then : +if ${ac_cv_sizeof_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (int))" "ac_cv_sizeof_int" "$ac_includes_default"; then : @@ -8351,9 +8469,8 @@ else if test "$ac_cv_type_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (int) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (int) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_int=0 fi @@ -8376,7 +8493,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long int" >&5 $as_echo_n "checking size of long int... " >&6; } -if test "${ac_cv_sizeof_long_int+set}" = set; then : +if ${ac_cv_sizeof_long_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long int))" "ac_cv_sizeof_long_int" "$ac_includes_default"; then : @@ -8385,9 +8502,8 @@ else if test "$ac_cv_type_long_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (long int) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (long int) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_int=0 fi @@ -8410,7 +8526,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of long long int" >&5 $as_echo_n "checking size of long long int... " >&6; } -if test "${ac_cv_sizeof_long_long_int+set}" = set; then : +if ${ac_cv_sizeof_long_long_int+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (long long int))" "ac_cv_sizeof_long_long_int" "$ac_includes_default"; then : @@ -8419,9 +8535,8 @@ else if test "$ac_cv_type_long_long_int" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (long long int) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (long long int) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_long_long_int=0 fi @@ -8444,7 +8559,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of float" >&5 $as_echo_n "checking size of float... " >&6; } -if test "${ac_cv_sizeof_float+set}" = set; then : +if ${ac_cv_sizeof_float+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (float))" "ac_cv_sizeof_float" "$ac_includes_default"; then : @@ -8453,9 +8568,8 @@ else if test "$ac_cv_type_float" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (float) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (float) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_float=0 fi @@ -8478,7 +8592,7 @@ _ACEOF # This bug is HP SR number 8606223364. { $as_echo "$as_me:${as_lineno-$LINENO}: checking size of double" >&5 $as_echo_n "checking size of double... " >&6; } -if test "${ac_cv_sizeof_double+set}" = set; then : +if ${ac_cv_sizeof_double+:} false; then : $as_echo_n "(cached) " >&6 else if ac_fn_c_compute_int "$LINENO" "(long int) (sizeof (double))" "ac_cv_sizeof_double" "$ac_includes_default"; then : @@ -8487,9 +8601,8 @@ else if test "$ac_cv_type_double" = yes; then { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ as_fn_set_status 77 -as_fn_error "cannot compute sizeof (double) -See \`config.log' for more details." "$LINENO" 5; }; } +as_fn_error 77 "cannot compute sizeof (double) +See \`config.log' for more details" "$LINENO" 5; } else ac_cv_sizeof_double=0 fi @@ -8509,7 +8622,7 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: checking for type of malloc" >&5 $as_echo_n "checking for type of malloc... " >&6; } -if test "${yap_cv_malloct+set}" = set; then : +if ${yap_cv_malloct+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8549,7 +8662,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc inline" >&5 $as_echo_n "checking for gcc inline... " >&6; } -if test "${yap_cv_gcc+set}" = set; then : +if ${yap_cv_gcc+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8670,7 +8783,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc threaded code" >&5 $as_echo_n "checking for gcc threaded code... " >&6; } -if test "${yap_cv_threaded_code+set}" = set; then : +if ${yap_cv_threaded_code+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8715,7 +8828,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IEEE floats" >&5 $as_echo_n "checking for IEEE floats... " >&6; } -if test "${yap_cv_ffieee+set}" = set; then : +if ${yap_cv_ffieee+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8756,7 +8869,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsetjmp" >&5 $as_echo_n "checking for sigsetjmp... " >&6; } -if test "${yap_cv_sigsetjmp+set}" = set; then : +if ${yap_cv_sigsetjmp+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8796,7 +8909,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigsegv" >&5 $as_echo_n "checking for sigsegv... " >&6; } -if test "${yap_cv_sigsegv+set}" = set; then : +if ${yap_cv_sigsegv+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8835,7 +8948,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for sigprof" >&5 $as_echo_n "checking for sigprof... " >&6; } -if test "${yap_cv_sigprof+set}" = set; then : +if ${yap_cv_sigprof+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8874,7 +8987,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for siginfo" >&5 $as_echo_n "checking for siginfo... " >&6; } -if test "${yap_cv_siginfo+set}" = set; then : +if ${yap_cv_siginfo+:} false; then : $as_echo_n "(cached) " >&6 else @@ -8955,7 +9068,7 @@ fi ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include " -if test "x$ac_cv_member_struct_tm_tm_gmtoff" = x""yes; then : +if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes; then : $as_echo "#define HAVE_STRUCT_TIME_TM_GMTOFF /**/" >>confdefs.h @@ -9026,7 +9139,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking return type of signal handlers" >&5 $as_echo_n "checking return type of signal handlers... " >&6; } -if test "${ac_cv_type_signal+set}" = set; then : +if ${ac_cv_type_signal+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9061,8 +9174,7 @@ for ac_func in _NSGetEnviron access acosh do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9074,8 +9186,7 @@ for ac_func in alloca asinh atanh chdir clock clock_gettime do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9087,8 +9198,7 @@ for ac_func in ctime dlopen dup2 do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9100,8 +9210,7 @@ for ac_func in erf feclearexcept do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9113,8 +9222,7 @@ for ac_func in fesettrapenable fgetpos finite fpclass ftime getcwd getenv do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9126,8 +9234,7 @@ for ac_func in gethostbyname gethostent gethostid gethostname do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9139,8 +9246,7 @@ for ac_func in gethrtime getpagesize do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9152,8 +9258,7 @@ for ac_func in getpwnam getrlimit getrusage gettimeofday getwd do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9165,8 +9270,7 @@ for ac_func in isatty isnan isinf kill labs link lgamma do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9178,8 +9282,7 @@ for ac_func in localtime lstat mallinfo do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9190,7 +9293,7 @@ done for ac_func in mbscoll do : ac_fn_c_check_func "$LINENO" "mbscoll" "ac_cv_func_mbscoll" -if test "x$ac_cv_func_mbscoll" = x""yes; then : +if test "x$ac_cv_func_mbscoll" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MBSCOLL 1 _ACEOF @@ -9201,7 +9304,7 @@ done for ac_func in mbscasecoll do : ac_fn_c_check_func "$LINENO" "mbscasecoll" "ac_cv_func_mbscasecoll" -if test "x$ac_cv_func_mbscasecoll" = x""yes; then : +if test "x$ac_cv_func_mbscasecoll" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MBSCASECOLL 1 _ACEOF @@ -9212,7 +9315,7 @@ done for ac_func in mbsnrtowcs do : ac_fn_c_check_func "$LINENO" "mbsnrtowcs" "ac_cv_func_mbsnrtowcs" -if test "x$ac_cv_func_mbsnrtowcs" = x""yes; then : +if test "x$ac_cv_func_mbsnrtowcs" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_MBSNRTOWCS 1 _ACEOF @@ -9224,8 +9327,7 @@ for ac_func in memcpy memmove mkstemp mktemp do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9237,8 +9339,7 @@ for ac_func in nanosleep mktime opendir do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9250,8 +9351,7 @@ for ac_func in putenv rand random readlink regexec do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9263,8 +9363,7 @@ for ac_func in rename rint sbrk select setbuf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9276,8 +9375,7 @@ for ac_func in setitimer setlocale setsid setlinebuf sigaction do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9289,8 +9387,7 @@ for ac_func in siggetmask siginterrupt do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9302,8 +9399,7 @@ for ac_func in signal sigprocmask socket stat do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9315,8 +9411,7 @@ for ac_func in strchr strerror stricmp strncat strncpy strtod do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9328,8 +9423,7 @@ for ac_func in time times tmpnam usleep utime vsnprintf do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9339,7 +9433,7 @@ done ac_fn_c_check_func "$LINENO" "regexec" "ac_cv_func_regexec" -if test "x$ac_cv_func_regexec" = x""yes; then : +if test "x$ac_cv_func_regexec" = xyes; then : NO_BUILTIN_REGEXP="#" else NO_BUILTIN_REGEXP="" @@ -9349,7 +9443,7 @@ fi for ac_func in NSLinkModule do : ac_fn_c_check_func "$LINENO" "NSLinkModule" "ac_cv_func_NSLinkModule" -if test "x$ac_cv_func_NSLinkModule" = x""yes; then : +if test "x$ac_cv_func_NSLinkModule" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_NSLINKMODULE 1 _ACEOF @@ -9364,8 +9458,7 @@ then do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9381,8 +9474,7 @@ then do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -eval as_val=\$$as_ac_var - if test "x$as_val" = x""yes; then : +if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF @@ -9394,7 +9486,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for mpz_xor" >&5 $as_echo_n "checking for mpz_xor... " >&6; } -if test "${yap_cv_mpz_xor+set}" = set; then : +if ${yap_cv_mpz_xor+:} false; then : $as_echo_n "(cached) " >&6 else @@ -9440,7 +9532,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking if fflush(NULL) clobbers input pipes" >&5 $as_echo_n "checking if fflush(NULL) clobbers input pipes... " >&6; } -if test "${yap_cv_broken_fflush_null+set}" = set; then : +if ${yap_cv_broken_fflush_null+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <&5 $as_echo_n "checking for socket in -lsocket... " >&6; } -if test "${ac_cv_lib_socket_socket+set}" = set; then : +if ${ac_cv_lib_socket_socket+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -9592,7 +9684,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_socket_socket" >&5 $as_echo "$ac_cv_lib_socket_socket" >&6; } -if test "x$ac_cv_lib_socket_socket" = x""yes; then : +if test "x$ac_cv_lib_socket_socket" = xyes; then : CLIB_NETLIBS="$CLIB_NETLIBS -lsocket" $as_echo "#define HAVE_LIBSOCKET 1" >>confdefs.h @@ -9602,13 +9694,13 @@ fi fi ac_fn_c_check_func "$LINENO" "gethostent" "ac_cv_func_gethostent" -if test "x$ac_cv_func_gethostent" = x""yes; then : +if test "x$ac_cv_func_gethostent" = xyes; then : else { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gethostent in -lnsl" >&5 $as_echo_n "checking for gethostent in -lnsl... " >&6; } -if test "${ac_cv_lib_nsl_gethostent+set}" = set; then : +if ${ac_cv_lib_nsl_gethostent+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -9642,7 +9734,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostent" >&5 $as_echo "$ac_cv_lib_nsl_gethostent" >&6; } -if test "x$ac_cv_lib_nsl_gethostent" = x""yes; then : +if test "x$ac_cv_lib_nsl_gethostent" = xyes; then : CLIB_NETLIBS="$CLIB_NETLIBS -lnsl" $as_echo "#define HAVE_LIBNSL 1" >>confdefs.h @@ -9655,7 +9747,7 @@ fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5 $as_echo_n "checking for pthread_create in -lpthread... " >&6; } -if test "${ac_cv_lib_pthread_pthread_create+set}" = set; then : +if ${ac_cv_lib_pthread_pthread_create+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -9689,7 +9781,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5 $as_echo "$ac_cv_lib_pthread_pthread_create" >&6; } -if test "x$ac_cv_lib_pthread_pthread_create" = x""yes; then : +if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then : CLIB_PTHREADS="-lpthread" else CLIB_PTHREADS="" @@ -9699,7 +9791,7 @@ fi oldlibs="$LIBS" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crypt in -lcrypt" >&5 $as_echo_n "checking for crypt in -lcrypt... " >&6; } -if test "${ac_cv_lib_crypt_crypt+set}" = set; then : +if ${ac_cv_lib_crypt_crypt+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS @@ -9733,7 +9825,7 @@ LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypt_crypt" >&5 $as_echo "$ac_cv_lib_crypt_crypt" >&6; } -if test "x$ac_cv_lib_crypt_crypt" = x""yes; then : +if test "x$ac_cv_lib_crypt_crypt" = xyes; then : CRYPT_TARGET=crypt.\$SO else CRYPT_TARGET="" @@ -9743,7 +9835,7 @@ CLIB_CRYPTLIBS="$LIBS" for ac_func in crypt do : ac_fn_c_check_func "$LINENO" "crypt" "ac_cv_func_crypt" -if test "x$ac_cv_func_crypt" = x""yes; then : +if test "x$ac_cv_func_crypt" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_CRYPT 1 _ACEOF @@ -9766,7 +9858,7 @@ ac_fn_c_check_type "$LINENO" "socklen_t" "ac_cv_type_socklen_t" " #include " -if test "x$ac_cv_type_socklen_t" = x""yes; then : +if test "x$ac_cv_type_socklen_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SOCKLEN_T 1 @@ -9780,7 +9872,7 @@ ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" " #include " -if test "x$ac_cv_type_ssize_t" = x""yes; then : +if test "x$ac_cv_type_ssize_t" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_SSIZE_T 1 @@ -9835,7 +9927,7 @@ fi ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include " -if test "x$ac_cv_member_struct_tm_tm_gmtoff" = x""yes; then : +if test "x$ac_cv_member_struct_tm_tm_gmtoff" = xyes; then : $as_echo "#define HAVE_STRUCT_TIME_TM_GMTOFF /**/" >>confdefs.h @@ -10092,6 +10184,11 @@ ac_config_files="$ac_config_files packages/CLPBN/clpbn/bp/Makefile" fi +if test "$ENABLE_GECODE" = ""; then +ac_config_files="$ac_config_files library/gecode/Makefile" + +fi + cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -10156,10 +10253,21 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && + if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file + if test ! -f "$cache_file" || test -h "$cache_file"; then + cat confcache >"$cache_file" + else + case $cache_file in #( + */* | ?:*) + mv -f confcache "$cache_file"$$ && + mv -f "$cache_file"$$ "$cache_file" ;; #( + *) + mv -f confcache "$cache_file" ;; + esac + fi + fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} @@ -10175,6 +10283,7 @@ DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= +U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' @@ -10190,7 +10299,7 @@ LTLIBOBJS=$ac_ltlibobjs -: ${CONFIG_STATUS=./config.status} +: "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" @@ -10291,6 +10400,7 @@ fi IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. +as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR @@ -10336,19 +10446,19 @@ export LANGUAGE (unset CDPATH) >/dev/null 2>&1 && unset CDPATH -# as_fn_error ERROR [LINENO LOG_FD] -# --------------------------------- +# as_fn_error STATUS ERROR [LINENO LOG_FD] +# ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the -# script with status $?, using 1 if that was 0. +# script with STATUS, using 1 if that was 0. as_fn_error () { - as_status=$?; test $as_status -eq 0 && as_status=1 - if test "$3"; then - as_lineno=${as_lineno-"$2"} as_lineno_stack=as_lineno_stack=$as_lineno_stack - $as_echo "$as_me:${as_lineno-$LINENO}: error: $1" >&$3 + as_status=$1; test $as_status -eq 0 && as_status=1 + if test "$4"; then + as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi - $as_echo "$as_me: error: $1" >&2 + $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error @@ -10544,7 +10654,7 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || as_fn_error "cannot create directory $as_dir" + } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p @@ -10598,7 +10708,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.65. Invocation command line was +generated by GNU Autoconf 2.68. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -10660,10 +10770,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.65, +configured by $0, generated by GNU Autoconf 2.68, with options \\"\$ac_cs_config\\" -Copyright (C) 2009 Free Software Foundation, Inc. +Copyright (C) 2010 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -10680,11 +10790,16 @@ ac_need_defaults=: while test $# != 0 do case $1 in - --*=*) + --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; + --*=) + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg= + ac_shift=: + ;; *) ac_option=$1 ac_optarg=$2 @@ -10706,6 +10821,7 @@ do $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; @@ -10718,7 +10834,7 @@ do ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - as_fn_error "ambiguous option: \`$1' + as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; @@ -10727,7 +10843,7 @@ Try \`$0 --help' for more information.";; ac_cs_silent=: ;; # This is an error. - -*) as_fn_error "unrecognized option: \`$1' + -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" @@ -10823,8 +10939,9 @@ do "packages/swi-minisat2/C/Makefile") CONFIG_FILES="$CONFIG_FILES packages/swi-minisat2/C/Makefile" ;; "packages/YapR/Makefile") CONFIG_FILES="$CONFIG_FILES packages/YapR/Makefile" ;; "packages/CLPBN/clpbn/bp/Makefile") CONFIG_FILES="$CONFIG_FILES packages/CLPBN/clpbn/bp/Makefile" ;; + "library/gecode/Makefile") CONFIG_FILES="$CONFIG_FILES library/gecode/Makefile" ;; - *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;; + *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done @@ -10846,9 +10963,10 @@ fi # after its creation but before its name has been assigned to `$tmp'. $debug || { - tmp= + tmp= ac_tmp= trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status + : "${ac_tmp:=$tmp}" + { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } @@ -10856,12 +10974,13 @@ $debug || { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" + test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") -} || as_fn_error "cannot create a temporary directory in ." "$LINENO" 5 +} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 +ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. @@ -10878,12 +10997,12 @@ if test "x$ac_cr" = x; then fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\r' + ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi -echo 'BEGIN {' >"$tmp/subs1.awk" && +echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF @@ -10892,18 +11011,18 @@ _ACEOF echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 +ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -10911,7 +11030,7 @@ done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h @@ -10959,7 +11078,7 @@ t delim rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && +cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" @@ -10991,21 +11110,29 @@ if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || as_fn_error "could not setup config files machinery" "$LINENO" 5 +fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ + || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# VPATH may cause trouble with some makes, so we remove sole $(srcdir), +# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ + ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ +h +s/// +s/^/:/ +s/[ ]*$/:/ +s/:\$(srcdir):/:/g +s/:\${srcdir}:/:/g +s/:@srcdir@:/:/g +s/^:*// s/:*$// +x +s/\(=[ ]*\).*/\1/ +G +s/\n// s/^[^=]*=[ ]*$// }' fi @@ -11017,7 +11144,7 @@ fi # test -n "$CONFIG_FILES" # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || +cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF @@ -11029,11 +11156,11 @@ _ACEOF # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then + ac_tt=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_tt"; then break elif $ac_last_try; then - as_fn_error "could not make $CONFIG_HEADERS" "$LINENO" 5 + as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi @@ -11118,7 +11245,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - as_fn_error "could not setup config headers machinery" "$LINENO" 5 + as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" @@ -11131,7 +11258,7 @@ do esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) as_fn_error "invalid tag \`$ac_tag'" "$LINENO" 5;; + :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac @@ -11150,7 +11277,7 @@ do for ac_f do case $ac_f in - -) ac_f="$tmp/stdin";; + -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. @@ -11159,7 +11286,7 @@ do [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - as_fn_error "cannot find input file: \`$ac_f'" "$LINENO" 5;; + as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" @@ -11185,8 +11312,8 @@ $as_echo "$as_me: creating $ac_file" >&6;} esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 ;; + *:-:* | *:-) cat >"$ac_tmp/stdin" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac @@ -11316,23 +11443,24 @@ s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack " -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ + >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ + "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 +which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} +which seems to be undefined. Please make sure it is defined" >&2;} - rm -f "$tmp/stdin" + rm -f "$ac_tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; + *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # @@ -11341,21 +11469,21 @@ which seems to be undefined. Please make sure it is defined." >&2;} if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" + } >"$ac_tmp/config.h" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 + if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || as_fn_error "could not create $ac_file" "$LINENO" 5 + mv "$ac_tmp/config.h" "$ac_file" \ + || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || as_fn_error "could not create -" "$LINENO" 5 + && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ + || as_fn_error $? "could not create -" "$LINENO" 5 fi ;; @@ -11370,7 +11498,7 @@ _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || - as_fn_error "write failure creating $CONFIG_STATUS" "$LINENO" 5 + as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. @@ -11391,7 +11519,7 @@ if test "$no_create" != yes; then exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. - $ac_cs_success || as_fn_exit $? + $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 diff --git a/configure.in b/configure.in index 473b27b72..64858c402 100644 --- a/configure.in +++ b/configure.in @@ -55,6 +55,41 @@ AC_PROG_AWK AC_SUBST(GCC) AC_SUBST(C_INTERF_FLAGS) AC_SUBST(C_PARSER_FLAGS) +AC_LANG(C) + +dnl Gecode support +AC_CHECK_HEADER(gecode/support/config.hpp, + have_gecode=yes, have_gecode=no) +use_gecode_default=no +AC_SUBST(PYTHON) +if test "$have_gecode" = yes; then + AC_CHECK_PROGS(PYTHON, [python2.78 python], [none]) + if test "$PYTHON" != none; then + use_gecode_default=yes + fi +else + PYTHON=none +fi +AC_ARG_ENABLE(gecode, + [ --enable-gecode install gecode library], + [use_gecode="$enableval" + if test "$use_gecode" = yes; then + if test "$have_gecode" = no; then + AC_MSG_ERROR([cannot enable gecode: gecode library not found]) + fi + if test "$PYTHON" = none; then + AC_MSG_ERROR([cannot enable gecode: python not found]) + fi + fi], use_gecode=$use_gecode_default) +AC_MSG_CHECKING([if dynamic arrays are supported]) +AC_COMPILE_IFELSE([ + AC_LANG_PROGRAM([[void foo(int n) { int a[n]; a[1]=0; }]],[[foo(3);]]) + ],[ + AC_MSG_RESULT([yes]) + AC_DEFINE([HAVE_DYNARRAY],[1],[Define if dynamic arrays are supported]) + ],[ + AC_MSG_RESULT([no]) + ]) AC_ARG_ENABLE(tabling, [ --enable-tabling support tabling ], @@ -198,7 +233,7 @@ AC_ARG_WITH(cudd, [yap_cv_cudd=no]) AC_ARG_ENABLE(myddas, -v [ --enable-myddas[[=DIR]] enable the MYDDAS library], + [ --enable-myddas[[=DIR]] enable the MYDDAS library], if test "$enableval" = yes; then yap_cv_myddas=/usr elif test "$enableval" = no; then @@ -475,11 +510,11 @@ if test "$GCC" = "yes" then if test "$debugyap" = "yes" then - CXXFLAGS="-O -g -Wall $CFLAGS" + CXXFLAGS="-O -g -Wall $CXXFLAGS" C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" else - CXXFLAGS="-O3 -fomit-frame-pointer -Wall $CFLAGS" + CXXFLAGS="-O3 -fomit-frame-pointer -Wall $CXXFLAGS" C_INTERF_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" C_PARSER_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" CFLAGS="-O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" @@ -495,7 +530,7 @@ then case "$target_os" in *solaris[2-9]*) dnl CFLAGS="-mno-app-regs -DOPTIMISE_ALL_REGS_FOR_SPARC=1 $CFLAGS" - CXXFLAGS="-mno-app-regs -DOPTIMISE_ALL_REGS_FOR_SPARC=1 $CFPPLAGS" + CXXFLAGS="-mno-app-regs -DOPTIMISE_ALL_REGS_FOR_SPARC=1 $CXXFLAGS" ;; esac ;; @@ -544,7 +579,7 @@ else CFLAGS="-A -A $CFLAGS" elif test "$CC" = "cl" then - CXXFLAGS="-/nologo $CFLAGS" + CXXFLAGS="-/nologo $CXXFLAGS" CFLAGS="/nologo $CFLAGS" CPP="/nologo /E" fi @@ -554,10 +589,10 @@ else then if test "$debugyap" = "yes" then - CXXFLAGS="-Ae -g -O $CFLAGS" + CXXFLAGS="-Ae -g -O $CXXFLAGS" CFLAGS="-Ae -g -O $CFLAGS" else - CXXFLAGS="-Ae +O3 +Onolimit $CFLAGS" + CXXFLAGS="-Ae +O3 +Onolimit $CXXFLAGS" CFLAGS="-Ae +O3 +Onolimit $CFLAGS" fi fi @@ -747,6 +782,13 @@ fi CMFLAGS=-fpic CIFLAGS=-I. +if test "$use_gecode" = no; then + ENABLE_GECODE="@# " +else + ENABLE_GECODE="" +fi +AC_SUBST(ENABLE_GECODE) + if test "$use_chr" = no; then ENABLE_CHR="@# " elif test -e "$srcdir"/packages/chr/Makefile.in; then @@ -2225,5 +2267,9 @@ if test "$ENABLE_CLPBN_BP" = ""; then AC_CONFIG_FILES([packages/CLPBN/clpbn/bp/Makefile]) fi +if test "$ENABLE_GECODE" = ""; then +AC_CONFIG_FILES([library/gecode/Makefile]) +fi + AC_OUTPUT() diff --git a/include/yap_structs.h b/include/yap_structs.h index 30f77bb9f..a0996375a 100644 --- a/include/yap_structs.h +++ b/include/yap_structs.h @@ -205,12 +205,14 @@ typedef int (*YAP_agc_hook)(void *_Atom); typedef void (*YAP_halt_hook)(int exit_code, void *closure); -typedef int YAP_opaque_tag_t; +typedef YAP_Int YAP_opaque_tag_t; typedef int (*YAP_Opaque_CallOnFail)(void *); +typedef int (*YAP_Opaque_CallOnWrite)(void *, YAP_opaque_tag_t, void *, int); typedef struct YAP_opaque_handler_struct { - YAP_Opaque_CallOnFail fail_handler; + YAP_Opaque_CallOnFail fail_handler; + YAP_Opaque_CallOnWrite write_handler; } YAP_opaque_handler_t; /********* execution mode ***********************/ diff --git a/library/dialect/swi.yap b/library/dialect/swi.yap index 811dfe487..7e1a78247 100644 --- a/library/dialect/swi.yap +++ b/library/dialect/swi.yap @@ -10,6 +10,7 @@ chdir/1, compile_aux_clauses/1, convert_time/2, + convert_time/8, '$declare_module'/5, '$set_predicate_attribute'/3, stamp_date_time/3, @@ -91,7 +92,6 @@ :- yap_flag(autoload,true). - :- set_prolog_flag(user_flags,silent). % Time is given as a float in SWI-Prolog. @@ -168,9 +168,40 @@ cvt_bindings([[Name|Value]|L],[AName=Value|Bindings]) :- chdir(X) :- cd(X). -% Time is received as int, and converted to "..." -% ctime is a built-in. -convert_time(X,Y) :- swi:ctime(X,Y). +%% convert_time(+Stamp, -String) +% +% Convert a time-stamp as obtained though get_time/1 into a textual +% representation using the C-library function ctime(). The value is +% returned as a SWI-Prolog string object (see section 4.23). See +% also convert_time/8. +% +% @deprecated Use format_time/3. + + +convert_time(Stamp, String) :- + format_time(string(String), '%+', Stamp). + +%% convert_time(+Stamp, -Y, -Mon, -Day, -Hour, -Min, -Sec, -MilliSec) +% +% Convert a time stamp, provided by get_time/1, time_file/2, +% etc. Year is unified with the year, Month with the month number +% (January is 1), Day with the day of the month (starting with 1), +% Hour with the hour of the day (0--23), Minute with the minute +% (0--59). Second with the second (0--59) and MilliSecond with the +% milliseconds (0--999). Note that the latter might not be accurate +% or might always be 0, depending on the timing capabilities of the +% system. See also convert_time/2. +% +% @deprecated Use stamp_date_time/3. + +convert_time(Stamp, Y, Mon, Day, Hour, Min, Sec, MilliSec) :- + stamp_date_time(Stamp, + date(Y, Mon, Day, + Hour, Min, FSec, + _, _, _), + local), + Sec is integer(float_integer_part(FSec)), + MilliSec is integer(float_fractional_part(FSec)*1000). compile_aux_clauses([]). compile_aux_clauses([(:- G)|Cls]) :- diff --git a/library/dialect/swi/fli/swi.c b/library/dialect/swi/fli/swi.c index b56e74a00..13086d5bb 100644 --- a/library/dialect/swi/fli/swi.c +++ b/library/dialect/swi/fli/swi.c @@ -2681,32 +2681,6 @@ PL_foreign_context_address(control_t ctx) } } -static int -SWI_ctime(void) -{ -#if HAVE_CTIME - time_t tim; -#endif - YAP_Term t1 = YAP_ARG1; - - if (YAP_IsVarTerm(t1)) { - YAP_Error(0,t1,"bad argumento to ctime"); - return FALSE; - } -#if HAVE_CTIME - if (YAP_IsIntTerm(t1)) - tim = (time_t)YAP_IntOfTerm(t1); - else if (YAP_IsFloatTerm(t1)) - tim = (time_t)YAP_FloatOfTerm(t1); - else - return FALSE; - return YAP_Unify(YAP_BufferToString(ctime(&tim)), YAP_ARG2); -#else - YAP_Error(0,0L,"convert_time requires ctime"); - return FALSE; -#endif -} - X_API int PL_get_signum_ex(term_t sig, int *n) { @@ -2805,7 +2779,6 @@ void Yap_swi_install(void) { Yap_install_blobs(); - YAP_UserCPredicate("ctime", SWI_ctime, 2); } int Yap_read_term(term_t t, IOSTREAM *st, term_t *excep, term_t vs); diff --git a/library/gecode/DOC.txt b/library/gecode/DOC.txt new file mode 100644 index 000000000..3ca6d3888 --- /dev/null +++ b/library/gecode/DOC.txt @@ -0,0 +1,167 @@ +USING THE GECODE MODULE +======================= + +:- use_module(gecode). +or +:- use_module(library(gecode)). +if it is installed as a library module + +CREATING A SPACE +================ + + Space := space + +CREATING VARIABLES +================== + +Unlike in Gecode, variable objects are not bound to a specific Space. Each one +actually contains an index with which it is possible to access a Space-bound +Gecode variable. Variables can be created using the following expressions: + + IVar := intvar(Space,SPEC...) + BVar := boolvar(Space) + SVar := setvar(Space,SPEC...) + +where SPEC... is the same as in Gecode. For creating lists of variables use +the following variants: + + IVars := intvars(Space,N,SPEC...) + BVars := boolvars(Space,N,SPEC...) + SVars := setvars(Space,N,SPEC...) + +where N is the number of variables to create (just like for XXXVarArray in +Gecode). Sometimes an IntSet is necessary: + + ISet := intset([SPEC...]) + +where each SPEC is either an integer or a pair (I,J) of integers. An IntSet +describes a set of ints by providing either intervals, or integers (which stand +for an interval of themselves). It might be tempting to simply represent an +IntSet as a list of specs, but this would be ambiguous with IntArgs which, +here, are represented as lists of ints. + +CONSTRAINTS AND BRANCHINGS +========================== + +all constraint and branching posting functions are available just like in +Gecode. Wherever a XXXArgs or YYYSharedArray is expected, simply use a list. +At present, there is no support for minimodel-like constraint posting. +Constraints and branchings are added to a space using: + + Space += CONSTRAINT + Space += BRANCHING + +For example: + + Space += rel(X,'IRT_EQ',Y) + +arrays of variables are represented by lists of variables, and constants are +represented by atoms with the same name as the Gecode constant +(e.g. 'INT_VAR_SIZE_MIN'). + +SEARCHING FOR SOLUTIONS +======================= + + SolSpace := search(Space) + +This is a backtrackable predicate that enumerates all solution spaces +(SolSpace). + +EXTRACTING INFO FROM A SOLUTION +=============================== + +An advantage of non Space-bound variables, is that you can use them both to +post constraints in the original space AND to consult their values in +solutions. Below are methods for looking up information about variables. Each +of these methods can either take a variable as argument, or a list of +variables, and returns resp. either a value, or a list of values: + + Val := assigned(Space,X) + + Val := min(Space,X) + Val := max(Space,X) + Val := med(Space,X) + Val := val(Space,X) + Val := size(Space,X) + Val := width(Space,X) + Val := regret_min(Space,X) + Val := regret_max(Space,X) + + Val := glbSize(Space,V) + Val := lubSize(Space,V) + Val := unknownSize(Space,V) + Val := cardMin(Space,V) + Val := cardMax(Space,V) + Val := lubMin(Space,V) + Val := lubMax(Space,V) + Val := glbMin(Space,V) + Val := glbMax(Space,V) + Val := glb_ranges(Space,V) + Val := lub_ranges(Space,V) + Val := unknown_ranges(Space,V) + Val := glb_values(Space,V) + Val := lub_values(Space,V) + Val := unknown_values(Space,V) + +DISJUNCTORS +=========== + +Disjunctors provide support for disjunctions of clauses, where each clause is a +conjunction of constraints: + + C1 or C2 or ... or Cn + +Each clause is executed "speculatively": this means it does not affect the main +space. When a clause becomes failed, it is discarded. When only one clause +remains, it is committed: this means that it now affects the main space. + +Example: + +Consider the problem where either X=Y=0 or X=Y+(1 or 2) for variable X and Y +that take values in 0..3. + + Space := space, + [X,Y] := intvars(Space,2,0,3), + +First, we must create a disjunctor as a manager for our 2 clauses: + + Disj := disjunctor(Space), + +We can now create our first clause: + + C1 := clause(Disj), + +This clause wants to constrain X and Y to 0. However, since it must be +executed "speculatively", it must operate on new variables X1 and Y1 that +shadow X and Y: + + [X1,Y1] := intvars(C1,2,0,3), + C1 += forward([X,Y],[X1,Y1]), + +The forward(...) stipulation indicates which global variable is shadowed by +which clause-local variable. Now we can post the speculative clause-local +constraints for X=Y=0: + + C1 += rel(X1,'IRT_EQ',0), + C1 += rel(Y1,'IRT_EQ',0), + +We now create the second clause which uses X2 and Y2 to shadow X and Y: + + C2 := clause(Disj), + [X2,Y2] := intvars(C2,2,0,3), + C2 += forward([X,Y],[X2,Y2]), + +However, this clause also needs a clause-local variable Z2 taking values 1 or +2 in order to post the clause-local constraint X2=Y2+Z2: + + Z2 := intvar(C2,1,2), + C2 += linear([-1,1,1],[X2,Y2,Z2],'IRT_EQ',0), + +Finally, we can branch and search: + + Space += branch([X,Y],'INT_VAR_SIZE_MIN','INT_VAL_MIN'), + SolSpace := search(Space), + +and lookup values of variables in each solution: + + [X_,Y_] := val(SolSpace,[X,Y]). diff --git a/library/gecode/Makefile.in b/library/gecode/Makefile.in new file mode 100644 index 000000000..0ae3ef8a8 --- /dev/null +++ b/library/gecode/Makefile.in @@ -0,0 +1,89 @@ +# +# default base directory for YAP installation +# (EROOT for architecture-dependent files) +# +prefix = @prefix@ +exec_prefix = @exec_prefix@ +ROOTDIR = $(prefix) +EROOTDIR = @exec_prefix@ +abs_top_builddir = @abs_top_builddir@ +# +# where the binary should be +# +BINDIR = $(EROOTDIR)/bin +# +# where YAP should look for libraries +# +LIBDIR=@libdir@ +YAPLIBDIR=@libdir@/Yap +# +# where YAP should look for architecture-independent Prolog libraries +# +SHAREDIR=$(ROOTDIR)/share +# +# +CXX=@CXX@ +CXXFLAGS= @SHLIB_CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -I. -I$(srcdir) -I../.. -I$(srcdir)/../../include +# +# +# You shouldn't need to change what follows. +# +INSTALL=@INSTALL@ +INSTALL_DATA=@INSTALL_DATA@ +INSTALL_PROGRAM=@INSTALL_PROGRAM@ +SHELL=/bin/sh +RANLIB=@RANLIB@ +srcdir=@srcdir@ +SO=@SO@ +#4.1VPATH=@srcdir@:@srcdir@/OPTYap +CWD=$(PWD) +# + +OBJS=gecode_yap.o +SOBJS=gecode_yap.@SO@ + +CODEGEN=$(srcdir)/code-generator.py +DISJUNCTOR = -DDISJUNCTOR +PYTHON = @PYTHON@ +export PYTHONPATH:=$(srcdir):$(PYTHONPATH) + +all: $(SOBJS) gecode.yap + +gecode_yap.o: \ + $(srcdir)/gecode_yap.cc \ + $(srcdir)/gecode-common.icc \ + gecode_yap_cc_impl_auto_generated.icc \ + gecode_yap_cc_init_auto_generated.icc \ + gecode_yap_cc_forward_auto_generated.icc \ + $(srcdir)/disjunctor.icc \ + $(srcdir)/disjunctor.hh + $(CXX) -c $(CXXFLAGS) $(DISJUNCTOR) -o $@ $< + +@DO_SECOND_LD@gecode_yap.@SO@: gecode_yap.o +@DO_SECOND_LD@ @SHLIB_LD@ -o gecode_yap.@SO@ gecode_yap.o $(LDFLAGS) -lgecodeint -lgecodeset -lgecodesearch @EXTRA_LIBS_FOR_DLLS@ + +gecode_yap_cc_init_auto_generated.icc: $(CODEGEN) + $(PYTHON) $< -t yap-cc-init -s $(srcdir) > $@ + +gecode_yap_cc_impl_auto_generated.icc: $(CODEGEN) + $(PYTHON) $< -t yap-cc-impl -s $(srcdir) > $@ + +gecode_yap_cc_forward_auto_generated.icc: $(CODEGEN) + $(PYTHON) $< -t yap-cc-forward -s $(srcdir) > $@ + +gecode_yap_auto_generated.yap: $(CODEGEN) + $(PYTHON) $< -t yap-prolog -s $(srcdir) > $@ + +gecode.yap: $(srcdir)/gecode_yap_hand_written.yap gecode_yap_auto_generated.yap + cat $^ > $@ + +.PHONY: all clean install + +clean: + -rm -f *.o *.so *~ *_auto_generated* gecode.yap *.pyc + +install: all + mkdir -p $(DESTDIR)$(YAPLIBDIR) + mkdir -p $(DESTDIR)$(SHAREDIR)/Yap + $(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(YAPLIBDIR) + $(INSTALL) gecode.yap $(DESTDIR)$(SHAREDIR)/Yap diff --git a/library/gecode/Makefile.sav b/library/gecode/Makefile.sav new file mode 100644 index 000000000..a2acd2056 --- /dev/null +++ b/library/gecode/Makefile.sav @@ -0,0 +1,34 @@ +CODEGEN=code-generator.py +DISJUNCTOR = -DDISJUNCTOR + +yap: gecode_yap.so gecode.yap + +gecode_yap.o: gecode_yap.cc gecode-common.icc \ + gecode_yap_cc_impl_auto_generated.icc \ + gecode_yap_cc_init_auto_generated.icc \ + gecode_yap_cc_forward_auto_generated.icc \ + disjunctor.icc disjunctor.hh + $(CXX) -Wall -ggdb -c -shared -fPIC $(DISJUNCTOR) $(CPPFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ $< + +gecode_yap.so: gecode_yap.o + $(CXX) -shared $(LDFLAGS) -o $@ $< -lgecodeint -lgecodeset -lgecodesearch + +gecode_yap_cc_init_auto_generated.icc: $(CODEGEN) + python $< -t yap-cc-init > $@ + +gecode_yap_cc_impl_auto_generated.icc: $(CODEGEN) + python $< -t yap-cc-impl > $@ + +gecode_yap_cc_forward_auto_generated.icc: $(CODEGEN) + python $< -t yap-cc-forward > $@ + +gecode_yap_auto_generated.yap: $(CODEGEN) + python $< -t yap-prolog > $@ + +gecode.yap: gecode_yap_hand_written.yap gecode_yap_auto_generated.yap + cat $^ > $@ + +.PHONY: yap + +clean: + -rm -f *.o *.so *~ *_auto_generated* gecode.yap diff --git a/library/gecode/code-generator.py b/library/gecode/code-generator.py new file mode 100644 index 000000000..0bc70ea80 --- /dev/null +++ b/library/gecode/code-generator.py @@ -0,0 +1,709 @@ +# -*- python -*- +#============================================================================== +# 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 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 General Public License along with +# this program. If not, see . +#============================================================================== + +import re + +NOTICE_CC = """// -*- 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 . +//============================================================================= +""" + +NOTICE_PROLOG="""%% -*- prolog -*- +%%============================================================================= +%% 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 . +%%============================================================================= +""" + +def prolog_print_notice(): + print NOTICE_PROLOG + +def cc_print_notice(): + print NOTICE_CC + +class Type(object): + + DEFAULT = re.compile("""^(.+)=(.+)$""") + CONST = re.compile("""^const\\b(.+)$""") + UNSIGNED = re.compile("""^unsigned\\b(.+)$""") + REFERENCE = re.compile("""^(.+)&$""") + + def __init__(self, text): + if isinstance(text, Type): + self.clone_from(text) + return + text = text.strip() + m = self.DEFAULT.match(text) + if m: + self.default = m.group(2).strip() + text = m.group(1).strip() + else: + self.default = None + m = self.CONST.match(text) + if m: + self.const = True + text = m.group(1).strip() + else: + self.const = False + m = self.UNSIGNED.match(text) + if m: + self.unsigned = True + text = m.group(1).strip() + else: + self.unsigned = False + m = self.REFERENCE.match(text) + if m: + self.reference = True + text = m.group(1).strip() + else: + self.reference = False + self.type = text + + def __str__(self): + l = [] + if self.const: l.append("const ") + if self.unsigned: l.append("unsigned ") + l.append(self.type) + if self.reference: l.append("&") + if self.default is not None: + l.append("=") + l.append(self.default) + return ''.join(l) + + def clone_from(self, other): + self.const = other.const + self.unsigned = other.unsigned + self.type = other.type + self.reference = other.reference + self.default = other.default + + def clone(self): + return type(self)(self) + + +class Constraint(object): + + DECL = re.compile("""^([^(]+)\\b(\w+)\((.*)\);$""") + ARG = re.compile("""((?:[^,<(]|<[^>]*>|\([^)]*\))+),?""") + + def __init__(self, line): + if isinstance(line, Constraint): + self.clone_from(line) + return + line = line.strip() + m = self.DECL.match(line) + self.rettype = Type(m.group(1).strip()) + self.name = m.group(2) + argtypes = [] + for x in self.ARG.finditer(m.group(3).strip()): + argtypes.append(Type(x.group(1))) + self.argtypes = tuple(argtypes) + self.api = None + + def __str__(self): + l = [] + l.append(str(self.rettype)) + l.append(" ") + l.append(self.name) + sep = "(" + for x in self.argtypes: + l.append(sep) + sep = ", " + l.append(str(x)) + l.append(")") + if self.api is not None: + l.append(" -> ") + l.append(self.api) + l.append(";") + return ''.join(l) + + def clone_from(self, other): + self.rettype = other.rettype.clone() + self.name = other.name + self.argtypes = tuple(t.clone() for t in other.argtypes) + + def clone(self): + return type(self)(self) + + +COMMENT = re.compile("""^\\s*//.*$""") + +def load_decls(filename): + decls = [] + for line in open(filename): + line = line.strip() + if not line: continue + m = COMMENT.match(line) + if m: continue + decls.append(Constraint(line)) + return decls + +class DeclsLoader(object): + + def __init__(self, filename): + self.decls = load_decls(filename) + + def print_decls(self): + for con in self.decls: + print str(con) + +class PredGenerator(DeclsLoader): + + OMIT = ("DFA", # NOT YET SUPPORTED!!! + "TupleSet", # NOT YET SUPPORTED!!! + "VarBranchOptions", + "ValBranchOptions", + "TieBreakVarBranch", + "TieBreakVarBranchOptions", + "TieBreakVarBranch") + + def __init__(self, filename): + super(PredGenerator, self).__init__(filename) + self._change_home_to_space() + self._change_intsharedarray_to_intargs() + self._generate() + self._number() + + def _change_home_to_space(self): + for p in self.decls: + for t in p.argtypes: + if t.type=="Home": + t.type="Space" + + def _change_intsharedarray_to_intargs(self): + for p in self.decls: + for t in p.argtypes: + if t.type=="IntSharedArray": + t.type="IntArgs" + + def _generate(self): + # drop the constraints and optional arguments we can't handle + preds = [] + for con in self.decls: + if self._con_ok(con): + con = con.clone() + con.argtypes = tuple(self._drop_deco(t) for t in con.argtypes + if t.type not in self.OMIT) + preds.append(con) + # for each pred that has an argument with a default produce + # 2 preds (1 without, 1 with). repeat until all defaults have + # been removed. + again = True + while again: + preds_ = [] + again = False + for con in preds: + i = self._defaulted(con.argtypes) + if i is None: + preds_.append(con) + else: + again = True + before = con.argtypes[:i] + # without the default argument + # and therefore without the args that follow + con1 = con.clone() + con1.argtypes = before + preds_.append(con1) + # with the default argument (not default anymore) + con2 = con.clone() + arg = con.argtypes[i].clone() + arg.default=None + after = con.argtypes[i+1:] + con2.argtypes = before + (arg,) + after + preds_.append(con2) + preds = preds_ + self.preds = preds + + def _con_ok(self, con): + for t in con.argtypes: + if (t.type in self.OMIT) and (t.default is None): + return False + return True + + def _drop_deco(self, t): + # drop const, ref, and unsigned indications + t.const = False + t.reference = False + t.unsigned = False + return t + + def _defaulted(self, argtypes): + i = 0 + for x in argtypes: + if x.default is not None: + return i + i += 1 + return None + + def _number(self): + i = 1 + for x in self.preds: + x.api = "%s_%d" % (x.name,i) + i += 1 + + def print_preds(self): + for p in self.preds: + print str(p) + +class Cluster(object): + + def __init__(self, name, arity): + self.name = name + self.arity = arity + self.preds = [] + +# discriminating tree based on argument types +class DTree(object): + + def __init__(self, i, preds): + self.index = i + if len(preds) == 1 and len(preds[0].argtypes) == i: + self.is_leaf = True + self.pred = preds[0] + return + self.is_leaf = False + # i is the index of the current arg + # preds are the predicates to be indexed under this tree node + dispatch = {} + for p in preds: + t = p.argtypes[i] + d = dispatch.get(t.type, None) + if d is None: + d = [] + dispatch[t.type] = d + d.append(p) + self.subtrees = tuple((t2,DTree(i+1,p2)) + for t2,p2 in dispatch.iteritems()) + + def _generate_body(self, user_vars, lib_vars): + if self.is_leaf: + return PrologLiteral("gecode_constraint_%s(%s)" % (self.pred.api, ",".join(lib_vars))) + X = user_vars[self.index] + Y = lib_vars[self.index] + return self._generate_dispatch(0, user_vars, lib_vars) + + def _generate_dispatch(self, i, user_vars, lib_vars): + if i == len(self.subtrees): + return PrologLiteral("throw(gecode_argument_error)") + typ, dtree = self.subtrees[i] + idx = self.index + X = user_vars[idx] + Y = lib_vars[idx] + # hack for disjunctor support + if typ=="Space": + typ = "Space_or_Clause" + return PrologIF( + PrologLiteral("is_%s(%s,%s)" % (typ,X,Y)), + dtree._generate_body(user_vars, lib_vars), + self._generate_dispatch(i+1, user_vars, lib_vars)) + + def _cc_descriptors(self, name, argtypes): + if self.is_leaf: + return (CCDescriptor(name, argtypes, self.pred.api),) + descriptors = [] + for typ,dtree in self.subtrees: + descriptors.extend(dtree._cc_descriptors(name,(argtypes+(typ,)))) + return descriptors + +class YAPConstraintGeneratorBase(PredGenerator): + + def __init__(self, filename): + super(YAPConstraintGeneratorBase, self).__init__(filename) + self._classify() + self._dtreefy() + + # create clusters (predicate,arity) + def _classify(self): + clusters = {} + for pred in self.preds: + name = pred.name + arity = len(pred.argtypes) + key = (name,arity) + cluster = clusters.get(key, None) + if cluster is None: + cluster = Cluster(name, arity) + clusters[key] = cluster + cluster.preds.append(pred) + self.clusters = clusters + + # for each cluster, create a dtree + def _dtreefy(self): + dtrees = {} + for key, cluster in self.clusters.iteritems(): + dtree = DTree(0, cluster.preds) + dtrees[key] = dtree + self.dtrees = dtrees + + def _user_vars(self, arity): + return tuple(("X%d" % i) for i in range(arity)) + + def _lib_vars(self, arity): + return tuple(("Y%d" % i) for i in range(arity)) + +class YAPConstraintPrologGenerator(YAPConstraintGeneratorBase): + + def __init__(self, filename): + super(YAPConstraintPrologGenerator, self).__init__(filename) + + def _prolog_clauses(self): + clauses = [] + for (name, arity), dtree in self.dtrees.iteritems(): + user_vars = self._user_vars(arity) + lib_vars = self._lib_vars(arity) + head = "%s(%s)" % (name, ",".join(user_vars)) + body = dtree._generate_body(user_vars, lib_vars) + clause = PrologClause(head, body) + clauses.append(clause) + return clauses + + def generate(self): + out = OStream(sys.stdout) + for clause in self._prolog_clauses(): + clause.pp(out, 0) + +class YAPConstraintCCGenerator(YAPConstraintGeneratorBase): + + def __init__(self, filename): + super(YAPConstraintCCGenerator, self).__init__(filename) + + def _cc_descriptors(self): + descriptors = [] + for (name, arity), dtree in self.dtrees.iteritems(): + descriptors.extend(dtree._cc_descriptors(name,())) + return descriptors + + def generate_impl(self): + for d in self._cc_descriptors(): + d.generate_impl() + + def generate_init(self): + for d in self._cc_descriptors(): + d.generate_init() + +# output stream that keeps track of the current column +# to facilitate proper indentation + +import sys + +class OStream(object): + + def __init__(self, fd=sys.stdout): + self.file = fd + self.column = 0 + + def write(self, s): + reset = False + for x in s.split('\n'): + if reset: + self.newline() + else: + reset = True + self.file.write(x) + self.column += len(x) + + def newline(self): + self.file.write("\n") + self.column = 0 + + def writeln(self, s=None): + if s is not None: + self.write(s) + self.newline() + + def indent_to(self, n): + if n0: + self.write(' ') + n -= 1 + +# representation of prolog code that automatically supports proper indentation + +class PrologObject(object): + pass + +class PrologClause(PrologObject): + + def __init__(self, head, body): + self.head = head + self.body = body + + def pp(self, out, offset): + out.indent_to(offset) + out.write(self.head) + out.writeln(" :-") + self.body.pp(out, offset+8) + out.writeln(".") + out.writeln() + +class PrologLiteral(PrologObject): + + def __init__(self, lit): + self.literal = lit + + def pp(self, out, offset): + out.indent_to(offset) + out.write(self.literal) + +class PrologIF(PrologObject): + + def __init__(self, cond, left, right): + self.cond = cond + self.left = left + self.right = right + + def pp(self, out, offset): + out.indent_to(offset) + out.write("("), + indent = offset+1 + self.cond.pp(out, indent) + out.writeln() + out.indent_to(indent) + out.write("-> ") + self.left.pp(out, indent+3) + out.writeln() + out.indent_to(indent) + out.write("; ") + self.right.pp(out, indent+3) + out.write(")") + +ENUM_CLASSES = None +ENUM_CLASSES_AVOID = ('ScriptMode','ViewSelStatus','ExecStatus', + 'ActorProperty','SpaceStatus') + +def enum_classes(): + global ENUM_CLASSES + filename = "gecode-enums-%s.py" % gecode_version() + if SRCDIR is not None: + import os.path + filename = os.path.join(SRCDIR,filename) + if ENUM_CLASSES is None: + import imp + ENUM_CLASSES = imp.load_source( + "gecode_enums", + filename).ENUM_CLASSES + ENUM_CLASSES = (x for x in ENUM_CLASSES if x.TYPE not in ENUM_CLASSES_AVOID) + return ENUM_CLASSES + +class YAPEnumImpl(object): + + def generate(self): + self._generate_atoms() + self._generate_from_term() + + def _generate_atoms(self): + for x in self.ENUM: + print "static YAP_Term gecode_%s;" % x + print + + def _generate_from_term(self): + print "static %s gecode_%s_from_term(YAP_Term X)" % (self.TYPE,self.TYPE) + print "{" + for x in self.ENUM: + print " if (X==gecode_%s) return %s;" % (x,x) + print ' cerr << "this should never happen" << endl; exit(1);' + print "}" + print + + def _generate_from_term_forward_decl(self): + print "static %s gecode_%s_from_term(YAP_Term);" % (self.TYPE,self.TYPE) + +class YAPEnumImplGenerator(object): + + def generate(self): + for c in enum_classes(): + class C(c,YAPEnumImpl): pass + o = C() + o.generate() + +class YAPEnumForwardGenerator(object): + + def generate(self): + for c in enum_classes(): + class C(c,YAPEnumImpl): pass + o = C() + o._generate_from_term_forward_decl() + +class YAPEnumInit(object): + + def generate(self): + for x in self.ENUM: + print '{ YAP_Atom X= YAP_LookupAtom("%s");' % x + print ' gecode_%s = YAP_MkAtomTerm(X);' % x + print ' YAP_AtomGetHold(X); }' + print + +class YAPEnumInitGenerator(object): + + def generate(self): + for c in enum_classes(): + class C(c,YAPEnumInit): pass + o = C() + o.generate() + +class YAPEnumProlog(object): + + def generate(self): + for x in self.ENUM: + print "is_%s_('%s')." % (self.TYPE, x) + print + for x in self.ENUM: + print "is_%s_('%s','%s')." % (self.TYPE, x, x) + print + print "is_%s(X,Y) :- nonvar(X), is_%s_(X,Y)." % (self.TYPE,self.TYPE) + print "is_%s(X) :- is_%s(X,_)." % (self.TYPE,self.TYPE) + print + +class YAPEnumPrologGenerator(object): + + def generate(self): + for c in enum_classes(): + class C(c,YAPEnumProlog): pass + o = C() + o.generate() + +class CCDescriptor(object): + + def __init__(self, name, argtypes, api): + self.name = name + self.argtypes = argtypes + self.api = api + + def generate_impl(self): + print "static int gecode_constraint_%s(void)" % self.api + print "{" + i = 1 + args = [] + for t in self.argtypes: + v = "X%d" % i + a = "YAP_ARG%d" % i + if t=="Space": + v = "*space" + print " GenericSpace* space = gecode_Space_from_term(%s);" % a + else: + extra = "" + if t in ("IntVar","BoolVar","SetVar","IntVarArgs","BoolVarArgs","SetVarArgs"): + extra = "space," + print " %s %s = gecode_%s_from_term(%s%s);" % (t,v,t,extra,a) + args.append(v) + i += 1 + print " %s(%s);" % (self.name, ",".join(args)) + print " return TRUE;" + print "}" + print + + def generate_init(self): + print 'YAP_UserCPredicate("gecode_constraint_%s", gecode_constraint_%s, %d);' \ + % (self.api, self.api, len(self.argtypes)) + +GECODE_VERSION = None + +def gecode_version(): + global GECODE_VERSION + if GECODE_VERSION is not None: + return GECODE_VERSION + from distutils.ccompiler import new_compiler, customize_compiler + import os + cxx = new_compiler() + customize_compiler(cxx) + pid = os.getpid() + file_hh = "_gecode_version_%d.hh" % pid + file_txt = "_gecode_version_%d.txt" % pid + f = file(file_hh,"w") + f.write("""#include "gecode/support/config.hpp" +@@GECODE_VERSION""") + f.close() + cxx.preprocess(file_hh,output_file=file_txt) + f = open(file_txt) + version = "" + for line in f: + if line.startswith("@@"): + version = line[3:-2] + break + f.close() + os.remove(file_hh) + os.remove(file_txt) + GECODE_VERSION = version + return version + +SRCDIR = None + +if __name__ == '__main__': + import argparse + parser = argparse.ArgumentParser( + description="code generator for gecode bindings") + parser.add_argument( + "-t", "--target", choices=("yap-prolog","yap-cc-impl","yap-cc-init", + "yap-cc-forward"), + default=None, metavar="TARGET", required=True, + help="type of code to generate") + parser.add_argument( + "-s", "--srcdir", metavar="DIR", default=None, + help="source directory") + + args = parser.parse_args() + if args.srcdir is not None: + import os.path + SRCDIR = os.path.abspath(args.srcdir) + filename = "gecode-prototypes-%s.hh" % gecode_version() + if SRCDIR is not None: + filename = os.path.join(SRCDIR,filename) + if args.target == "yap-prolog": + prolog_print_notice() + YAPEnumPrologGenerator().generate() + YAPConstraintPrologGenerator(filename).generate() + elif args.target == "yap-cc-impl": + cc_print_notice() + YAPEnumImplGenerator().generate() + YAPConstraintCCGenerator(filename).generate_impl() + elif args.target == "yap-cc-init": + cc_print_notice() + YAPEnumInitGenerator().generate() + YAPConstraintCCGenerator(filename).generate_init() + elif args.target == "yap-cc-forward": + cc_print_notice() + YAPEnumForwardGenerator().generate() + else: + raise NotImplementedError("target not yet suported: %s" % args.target) diff --git a/library/gecode/disjunctor.hh b/library/gecode/disjunctor.hh new file mode 100644 index 000000000..6fc2d445d --- /dev/null +++ b/library/gecode/disjunctor.hh @@ -0,0 +1,156 @@ +// -*- 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 . +//============================================================================= + +#ifndef __GECODE_DISJUNCTOR_HH__ +#define __GECODE_DISJUNCTOR_HH__ + +#include +#include +#include + +namespace Gecode { namespace Disjunctor_ { + + using namespace generic_gecode; + + //========================================================================= + // from a user perspective, a Disjunctor corresponds to a set of + // speculative clauses: + // + // - when a non-committed clause fails, it is simply discarded + // - when a single clause remains, it is committed + // + // from an implementation perspective, a Disjunctor is an object shared by + // several clauses, that contains a counter keeping track of how many + // clauses remain. when the counter reaches 1, the remaining clause + // becomes committed. + //========================================================================= + + // following the example in MPG + struct Disjunctor: public LocalHandle + { + Disjunctor(); + Disjunctor(Space& home); + Disjunctor(const Disjunctor& d); + int get() const; + void incr(); + void decr(); + void dispose(Space& home); + }; + + //========================================================================= + // a Clause encapsulates the speculative execution of a set of propagators. + // Therefore, these propagators must be posted in a separate (sub)space. + // However they normally want to constrain variables of the original home + // space: for each such variable X, a variable Y local to the subspace must + // be created and used instead, and a forwarder must be created from X to + // Y. A Clause is then a Propagator that subscribes to the Xs. Whenever a + // X changes, the domains of the Xs are forwarded into the Ys and + // constraint propagation is run in the subspace. When a clause is + // committed, after propagation, the domains of Ys are forwarded back into + // the Xs. + //========================================================================= + + // TODO: copy (difficulty is forwarder list) + + class SubSpace; + + class Clause: public Propagator { + Disjunctor disj; + SubSpace*const subhome; + public: + Clause(Space& home_, Disjunctor disj_); + Clause(Space& home, bool share, Clause& c); + virtual Propagator* copy(Space& home, bool share); + virtual size_t dispose(Space& home); + virtual PropCost cost(const Space&, const ModEventDelta&) const; + virtual ExecStatus propagate(Space& home, const ModEventDelta&); + // user API + operator GenericSpace&(); + operator Space&(); + operator Home(); + GenericSpace* generic_space() const; + Space* space() const; + void forward(Space& home, IntVar outer, IntVar inner); + void forward(Space& home, BoolVar outer, BoolVar inner); + void forward(Space& home, SetVar outer, SetVar inner); + protected: + ExecStatus forward_in(); + ExecStatus forward_out(Space& outer_home); + bool committed() const; + }; + + //========================================================================= + // a SubSpace is the Space associated with a Clause. It also contains the + // forwarder linked-list because we want it to manage the memory for that + // list. + //========================================================================= + + class BasicForwarder; + using Int::IntView; + using Int::BoolView; + using Set::SetView; + + class SubSpace: public GenericSpace + { + private: + Space* homeDuringCloning; + // linked-list of pairs of a variable in the parent space and a + // corresponding variable in the subspace + BasicForwarder* forwarder; + // auxiliary methods for adding an entry to the forwarder list + void forward(IntView outer, IntView inner); + void forward(BoolView outer, BoolView inner); + void forward(SetView outer, SetView inner); + // for forwarding domains into and out of the subhome + ExecStatus forward_in(); + ExecStatus forward_out(Space&); + // for cancelling subscriptions + void cancel(Space& home, Clause&); + // allow Clause to use this private API + friend class Clause; + public: + SubSpace(); + SubSpace(bool share, SubSpace& s); + virtual Space* copy(bool share); + SubSpace* copy(Space& home, bool share); + }; +}} + +namespace Gecode +{ + using Disjunctor_::Disjunctor; + + class Clause + { + generic_gecode::GenericSpace& _home; + Disjunctor_::Clause* _clause; + public: + Clause(generic_gecode::GenericSpace& home, Disjunctor disj); + operator generic_gecode::GenericSpace&(); + operator Space&(); + operator Home(); + generic_gecode::GenericSpace* generic_space(); + generic_gecode::GenericSpace* generic_parent(); + Space* space(); + void forward(IntVar outer, IntVar inner); + void forward(BoolVar outer, BoolVar inner); + void forward(SetVar outer, SetVar inner); + }; +} + +#endif diff --git a/library/gecode/disjunctor.icc b/library/gecode/disjunctor.icc new file mode 100644 index 000000000..3e1d41285 --- /dev/null +++ b/library/gecode/disjunctor.icc @@ -0,0 +1,380 @@ +// -*- 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 . +//============================================================================= +#include "disjunctor.hh" + +namespace Gecode { namespace Disjunctor_ { + + //========================================================================= + // Disjunctor (following example in MPG) + //========================================================================= + + struct DisjunctorObject: public LocalObject + { + int n; + DisjunctorObject(Space& home) : LocalObject(home), n(0) {} + DisjunctorObject(Space& home, bool share, DisjunctorObject& d) + : LocalObject(home, share, d), n(d.n) {} + virtual LocalObject* copy(Space& home, bool share) + { return new (home) DisjunctorObject(home, share, *this); } + virtual size_t dispose(Space&) { return sizeof(*this); } + }; + + Disjunctor::Disjunctor(): LocalHandle() {} + Disjunctor::Disjunctor(Space& home) + : LocalHandle(new (home) DisjunctorObject(home)) {} + Disjunctor::Disjunctor(const Disjunctor& d): LocalHandle(d) {} + int Disjunctor::get() const { return static_cast(object())->n; } + void Disjunctor::incr() { static_cast(object())->n += 1; } + void Disjunctor::decr() { static_cast(object())->n -= 1; } + void Disjunctor::dispose(Space& home) + { static_cast(object())->dispose(home); } + + //========================================================================= + // Forwarder + // used to forward the domain of a view V1 into a view V2 located in a + // subspace (the subspace of a speculative clause). V2 represents V1 in + // that space. + // + // BasicForwarder + // base class of all Forwarders. It declares the virtual functions + // that must be implemented to do the actual work, and contains the pointer + // implementing the singly-linked list of Forwarders associated with each + // clause. It also redefines new and delete to manage memory in the + // subspace. + //========================================================================= + + struct BasicForwarder + { + BasicForwarder* next; + + BasicForwarder() : next(NULL) {} + + // forward V1's domain into V2. This is used each time the Clause (as a + // a propagator) is woken to perform propagation. + + virtual ExecStatus forward_in(Space& inner_home) = 0; + + // forward V2's domain into V1. This is used after propagation in the + // case where the Clause has been committed to (because it is the last + // one remaining). + + virtual void forward_out(Space& outer_home) = 0; + + // needed by delete to know how much to free + virtual size_t size() const = 0; + + // usage: new (home) FRWRDR(...); + // to allocate the instance of FRWRDR on home's heap + + static void* operator new(size_t n, Space& home) + { return home.ralloc(n); } + + // usage: delete (home) PTR; + // to free the instance pointed to by PTR from home's heap + + static void operator delete(void* ptr, Space& home) + { home.rfree(ptr, ((BasicForwarder*)ptr)->size()); } + + virtual BasicForwarder* + copy(Space& outer_home, Space& inner_home, bool share) = 0; + + virtual void cancel(Space& home, Clause&) = 0; + }; + + // Forwarder parametrized by View + + template + struct Forwarder: public BasicForwarder + { + View outer; + View inner; + Forwarder(View v1, View v2): outer(v1), inner(v2) {} + Forwarder() {} + virtual ExecStatus forward_in(Space& home); + virtual void forward_out(Space& home); + virtual size_t size() const { return sizeof(*this); } + virtual BasicForwarder* copy(Space& outer_home, Space& inner_home, bool share) + { + Forwarder* fwd = new (inner_home) Forwarder(); + fwd->outer.update(outer_home, share, outer); + fwd->inner.update(inner_home, share, inner); + return fwd; + } + virtual void cancel(Space& home, Clause& c); + }; + + // instances of Forwarder that we actually use + + typedef Forwarder IntForwarder; + typedef Forwarder BoolForwarder; + typedef Forwarder SetForwarder; + + //========================================================================= + // IntForwarder + //========================================================================= + + template <> + ExecStatus IntForwarder::forward_in(Space& home) // inner home + { + Int::ViewRanges r(outer); + GECODE_ME_CHECK(inner.inter_r(home,r)); + return ES_OK; + } + + template <> + void IntForwarder::forward_out(Space& home) // outer home + { + // it is guaranteed by design that after successful propagation the + // domain of the inner variable is a non-empty narrowing of the domain of + // the outer variable. therefore, we can simply replace the domain of + // the outer variable with the domain of the inner variable. + Int::ViewRanges r(inner); + outer.narrow_r(home, r, false); + } + + template <> + void IntForwarder::cancel(Space& home, Clause& c) + { outer.cancel(home, c, Int::PC_INT_DOM); } + + //========================================================================= + // BoolForwarder + //========================================================================= + + template <> + ExecStatus BoolForwarder::forward_in(Space& home) + { + Int::ViewRanges r(outer); + GECODE_ME_CHECK(inner.inter_r(home,r)); + return ES_OK; + } + + template <> + void BoolForwarder::forward_out(Space& home) + { + Int::ViewRanges r(inner); + outer.narrow_r(home, r, false); + } + + template <> + void BoolForwarder::cancel(Space& home, Clause& c) + { outer.cancel(home, c, Int::PC_INT_DOM); } + + //========================================================================= + // SetForwarder + //========================================================================= + + template <> + ExecStatus SetForwarder::forward_in(Space& home) + { + Set::GlbRanges gr(outer); + GECODE_ME_CHECK(inner.includeI(home,gr)); + Set::LubRanges lr(outer); + GECODE_ME_CHECK(inner.intersectI(home,lr)); + GECODE_ME_CHECK(inner.cardMin(home, outer.cardMin())); + GECODE_ME_CHECK(inner.cardMax(home, outer.cardMax())); + return ES_OK; + } + + template <> + void SetForwarder::forward_out(Space& home) + { + Set::GlbRanges gr(inner); + outer.includeI(home, gr); + Set::LubRanges lr(inner); + outer.intersectI(home, lr); + outer.cardMin(home, inner.cardMin()); + outer.cardMax(home, inner.cardMax()); + } + + template <> + void SetForwarder::cancel(Space& home, Clause& c) + { outer.cancel(home, c, Set::PC_SET_ANY); } + + //========================================================================= + // SubSpace + //========================================================================= + + void SubSpace::forward(IntView outer, IntView inner) + { + BasicForwarder* fwd = new (*this) IntForwarder(outer, inner); + fwd->next = forwarder; + forwarder = fwd; + } + + void SubSpace::forward(BoolView outer, BoolView inner) + { + BasicForwarder* fwd = new (*this) BoolForwarder(outer, inner); + fwd->next = forwarder; + forwarder = fwd; + } + + void SubSpace::forward(SetView outer, SetView inner) + { + BasicForwarder* fwd = new (*this) SetForwarder(outer, inner); + fwd->next = forwarder; + forwarder = fwd; + } + + ExecStatus SubSpace::forward_in() + { + for (BasicForwarder* p=forwarder; p!=NULL; p=p->next) + GECODE_ES_CHECK(p->forward_in(*this)); + return ES_OK; + } + + ExecStatus SubSpace::forward_out(Space& home) // outer home + { + for (BasicForwarder* p=forwarder; p!=NULL; p=p->next) + p->forward_out(home); + return ES_OK; + } + + SubSpace::SubSpace(): GenericSpace(), forwarder(NULL) {} + + SubSpace::SubSpace(bool share, SubSpace& s) + : GenericSpace(share, s), forwarder(NULL) + { + BasicForwarder** prev = &forwarder; + for (BasicForwarder* p=s.forwarder; p!=NULL; p=p->next) + { + BasicForwarder* fwd = p->copy(*s.homeDuringCloning, *this, share); + *prev = fwd; + prev = &fwd->next; + } + } + + Space* SubSpace::copy(bool share) + { return new SubSpace(share,*this); } + + SubSpace* SubSpace::copy(Space& home, bool share) + { homeDuringCloning = &home; return static_cast(clone(share)); } + + void SubSpace::cancel(Space& home, Clause& c) + { + for (BasicForwarder*p = forwarder; p!=NULL; p=p->next) + p->cancel(home, c); + } + + //========================================================================= + // Clause + //========================================================================= + + Clause::operator GenericSpace&() { return *subhome; } + Clause::operator Space&() { return *subhome; } + Clause::operator Home() { return *subhome; } + + GenericSpace* Clause::generic_space() const { return subhome; } + Space* Clause::space() const { return subhome; } + + Clause::Clause(Space& home_, Disjunctor disj_) + : Propagator(home_), disj(disj_), subhome(new SubSpace()) + { + disj.incr(); + } + + Clause::Clause(Space& home, bool share, Clause& c) + : Propagator(home, share, c), subhome(c.subhome->copy(home, share)) + { + disj.update(home, share, c.disj); + } + + Propagator* Clause::copy(Space& home, bool share) + { return new (home) Clause(home, share, *this); } + + void Clause::forward(Space& home, IntVar outer, IntVar inner) + { + IntView oview(outer); + IntView iview(inner); + subhome->forward(oview, iview); + oview.subscribe(home, *this, Int::PC_INT_DOM); + } + + void Clause::forward(Space& home, BoolVar outer, BoolVar inner) + { + BoolView oview(outer); + BoolView iview(inner); + subhome->forward(oview, iview); + oview.subscribe(home, *this, Int::PC_INT_DOM); + } + + void Clause::forward(Space& home, SetVar outer, SetVar inner) + { + SetView oview(outer); + SetView iview(inner); + subhome->forward(oview, iview); + oview.subscribe(home, *this, Set::PC_SET_ANY); + } + + ExecStatus Clause::forward_in() + { return subhome->forward_in(); } + + ExecStatus Clause::forward_out(Space& home) // outer home + { return subhome->forward_out(home); } + + inline bool Clause::committed() const { return disj.get() == 1; } + + ExecStatus Clause::propagate(Space& home, const ModEventDelta&) + { + if (forward_in() == ES_FAILED || + subhome->status() == SS_FAILED ) + { + if (committed()) return ES_FAILED; + disj.decr(); + return home.ES_SUBSUMED(*this); + } + if (committed()) forward_out(home); + // maybe do something clever about subsumption later + return ES_FIX; + } + + size_t Clause::dispose(Space& home) + { + subhome->cancel(home, *this); + delete subhome; + // the memory for the disj's LocalObject is not recovered + (void) Propagator::dispose(home); + return sizeof(*this); + } + + PropCost Clause::cost(const Space&, const ModEventDelta&) const + { + // consider a clause to be crazy expensive + return PropCost::crazy(PropCost::HI,10); + } +} + + //=========================================================================== + // Clause (user API) + //=========================================================================== + + Clause::Clause(generic_gecode::GenericSpace& home, Disjunctor disj) + : _home(home), _clause(new (home) Disjunctor_::Clause(home, disj)) {} + Clause::operator generic_gecode::GenericSpace&() { return *_clause; } + Clause::operator Space&() { return *_clause; } + Clause::operator Home() { return *_clause; } + generic_gecode::GenericSpace* Clause::generic_space() { return _clause->generic_space(); } + generic_gecode::GenericSpace* Clause::generic_parent() { return &_home; } + Space* Clause::space() { return _clause->space(); } + void Clause::forward(IntVar outer, IntVar inner) + { _clause->forward(_home, outer, inner); } + void Clause::forward(BoolVar outer, BoolVar inner) + { _clause->forward(_home, outer, inner); } + void Clause::forward(SetVar outer, SetVar inner) + { _clause->forward(_home, outer, inner); } + +} diff --git a/library/gecode/disjunctor1.yap b/library/gecode/disjunctor1.yap new file mode 100644 index 000000000..170a5fd84 --- /dev/null +++ b/library/gecode/disjunctor1.yap @@ -0,0 +1,37 @@ +%% -*- prolog -*- +%%============================================================================= +%% 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 . +%%============================================================================= + +:- use_module(gecode). + +disjunctor1(X_,Y_) :- + Space := space, + [X,Y] := intvars(Space,2,0,3), + D := disjunctor(Space), + C1 := clause(D), + [X1,Y1] := intvars(C1,2,0,3), + C1 += rel(X1,'IRT_EQ',1), + C1 += rel(Y1,'IRT_EQ',1), + C1 += forward([X,Y],[X1,Y1]), + C2 := clause(D), + [X2,Y2] := intvars(C2,2,0,3), + C2 += rel(X2,'IRT_EQ',2), + C2 += rel(Y2,'IRT_EQ',2), + C2 += forward([X,Y],[X2,Y2]), + Space += branch([X,Y],'INT_VAR_SIZE_MIN','INT_VAL_MIN'), + SolSpace := search(Space), + [X_,Y_] := val(SolSpace,[X,Y]). diff --git a/library/gecode/disjunctor2.yap b/library/gecode/disjunctor2.yap new file mode 100644 index 000000000..cf4fcd6a6 --- /dev/null +++ b/library/gecode/disjunctor2.yap @@ -0,0 +1,37 @@ +%% -*- prolog -*- +%%============================================================================= +%% 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 . +%%============================================================================= + +:- use_module(gecode). + +disjunctor2(X_,Y_) :- + Space := space, + [X,Y] := intvars(Space,2,0,3), + D := disjunctor(Space), + C1 := clause(D), + [X1,Y1] := intvars(C1,2,0,3), + C1 += forward([X,Y],[X1,Y1]), + C1 += rel(X1,'IRT_EQ',0), + C1 += rel(Y1,'IRT_EQ',0), + C2 := clause(D), + [X2,Y2] := intvars(C2,2,0,3), + C2 += forward([X,Y],[X2,Y2]), + Z2 := intvar(C2,1,2), + C2 += linear([-1,1,1],[X2,Y2,Z2],'IRT_EQ',0), + Space += branch([X,Y],'INT_VAR_SIZE_MIN','INT_VAL_MIN'), + SolSpace := search(Space), + [X_,Y_] := val(SolSpace,[X,Y]). diff --git a/library/gecode/extractor/Doxyfile.in b/library/gecode/extractor/Doxyfile.in new file mode 100644 index 000000000..e20ff3563 --- /dev/null +++ b/library/gecode/extractor/Doxyfile.in @@ -0,0 +1,1716 @@ +# Doxyfile 1.7.4 + +# This file describes the settings to be used by the documentation system +# doxygen (www.doxygen.org) for a project. +# +# All text after a hash (#) is considered a comment and will be ignored. +# The format is: +# TAG = value [value, ...] +# For lists items can also be appended using: +# TAG += value [value, ...] +# Values that contain spaces should be placed between quotes (" "). + +#--------------------------------------------------------------------------- +# Project related configuration options +#--------------------------------------------------------------------------- + +# This tag specifies the encoding used for all characters in the config file +# that follow. The default is UTF-8 which is also the encoding used for all +# text before the first occurrence of this tag. Doxygen uses libiconv (or the +# iconv built into libc) for the transcoding. See +# http://www.gnu.org/software/libiconv for the list of possible encodings. + +DOXYFILE_ENCODING = UTF-8 + +# The PROJECT_NAME tag is a single word (or a sequence of words surrounded +# by quotes) that should identify the project. + +PROJECT_NAME = Gecode + +# The PROJECT_NUMBER tag can be used to enter a project or revision number. +# This could be handy for archiving the generated documentation or +# if some version control system is used. + +PROJECT_NUMBER = + +# Using the PROJECT_BRIEF tag one can provide an optional one line description +# for a project that appears at the top of each page and should give viewer +# a quick idea about the purpose of the project. Keep the description short. + +PROJECT_BRIEF = + +# With the PROJECT_LOGO tag one can specify an logo or icon that is +# included in the documentation. The maximum height of the logo should not +# exceed 55 pixels and the maximum width should not exceed 200 pixels. +# Doxygen will copy the logo to the output directory. + +PROJECT_LOGO = + +# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) +# base path where the generated documentation will be put. +# If a relative path is entered, it will be relative to the location +# where doxygen was started. If left blank the current directory will be used. + +OUTPUT_DIRECTORY = + +# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create +# 4096 sub-directories (in 2 levels) under the output directory of each output +# format and will distribute the generated files over these directories. +# Enabling this option can be useful when feeding doxygen a huge amount of +# source files, where putting all generated files in the same directory would +# otherwise cause performance problems for the file system. + +CREATE_SUBDIRS = NO + +# The OUTPUT_LANGUAGE tag is used to specify the language in which all +# documentation generated by doxygen is written. Doxygen will use this +# information to generate all constant output in the proper language. +# The default language is English, other supported languages are: +# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, +# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German, +# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English +# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian, +# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrillic, Slovak, +# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese. + +OUTPUT_LANGUAGE = English + +# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will +# include brief member descriptions after the members that are listed in +# the file and class documentation (similar to JavaDoc). +# Set to NO to disable this. + +BRIEF_MEMBER_DESC = YES + +# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend +# the brief description of a member or function before the detailed description. +# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the +# brief descriptions will be completely suppressed. + +REPEAT_BRIEF = YES + +# This tag implements a quasi-intelligent brief description abbreviator +# that is used to form the text in various listings. Each string +# in this list, if found as the leading text of the brief description, will be +# stripped from the text and the result after processing the whole list, is +# used as the annotated text. Otherwise, the brief description is used as-is. +# If left blank, the following values are used ("$name" is automatically +# replaced with the name of the entity): "The $name class" "The $name widget" +# "The $name file" "is" "provides" "specifies" "contains" +# "represents" "a" "an" "the" + +ABBREVIATE_BRIEF = + +# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then +# Doxygen will generate a detailed section even if there is only a brief +# description. + +ALWAYS_DETAILED_SEC = NO + +# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all +# inherited members of a class in the documentation of that class as if those +# members were ordinary class members. Constructors, destructors and assignment +# operators of the base classes will not be shown. + +INLINE_INHERITED_MEMB = NO + +# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full +# path before files name in the file list and in the header files. If set +# to NO the shortest path that makes the file name unique will be used. + +FULL_PATH_NAMES = YES + +# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag +# can be used to strip a user-defined part of the path. Stripping is +# only done if one of the specified strings matches the left-hand part of +# the path. The tag can be used to show relative paths in the file list. +# If left blank the directory from which doxygen is run is used as the +# path to strip. + +STRIP_FROM_PATH = + +# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of +# the path mentioned in the documentation of a class, which tells +# the reader which header file to include in order to use a class. +# If left blank only the name of the header file containing the class +# definition is used. Otherwise one should specify the include paths that +# are normally passed to the compiler using the -I flag. + +STRIP_FROM_INC_PATH = + +# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter +# (but less readable) file names. This can be useful if your file system +# doesn't support long names like on DOS, Mac, or CD-ROM. + +SHORT_NAMES = NO + +# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen +# will interpret the first line (until the first dot) of a JavaDoc-style +# comment as the brief description. If set to NO, the JavaDoc +# comments will behave just like regular Qt-style comments +# (thus requiring an explicit @brief command for a brief description.) + +JAVADOC_AUTOBRIEF = NO + +# If the QT_AUTOBRIEF tag is set to YES then Doxygen will +# interpret the first line (until the first dot) of a Qt-style +# comment as the brief description. If set to NO, the comments +# will behave just like regular Qt-style comments (thus requiring +# an explicit \brief command for a brief description.) + +QT_AUTOBRIEF = NO + +# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen +# treat a multi-line C++ special comment block (i.e. a block of //! or /// +# comments) as a brief description. This used to be the default behaviour. +# The new default is to treat a multi-line C++ comment block as a detailed +# description. Set this tag to YES if you prefer the old behaviour instead. + +MULTILINE_CPP_IS_BRIEF = NO + +# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented +# member inherits the documentation from any documented member that it +# re-implements. + +INHERIT_DOCS = YES + +# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce +# a new page for each member. If set to NO, the documentation of a member will +# be part of the file/class/namespace that contains it. + +SEPARATE_MEMBER_PAGES = NO + +# The TAB_SIZE tag can be used to set the number of spaces in a tab. +# Doxygen uses this value to replace tabs by spaces in code fragments. + +TAB_SIZE = 8 + +# This tag can be used to specify a number of aliases that acts +# as commands in the documentation. An alias has the form "name=value". +# For example adding "sideeffect=\par Side Effects:\n" will allow you to +# put the command \sideeffect (or @sideeffect) in the documentation, which +# will result in a user-defined paragraph with heading "Side Effects:". +# You can put \n's in the value part of an alias to insert newlines. + +ALIASES = + +# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C +# sources only. Doxygen will then generate output that is more tailored for C. +# For instance, some of the names that are used will be different. The list +# of all members will be omitted, etc. + +OPTIMIZE_OUTPUT_FOR_C = NO + +# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java +# sources only. Doxygen will then generate output that is more tailored for +# Java. For instance, namespaces will be presented as packages, qualified +# scopes will look different, etc. + +OPTIMIZE_OUTPUT_JAVA = NO + +# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran +# sources only. Doxygen will then generate output that is more tailored for +# Fortran. + +OPTIMIZE_FOR_FORTRAN = NO + +# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL +# sources. Doxygen will then generate output that is tailored for +# VHDL. + +OPTIMIZE_OUTPUT_VHDL = NO + +# Doxygen selects the parser to use depending on the extension of the files it +# parses. With this tag you can assign which parser to use for a given extension. +# Doxygen has a built-in mapping, but you can override or extend it using this +# tag. The format is ext=language, where ext is a file extension, and language +# is one of the parsers supported by doxygen: IDL, Java, Javascript, CSharp, C, +# C++, D, PHP, Objective-C, Python, Fortran, VHDL, C, C++. For instance to make +# doxygen treat .inc files as Fortran files (default is PHP), and .f files as C +# (default is Fortran), use: inc=Fortran f=C. Note that for custom extensions +# you also need to set FILE_PATTERNS otherwise the files are not read by doxygen. + +EXTENSION_MAPPING = + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should +# set this tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); v.s. +# func(std::string) {}). This also makes the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. + +BUILTIN_STL_SUPPORT = NO + +# If you use Microsoft's C++/CLI language, you should set this option to YES to +# enable parsing support. + +CPP_CLI_SUPPORT = NO + +# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only. +# Doxygen will parse them like normal C++ but will assume all classes use public +# instead of private inheritance when no explicit protection keyword is present. + +SIP_SUPPORT = NO + +# For Microsoft's IDL there are propget and propput attributes to indicate getter +# and setter methods for a property. Setting this option to YES (the default) +# will make doxygen replace the get and set methods by a property in the +# documentation. This will only work if the methods are indeed getting or +# setting a simple type. If this is not the case, or you want to show the +# methods anyway, you should set this option to NO. + +IDL_PROPERTY_SUPPORT = YES + +# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC +# tag is set to YES, then doxygen will reuse the documentation of the first +# member in the group (if any) for the other members of the group. By default +# all members of a group must be documented explicitly. + +DISTRIBUTE_GROUP_DOC = NO + +# Set the SUBGROUPING tag to YES (the default) to allow class member groups of +# the same type (for instance a group of public functions) to be put as a +# subgroup of that type (e.g. under the Public Functions section). Set it to +# NO to prevent subgrouping. Alternatively, this can be done per class using +# the \nosubgrouping command. + +SUBGROUPING = YES + +# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and +# unions are shown inside the group in which they are included (e.g. using +# @ingroup) instead of on a separate page (for HTML and Man pages) or +# section (for LaTeX and RTF). + +INLINE_GROUPED_CLASSES = NO + +# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum +# is documented as struct, union, or enum with the name of the typedef. So +# typedef struct TypeS {} TypeT, will appear in the documentation as a struct +# with name TypeT. When disabled the typedef will appear as a member of a file, +# namespace, or class. And the struct will be named TypeS. This can typically +# be useful for C code in case the coding convention dictates that all compound +# types are typedef'ed and only the typedef is referenced, never the tag name. + +TYPEDEF_HIDES_STRUCT = NO + +# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to +# determine which symbols to keep in memory and which to flush to disk. +# When the cache is full, less often used symbols will be written to disk. +# For small to medium size projects (<1000 input files) the default value is +# probably good enough. For larger projects a too small cache size can cause +# doxygen to be busy swapping symbols to and from disk most of the time +# causing a significant performance penalty. +# If the system has enough physical memory increasing the cache will improve the +# performance by keeping more symbols in memory. Note that the value works on +# a logarithmic scale so increasing the size by one will roughly double the +# memory usage. The cache size is given by this formula: +# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0, +# corresponding to a cache size of 2^16 = 65536 symbols + +SYMBOL_CACHE_SIZE = 0 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in +# documentation are documented, even if no documentation was available. +# Private class members and static file members will be hidden unless +# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES all private members of a class +# will be included in the documentation. + +EXTRACT_PRIVATE = NO + +# If the EXTRACT_STATIC tag is set to YES all static members of a file +# will be included in the documentation. + +EXTRACT_STATIC = NO + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) +# defined locally in source files will be included in the documentation. +# If set to NO only classes defined in header files are included. + +EXTRACT_LOCAL_CLASSES = YES + +# This flag is only useful for Objective-C code. When set to YES local +# methods, which are defined in the implementation section but not in +# the interface are included in the documentation. +# If set to NO (the default) only methods in the interface are included. + +EXTRACT_LOCAL_METHODS = NO + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base +# name of the file that contains the anonymous namespace. By default +# anonymous namespaces are hidden. + +EXTRACT_ANON_NSPACES = NO + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all +# undocumented members of documented classes, files or namespaces. +# If set to NO (the default) these members will be included in the +# various overviews, but no documentation section is generated. +# This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_MEMBERS = NO + +# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. +# If set to NO (the default) these classes will be included in the various +# overviews. This option has no effect if EXTRACT_ALL is enabled. + +HIDE_UNDOC_CLASSES = NO + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all +# friend (class|struct|union) declarations. +# If set to NO (the default) these declarations will be included in the +# documentation. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any +# documentation blocks found inside the body of a function. +# If set to NO (the default) these blocks will be appended to the +# function's detailed documentation block. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation +# that is typed after a \internal command is included. If the tag is set +# to NO (the default) then the documentation will be excluded. +# Set it to YES to include the internal documentation. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate +# file names in lower-case letters. If set to YES upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen +# will show members with their full class and namespace scopes in the +# documentation. If set to YES the scope will be hidden. + +HIDE_SCOPE_NAMES = NO + +# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen +# will put a list of the files that are included by a file in the documentation +# of that file. + +SHOW_INCLUDE_FILES = YES + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen +# will list include files with double quotes in the documentation +# rather than with sharp brackets. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES (the default) then a tag [inline] +# is inserted in the documentation for inline members. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen +# will sort the (detailed) documentation of file and class members +# alphabetically by member name. If set to NO the members will appear in +# declaration order. + +SORT_MEMBER_DOCS = YES + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the +# brief documentation of file, namespace and class members alphabetically +# by member name. If set to NO (the default) the members will appear in +# declaration order. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen +# will sort the (brief and detailed) documentation of class members so that +# constructors and destructors are listed first. If set to NO (the default) +# the constructors will appear in the respective orders defined by +# SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. +# This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO +# and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the +# hierarchy of group names into alphabetical order. If set to NO (the default) +# the group names will appear in their defined order. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be +# sorted by fully-qualified names, including namespaces. If set to +# NO (the default), the class list will be sorted only by class name, +# not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the +# alphabetical list. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to +# do proper type resolution of all parameters of a function it will reject a +# match between the prototype and the implementation of a member function even +# if there is only one candidate or it is obvious which candidate to choose +# by doing a simple string match. By disabling STRICT_PROTO_MATCHING doxygen +# will still accept a match between prototype and implementation in such cases. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or +# disable (NO) the todo list. This list is created by putting \todo +# commands in the documentation. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or +# disable (NO) the test list. This list is created by putting \test +# commands in the documentation. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or +# disable (NO) the bug list. This list is created by putting \bug +# commands in the documentation. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or +# disable (NO) the deprecated list. This list is created by putting +# \deprecated commands in the documentation. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional +# documentation sections, marked by \if sectionname ... \endif. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines +# the initial value of a variable or macro consists of for it to appear in +# the documentation. If the initializer consists of more lines than specified +# here it will be hidden. Use a value of 0 to hide initializers completely. +# The appearance of the initializer of individual variables and macros in the +# documentation can be controlled using \showinitializer or \hideinitializer +# command in the documentation regardless of this setting. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated +# at the bottom of the documentation of classes and structs. If set to YES the +# list will mention the files that were used to generate the documentation. + +SHOW_USED_FILES = YES + +# If the sources in your project are distributed over multiple directories +# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy +# in the documentation. The default is NO. + +SHOW_DIRECTORIES = NO + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. +# This will remove the Files entry from the Quick Index and from the +# Folder Tree View (if specified). The default is YES. + +SHOW_FILES = YES + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the +# Namespaces page. +# This will remove the Namespaces entry from the Quick Index +# and from the Folder Tree View (if specified). The default is YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command , where is the value of +# the FILE_VERSION_FILTER tag, and is the name of an input file +# provided by doxygen. Whatever the program writes to standard output +# is used as the file version. See the manual for examples. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. The create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. +# You can optionally specify a file name after the option, if omitted +# DoxygenLayout.xml will be used as the name of the layout file. + +LAYOUT_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated +# by doxygen. Possible values are YES and NO. If left blank NO is used. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated by doxygen. Possible values are YES and NO. If left blank +# NO is used. + +WARNINGS = YES + +# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings +# for undocumented members. If EXTRACT_ALL is set to YES then this flag will +# automatically be disabled. + +WARN_IF_UNDOCUMENTED = YES + +# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some +# parameters in a documented function, or documenting parameters that +# don't exist or using markup commands wrongly. + +WARN_IF_DOC_ERROR = YES + +# The WARN_NO_PARAMDOC option can be enabled to get warnings for +# functions that are documented, but have no documentation for their parameters +# or return value. If set to NO (the default) doxygen will only warn about +# wrong or incomplete parameter documentation, but not about the absence of +# documentation. + +WARN_NO_PARAMDOC = NO + +# The WARN_FORMAT tag determines the format of the warning messages that +# doxygen can produce. The string should contain the $file, $line, and $text +# tags, which will be replaced by the file and line number from which the +# warning originated and the warning text. Optionally the format may contain +# $version, which will be replaced by the version of the file (if it could +# be obtained via FILE_VERSION_FILTER) + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning +# and error messages should be written. If left blank the output is written +# to stderr. + +WARN_LOGFILE = + +#--------------------------------------------------------------------------- +# configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag can be used to specify the files and/or directories that contain +# documented source files. You may enter file names like "myfile.cpp" or +# directories like "/usr/src/myproject". Separate the files or directories +# with spaces. + +INPUT = @GECODEDIR@ + +# This tag can be used to specify the character encoding of the source files +# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is +# also the default input encoding. Doxygen uses libiconv (or the iconv built +# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for +# the list of possible encodings. + +INPUT_ENCODING = ISO-8859-1 + +# If the value of the INPUT tag contains directories, you can use the +# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank the following patterns are tested: +# *.c *.cc *.cxx *.cpp *.c++ *.d *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh +# *.hxx *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.dox *.py +# *.f90 *.f *.for *.vhd *.vhdl + +FILE_PATTERNS = *.hh *.hpp + +# The RECURSIVE tag can be used to turn specify whether or not subdirectories +# should be searched for input files as well. Possible values are YES and NO. +# If left blank NO is used. + +RECURSIVE = YES + +# The EXCLUDE tag can be used to specify files and/or directories that should +# excluded from the INPUT source files. This way you can easily exclude a +# subdirectory from a directory tree whose root is specified with the INPUT tag. + +EXCLUDE = + +# The EXCLUDE_SYMLINKS tag can be used select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. + +EXCLUDE_SYMLINKS = NO + +# If the value of the INPUT tag contains directories, you can use the +# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude +# certain files from those directories. Note that the wildcards are matched +# against the file with absolute path, so to exclude all test directories +# for example use the pattern */test/* + +EXCLUDE_PATTERNS = + +# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names +# (namespaces, classes, functions, etc.) that should be excluded from the +# output. The symbol name can be a fully qualified name, a word, or if the +# wildcard * is used, a substring. Examples: ANamespace, AClass, +# AClass::ANamespace, ANamespace::*Test + +EXCLUDE_SYMBOLS = + +# The EXAMPLE_PATH tag can be used to specify one or more files or +# directories that contain example code fragments that are included (see +# the \include command). + +EXAMPLE_PATH = + +# If the value of the EXAMPLE_PATH tag contains directories, you can use the +# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp +# and *.h) to filter out the source-files in the directories. If left +# blank all files are included. + +EXAMPLE_PATTERNS = + +# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be +# searched for input files to be used with the \include or \dontinclude +# commands irrespective of the value of the RECURSIVE tag. +# Possible values are YES and NO. If left blank NO is used. + +EXAMPLE_RECURSIVE = NO + +# The IMAGE_PATH tag can be used to specify one or more files or +# directories that contain image that are included in the documentation (see +# the \image command). + +IMAGE_PATH = + +# The INPUT_FILTER tag can be used to specify a program that doxygen should +# invoke to filter for each input file. Doxygen will invoke the filter program +# by executing (via popen()) the command , where +# is the value of the INPUT_FILTER tag, and is the name of an +# input file. Doxygen will then use the output that the filter program writes +# to standard output. +# If FILTER_PATTERNS is specified, this tag will be +# ignored. + +INPUT_FILTER = + +# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern +# basis. +# Doxygen will compare the file name with each pattern and apply the +# filter if there is a match. +# The filters are a list of the form: +# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further +# info on how filters are used. If FILTER_PATTERNS is empty or if +# non of the patterns match the file name, INPUT_FILTER is applied. + +FILTER_PATTERNS = + +# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using +# INPUT_FILTER) will be used to filter the input files when producing source +# files to browse (i.e. when SOURCE_BROWSER is set to YES). + +FILTER_SOURCE_FILES = NO + +# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file +# pattern. A pattern will override the setting for FILTER_PATTERN (if any) +# and it is also possible to disable source filtering for a specific pattern +# using *.ext= (so without naming a filter). This option only has effect when +# FILTER_SOURCE_FILES is enabled. + +FILTER_SOURCE_PATTERNS = + +#--------------------------------------------------------------------------- +# configuration options related to source browsing +#--------------------------------------------------------------------------- + +# If the SOURCE_BROWSER tag is set to YES then a list of source files will +# be generated. Documented entities will be cross-referenced with these sources. +# Note: To get rid of all source code in the generated output, make sure also +# VERBATIM_HEADERS is set to NO. + +SOURCE_BROWSER = NO + +# Setting the INLINE_SOURCES tag to YES will include the body +# of functions and classes directly in the documentation. + +INLINE_SOURCES = NO + +# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct +# doxygen to hide any special comment blocks from generated source code +# fragments. Normal C and C++ comments will always remain visible. + +STRIP_CODE_COMMENTS = YES + +# If the REFERENCED_BY_RELATION tag is set to YES +# then for each documented function all documented +# functions referencing it will be listed. + +REFERENCED_BY_RELATION = NO + +# If the REFERENCES_RELATION tag is set to YES +# then for each documented function all documented entities +# called/used by that function will be listed. + +REFERENCES_RELATION = NO + +# If the REFERENCES_LINK_SOURCE tag is set to YES (the default) +# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from +# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will +# link to the source code. +# Otherwise they will link to the documentation. + +REFERENCES_LINK_SOURCE = YES + +# If the USE_HTAGS tag is set to YES then the references to source code +# will point to the HTML generated by the htags(1) tool instead of doxygen +# built-in source browser. The htags tool is part of GNU's global source +# tagging system (see http://www.gnu.org/software/global/global.html). You +# will need version 4.8.6 or higher. + +USE_HTAGS = NO + +# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen +# will generate a verbatim copy of the header file for each class for +# which an include is specified. Set to NO to disable this. + +VERBATIM_HEADERS = YES + +#--------------------------------------------------------------------------- +# configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- + +# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index +# of all compounds will be generated. Enable this if the project +# contains a lot of classes, structs, unions or interfaces. + +ALPHABETICAL_INDEX = YES + +# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then +# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns +# in which this list will be split (can be a number in the range [1..20]) + +COLS_IN_ALPHA_INDEX = 5 + +# In case all classes in a project start with a common prefix, all +# classes will be put under the same header in the alphabetical index. +# The IGNORE_PREFIX tag can be used to specify one or more prefixes that +# should be ignored while generating the index headers. + +IGNORE_PREFIX = + +#--------------------------------------------------------------------------- +# configuration options related to the HTML output +#--------------------------------------------------------------------------- + +# If the GENERATE_HTML tag is set to YES (the default) Doxygen will +# generate HTML output. + +GENERATE_HTML = NO + +# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `html' will be used as the default path. + +HTML_OUTPUT = html + +# The HTML_FILE_EXTENSION tag can be used to specify the file extension for +# each generated HTML page (for example: .htm,.php,.asp). If it is left blank +# doxygen will generate files with .html extension. + +HTML_FILE_EXTENSION = .html + +# The HTML_HEADER tag can be used to specify a personal HTML header for +# each generated HTML page. If it is left blank doxygen will generate a +# standard header. Note that when using a custom header you are responsible +# for the proper inclusion of any scripts and style sheets that doxygen +# needs, which is dependent on the configuration options used. +# It is adviced to generate a default header using "doxygen -w html +# header.html footer.html stylesheet.css YourConfigFile" and then modify +# that header. Note that the header is subject to change so you typically +# have to redo this when upgrading to a newer version of doxygen or when changing the value of configuration settings such as GENERATE_TREEVIEW! + +HTML_HEADER = + +# The HTML_FOOTER tag can be used to specify a personal HTML footer for +# each generated HTML page. If it is left blank doxygen will generate a +# standard footer. + +HTML_FOOTER = + +# The HTML_STYLESHEET tag can be used to specify a user-defined cascading +# style sheet that is used by each HTML page. It can be used to +# fine-tune the look of the HTML output. If the tag is left blank doxygen +# will generate a default style sheet. Note that doxygen will try to copy +# the style sheet file to the HTML output directory, so don't put your own +# stylesheet in the HTML output directory as well, or it will be erased! + +HTML_STYLESHEET = + +# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or +# other source files which should be copied to the HTML output directory. Note +# that these files will be copied to the base HTML output directory. Use the +# $relpath$ marker in the HTML_HEADER and/or HTML_FOOTER files to load these +# files. In the HTML_STYLESHEET file, use the file name only. Also note that +# the files will be copied as-is; there are no commands or markers available. + +HTML_EXTRA_FILES = + +# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. +# Doxygen will adjust the colors in the stylesheet and background images +# according to this color. Hue is specified as an angle on a colorwheel, +# see http://en.wikipedia.org/wiki/Hue for more information. +# For instance the value 0 represents red, 60 is yellow, 120 is green, +# 180 is cyan, 240 is blue, 300 purple, and 360 is red again. +# The allowed range is 0 to 359. + +HTML_COLORSTYLE_HUE = 220 + +# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of +# the colors in the HTML output. For a value of 0 the output will use +# grayscales only. A value of 255 will produce the most vivid colors. + +HTML_COLORSTYLE_SAT = 100 + +# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to +# the luminance component of the colors in the HTML output. Values below +# 100 gradually make the output lighter, whereas values above 100 make +# the output darker. The value divided by 100 is the actual gamma applied, +# so 80 represents a gamma of 0.8, The value 220 represents a gamma of 2.2, +# and 100 does not change the gamma. + +HTML_COLORSTYLE_GAMMA = 80 + +# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML +# page will contain the date and time when the page was generated. Setting +# this to NO can help when comparing the output of multiple runs. + +HTML_TIMESTAMP = YES + +# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, +# files or namespaces will be aligned in HTML using tables. If set to +# NO a bullet list will be used. + +HTML_ALIGN_MEMBERS = YES + +# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML +# documentation will contain sections that can be hidden and shown after the +# page has loaded. For this to work a browser that supports +# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox +# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). + +HTML_DYNAMIC_SECTIONS = NO + +# If the GENERATE_DOCSET tag is set to YES, additional index files +# will be generated that can be used as input for Apple's Xcode 3 +# integrated development environment, introduced with OSX 10.5 (Leopard). +# To create a documentation set, doxygen will generate a Makefile in the +# HTML output directory. Running make will produce the docset in that +# directory and running "make install" will install the docset in +# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find +# it at startup. +# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html +# for more information. + +GENERATE_DOCSET = NO + +# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the +# feed. A documentation feed provides an umbrella under which multiple +# documentation sets from a single provider (such as a company or product suite) +# can be grouped. + +DOCSET_FEEDNAME = "Doxygen generated docs" + +# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that +# should uniquely identify the documentation set bundle. This should be a +# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen +# will append .docset to the name. + +DOCSET_BUNDLE_ID = org.doxygen.Project + +# When GENERATE_PUBLISHER_ID tag specifies a string that should uniquely identify +# the documentation publisher. This should be a reverse domain-name style +# string, e.g. com.mycompany.MyDocSet.documentation. + +DOCSET_PUBLISHER_ID = org.doxygen.Publisher + +# The GENERATE_PUBLISHER_NAME tag identifies the documentation publisher. + +DOCSET_PUBLISHER_NAME = Publisher + +# If the GENERATE_HTMLHELP tag is set to YES, additional index files +# will be generated that can be used as input for tools like the +# Microsoft HTML help workshop to generate a compiled HTML help file (.chm) +# of the generated HTML documentation. + +GENERATE_HTMLHELP = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can +# be used to specify the file name of the resulting .chm file. You +# can add a path in front of the file if the result should not be +# written to the html output directory. + +CHM_FILE = + +# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can +# be used to specify the location (absolute path including file name) of +# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run +# the HTML help compiler on the generated index.hhp. + +HHC_LOCATION = + +# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag +# controls if a separate .chi index file is generated (YES) or that +# it should be included in the master .chm file (NO). + +GENERATE_CHI = NO + +# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING +# is used to encode HtmlHelp index (hhk), content (hhc) and project file +# content. + +CHM_INDEX_ENCODING = + +# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag +# controls whether a binary table of contents is generated (YES) or a +# normal table of contents (NO) in the .chm file. + +BINARY_TOC = NO + +# The TOC_EXPAND flag can be set to YES to add extra items for group members +# to the contents of the HTML help documentation and to the tree view. + +TOC_EXPAND = NO + +# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and +# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated +# that can be used as input for Qt's qhelpgenerator to generate a +# Qt Compressed Help (.qch) of the generated HTML documentation. + +GENERATE_QHP = NO + +# If the QHG_LOCATION tag is specified, the QCH_FILE tag can +# be used to specify the file name of the resulting .qch file. +# The path specified is relative to the HTML output folder. + +QCH_FILE = + +# The QHP_NAMESPACE tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#namespace + +QHP_NAMESPACE = org.doxygen.Project + +# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating +# Qt Help Project output. For more information please see +# http://doc.trolltech.com/qthelpproject.html#virtual-folders + +QHP_VIRTUAL_FOLDER = doc + +# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to +# add. For more information please see +# http://doc.trolltech.com/qthelpproject.html#custom-filters + +QHP_CUST_FILTER_NAME = + +# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the +# custom filter to add. For more information please see +# +# Qt Help Project / Custom Filters. + +QHP_CUST_FILTER_ATTRS = + +# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this +# project's +# filter section matches. +# +# Qt Help Project / Filter Attributes. + +QHP_SECT_FILTER_ATTRS = + +# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can +# be used to specify the location of Qt's qhelpgenerator. +# If non-empty doxygen will try to run qhelpgenerator on the generated +# .qhp file. + +QHG_LOCATION = + +# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files +# will be generated, which together with the HTML files, form an Eclipse help +# plugin. To install this plugin and make it available under the help contents +# menu in Eclipse, the contents of the directory containing the HTML and XML +# files needs to be copied into the plugins directory of eclipse. The name of +# the directory within the plugins directory should be the same as +# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before +# the help appears. + +GENERATE_ECLIPSEHELP = NO + +# A unique identifier for the eclipse help plugin. When installing the plugin +# the directory name containing the HTML and XML files should also have +# this name. + +ECLIPSE_DOC_ID = org.doxygen.Project + +# The DISABLE_INDEX tag can be used to turn on/off the condensed index at +# top of each HTML page. The value NO (the default) enables the index and +# the value YES disables it. + +DISABLE_INDEX = NO + +# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values +# (range [0,1..20]) that doxygen will group on one line in the generated HTML +# documentation. Note that a value of 0 will completely suppress the enum +# values from appearing in the overview section. + +ENUM_VALUES_PER_LINE = 4 + +# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index +# structure should be generated to display hierarchical information. +# If the tag value is set to YES, a side panel will be generated +# containing a tree-like index structure (just like the one that +# is generated for HTML Help). For this to work a browser that supports +# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser). +# Windows users are probably better off using the HTML help feature. + +GENERATE_TREEVIEW = NO + +# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories, +# and Class Hierarchy pages using a tree view instead of an ordered list. + +USE_INLINE_TREES = NO + +# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be +# used to set the initial width (in pixels) of the frame in which the tree +# is shown. + +TREEVIEW_WIDTH = 250 + +# When the EXT_LINKS_IN_WINDOW option is set to YES doxygen will open +# links to external symbols imported via tag files in a separate window. + +EXT_LINKS_IN_WINDOW = NO + +# Use this tag to change the font size of Latex formulas included +# as images in the HTML documentation. The default is 10. Note that +# when you change the font size after a successful doxygen run you need +# to manually remove any form_*.png images from the HTML output directory +# to force them to be regenerated. + +FORMULA_FONTSIZE = 10 + +# Use the FORMULA_TRANPARENT tag to determine whether or not the images +# generated for formulas are transparent PNGs. Transparent PNGs are +# not supported properly for IE 6.0, but are supported on all modern browsers. +# Note that when changing this option you need to delete any form_*.png files +# in the HTML output before the changes have effect. + +FORMULA_TRANSPARENT = YES + +# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax +# (see http://www.mathjax.org) which uses client side Javascript for the +# rendering instead of using prerendered bitmaps. Use this if you do not +# have LaTeX installed or if you want to formulas look prettier in the HTML +# output. When enabled you also need to install MathJax separately and +# configure the path to it using the MATHJAX_RELPATH option. + +USE_MATHJAX = NO + +# When MathJax is enabled you need to specify the location relative to the +# HTML output directory using the MATHJAX_RELPATH option. The destination +# directory should contain the MathJax.js script. For instance, if the mathjax +# directory is located at the same level as the HTML output directory, then +# MATHJAX_RELPATH should be ../mathjax. The default value points to the +# mathjax.org site, so you can quickly see the result without installing +# MathJax, but it is strongly recommended to install a local copy of MathJax +# before deployment. + +MATHJAX_RELPATH = http://www.mathjax.org/mathjax + +# When the SEARCHENGINE tag is enabled doxygen will generate a search box +# for the HTML output. The underlying search engine uses javascript +# and DHTML and should work on any modern browser. Note that when using +# HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets +# (GENERATE_DOCSET) there is already a search function so this one should +# typically be disabled. For large projects the javascript based search engine +# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution. + +SEARCHENGINE = YES + +# When the SERVER_BASED_SEARCH tag is enabled the search engine will be +# implemented using a PHP enabled web server instead of at the web client +# using Javascript. Doxygen will generate the search PHP script and index +# file to put on the web server. The advantage of the server +# based approach is that it scales better to large projects and allows +# full text search. The disadvantages are that it is more difficult to setup +# and does not have live searching capabilities. + +SERVER_BASED_SEARCH = NO + +#--------------------------------------------------------------------------- +# configuration options related to the LaTeX output +#--------------------------------------------------------------------------- + +# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will +# generate Latex output. + +GENERATE_LATEX = NO + +# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `latex' will be used as the default path. + +LATEX_OUTPUT = latex + +# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be +# invoked. If left blank `latex' will be used as the default command name. +# Note that when enabling USE_PDFLATEX this option is only used for +# generating bitmaps for formulas in the HTML output, but not in the +# Makefile that is written to the output directory. + +LATEX_CMD_NAME = latex + +# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to +# generate index for LaTeX. If left blank `makeindex' will be used as the +# default command name. + +MAKEINDEX_CMD_NAME = makeindex + +# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact +# LaTeX documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_LATEX = NO + +# The PAPER_TYPE tag can be used to set the paper type that is used +# by the printer. Possible values are: a4, letter, legal and +# executive. If left blank a4wide will be used. + +PAPER_TYPE = a4 + +# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX +# packages that should be included in the LaTeX output. + +EXTRA_PACKAGES = + +# The LATEX_HEADER tag can be used to specify a personal LaTeX header for +# the generated latex document. The header should contain everything until +# the first chapter. If it is left blank doxygen will generate a +# standard header. Notice: only use this tag if you know what you are doing! + +LATEX_HEADER = + +# The LATEX_FOOTER tag can be used to specify a personal LaTeX footer for +# the generated latex document. The footer should contain everything after +# the last chapter. If it is left blank doxygen will generate a +# standard footer. Notice: only use this tag if you know what you are doing! + +LATEX_FOOTER = + +# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated +# is prepared for conversion to pdf (using ps2pdf). The pdf file will +# contain links (just like the HTML output) instead of page references +# This makes the output suitable for online browsing using a pdf viewer. + +PDF_HYPERLINKS = YES + +# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of +# plain latex in the generated Makefile. Set this option to YES to get a +# higher quality PDF documentation. + +USE_PDFLATEX = YES + +# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. +# command to the generated LaTeX files. This will instruct LaTeX to keep +# running if errors occur, instead of asking the user for help. +# This option is also used when generating formulas in HTML. + +LATEX_BATCHMODE = NO + +# If LATEX_HIDE_INDICES is set to YES then doxygen will not +# include the index chapters (such as File Index, Compound Index, etc.) +# in the output. + +LATEX_HIDE_INDICES = NO + +# If LATEX_SOURCE_CODE is set to YES then doxygen will include +# source code with syntax highlighting in the LaTeX output. +# Note that which sources are shown also depends on other settings +# such as SOURCE_BROWSER. + +LATEX_SOURCE_CODE = NO + +#--------------------------------------------------------------------------- +# configuration options related to the RTF output +#--------------------------------------------------------------------------- + +# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output +# The RTF output is optimized for Word 97 and may not look very pretty with +# other RTF readers or editors. + +GENERATE_RTF = NO + +# The RTF_OUTPUT tag is used to specify where the RTF docs will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `rtf' will be used as the default path. + +RTF_OUTPUT = rtf + +# If the COMPACT_RTF tag is set to YES Doxygen generates more compact +# RTF documents. This may be useful for small projects and may help to +# save some trees in general. + +COMPACT_RTF = NO + +# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated +# will contain hyperlink fields. The RTF file will +# contain links (just like the HTML output) instead of page references. +# This makes the output suitable for online browsing using WORD or other +# programs which support those fields. +# Note: wordpad (write) and others do not support links. + +RTF_HYPERLINKS = NO + +# Load stylesheet definitions from file. Syntax is similar to doxygen's +# config file, i.e. a series of assignments. You only have to provide +# replacements, missing definitions are set to their default value. + +RTF_STYLESHEET_FILE = + +# Set optional variables used in the generation of an rtf document. +# Syntax is similar to doxygen's config file. + +RTF_EXTENSIONS_FILE = + +#--------------------------------------------------------------------------- +# configuration options related to the man page output +#--------------------------------------------------------------------------- + +# If the GENERATE_MAN tag is set to YES (the default) Doxygen will +# generate man pages + +GENERATE_MAN = NO + +# The MAN_OUTPUT tag is used to specify where the man pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `man' will be used as the default path. + +MAN_OUTPUT = man + +# The MAN_EXTENSION tag determines the extension that is added to +# the generated man pages (default is the subroutine's section .3) + +MAN_EXTENSION = .3 + +# If the MAN_LINKS tag is set to YES and Doxygen generates man output, +# then it will generate one additional man file for each entity +# documented in the real man page(s). These additional files +# only source the real man page, but without them the man command +# would be unable to find the correct page. The default is NO. + +MAN_LINKS = NO + +#--------------------------------------------------------------------------- +# configuration options related to the XML output +#--------------------------------------------------------------------------- + +# If the GENERATE_XML tag is set to YES Doxygen will +# generate an XML file that captures the structure of +# the code including all documentation. + +GENERATE_XML = YES + +# The XML_OUTPUT tag is used to specify where the XML pages will be put. +# If a relative path is entered the value of OUTPUT_DIRECTORY will be +# put in front of it. If left blank `xml' will be used as the default path. + +XML_OUTPUT = xml + +# The XML_SCHEMA tag can be used to specify an XML schema, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_SCHEMA = + +# The XML_DTD tag can be used to specify an XML DTD, +# which can be used by a validating XML parser to check the +# syntax of the XML files. + +XML_DTD = + +# If the XML_PROGRAMLISTING tag is set to YES Doxygen will +# dump the program listings (including syntax highlighting +# and cross-referencing information) to the XML output. Note that +# enabling this will significantly increase the size of the XML output. + +XML_PROGRAMLISTING = YES + +#--------------------------------------------------------------------------- +# configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- + +# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will +# generate an AutoGen Definitions (see autogen.sf.net) file +# that captures the structure of the code including all +# documentation. Note that this feature is still experimental +# and incomplete at the moment. + +GENERATE_AUTOGEN_DEF = NO + +#--------------------------------------------------------------------------- +# configuration options related to the Perl module output +#--------------------------------------------------------------------------- + +# If the GENERATE_PERLMOD tag is set to YES Doxygen will +# generate a Perl module file that captures the structure of +# the code including all documentation. Note that this +# feature is still experimental and incomplete at the +# moment. + +GENERATE_PERLMOD = NO + +# If the PERLMOD_LATEX tag is set to YES Doxygen will generate +# the necessary Makefile rules, Perl scripts and LaTeX code to be able +# to generate PDF and DVI output from the Perl module output. + +PERLMOD_LATEX = NO + +# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be +# nicely formatted so it can be parsed by a human reader. +# This is useful +# if you want to understand what is going on. +# On the other hand, if this +# tag is set to NO the size of the Perl module output will be much smaller +# and Perl will parse it just the same. + +PERLMOD_PRETTY = YES + +# The names of the make variables in the generated doxyrules.make file +# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. +# This is useful so different doxyrules.make files included by the same +# Makefile don't overwrite each other's variables. + +PERLMOD_MAKEVAR_PREFIX = + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will +# evaluate all C-preprocessor directives found in the sources and include +# files. + +ENABLE_PREPROCESSING = YES + +# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro +# names in the source code. If set to NO (the default) only conditional +# compilation will be performed. Macro expansion can be done in a controlled +# way by setting EXPAND_ONLY_PREDEF to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES +# then the macro expansion is limited to the macros specified with the +# PREDEFINED and EXPAND_AS_DEFINED tags. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files +# pointed to by INCLUDE_PATH will be searched when a #include is found. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by +# the preprocessor. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will +# be used. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that +# are defined before the preprocessor is started (similar to the -D option of +# gcc). The argument of the tag is a list of macros of the form: name +# or name=definition (no spaces). If the definition and the = are +# omitted =1 is assumed. To prevent a macro definition from being +# undefined via #undef or recursively expanded use the := operator +# instead of the = operator. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then +# this tag can be used to specify a list of macro names that should be expanded. +# The macro definition that is found in the sources will be used. +# Use the PREDEFINED tag if you want to use a different macro definition that +# overrules the definition found in the source code. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then +# doxygen's preprocessor will remove all references to function-like macros +# that are alone on a line, have an all uppercase name, and do not end with a +# semicolon, because these will confuse the parser if not removed. + +SKIP_FUNCTION_MACROS = YES + +#--------------------------------------------------------------------------- +# Configuration::additions related to external references +#--------------------------------------------------------------------------- + +# The TAGFILES option can be used to specify one or more tagfiles. +# Optionally an initial location of the external documentation +# can be added for each tagfile. The format of a tag file without +# this location is as follows: +# +# TAGFILES = file1 file2 ... +# Adding location for the tag files is done as follows: +# +# TAGFILES = file1=loc1 "file2 = loc2" ... +# where "loc1" and "loc2" can be relative or absolute paths or +# URLs. If a location is present for each tag, the installdox tool +# does not have to be run to correct the links. +# Note that each tag file must have a unique name +# (where the name does NOT include the path) +# If a tag file is not located in the directory in which doxygen +# is run, you must also specify the path to the tagfile here. + +TAGFILES = + +# When a file name is specified after GENERATE_TAGFILE, doxygen will create +# a tag file that is based on the input files it reads. + +GENERATE_TAGFILE = + +# If the ALLEXTERNALS tag is set to YES all external classes will be listed +# in the class index. If set to NO only the inherited external classes +# will be listed. + +ALLEXTERNALS = NO + +# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed +# in the modules index. If set to NO, only the current project's groups will +# be listed. + +EXTERNAL_GROUPS = YES + +# The PERL_PATH should be the absolute path and name of the perl script +# interpreter (i.e. the result of `which perl'). + +PERL_PATH = /usr/bin/perl + +#--------------------------------------------------------------------------- +# Configuration options related to the dot tool +#--------------------------------------------------------------------------- + +# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will +# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base +# or super classes. Setting the tag to NO turns the diagrams off. Note that +# this option also works with HAVE_DOT disabled, but it is recommended to +# install and use dot, since it yields more powerful graphs. + +CLASS_DIAGRAMS = NO + +# You can define message sequence charts within doxygen comments using the \msc +# command. Doxygen will then run the mscgen tool (see +# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the +# documentation. The MSCGEN_PATH tag allows you to specify the directory where +# the mscgen tool resides. If left empty the tool is assumed to be found in the +# default search path. + +MSCGEN_PATH = + +# If set to YES, the inheritance and collaboration graphs will hide +# inheritance and usage relations if the target is undocumented +# or is not a class. + +HIDE_UNDOC_RELATIONS = YES + +# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is +# available from the path. This tool is part of Graphviz, a graph visualization +# toolkit from AT&T and Lucent Bell Labs. The other options in this section +# have no effect if this option is set to NO (the default) + +HAVE_DOT = NO + +# The DOT_NUM_THREADS specifies the number of dot invocations doxygen is +# allowed to run in parallel. When set to 0 (the default) doxygen will +# base this on the number of processors available in the system. You can set it +# explicitly to a value larger than 0 to get control over the balance +# between CPU load and processing speed. + +DOT_NUM_THREADS = 0 + +# By default doxygen will write a font called Helvetica to the output +# directory and reference it in all dot files that doxygen generates. +# When you want a differently looking font you can specify the font name +# using DOT_FONTNAME. You need to make sure dot is able to find the font, +# which can be done by putting it in a standard location or by setting the +# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory +# containing the font. + +DOT_FONTNAME = Helvetica + +# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs. +# The default size is 10pt. + +DOT_FONTSIZE = 10 + +# By default doxygen will tell dot to use the output directory to look for the +# FreeSans.ttf font (which doxygen will put there itself). If you specify a +# different font using DOT_FONTNAME you can set the path where dot +# can find it using this tag. + +DOT_FONTPATH = + +# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect inheritance relations. Setting this tag to YES will force the +# the CLASS_DIAGRAMS tag to NO. + +CLASS_GRAPH = YES + +# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for each documented class showing the direct and +# indirect implementation dependencies (inheritance, containment, and +# class references variables) of the class with other documented classes. + +COLLABORATION_GRAPH = YES + +# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen +# will generate a graph for groups, showing the direct groups dependencies + +GROUP_GRAPHS = YES + +# If the UML_LOOK tag is set to YES doxygen will generate inheritance and +# collaboration diagrams in a style similar to the OMG's Unified Modeling +# Language. + +UML_LOOK = NO + +# If set to YES, the inheritance and collaboration graphs will show the +# relations between templates and their instances. + +TEMPLATE_RELATIONS = NO + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT +# tags are set to YES then doxygen will generate a graph for each documented +# file showing the direct and indirect include dependencies of the file with +# other documented files. + +INCLUDE_GRAPH = YES + +# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and +# HAVE_DOT tags are set to YES then doxygen will generate a graph for each +# documented header file showing the documented files that directly or +# indirectly include this file. + +INCLUDED_BY_GRAPH = YES + +# If the CALL_GRAPH and HAVE_DOT options are set to YES then +# doxygen will generate a call dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable call graphs +# for selected functions only using the \callgraph command. + +CALL_GRAPH = NO + +# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then +# doxygen will generate a caller dependency graph for every global function +# or class method. Note that enabling this option will significantly increase +# the time of a run. So in most cases it will be better to enable caller +# graphs for selected functions only using the \callergraph command. + +CALLER_GRAPH = NO + +# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen +# will generate a graphical hierarchy of all classes instead of a textual one. + +GRAPHICAL_HIERARCHY = YES + +# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES +# then doxygen will show the dependencies a directory has on other directories +# in a graphical way. The dependency relations are determined by the #include +# relations between the files in the directories. + +DIRECTORY_GRAPH = YES + +# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images +# generated by dot. Possible values are svg, png, jpg, or gif. +# If left blank png will be used. + +DOT_IMAGE_FORMAT = png + +# The tag DOT_PATH can be used to specify the path where the dot tool can be +# found. If left blank, it is assumed the dot tool can be found in the path. + +DOT_PATH = + +# The DOTFILE_DIRS tag can be used to specify one or more directories that +# contain dot files that are included in the documentation (see the +# \dotfile command). + +DOTFILE_DIRS = + +# The MSCFILE_DIRS tag can be used to specify one or more directories that +# contain msc files that are included in the documentation (see the +# \mscfile command). + +MSCFILE_DIRS = + +# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of +# nodes that will be shown in the graph. If the number of nodes in a graph +# becomes larger than this value, doxygen will truncate the graph, which is +# visualized by representing a node as a red box. Note that doxygen if the +# number of direct children of the root node in a graph is already larger than +# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note +# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. + +DOT_GRAPH_MAX_NODES = 50 + +# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the +# graphs generated by dot. A depth value of 3 means that only nodes reachable +# from the root by following a path via at most 3 edges will be shown. Nodes +# that lay further from the root node will be omitted. Note that setting this +# option to 1 or 2 may greatly reduce the computation time needed for large +# code bases. Also note that the size of a graph can be further restricted by +# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. + +MAX_DOT_GRAPH_DEPTH = 0 + +# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent +# background. This is disabled by default, because dot on Windows does not +# seem to support this out of the box. Warning: Depending on the platform used, +# enabling this option may lead to badly anti-aliased labels on the edges of +# a graph (i.e. they become hard to read). + +DOT_TRANSPARENT = NO + +# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output +# files in one run (i.e. multiple -o and -T options on the command line). This +# makes dot run faster, but since only newer versions of dot (>1.8.10) +# support this, this feature is disabled by default. + +DOT_MULTI_TARGETS = NO + +# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will +# generate a legend page explaining the meaning of the various boxes and +# arrows in the dot generated graphs. + +GENERATE_LEGEND = YES + +# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will +# remove the intermediate dot files that are used to generate +# the various graphs. + +DOT_CLEANUP = YES diff --git a/library/gecode/extractor/Makefile b/library/gecode/extractor/Makefile new file mode 100644 index 000000000..3fc261ab7 --- /dev/null +++ b/library/gecode/extractor/Makefile @@ -0,0 +1,33 @@ +GECODEDIR := $(shell g++ -q $(CPPFLAGS) $(CXXFLAGS) -H -E gecodedir.hh 2>&1 >/dev/null | grep gecode/kernel.hh | awk '{print $$2}' | sed 's|/kernel.hh||') +GECODECONFIG := $(GECODEDIR)/support/config.hpp +GECODEVERSION := $(shell cat $(GECODECONFIG) | egrep GECODE_VERSION | awk '{print $$3}' | sed 's/"//g') +PROTOTYPES = gecode-prototypes-$(GECODEVERSION).hh +ENUMS = gecode-enums-$(GECODEVERSION).py + +all: $(PROTOTYPES) $(ENUMS) + +$(PROTOTYPES): % : xml/namespaceGecode.xml extract-prototypes.xsl + cat notice.hh > $@ + xsltproc extract-prototypes.xsl $< \ + | sed 's/Gecode:://g' \ + | sed 's/< //>/g' \ + | sed 's/ \&/\&/g' \ + | sed 's/, /,/g' \ + | sed 's/forceinline //g' \ + | sed 's/GECODE_INT_EXPORT //g' \ + | sed 's/GECODE_SET_EXPORT //g' \ + | grep -v '*' | sort >> $@ + +$(ENUMS): % : xml/namespaceGecode.xml extract-enums.xsl + cat notice.py > $@ + xsltproc extract-enums.xsl $< >> $@ + +xml/namespaceGecode.xml: Doxyfile + doxygen Doxyfile + +Doxyfile: Doxyfile.in + cat $< | sed "s#@GECODEDIR@#$(GECODEDIR)#" > $@ + +clean: + -rm -rf *~ gecode-prototypes-*.hh gecode-enums-*.py Doxyfile xml diff --git a/library/gecode/extractor/README b/library/gecode/extractor/README new file mode 100644 index 000000000..6a098164e --- /dev/null +++ b/library/gecode/extractor/README @@ -0,0 +1,2 @@ +This directory contains support code for automatically extracting +prototypes from the local Gecode installation. diff --git a/library/gecode/extractor/extract-enums.xsl b/library/gecode/extractor/extract-enums.xsl new file mode 100644 index 000000000..313e8d6f7 --- /dev/null +++ b/library/gecode/extractor/extract-enums.xsl @@ -0,0 +1,31 @@ + + + + ENUM_CLASSES = [] + + + + class + + (object): + + TYPE = ' + + ' + ENUM = [ + + , + ' + + ' + + ] + +ENUM_CLASSES.append( + + ) + + + + + diff --git a/library/gecode/extractor/extract-prototypes.xsl b/library/gecode/extractor/extract-prototypes.xsl new file mode 100644 index 000000000..7ceacbaf7 --- /dev/null +++ b/library/gecode/extractor/extract-prototypes.xsl @@ -0,0 +1,21 @@ + + + + + + + + + ( + , + + + = + + + + ); + + + + diff --git a/library/gecode/extractor/gecodedir.hh b/library/gecode/extractor/gecodedir.hh new file mode 100644 index 000000000..b3cc63621 --- /dev/null +++ b/library/gecode/extractor/gecodedir.hh @@ -0,0 +1 @@ +#include "gecode/kernel.hh" diff --git a/library/gecode/extractor/notice.hh b/library/gecode/extractor/notice.hh new file mode 100644 index 000000000..935fe8212 --- /dev/null +++ b/library/gecode/extractor/notice.hh @@ -0,0 +1,3 @@ +// This file was automatically extracted from Gecode source files. +// It is subject to the same Copyright as the source files from which +// it is derived, and is distributed under the same Licensing conditions. diff --git a/library/gecode/extractor/notice.py b/library/gecode/extractor/notice.py new file mode 100644 index 000000000..cdfd4d2cd --- /dev/null +++ b/library/gecode/extractor/notice.py @@ -0,0 +1,3 @@ +# This file was automatically extracted from Gecode source files. +# It is subject to the same Copyright as the source files from which +# it is derived, and is distributed under the same Licensing conditions. diff --git a/library/gecode/gecode-common.icc b/library/gecode/gecode-common.icc new file mode 100644 index 000000000..029227e17 --- /dev/null +++ b/library/gecode/gecode-common.icc @@ -0,0 +1,259 @@ +// -*- 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 . +//============================================================================= + +#ifndef GECODE_COMMON +#define GECODE_COMMON + +#include "gecode/int.hh" +#include "gecode/set.hh" +#include "gecode/search.hh" +#include + +namespace generic_gecode +{ + using namespace std; + using namespace Gecode; + + // description of the optimization criterion + struct Optimizing + { + enum What { OPT_NONE, OPT_INT, OPT_RATIO }; + enum How { OPT_MIN, OPT_MAX }; + int num; + int den; + What what; + How how; + Optimizing(): num(-1), den(-1), what(OPT_NONE), how(OPT_MAX) {} + Optimizing(Optimizing& o) + : num(o.num), den(o.den), what(o.what), how(o.how) {} + void maximize(int i) + { what = OPT_INT; how = OPT_MAX; num = i; }; + void maximize(int i,int j) + { what = OPT_RATIO; how = OPT_MAX; num = i; den = j; }; + void minimize(int i) + { what = OPT_INT; how = OPT_MIN; num = i; }; + void minimize(int i,int j) + { what = OPT_RATIO; how = OPT_MIN; num = i; den = j; }; + }; + + struct GenericSpace; + + struct GenericEngine + { + virtual GenericSpace* next(void)=0; + virtual ~GenericEngine() {}; + }; + + struct GenericDFS: GenericEngine + { + DFS engine; + GenericDFS(GenericSpace* s) : engine(s) {} + virtual GenericSpace* next(void) { return engine.next(); } + }; + + struct GenericBAB: GenericEngine + { + BAB engine; + GenericBAB(GenericSpace* s) : engine(s) {} + virtual GenericSpace* next(void) { return engine.next(); } + }; + + struct GenericSpace: Space + { + Optimizing optim; + IntVarArray ivars; + BoolVarArray bvars; + SetVarArray svars; + vector* _ivars; + vector* _bvars; + vector* _svars; + + Space* space() { return this; } + + GenericSpace(bool share, GenericSpace& s) + : Space(share, s), optim(s.optim), + _ivars(NULL), _bvars(NULL), _svars(NULL) + { + ivars.update(*this, share, s.ivars); + bvars.update(*this, share, s.bvars); + svars.update(*this, share, s.svars); + } + + Space* copy(bool share) + { freeze(); return new GenericSpace(share, *this); } + + GenericSpace() : _ivars(NULL), _bvars(NULL), _svars(NULL) {} + + // freeze the space before handing it off to a search engine + void freeze() + { + if (_ivars) + { + int n = _ivars->size(); + ivars = IntVarArray(*this, n); + vector& v(*_ivars); + for (; n--;) ivars[n] = v[n]; + delete _ivars; + _ivars = NULL; + } + + if (_bvars) + { + int n = _bvars->size(); + bvars = BoolVarArray(*this, n); + vector& v(*_bvars); + for (; n--;) bvars[n] = v[n]; + delete _bvars; + _bvars = NULL; + } + + if (_svars) + { + int n = _svars->size(); + svars = SetVarArray(*this, n); + vector& v(*_svars); + for (; n--;) svars[n] = v[n]; + delete _svars; + _svars = NULL; + } + } + + IntVar get_ivar(int i) const { return (_ivars) ? (*_ivars)[i] : ivars[i]; } + BoolVar get_bvar(int i) const { return (_bvars) ? (*_bvars)[i] : bvars[i]; } + SetVar get_svar(int i) const { return (_svars) ? (*_svars)[i] : svars[i]; } + + GenericEngine* new_engine() + { + freeze(); + return (optim.what == Optimizing::OPT_NONE) + ? static_cast(new GenericDFS(this)) + : static_cast(new GenericBAB(this)); + } + + int _new_ivar(IntVar& v) + { + if (!_ivars) _ivars = new vector; + int i = _ivars->size(); + _ivars->push_back(v); + return i; + } + + int new_ivar(int lo, int hi) + { + IntVar v(*this, lo, hi); + return _new_ivar(v); + } + + int new_ivar(IntSet& s) + { + IntVar v(*this, s); + return _new_ivar(v); + } + + int _new_bvar(BoolVar& v) + { + if (!_bvars) _bvars = new vector; + int i = _bvars->size(); + _bvars->push_back(v); + return i; + } + + int new_bvar() + { + BoolVar v(*this, 0, 1); + return _new_bvar(v); + } + + int _new_svar(SetVar& v) + { + if (!_svars) _svars = new vector; + int i = _svars->size(); + _svars->push_back(v); + return i; + } + + int new_svar(int glbMin, int glbMax, int lubMin, int lubMax, + unsigned int cardMin=0, + unsigned int cardMax=Set::Limits::card) + { + SetVar v(*this, glbMin, glbMax, lubMin, lubMax, cardMin, cardMax); + return _new_svar(v); + } + + int new_svar(IntSet glb, int lubMin, int lubMax, + unsigned int cardMin=0, + unsigned int cardMax=Set::Limits::card) + { + SetVar v(*this, glb, lubMin, lubMax, cardMin, cardMax); + return _new_svar(v); + } + + int new_svar(int glbMin, int glbMax, IntSet lub, + unsigned int cardMin=0, + unsigned int cardMax=Set::Limits::card) + { + SetVar v(*this, glbMin, glbMax, lub, cardMin, cardMax); + return _new_svar(v); + } + + int new_svar(IntSet glb, IntSet lub, + unsigned int cardMin=0, + unsigned int cardMax=Set::Limits::card) + { + SetVar v(*this, glb, lub, cardMin, cardMax); + return _new_svar(v); + } + + void minimize(int i) { optim.minimize(i); } + void minimize(int i, int j) { optim.minimize(i,j); } + void maximize(int i) { optim.maximize(i); } + void maximize(int i, int j) { optim.maximize(i,j); } + + virtual void constrain(const Space& s) + { + const GenericSpace& sol = static_cast(s); + switch (optim.what) + { + case Optimizing::OPT_NONE: + break; + case Optimizing::OPT_INT: + rel(*this, ivars[optim.num], + ((optim.how==Optimizing::OPT_MIN) ? IRT_LE : IRT_GR), + sol.ivars[optim.num].val()); + break; + case Optimizing::OPT_RATIO: + { + IntArgs c(2, sol.ivars[optim.den].val(), + - sol.ivars[optim.num].val()); + IntVarArgs v(2); + v[0] = ivars[optim.num]; + v[1] = ivars[optim.den]; + linear(*this, c, v, + ((optim.how==Optimizing::OPT_MIN) ? IRT_LE : IRT_GR), 0); + break; + } + } + } + }; +} + +#ifdef DISJUNCTOR +#include "disjunctor.icc" +#endif + +#endif diff --git a/library/gecode/gecode-enums-3.6.0.py b/library/gecode/gecode-enums-3.6.0.py new file mode 100644 index 000000000..838a0deb2 --- /dev/null +++ b/library/gecode/gecode-enums-3.6.0.py @@ -0,0 +1,113 @@ +# This file was automatically extracted from Gecode source files. +# It is subject to the same Copyright as the source files from which +# it is derived, and is distributed under the same Licensing conditions. +ENUM_CLASSES = [] + +class ScriptMode(object): + TYPE = 'ScriptMode' + ENUM = ['SM_SOLUTION','SM_TIME','SM_STAT','SM_GIST'] + +ENUM_CLASSES.append(ScriptMode) + +class IntRelType(object): + TYPE = 'IntRelType' + ENUM = ['IRT_EQ','IRT_NQ','IRT_LQ','IRT_LE','IRT_GQ','IRT_GR'] + +ENUM_CLASSES.append(IntRelType) + +class BoolOpType(object): + TYPE = 'BoolOpType' + ENUM = ['BOT_AND','BOT_OR','BOT_IMP','BOT_EQV','BOT_XOR'] + +ENUM_CLASSES.append(BoolOpType) + +class IntConLevel(object): + TYPE = 'IntConLevel' + ENUM = ['ICL_VAL','ICL_BND','ICL_DOM','ICL_DEF'] + +ENUM_CLASSES.append(IntConLevel) + +class TaskType(object): + TYPE = 'TaskType' + ENUM = ['TT_FIXP','TT_FIXS','TT_FIXE'] + +ENUM_CLASSES.append(TaskType) + +class ExtensionalPropKind(object): + TYPE = 'ExtensionalPropKind' + ENUM = ['EPK_DEF','EPK_SPEED','EPK_MEMORY'] + +ENUM_CLASSES.append(ExtensionalPropKind) + +class IntVarBranch(object): + TYPE = 'IntVarBranch' + ENUM = ['INT_VAR_NONE','INT_VAR_RND','INT_VAR_DEGREE_MIN','INT_VAR_DEGREE_MAX','INT_VAR_AFC_MIN','INT_VAR_AFC_MAX','INT_VAR_MIN_MIN','INT_VAR_MIN_MAX','INT_VAR_MAX_MIN','INT_VAR_MAX_MAX','INT_VAR_SIZE_MIN','INT_VAR_SIZE_MAX','INT_VAR_SIZE_DEGREE_MIN','INT_VAR_SIZE_DEGREE_MAX','INT_VAR_SIZE_AFC_MIN','INT_VAR_SIZE_AFC_MAX','INT_VAR_REGRET_MIN_MIN','INT_VAR_REGRET_MIN_MAX','INT_VAR_REGRET_MAX_MIN','INT_VAR_REGRET_MAX_MAX'] + +ENUM_CLASSES.append(IntVarBranch) + +class IntValBranch(object): + TYPE = 'IntValBranch' + ENUM = ['INT_VAL_MIN','INT_VAL_MED','INT_VAL_MAX','INT_VAL_RND','INT_VAL_SPLIT_MIN','INT_VAL_SPLIT_MAX','INT_VAL_RANGE_MIN','INT_VAL_RANGE_MAX','INT_VALUES_MIN','INT_VALUES_MAX'] + +ENUM_CLASSES.append(IntValBranch) + +class IntAssign(object): + TYPE = 'IntAssign' + ENUM = ['INT_ASSIGN_MIN','INT_ASSIGN_MED','INT_ASSIGN_MAX','INT_ASSIGN_RND'] + +ENUM_CLASSES.append(IntAssign) + +class ViewSelStatus(object): + TYPE = 'ViewSelStatus' + ENUM = ['VSS_BEST','VSS_BETTER','VSS_TIE','VSS_WORSE'] + +ENUM_CLASSES.append(ViewSelStatus) + +class ExecStatus(object): + TYPE = 'ExecStatus' + ENUM = ['__ES_SUBSUMED','ES_FAILED','ES_NOFIX','ES_OK','ES_FIX','ES_NOFIX_FORCE','__ES_PARTIAL'] + +ENUM_CLASSES.append(ExecStatus) + +class ActorProperty(object): + TYPE = 'ActorProperty' + ENUM = ['AP_DISPOSE','AP_WEAKLY'] + +ENUM_CLASSES.append(ActorProperty) + +class SpaceStatus(object): + TYPE = 'SpaceStatus' + ENUM = ['SS_FAILED','SS_SOLVED','SS_BRANCH'] + +ENUM_CLASSES.append(SpaceStatus) + +class SetRelType(object): + TYPE = 'SetRelType' + ENUM = ['SRT_EQ','SRT_NQ','SRT_SUB','SRT_SUP','SRT_DISJ','SRT_CMPL'] + +ENUM_CLASSES.append(SetRelType) + +class SetOpType(object): + TYPE = 'SetOpType' + ENUM = ['SOT_UNION','SOT_DUNION','SOT_INTER','SOT_MINUS'] + +ENUM_CLASSES.append(SetOpType) + +class SetVarBranch(object): + TYPE = 'SetVarBranch' + ENUM = ['SET_VAR_NONE','SET_VAR_RND','SET_VAR_DEGREE_MIN','SET_VAR_DEGREE_MAX','SET_VAR_AFC_MIN','SET_VAR_AFC_MAX','SET_VAR_MIN_MIN','SET_VAR_MIN_MAX','SET_VAR_MAX_MIN','SET_VAR_MAX_MAX','SET_VAR_SIZE_MIN','SET_VAR_SIZE_MAX','SET_VAR_SIZE_DEGREE_MIN','SET_VAR_SIZE_DEGREE_MAX','SET_VAR_SIZE_AFC_MIN','SET_VAR_SIZE_AFC_MAX'] + +ENUM_CLASSES.append(SetVarBranch) + +class SetValBranch(object): + TYPE = 'SetValBranch' + ENUM = ['SET_VAL_MIN_INC','SET_VAL_MIN_EXC','SET_VAL_MED_INC','SET_VAL_MED_EXC','SET_VAL_MAX_INC','SET_VAL_MAX_EXC','SET_VAL_RND_INC','SET_VAL_RND_EXC'] + +ENUM_CLASSES.append(SetValBranch) + +class SetAssign(object): + TYPE = 'SetAssign' + ENUM = ['SET_ASSIGN_MIN_INC','SET_ASSIGN_MIN_EXC','SET_ASSIGN_MED_INC','SET_ASSIGN_MED_EXC','SET_ASSIGN_MAX_INC','SET_ASSIGN_MAX_EXC','SET_ASSIGN_RND_INC','SET_ASSIGN_RND_EXC'] + +ENUM_CLASSES.append(SetAssign) + diff --git a/library/gecode/gecode-enums-3.6.0.pyc b/library/gecode/gecode-enums-3.6.0.pyc new file mode 100644 index 000000000..959eb1290 Binary files /dev/null and b/library/gecode/gecode-enums-3.6.0.pyc differ diff --git a/library/gecode/gecode-prototypes-3.6.0.hh b/library/gecode/gecode-prototypes-3.6.0.hh new file mode 100644 index 000000000..8e5189e4a --- /dev/null +++ b/library/gecode/gecode-prototypes-3.6.0.hh @@ -0,0 +1,209 @@ +// This file was automatically extracted from Gecode source files. +// It is subject to the same Copyright as the source files from which +// it is derived, and is distributed under the same Licensing conditions. +void abs(Home,IntVar,IntVar,IntConLevel=ICL_DEF); +void assign(Home,BoolVar,IntAssign,const ValBranchOptions&=ValBranchOptions::def); +void assign(Home,const BoolVarArgs&,IntAssign,const ValBranchOptions&=ValBranchOptions::def); +void assign(Home,const IntVarArgs&,IntAssign,const ValBranchOptions&=ValBranchOptions::def); +void assign(Home,const SetVarArgs&,SetAssign,const ValBranchOptions&=ValBranchOptions::def); +void assign(Home,IntVar,IntAssign,const ValBranchOptions&=ValBranchOptions::def); +void assign(Home,SetVar,SetAssign,const ValBranchOptions&=ValBranchOptions::def); +void atmostOne(Home,const SetVarArgs&,unsigned int); +void binpacking(Home,const IntVarArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF); +void branch(Home,BoolVar,IntValBranch,const ValBranchOptions&=ValBranchOptions::def); +void branch(Home,const BoolVarArgs&,const TieBreakVarBranch&,IntValBranch,const TieBreakVarBranchOptions&=TieBreakVarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def); +void branch(Home,const BoolVarArgs&,IntVarBranch,IntValBranch,const VarBranchOptions&=VarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def); +void branch(Home,const IntVarArgs&,const TieBreakVarBranch&,IntValBranch,const TieBreakVarBranchOptions&=TieBreakVarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def); +void branch(Home,const IntVarArgs&,IntVarBranch,IntValBranch,const VarBranchOptions&=VarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def); +void branch(Home,const SetVarArgs&,const TieBreakVarBranch&,SetValBranch,const TieBreakVarBranchOptions&=TieBreakVarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def); +void branch(Home,const SetVarArgs&,SetVarBranch,SetValBranch,const VarBranchOptions&=VarBranchOptions::def,const ValBranchOptions&=ValBranchOptions::def); +void branch(Home,IntVar,IntValBranch,const ValBranchOptions&=ValBranchOptions::def); +void branch(Home,SetVar,SetValBranch,const ValBranchOptions&=ValBranchOptions::def); +void cardinality(Home,SetVar,IntVar); +void cardinality(Home,SetVar,unsigned int,unsigned int); +void channel(Home,BoolVar,IntVar,IntConLevel=ICL_DEF); +void channel(Home,const BoolVarArgs&,IntVar,int=0,IntConLevel=ICL_DEF); +void channel(Home,const BoolVarArgs&,SetVar); +void channel(Home,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF); +void channel(Home,const IntVarArgs&,const SetVarArgs&); +void channel(Home,const IntVarArgs&,int,const IntVarArgs&,int,IntConLevel=ICL_DEF); +void channel(Home,IntVar,BoolVar,IntConLevel=ICL_DEF); +void channelSorted(Home,const IntVarArgs&,SetVar); +void circuit(Home,const IntArgs&,const IntVarArgs&,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF); +void circuit(Home,const IntArgs&,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF); +void circuit(Home,const IntArgs&,int,const IntVarArgs&,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF); +void circuit(Home,const IntArgs&,int,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF); +void circuit(Home,const IntVarArgs&,IntConLevel=ICL_DEF); +void circuit(Home,int,const IntVarArgs&,IntConLevel=ICL_DEF); +void clause(Home,BoolOpType,const BoolVarArgs&,const BoolVarArgs&,BoolVar,IntConLevel=ICL_DEF); +void clause(Home,BoolOpType,const BoolVarArgs&,const BoolVarArgs&,int,IntConLevel=ICL_DEF); +void convex(Home,SetVar); +void convex(Home,SetVar,SetVar); +void count(Home,const IntVarArgs&,const IntArgs&,IntRelType,int,IntConLevel=ICL_DEF); +void count(Home,const IntVarArgs&,const IntArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF); +void count(Home,const IntVarArgs&,const IntSetArgs&,const IntArgs&,IntConLevel=ICL_DEF); +void count(Home,const IntVarArgs&,const IntSetArgs&,IntConLevel=ICL_DEF); +void count(Home,const IntVarArgs&,const IntSet&,const IntArgs&,IntConLevel=ICL_DEF); +void count(Home,const IntVarArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF); +void count(Home,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF); +void count(Home,const IntVarArgs&,int,IntRelType,int,IntConLevel=ICL_DEF); +void count(Home,const IntVarArgs&,int,IntRelType,IntVar,IntConLevel=ICL_DEF); +void count(Home,const IntVarArgs&,IntVar,IntRelType,int,IntConLevel=ICL_DEF); +void count(Home,const IntVarArgs&,IntVar,IntRelType,IntVar,IntConLevel=ICL_DEF); +void cumulative(Home,int,const IntVarArgs&,const IntArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF); +void cumulative(Home,int,const IntVarArgs&,const IntArgs&,const IntArgs&,IntConLevel=ICL_DEF); +void cumulative(Home,int,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF); +void cumulative(Home,int,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF); +void cumulative(Home,int,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF); +void cumulative(Home,int,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,IntConLevel=ICL_DEF); +void cumulative(Home,IntVar,const IntVarArgs&,const IntArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF); +void cumulative(Home,IntVar,const IntVarArgs&,const IntArgs&,const IntArgs&,IntConLevel=ICL_DEF); +void cumulative(Home,IntVar,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF); +void cumulative(Home,IntVar,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF); +void cumulative(Home,IntVar,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF); +void cumulative(Home,IntVar,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,IntConLevel=ICL_DEF); +void cumulatives(Home,const IntArgs&,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF); +void cumulatives(Home,const IntArgs&,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF); +void cumulatives(Home,const IntArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF); +void cumulatives(Home,const IntArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF); +void cumulatives(Home,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF); +void cumulatives(Home,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF); +void cumulatives(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF); +void cumulatives(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntArgs&,bool,IntConLevel=ICL_DEF); +void distinct(Home,const IntArgs&,const IntVarArgs&,IntConLevel=ICL_DEF); +void distinct(Home,const IntVarArgs&,IntConLevel=ICL_DEF); +void div(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF); +void divmod(Home,IntVar,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF); +void dom(Home,const IntVarArgs&,const IntSet&,IntConLevel=ICL_DEF); +void dom(Home,const IntVarArgs&,int,IntConLevel=ICL_DEF); +void dom(Home,const IntVarArgs&,int,int,IntConLevel=ICL_DEF); +void dom(Home,IntVar,const IntSet&,BoolVar,IntConLevel=ICL_DEF); +void dom(Home,IntVar,const IntSet&,IntConLevel=ICL_DEF); +void dom(Home,IntVar,int,BoolVar,IntConLevel=ICL_DEF); +void dom(Home,IntVar,int,int,BoolVar,IntConLevel=ICL_DEF); +void dom(Home,IntVar,int,IntConLevel=ICL_DEF); +void dom(Home,IntVar,int,int,IntConLevel=ICL_DEF); +void dom(Home,SetVar,SetRelType,const IntSet&); +void dom(Home,SetVar,SetRelType,const IntSet&,BoolVar); +void dom(Home,SetVar,SetRelType,int); +void dom(Home,SetVar,SetRelType,int,BoolVar); +void dom(Home,SetVar,SetRelType,int,int); +void dom(Home,SetVar,SetRelType,int,int,BoolVar); +void element(Home,const BoolVarArgs&,IntVar,BoolVar,IntConLevel=ICL_DEF); +void element(Home,const BoolVarArgs&,IntVar,int,IntConLevel=ICL_DEF); +void element(Home,const BoolVarArgs&,IntVar,int,IntVar,int,BoolVar,IntConLevel=ICL_DEF); +void element(Home,const IntSetArgs&,IntVar,int,IntVar,int,SetVar); +void element(Home,const IntSetArgs&,IntVar,SetVar); +void element(Home,const IntVarArgs&,IntVar,int,IntConLevel=ICL_DEF); +void element(Home,const IntVarArgs&,IntVar,int,IntVar,int,IntVar,IntConLevel=ICL_DEF); +void element(Home,const IntVarArgs&,IntVar,IntVar,IntConLevel=ICL_DEF); +void element(Home,const SetVarArgs&,IntVar,int,IntVar,int,SetVar); +void element(Home,const SetVarArgs&,IntVar,SetVar); +void element(Home,IntSharedArray,IntVar,BoolVar,IntConLevel=ICL_DEF); +void element(Home,IntSharedArray,IntVar,int,IntConLevel=ICL_DEF); +void element(Home,IntSharedArray,IntVar,int,IntVar,int,BoolVar,IntConLevel=ICL_DEF); +void element(Home,IntSharedArray,IntVar,int,IntVar,int,IntVar,IntConLevel=ICL_DEF); +void element(Home,IntSharedArray,IntVar,IntVar,IntConLevel=ICL_DEF); +void element(Home,SetOpType,const IntSetArgs&,SetVar,SetVar,const IntSet&=IntSet(Set::Limits::min,Set::Limits::max)); +void element(Home,SetOpType,const SetVarArgs&,SetVar,SetVar,const IntSet&=IntSet(Set::Limits::min,Set::Limits::max)); +void extensional(Home,const BoolVarArgs&,const TupleSet&,ExtensionalPropKind=EPK_DEF,IntConLevel=ICL_DEF); +void extensional(Home,const BoolVarArgs&,DFA,IntConLevel=ICL_DEF); +void extensional(Home,const IntVarArgs&,const TupleSet&,ExtensionalPropKind=EPK_DEF,IntConLevel=ICL_DEF); +void extensional(Home,const IntVarArgs&,DFA,IntConLevel=ICL_DEF); +void linear(Home,const BoolVarArgs&,IntRelType,int,BoolVar,IntConLevel=ICL_DEF); +void linear(Home,const BoolVarArgs&,IntRelType,int,IntConLevel=ICL_DEF); +void linear(Home,const BoolVarArgs&,IntRelType,IntVar,BoolVar,IntConLevel=ICL_DEF); +void linear(Home,const BoolVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF); +void linear(Home,const IntArgs&,const BoolVarArgs&,IntRelType,int,BoolVar,IntConLevel=ICL_DEF); +void linear(Home,const IntArgs&,const BoolVarArgs&,IntRelType,int,IntConLevel=ICL_DEF); +void linear(Home,const IntArgs&,const BoolVarArgs&,IntRelType,IntVar,BoolVar,IntConLevel=ICL_DEF); +void linear(Home,const IntArgs&,const BoolVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF); +void linear(Home,const IntArgs&,const IntVarArgs&,IntRelType,int,BoolVar,IntConLevel=ICL_DEF); +void linear(Home,const IntArgs&,const IntVarArgs&,IntRelType,int,IntConLevel=ICL_DEF); +void linear(Home,const IntArgs&,const IntVarArgs&,IntRelType,IntVar,BoolVar,IntConLevel=ICL_DEF); +void linear(Home,const IntArgs&,const IntVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF); +void linear(Home,const IntVarArgs&,IntRelType,int,BoolVar,IntConLevel=ICL_DEF); +void linear(Home,const IntVarArgs&,IntRelType,int,IntConLevel=ICL_DEF); +void linear(Home,const IntVarArgs&,IntRelType,IntVar,BoolVar,IntConLevel=ICL_DEF); +void linear(Home,const IntVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF); +void max(Home,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF); +void max(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF); +void max(Home,SetVar,IntVar); +void max(Home,SetVar,IntVar,BoolVar); +void min(Home,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF); +void min(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF); +void min(Home,SetVar,IntVar); +void min(Home,SetVar,IntVar,BoolVar); +void mod(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF); +void mult(Home,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF); +void nooverlap(Home,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF); +void nooverlap(Home,const IntVarArgs&,const IntArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF); +void nooverlap(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF); +void nooverlap(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF); +void notMax(Home,SetVar,IntVar); +void notMin(Home,SetVar,IntVar); +void path(Home,const IntArgs&,const IntVarArgs&,IntVar,IntVar,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF); +void path(Home,const IntArgs&,const IntVarArgs&,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF); +void path(Home,const IntArgs&,int,const IntVarArgs&,IntVar,IntVar,const IntVarArgs&,IntVar,IntConLevel=ICL_DEF); +void path(Home,const IntArgs&,int,const IntVarArgs&,IntVar,IntVar,IntVar,IntConLevel=ICL_DEF); +void path(Home,const IntVarArgs&,IntVar,IntVar,IntConLevel=ICL_DEF); +void path(Home,int,const IntVarArgs&,IntVar,IntVar,IntConLevel=ICL_DEF); +void precede(Home,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF); +void precede(Home,const IntVarArgs&,int,int,IntConLevel=ICL_DEF); +void precede(Home,const SetVarArgs&,const IntArgs&); +void precede(Home,const SetVarArgs&,int,int); +void rel(Home,BoolOpType,const BoolVarArgs&,BoolVar,IntConLevel=ICL_DEF); +void rel(Home,BoolOpType,const BoolVarArgs&,int,IntConLevel=ICL_DEF); +void rel(Home,BoolVar,BoolOpType,BoolVar,BoolVar,IntConLevel=ICL_DEF); +void rel(Home,BoolVar,BoolOpType,BoolVar,int,IntConLevel=ICL_DEF); +void rel(Home,BoolVar,IntRelType,BoolVar,BoolVar,IntConLevel=ICL_DEF); +void rel(Home,BoolVar,IntRelType,BoolVar,IntConLevel=ICL_DEF); +void rel(Home,BoolVar,IntRelType,int,BoolVar,IntConLevel=ICL_DEF); +void rel(Home,BoolVar,IntRelType,int,IntConLevel=ICL_DEF); +void rel(Home,const BoolVarArgs&,IntRelType,BoolVar,IntConLevel=ICL_DEF); +void rel(Home,const BoolVarArgs&,IntRelType,const BoolVarArgs&,IntConLevel=ICL_DEF); +void rel(Home,const BoolVarArgs&,IntRelType,IntConLevel=ICL_DEF); +void rel(Home,const BoolVarArgs&,IntRelType,int,IntConLevel=ICL_DEF); +void rel(Home,const IntSet&,SetOpType,SetVar,SetRelType,const IntSet&); +void rel(Home,const IntSet&,SetOpType,SetVar,SetRelType,SetVar); +void rel(Home,const IntVarArgs&,IntRelType,const IntVarArgs&,IntConLevel=ICL_DEF); +void rel(Home,const IntVarArgs&,IntRelType,IntConLevel=ICL_DEF); +void rel(Home,const IntVarArgs&,IntRelType,int,IntConLevel=ICL_DEF); +void rel(Home,const IntVarArgs&,IntRelType,IntVar,IntConLevel=ICL_DEF); +void rel(Home,IntVar,IntRelType,int,BoolVar,IntConLevel=ICL_DEF); +void rel(Home,IntVar,IntRelType,int,IntConLevel=ICL_DEF); +void rel(Home,IntVar,IntRelType,IntVar,BoolVar,IntConLevel=ICL_DEF); +void rel(Home,IntVar,IntRelType,IntVar,IntConLevel=ICL_DEF); +void rel(Home,IntVar,IntRelType,SetVar); +void rel(Home,IntVar,SetRelType,SetVar); +void rel(Home,IntVar,SetRelType,SetVar,BoolVar); +void rel(Home,SetOpType,const IntVarArgs&,const IntSet&,SetVar); +void rel(Home,SetOpType,const IntVarArgs&,SetVar); +void rel(Home,SetOpType,const SetVarArgs&,const IntSet&,SetVar); +void rel(Home,SetOpType,const SetVarArgs&,SetVar); +void rel(Home,SetVar,IntRelType,IntVar); +void rel(Home,SetVar,SetOpType,const IntSet&,SetRelType,const IntSet&); +void rel(Home,SetVar,SetOpType,const IntSet&,SetRelType,SetVar); +void rel(Home,SetVar,SetOpType,SetVar,SetRelType,const IntSet&); +void rel(Home,SetVar,SetOpType,SetVar,SetRelType,SetVar); +void rel(Home,SetVar,SetRelType,IntVar); +void rel(Home,SetVar,SetRelType,IntVar,BoolVar); +void rel(Home,SetVar,SetRelType,SetVar); +void rel(Home,SetVar,SetRelType,SetVar,BoolVar); +void sequence(Home,const BoolVarArgs&,const IntSet&,int,int,int,IntConLevel=ICL_DEF); +void sequence(Home,const IntVarArgs&,const IntSet&,int,int,int,IntConLevel=ICL_DEF); +void sequence(Home,const SetVarArgs&); +void sequence(Home,const SetVarArgs&,SetVar); +void sorted(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF); +void sorted(Home,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF); +void sqr(Home,IntVar,IntVar,IntConLevel=ICL_DEF); +void sqrt(Home,IntVar,IntVar,IntConLevel=ICL_DEF); +void unary(Home,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF); +void unary(Home,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF); +void unary(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF); +void unary(Home,const IntVarArgs&,const IntVarArgs&,const IntVarArgs&,IntConLevel=ICL_DEF); +void unary(Home,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,const BoolVarArgs&,IntConLevel=ICL_DEF); +void unary(Home,const TaskTypeArgs&,const IntVarArgs&,const IntArgs&,IntConLevel=ICL_DEF); +void unshare(Home,BoolVarArgs&,IntConLevel=ICL_DEF); +void unshare(Home,IntVarArgs&,IntConLevel=ICL_DEF); +void weights(Home,const IntArgs&,const IntArgs&,SetVar,IntVar); diff --git a/library/gecode/gecode_yap.cc b/library/gecode/gecode_yap.cc new file mode 100644 index 000000000..51e0d4dd2 --- /dev/null +++ b/library/gecode/gecode_yap.cc @@ -0,0 +1,1128 @@ +// -*- 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 . +//============================================================================= + +#include "gecode-common.icc" +#include +using namespace std; +using namespace generic_gecode; +using namespace Gecode; + +extern "C" +{ +#include "config.h" +} + +namespace generic_gecode +{ +#ifndef HAVE_DYNARRAY + template struct DynArray + { + T* _array; + DynArray(int n): _array(new T[n]) {} + ~DynArray() { delete[] _array; } + T& operator[](int i) { return _array[i]; } + }; +#define DYNARRAY(T,A,N) DynArray A(N) +#else +#define DYNARRAY(T,A,N) T A[N] +#endif + +#ifndef HAVE_DYNARRAY + struct SpecArray + { + int (*_array)[2]; + SpecArray(int n): _array((int (*)[2]) new int[n*2]) {} + ~SpecArray() { delete[] _array; } + int& operator()(int i,int j) { return _array[i][j]; } + }; +#define SPECARRAY(A,N) SpecArray A(N) +#define SPECARRAYELEM(A,I,J) A(I,J) +#define SPECARRAYDEREF(A) A._array +#else +#define SPECARRAY(A,N) int A[N][2] +#define SPECARRAYELEM(A,I,J) A[I][J] +#define SPECARRAYDEREF(A) A +#endif +} + +extern "C" +{ +#include "SWI-Stream.h" +#include "YapInterface.h" + + static YAP_opaque_tag_t gecode_space_tag; + static YAP_opaque_handler_t gecode_space_handler; + + static int gecode_space_fail_handler(void* p) + { + delete *(GenericSpace**)p; + return TRUE; + } + + static int + gecode_space_write_handler + (void *stream_, YAP_opaque_tag_t type, void *p, int flags) + { + IOSTREAM* stream = (IOSTREAM*) stream_; + Sfprintf(stream,"", p); + return TRUE; + } + + static YAP_Term gecode_term_from_space(GenericSpace* s) + { + YAP_Term term = + YAP_NewOpaqueObject(gecode_space_tag, sizeof(GenericSpace*)); + GenericSpace** ptr = + (GenericSpace**) YAP_OpaqueObjectFromTerm(term); + *ptr = s; + return term; + } + + static int gecode_new_space(void) + { + YAP_Term term = gecode_term_from_space(new GenericSpace); + return YAP_Unify(YAP_ARG1, term); + } + +#ifndef DISJUNCTOR + static inline GenericSpace* + gecode_Space_from_term(YAP_Term t) + { + return * (GenericSpace**) YAP_OpaqueObjectFromTerm(t); + } +#else + struct YapDisjunctor + { + GenericSpace* home; + Disjunctor disj; + YapDisjunctor(GenericSpace* home_) + : home(home_), disj(*home_) {} + }; + + static YAP_opaque_tag_t gecode_disjunctor_tag; + static YAP_opaque_handler_t gecode_disjunctor_handler; + static YAP_opaque_tag_t gecode_disjunctor_clause_tag; + static YAP_opaque_handler_t gecode_disjunctor_clause_handler; + + static inline Disjunctor& + gecode_Disjunctor_from_term(YAP_Term t) + { + return ((YapDisjunctor*) YAP_OpaqueObjectFromTerm(t))->disj; + } + + static inline YapDisjunctor& + gecode_YapDisjunctor_from_term(YAP_Term t) + { + return * (YapDisjunctor*) YAP_OpaqueObjectFromTerm(t); + } + + static inline Clause& + gecode_Clause_from_term(YAP_Term t) + { + return * (Clause*) YAP_OpaqueObjectFromTerm(t); + } + + static inline GenericSpace* + gecode_Space_from_term(YAP_Term t) + { + if (YAP_IsOpaqueObjectTerm(t, gecode_disjunctor_clause_tag)) + { + Clause& c = gecode_Clause_from_term(t); + return & (GenericSpace&) c; + } + return * (GenericSpace**) YAP_OpaqueObjectFromTerm(t); + } +#endif + + static YAP_opaque_tag_t gecode_engine_tag; + static YAP_opaque_handler_t gecode_engine_handler; + + static int gecode_new_engine(void) + { + YAP_Term arg1 = YAP_ARG1; + YAP_Term arg2 = YAP_ARG2; + GenericSpace* space = gecode_Space_from_term(arg1); + GenericEngine* engine = space->new_engine(); + YAP_Term y_engine = + YAP_NewOpaqueObject(gecode_engine_tag, sizeof(GenericEngine*)); + GenericEngine** ptr = + (GenericEngine**) YAP_OpaqueObjectFromTerm(y_engine); + *ptr = engine; + return YAP_Unify(arg2, y_engine); + } + + static inline GenericEngine* + gecode_engine_from_term(YAP_Term t) + { + return * (GenericEngine**) YAP_OpaqueObjectFromTerm(t); + } + + static int gecode_engine_fail_handler(void* p) + { + delete *(GenericEngine**)p; + return TRUE; + } + + static int + gecode_engine_write_handler + (void *stream_, YAP_opaque_tag_t type, void *p, int flags) + { + IOSTREAM* stream = (IOSTREAM*) stream_; + Sfprintf(stream,"", p); + return TRUE; + } + + static int gecode_engine_search(void) + { + GenericEngine* engine = gecode_engine_from_term(YAP_ARG1); + GenericSpace* space = engine->next(); + if (space) + { + YAP_Term term = gecode_term_from_space(space); + return YAP_Unify(YAP_ARG2, term); + } + else YAP_cut_fail(); + } + +#ifdef DISJUNCTOR + static int gecode_new_disjunctor(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + YAP_Term term = + YAP_NewOpaqueObject(gecode_disjunctor_tag, sizeof(YapDisjunctor)); + new (YAP_OpaqueObjectFromTerm(term)) YapDisjunctor(space); + return YAP_Unify(result, term); + } + + static int + gecode_disjunctor_write_handler + (void *stream_, YAP_opaque_tag_t type, void *p, int flags) + { + IOSTREAM* stream = (IOSTREAM*) stream_; + Sfprintf(stream,"", p); + return TRUE; + } + + static int gecode_new_clause(void) + { + YAP_Term result = YAP_ARG1; + YapDisjunctor& disj = gecode_YapDisjunctor_from_term(YAP_ARG2); + YAP_Term term = + YAP_NewOpaqueObject(gecode_disjunctor_clause_tag, sizeof(Clause)); + new (YAP_OpaqueObjectFromTerm(term)) Clause(*disj.home,disj.disj); + return YAP_Unify(result, term); + } + + static int + gecode_clause_write_handler + (void *stream_, YAP_opaque_tag_t type, void *p, int flags) + { + IOSTREAM* stream = (IOSTREAM*) stream_; + Sfprintf(stream,"", p); + return TRUE; + } + + static IntVar gecode_IntVar_from_term(GenericSpace*,YAP_Term); + static BoolVar gecode_BoolVar_from_term(GenericSpace*,YAP_Term); + static SetVar gecode_SetVar_from_term(GenericSpace*,YAP_Term); + + static int gecode_clause_intvar_forward(void) + { + Clause& clause = gecode_Clause_from_term(YAP_ARG1); + GenericSpace* outer = clause.generic_parent(); + GenericSpace* inner = clause.generic_space(); + IntVar outer_var = gecode_IntVar_from_term(outer, YAP_ARG2); + IntVar inner_var = gecode_IntVar_from_term(inner, YAP_ARG3); + clause.forward(outer_var,inner_var); + return TRUE; + } + + static int gecode_clause_boolvar_forward(void) + { + Clause& clause = gecode_Clause_from_term(YAP_ARG1); + GenericSpace* outer = clause.generic_parent(); + GenericSpace* inner = clause.generic_space(); + BoolVar outer_var = gecode_BoolVar_from_term(outer, YAP_ARG2); + BoolVar inner_var = gecode_BoolVar_from_term(inner, YAP_ARG3); + clause.forward(outer_var,inner_var); + return TRUE; + } + + static int gecode_clause_setvar_forward(void) + { + Clause& clause = gecode_Clause_from_term(YAP_ARG1); + GenericSpace* outer = clause.generic_parent(); + GenericSpace* inner = clause.generic_space(); + SetVar outer_var = gecode_SetVar_from_term(outer, YAP_ARG2); + SetVar inner_var = gecode_SetVar_from_term(inner, YAP_ARG3); + clause.forward(outer_var,inner_var); + return TRUE; + } +#endif + + static int gecode_new_intvar_from_bounds(void) + { + YAP_Term ivar = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + int lo = YAP_IntOfTerm(YAP_ARG3); + int hi = YAP_IntOfTerm(YAP_ARG4); + int i = space->new_ivar(lo, hi); + YAP_Term y_i = YAP_MkIntTerm(i); + return YAP_Unify(ivar, y_i); + } + + static int + gecode_list_length(YAP_Term l) + { + int n = 0; + while (YAP_IsPairTerm(l)) + { + n += 1; + l = YAP_TailOfTerm(l); + } + return n; + } + + static IntSet + gecode_IntSet_from_term(YAP_Term specs) + { + int n = gecode_list_length(specs); + SPECARRAY(r,n); + int i = 0; + while (YAP_IsPairTerm(specs)) + { + YAP_Term head = YAP_HeadOfTerm(specs); + specs = YAP_TailOfTerm(specs); + SPECARRAYELEM(r,i,0) = YAP_IntOfTerm(YAP_ArgOfTerm(1, head)); + SPECARRAYELEM(r,i,1) = YAP_IntOfTerm(YAP_ArgOfTerm(2, head)); + i += 1; + } + return IntSet(SPECARRAYDEREF(r), n); + } + + static int gecode_new_intvar_from_intset(void) + { + YAP_Term ivar = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + YAP_Term specs = YAP_ARG3; + IntSet iset = gecode_IntSet_from_term(specs); + int i = space->new_ivar(iset); + return YAP_Unify(ivar, YAP_MkIntTerm(i)); + } + + static int gecode_new_boolvar(void) + { + YAP_Term bvar = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + int i = space->new_bvar(); + return YAP_Unify(bvar, YAP_MkIntTerm(i)); + } + + static int gecode_new_setvar_1(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + int GlbMin = YAP_IntOfTerm(YAP_ARG3); + int GlbMax = YAP_IntOfTerm(YAP_ARG4); + int LubMin = YAP_IntOfTerm(YAP_ARG5); + int LubMax = YAP_IntOfTerm(YAP_ARG6); + int CardMin= YAP_IntOfTerm(YAP_ARG7); + int CardMax= YAP_IntOfTerm(YAP_ARG8); + int idx = space->new_svar(GlbMin,GlbMax,LubMin,LubMax,CardMin,CardMax); + return YAP_Unify(result, YAP_MkIntTerm(idx)); + } + + static int gecode_new_setvar_2(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + int GlbMin = YAP_IntOfTerm(YAP_ARG3); + int GlbMax = YAP_IntOfTerm(YAP_ARG4); + int LubMin = YAP_IntOfTerm(YAP_ARG5); + int LubMax = YAP_IntOfTerm(YAP_ARG6); + int CardMin= YAP_IntOfTerm(YAP_ARG7); + int idx = space->new_svar(GlbMin,GlbMax,LubMin,LubMax,CardMin); + return YAP_Unify(result, YAP_MkIntTerm(idx)); + } + + static int gecode_new_setvar_3(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + int GlbMin = YAP_IntOfTerm(YAP_ARG3); + int GlbMax = YAP_IntOfTerm(YAP_ARG4); + int LubMin = YAP_IntOfTerm(YAP_ARG5); + int LubMax = YAP_IntOfTerm(YAP_ARG6); + int idx = space->new_svar(GlbMin,GlbMax,LubMin,LubMax); + return YAP_Unify(result, YAP_MkIntTerm(idx)); + } + + static int gecode_new_setvar_4(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntSet Glb = gecode_IntSet_from_term(YAP_ARG3); + int LubMin = YAP_IntOfTerm(YAP_ARG4); + int LubMax = YAP_IntOfTerm(YAP_ARG5); + int CardMin = YAP_IntOfTerm(YAP_ARG6); + int CardMax = YAP_IntOfTerm(YAP_ARG7); + int idx = space->new_svar(Glb,LubMin,LubMax,CardMin,CardMax); + return YAP_Unify(result, YAP_MkIntTerm(idx)); + } + + static int gecode_new_setvar_5(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntSet Glb = gecode_IntSet_from_term(YAP_ARG3); + int LubMin = YAP_IntOfTerm(YAP_ARG4); + int LubMax = YAP_IntOfTerm(YAP_ARG5); + int CardMin = YAP_IntOfTerm(YAP_ARG6); + int idx = space->new_svar(Glb,LubMin,LubMax,CardMin); + return YAP_Unify(result, YAP_MkIntTerm(idx)); + } + + static int gecode_new_setvar_6(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntSet Glb = gecode_IntSet_from_term(YAP_ARG3); + int LubMin = YAP_IntOfTerm(YAP_ARG4); + int LubMax = YAP_IntOfTerm(YAP_ARG5); + int idx = space->new_svar(Glb,LubMin,LubMax); + return YAP_Unify(result, YAP_MkIntTerm(idx)); + } + + static int gecode_new_setvar_7(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + int GlbMin = YAP_IntOfTerm(YAP_ARG3); + int GlbMax = YAP_IntOfTerm(YAP_ARG4); + IntSet Lub = gecode_IntSet_from_term(YAP_ARG5); + int CardMin = YAP_IntOfTerm(YAP_ARG6); + int CardMax = YAP_IntOfTerm(YAP_ARG7); + int idx = space->new_svar(GlbMin,GlbMax,Lub,CardMin,CardMax); + return YAP_Unify(result, YAP_MkIntTerm(idx)); + } + + static int gecode_new_setvar_8(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + int GlbMin = YAP_IntOfTerm(YAP_ARG3); + int GlbMax = YAP_IntOfTerm(YAP_ARG4); + IntSet Lub = gecode_IntSet_from_term(YAP_ARG5); + int CardMin = YAP_IntOfTerm(YAP_ARG6); + int idx = space->new_svar(GlbMin,GlbMax,Lub,CardMin); + return YAP_Unify(result, YAP_MkIntTerm(idx)); + } + + static int gecode_new_setvar_9(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + int GlbMin = YAP_IntOfTerm(YAP_ARG3); + int GlbMax = YAP_IntOfTerm(YAP_ARG4); + IntSet Lub = gecode_IntSet_from_term(YAP_ARG5); + int idx = space->new_svar(GlbMin,GlbMax,Lub); + return YAP_Unify(result, YAP_MkIntTerm(idx)); + } + + static int gecode_new_setvar_10(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntSet Glb = gecode_IntSet_from_term(YAP_ARG3); + IntSet Lub = gecode_IntSet_from_term(YAP_ARG4); + int CardMin = YAP_IntOfTerm(YAP_ARG5); + int CardMax = YAP_IntOfTerm(YAP_ARG6); + int idx = space->new_svar(Glb,Lub,CardMin,CardMax); + return YAP_Unify(result, YAP_MkIntTerm(idx)); + } + + static int gecode_new_setvar_11(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntSet Glb = gecode_IntSet_from_term(YAP_ARG3); + IntSet Lub = gecode_IntSet_from_term(YAP_ARG4); + int CardMin = YAP_IntOfTerm(YAP_ARG5); + int idx = space->new_svar(Glb,Lub,CardMin); + return YAP_Unify(result, YAP_MkIntTerm(idx)); + } + + static int gecode_new_setvar_12(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntSet Glb = gecode_IntSet_from_term(YAP_ARG3); + IntSet Lub = gecode_IntSet_from_term(YAP_ARG4); + int idx = space->new_svar(Glb,Lub); + return YAP_Unify(result, YAP_MkIntTerm(idx)); + } + + static int gecode_space_minimize(void) + { + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int i = YAP_IntOfTerm(YAP_ARG2); + space->minimize(i); + return TRUE; + } + + static int gecode_space_maximize(void) + { + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int i = YAP_IntOfTerm(YAP_ARG2); + space->maximize(i); + return TRUE; + } + + static int gecode_space_minimize_ratio(void) + { + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int i = YAP_IntOfTerm(YAP_ARG2); + int j = YAP_IntOfTerm(YAP_ARG3); + space->minimize(i,j); + return TRUE; + } + + static int gecode_space_maximize_ratio(void) + { + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + int i = YAP_IntOfTerm(YAP_ARG2); + int j = YAP_IntOfTerm(YAP_ARG3); + space->maximize(i,j); + return TRUE; + } + + static IntVar + gecode_IntVar_from_term(GenericSpace* space, YAP_Term x) + { + int i = YAP_IntOfTerm(x); + return space->get_ivar(i); + } + + static BoolVar + gecode_BoolVar_from_term(GenericSpace* space, YAP_Term x) + { + int i = YAP_IntOfTerm(x); + return space->get_bvar(i); + } + + static SetVar + gecode_SetVar_from_term(GenericSpace* space, YAP_Term x) + { + int i = YAP_IntOfTerm(x); + return space->get_svar(i); + } + + static IntVarArgs + gecode_IntVarArgs_from_term(GenericSpace* space, YAP_Term l) + { + int n = gecode_list_length(l); + IntVarArgs v(n); + int i = 0; + while (YAP_IsPairTerm(l)) + { + int idx = YAP_IntOfTerm(YAP_HeadOfTerm(l)); + v[i] = space->get_ivar(idx); + l = YAP_TailOfTerm(l); + i += 1; + } + return v; + } + + static BoolVarArgs + gecode_BoolVarArgs_from_term(GenericSpace* space, YAP_Term l) + { + int n = gecode_list_length(l); + BoolVarArgs v(n); + int i = 0; + while (YAP_IsPairTerm(l)) + { + int idx = YAP_IntOfTerm(YAP_HeadOfTerm(l)); + v[i] = space->get_bvar(idx); + l = YAP_TailOfTerm(l); + i += 1; + } + return v; + } + + static SetVarArgs + gecode_SetVarArgs_from_term(GenericSpace* space, YAP_Term l) + { + int n = gecode_list_length(l); + SetVarArgs v(n); + int i = 0; + while (YAP_IsPairTerm(l)) + { + int idx = YAP_IntOfTerm(YAP_HeadOfTerm(l)); + v[i] = space->get_svar(idx); + l = YAP_TailOfTerm(l); + i += 1; + } + return v; + } + + static IntArgs + gecode_IntArgs_from_term(YAP_Term l) + { + int n = gecode_list_length(l); + IntArgs v(n); + int i = 0; + while (YAP_IsPairTerm(l)) + { + int idx = YAP_IntOfTerm(YAP_HeadOfTerm(l)); + v[i] = idx; + l = YAP_TailOfTerm(l); + i += 1; + } + return v; + } + + static IntSetArgs + gecode_IntSetArgs_from_term(YAP_Term l) + { + int n = gecode_list_length(l); + IntSetArgs v(n); + int i = 0; + while (YAP_IsPairTerm(l)) + { + IntSet s = gecode_IntSet_from_term(YAP_HeadOfTerm(l)); + v[i] = s; + l = YAP_TailOfTerm(l); + i += 1; + } + return v; + } + + static TaskType gecode_TaskType_from_term(YAP_Term); + + static TaskTypeArgs + gecode_TaskTypeArgs_from_term(YAP_Term l) + { + int n = gecode_list_length(l); + TaskTypeArgs v(n); + int i = 0; + while (YAP_IsPairTerm(l)) + { + TaskType tt = gecode_TaskType_from_term(YAP_HeadOfTerm(l)); + v[i] = tt; + l = YAP_TailOfTerm(l); + i += 1; + } + return v; + } + + static YAP_Term gecode_TRUE; + static YAP_Term gecode_FALSE; + + static bool + gecode_bool_from_term(YAP_Term X) + { + if (X==gecode_TRUE) return true; + if (X==gecode_FALSE) return false; + cerr << "this should never happen" << endl; exit(1); + } + + // INFO ON INTVARS + static int gecode_intvar_assigned(void) + { + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + IntVar x = gecode_IntVar_from_term(space, YAP_ARG2); + return (x.assigned()) ? TRUE : FALSE; + } + + static int gecode_intvar_min(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntVar x = gecode_IntVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.min())); + } + + static int gecode_intvar_max(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntVar x = gecode_IntVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.max())); + } + + static int gecode_intvar_med(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntVar x = gecode_IntVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.med())); + } + + static int gecode_intvar_val(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntVar x = gecode_IntVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.val())); + } + + static int gecode_intvar_size(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntVar x = gecode_IntVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.size())); + } + + static int gecode_intvar_width(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntVar x = gecode_IntVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.width())); + } + + static int gecode_intvar_regret_min(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntVar x = gecode_IntVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.regret_min())); + } + + static int gecode_intvar_regret_max(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntVar x = gecode_IntVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.regret_max())); + } + + static YAP_Functor gecode_COMMA2; + + static int gecode_intvar_ranges(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntVar x = gecode_IntVar_from_term(space, YAP_ARG3); + int n = 0; + { IntVarRanges it(x); while (it()) { ++n; ++it; } } + DYNARRAY(int,min,n); + DYNARRAY(int,max,n); + { IntVarRanges it(x); int i=0; + while (it()) { min[i]=it.min(); max[i]=it.max(); ++it; ++i; } } + YAP_Term lst = YAP_TermNil(); + for (;n--;) + { + YAP_Term args[2]; + args[0] = YAP_MkIntTerm(min[n]); + args[1] = YAP_MkIntTerm(max[n]); + YAP_Term range = YAP_MkApplTerm(gecode_COMMA2,2,args); + lst = YAP_MkPairTerm(range,lst); + } + return YAP_Unify(result,lst); + } + + static int gecode_intvar_values(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + IntVar x = gecode_IntVar_from_term(space, YAP_ARG3); + int n = x.size(); + DYNARRAY(int,a,n); + { IntVarValues it(x); int i=0; + while (it()) { a[i]=it.val(); ++it; ++i; } } + YAP_Term lst = YAP_TermNil(); + for (;n--;) + { + lst = YAP_MkPairTerm(YAP_MkIntTerm(a[n]),lst); + } + return YAP_Unify(result,lst); + } + + // INFO ON BOOLVARS + static int gecode_boolvar_assigned(void) + { + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + BoolVar x = gecode_BoolVar_from_term(space, YAP_ARG2); + return (x.assigned()) ? TRUE : FALSE; + } + + static int gecode_boolvar_min(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + BoolVar x = gecode_BoolVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.min())); + } + + static int gecode_boolvar_max(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + BoolVar x = gecode_BoolVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.max())); + } + + static int gecode_boolvar_med(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + BoolVar x = gecode_BoolVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.med())); + } + + static int gecode_boolvar_val(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + BoolVar x = gecode_BoolVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.val())); + } + + static int gecode_boolvar_size(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + BoolVar x = gecode_BoolVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.size())); + } + + static int gecode_boolvar_width(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + BoolVar x = gecode_BoolVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.width())); + } + + static int gecode_boolvar_regret_min(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + BoolVar x = gecode_BoolVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.regret_min())); + } + + static int gecode_boolvar_regret_max(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + BoolVar x = gecode_BoolVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.regret_max())); + } + + // INFO ON SETVARS + static int gecode_setvar_assigned(void) + { + GenericSpace* space = gecode_Space_from_term(YAP_ARG1); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG2); + return (x.assigned()) ? TRUE : FALSE; + } + + static int gecode_setvar_glbSize(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.glbSize())); + } + + static int gecode_setvar_lubSize(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.lubSize())); + } + + static int gecode_setvar_unknownSize(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.unknownSize())); + } + + static int gecode_setvar_cardMin(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.cardMin())); + } + + static int gecode_setvar_cardMax(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.cardMax())); + } + + static int gecode_setvar_lubMin(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.lubMin())); + } + + static int gecode_setvar_lubMax(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.lubMax())); + } + + static int gecode_setvar_glbMin(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.glbMin())); + } + + static int gecode_setvar_glbMax(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + return YAP_Unify(result, YAP_MkIntTerm(x.glbMax())); + } + + static int gecode_setvar_glb_ranges(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + int n = 0; + { SetVarGlbRanges it(x); while (it()) { ++n; ++it; } } + DYNARRAY(int,min,n); + DYNARRAY(int,max,n); + { SetVarGlbRanges it(x); int i=0; + while (it()) { min[i]=it.min(); max[i]=it.max(); ++it; ++i; } } + YAP_Term lst = YAP_TermNil(); + for (;n--;) + { + YAP_Term args[2]; + args[0] = YAP_MkIntTerm(min[n]); + args[1] = YAP_MkIntTerm(max[n]); + YAP_Term range = YAP_MkApplTerm(gecode_COMMA2,2,args); + lst = YAP_MkPairTerm(range,lst); + } + return YAP_Unify(result,lst); + } + + static int gecode_setvar_lub_ranges(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + int n = 0; + { SetVarLubRanges it(x); while (it()) { ++n; ++it; } } + DYNARRAY(int,min,n); + DYNARRAY(int,max,n); + { SetVarLubRanges it(x); int i=0; + while (it()) { min[i]=it.min(); max[i]=it.max(); ++it; ++i; } } + YAP_Term lst = YAP_TermNil(); + for (;n--;) + { + YAP_Term args[2]; + args[0] = YAP_MkIntTerm(min[n]); + args[1] = YAP_MkIntTerm(max[n]); + YAP_Term range = YAP_MkApplTerm(gecode_COMMA2,2,args); + lst = YAP_MkPairTerm(range,lst); + } + return YAP_Unify(result,lst); + } + + static int gecode_setvar_unknown_ranges(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + int n = 0; + { SetVarUnknownRanges it(x); while (it()) { ++n; ++it; } } + DYNARRAY(int,min,n); + DYNARRAY(int,max,n); + { SetVarUnknownRanges it(x); int i=0; + while (it()) { min[i]=it.min(); max[i]=it.max(); ++it; ++i; } } + YAP_Term lst = YAP_TermNil(); + for (;n--;) + { + YAP_Term args[2]; + args[0] = YAP_MkIntTerm(min[n]); + args[1] = YAP_MkIntTerm(max[n]); + YAP_Term range = YAP_MkApplTerm(gecode_COMMA2,2,args); + lst = YAP_MkPairTerm(range,lst); + } + return YAP_Unify(result,lst); + } + + static int gecode_setvar_glb_values(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + DYNARRAY(YAP_Term,elems,x.glbSize()); + SetVarGlbValues it(x); + int n = 0; + while (it()) { elems[n] = YAP_MkIntTerm(it.val()); ++it; ++n; } + YAP_Term lst = YAP_TermNil(); + for (;n--;) lst = YAP_MkPairTerm(elems[n],lst); + return YAP_Unify(result,lst); + } + + static int gecode_setvar_lub_values(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + DYNARRAY(YAP_Term,elems,x.glbSize()); + SetVarLubValues it(x); + int n = 0; + while (it()) { elems[n] = YAP_MkIntTerm(it.val()); ++it; ++n; } + YAP_Term lst = YAP_TermNil(); + for (;n--;) lst = YAP_MkPairTerm(elems[n],lst); + return YAP_Unify(result,lst); + } + + static int gecode_setvar_unknown_values(void) + { + YAP_Term result = YAP_ARG1; + GenericSpace* space = gecode_Space_from_term(YAP_ARG2); + SetVar x = gecode_SetVar_from_term(space, YAP_ARG3); + DYNARRAY(YAP_Term,elems,x.glbSize()); + SetVarUnknownValues it(x); + int n = 0; + while (it()) { elems[n] = YAP_MkIntTerm(it.val()); ++it; ++n; } + YAP_Term lst = YAP_TermNil(); + for (;n--;) lst = YAP_MkPairTerm(elems[n],lst); + return YAP_Unify(result,lst); + } + +#define gecode_int_from_term YAP_IntOfTerm + +#include "gecode_yap_cc_forward_auto_generated.icc" +#include "gecode_yap_cc_impl_auto_generated.icc" + + void gecode_init(void) + { + { YAP_Atom X= YAP_LookupAtom("true"); + gecode_TRUE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + { YAP_Atom X= YAP_LookupAtom("false"); + gecode_FALSE = YAP_MkAtomTerm(X); + YAP_AtomGetHold(X); } + { YAP_Atom X= YAP_LookupAtom(","); + YAP_AtomGetHold(X); + gecode_COMMA2 = YAP_MkFunctor(X,2); } +#include "gecode_yap_cc_init_auto_generated.icc" + // opaque spaces + gecode_space_handler.fail_handler = gecode_space_fail_handler; + gecode_space_handler.write_handler = gecode_space_write_handler; + gecode_space_tag = YAP_NewOpaqueType(&gecode_space_handler); + YAP_UserCPredicate("gecode_new_space", gecode_new_space, 1); + // opaque engines + gecode_engine_handler.fail_handler = gecode_engine_fail_handler; + gecode_engine_handler.write_handler = gecode_engine_write_handler; + gecode_engine_tag = YAP_NewOpaqueType(&gecode_engine_handler); + YAP_UserCPredicate("gecode_new_engine", gecode_new_engine, 2); +#ifdef DISJUNCTOR + // opaque disjunctors and clauses + gecode_disjunctor_handler.write_handler = gecode_disjunctor_write_handler; + gecode_disjunctor_tag = YAP_NewOpaqueType(&gecode_disjunctor_handler); + gecode_disjunctor_clause_handler.write_handler = gecode_clause_write_handler; + gecode_disjunctor_clause_tag = + YAP_NewOpaqueType(&gecode_disjunctor_clause_handler); + YAP_UserCPredicate("gecode_new_disjunctor", gecode_new_disjunctor, 2); + YAP_UserCPredicate("gecode_new_clause", gecode_new_clause, 2); + YAP_UserCPredicate("gecode_clause_intvar_forward", gecode_clause_intvar_forward, 3); + YAP_UserCPredicate("gecode_clause_boolvar_forward", gecode_clause_boolvar_forward, 3); + YAP_UserCPredicate("gecode_clause_setvar_forward", gecode_clause_setvar_forward, 3); +#endif + // backtracking search using an engine + YAP_UserBackCutCPredicate("gecode_engine_search", + gecode_engine_search, gecode_engine_search, + NULL, 2, 0); + // creating variables + YAP_UserCPredicate("gecode_new_intvar_from_bounds", + gecode_new_intvar_from_bounds, 4); + YAP_UserCPredicate("gecode_new_intvar_from_intset", + gecode_new_intvar_from_intset, 3); + YAP_UserCPredicate("gecode_new_boolvar", gecode_new_boolvar, 2); + YAP_UserCPredicate("gecode_new_setvar_1", gecode_new_setvar_1, 8); + YAP_UserCPredicate("gecode_new_setvar_2", gecode_new_setvar_2, 7); + YAP_UserCPredicate("gecode_new_setvar_3", gecode_new_setvar_3, 6); + YAP_UserCPredicate("gecode_new_setvar_4", gecode_new_setvar_4, 7); + YAP_UserCPredicate("gecode_new_setvar_5", gecode_new_setvar_5, 6); + YAP_UserCPredicate("gecode_new_setvar_6", gecode_new_setvar_6, 5); + YAP_UserCPredicate("gecode_new_setvar_7", gecode_new_setvar_7, 7); + YAP_UserCPredicate("gecode_new_setvar_8", gecode_new_setvar_8, 6); + YAP_UserCPredicate("gecode_new_setvar_9", gecode_new_setvar_9, 5); + YAP_UserCPredicate("gecode_new_setvar_10", gecode_new_setvar_10, 6); + YAP_UserCPredicate("gecode_new_setvar_11", gecode_new_setvar_11, 5); + YAP_UserCPredicate("gecode_new_setvar_12", gecode_new_setvar_12, 4); + YAP_UserCPredicate("gecode_space_minimize", gecode_space_minimize, 2); + YAP_UserCPredicate("gecode_space_maximize", gecode_space_maximize, 2); + YAP_UserCPredicate("gecode_space_minimize_ratio", gecode_space_minimize_ratio, 3); + YAP_UserCPredicate("gecode_space_maximize_ratio", gecode_space_maximize_ratio, 3); + // INFO ON INTVARS + YAP_UserCPredicate("gecode_intvar_assigned", gecode_intvar_assigned, 2); + YAP_UserCPredicate("gecode_intvar_min", gecode_intvar_min, 3); + YAP_UserCPredicate("gecode_intvar_max", gecode_intvar_max, 3); + YAP_UserCPredicate("gecode_intvar_med", gecode_intvar_med, 3); + YAP_UserCPredicate("gecode_intvar_val", gecode_intvar_val, 3); + YAP_UserCPredicate("gecode_intvar_size", gecode_intvar_size, 3); + YAP_UserCPredicate("gecode_intvar_width", gecode_intvar_width, 3); + YAP_UserCPredicate("gecode_intvar_regret_min", gecode_intvar_regret_min, 3); + YAP_UserCPredicate("gecode_intvar_regret_max", gecode_intvar_regret_max, 3); + YAP_UserCPredicate("gecode_intvar_ranges", gecode_intvar_ranges, 3); + YAP_UserCPredicate("gecode_intvar_values", gecode_intvar_values, 3); + // INFO ON BOOLVARS + YAP_UserCPredicate("gecode_boolvar_assigned", gecode_boolvar_assigned, 2); + YAP_UserCPredicate("gecode_boolvar_min", gecode_boolvar_min, 3); + YAP_UserCPredicate("gecode_boolvar_max", gecode_boolvar_max, 3); + YAP_UserCPredicate("gecode_boolvar_med", gecode_boolvar_med, 3); + YAP_UserCPredicate("gecode_boolvar_val", gecode_boolvar_val, 3); + YAP_UserCPredicate("gecode_boolvar_size", gecode_boolvar_size, 3); + YAP_UserCPredicate("gecode_boolvar_width", gecode_boolvar_width, 3); + YAP_UserCPredicate("gecode_boolvar_regret_min", gecode_boolvar_regret_min, 3); + YAP_UserCPredicate("gecode_boolvar_regret_max", gecode_boolvar_regret_max, 3); + // INFO ON SETVARS + YAP_UserCPredicate("gecode_setvar_assigned", gecode_setvar_assigned, 2); + YAP_UserCPredicate("gecode_setvar_glbSize", gecode_setvar_glbSize, 3); + YAP_UserCPredicate("gecode_setvar_lubSize", gecode_setvar_lubSize, 3); + YAP_UserCPredicate("gecode_setvar_unknownSize", gecode_setvar_unknownSize, 3); + YAP_UserCPredicate("gecode_setvar_cardMin", gecode_setvar_cardMin, 3); + YAP_UserCPredicate("gecode_setvar_cardMax", gecode_setvar_cardMax, 3); + YAP_UserCPredicate("gecode_setvar_lubMin", gecode_setvar_lubMin, 3); + YAP_UserCPredicate("gecode_setvar_lubMax", gecode_setvar_lubMax, 3); + YAP_UserCPredicate("gecode_setvar_glbMin", gecode_setvar_glbMin, 3); + YAP_UserCPredicate("gecode_setvar_glbMax", gecode_setvar_glbMax, 3); + YAP_UserCPredicate("gecode_setvar_glb_ranges", gecode_setvar_glb_ranges, 3); + YAP_UserCPredicate("gecode_setvar_lub_ranges", gecode_setvar_lub_ranges, 3); + YAP_UserCPredicate("gecode_setvar_unknown_ranges", gecode_setvar_unknown_ranges, 3); + YAP_UserCPredicate("gecode_setvar_glb_values", gecode_setvar_glb_values, 3); + YAP_UserCPredicate("gecode_setvar_lub_values", gecode_setvar_lub_values, 3); + YAP_UserCPredicate("gecode_setvar_unknown_values", gecode_setvar_unknown_values, 3); + } +} diff --git a/library/gecode/gecode_yap_hand_written.yap b/library/gecode/gecode_yap_hand_written.yap new file mode 100644 index 000000000..a5fea2a79 --- /dev/null +++ b/library/gecode/gecode_yap_hand_written.yap @@ -0,0 +1,760 @@ +%% -*- prolog -*- +%%============================================================================= +%% 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 . +%%============================================================================= + +:- module(gecode, [(:=)/2, op(500, xfx, ':='), + (+=)/2, op(500, xfx, '+=')]). + +:- op(500, xfx, ':='). +:- op(500, xfx, '+='). +:- load_foreign_files([gecode_yap],[],gecode_init). + +is_int(X,Y) :- integer(X), Y=X. +is_int(X) :- integer(X). + +is_bool_(true,true). +is_bool_(false,false). +is_bool(X,Y) :- nonvar(X), Y=X. +is_bool(X) :- is_bool(X,_). + +is_IntVar_('IntVar'(I),I) :- integer(I). +is_BoolVar_('BoolVar'(I),I) :- integer(I). +is_SetVar_('SetVar'(I),I) :- integer(I). + +is_IntVar(X,I) :- nonvar(X), is_IntVar_(X,I). +is_BoolVar(X,I) :- nonvar(X), is_BoolVar_(X,I). +is_SetVar(X,I) :- nonvar(X), is_SetVar_(X,I). + +is_IntVar(X) :- is_IntVar(X,_). +is_BoolVar(X) :- is_BoolVar(X,_). +is_SetVar(X) :- is_SetVar(X,_). + +is_IntVarArgs_([],[]). +is_IntVarArgs_([H|T],[H2|T2]) :- is_IntVar(H,H2), is_IntVarArgs(T,T2). +is_IntVarArgs(X,Y) :- nonvar(X), is_IntVarArgs_(X,Y). +is_IntVarArgs(X) :- \+ \+ is_IntVarArgs(X,_). + +is_BoolVarArgs_([],[]). +is_BoolVarArgs_([H|T],[H2|T2]) :- is_BoolVar(H,H2), is_BoolVarArgs(T,T2). +is_BoolVarArgs(X,Y) :- nonvar(X), is_BoolVarArgs_(X,Y). +is_BoolVarArgs(X) :- \+ \+ is_BoolVarArgs(X,_). + +is_SetVarArgs_([],[]). +is_SetVarArgs_([H|T],[H2|T2]) :- is_SetVar(H,H2), is_SetVarArgs(T,T2). +is_SetVarArgs(X,Y) :- nonvar(X), is_SetVarArgs_(X,Y). +is_SetVarArgs(X) :- \+ \+ is_SetVarArgs(X,_). + +is_IntArgs_([],[]). +is_IntArgs_([H|T],[H|T2]) :- integer(H), is_IntArgs(T,T2). +is_IntArgs(X,Y) :- nonvar(X), is_IntArgs_(X,Y). +is_IntArgs(X) :- \+ \+ is_IntArgs(X,_). + +is_IntSharedArray(X) :- is_IntArgs(X). +is_IntSharedArray(X,Y) :- is_IntArgs(X,Y). + +is_TaskTypeArgs_([],[]). +is_TaskTypeArgs_([H|T],[H2|T2]) :- is_TaskType(H,H2), is_TaskTypeArgs(T,T2). +is_TaskTypeArgs(X,Y) :- nonvar(X), is_TaskTypeArgs_(X,Y). +is_TaskTypeArgs(X) :- \+ \+ is_TaskTypeArgs(X,_). + +is_IntSet_('IntSet'(L),L). +is_IntSet(X,Y) :- nonvar(X), is_IntSet_(X,Y). +is_IntSet(X) :- is_IntSet(X,_). + +is_IntSetArgs_([],[]). +is_IntSetArgs_([H|T],[H2|T2]) :- is_IntSet(H,H2), is_IntSetArgs(T,T2). +is_IntSetArgs(X,Y) :- nonvar(X), is_IntSetArgs_(X,Y). +is_IntSetArgs(X) :- \+ \+ is_IntSetArgs(X,_). + +new_intset(X,I,J) :- intset(X,I,J). +new_intset(X,L) :- intset(X,L). + +intset(X, I, J) :- + integer(I), + integer(J), + X='IntSet'([(I,J)]). +intset(X, L) :- + is_list_of_intset_specs(L,L2), + X='IntSet'(L2). + +is_list_of_intset_specs(X,Y) :- + nonvar(X), is_list_of_intset_specs_(X,Y). +is_list_of_intset_specs_([],[]). +is_list_of_intset_specs_([H|T],[H2|T2]) :- + is_intset_spec(H,H2), + is_list_of_intset_specs(T,T2). + +is_intset_spec(X,Y) :- nonvar(X), is_intset_spec_(X,Y). +is_intset_spec_((I,J),(I,J)) :- !, integer(I), integer(J). +is_intset_spec_(I,(I,I)) :- integer(I). + +assert_var(X,Y) :- + var(X) -> X=Y; throw(gecode_error(expected(var))). +assert_is_int(X,Y) :- + integer(X) -> X=Y ; throw(gecode_error(expected(int))). +assert_is_Space(X,Y) :- + is_Space(X,Y) -> true ; throw(gecode_error(expected(space))). +assert_is_IntSet(X,Y) :- + is_IntSet(X,Y) -> true ; throw(gecode_error(expected(intset))). +assert_is_IntVar(X,Y) :- + is_IntVar(X,Y) -> true ; throw(gecode_error(expected(intvar))). +assert_is_BoolVar(X,Y) :- + is_BoolVar(X,Y) -> true ; throw(gecode_error(expected(boolvar))). +assert_is_SetVar(X,Y) :- + is_SetVar(X,Y) -> true ; throw(gecode_error(expected(setvar))). +assert_is_IntArgs(X,Y) :- + is_IntArgs(X,Y) -> true ; throw(gecode_error(expected(intargs))). +assert_is_IntVarArgs(X,Y) :- + is_IntVarArgs(X,Y) -> true ; throw(gecode_error(expected(intvarargs))). +assert_is_BoolVarArgs(X,Y) :- + is_BoolVarArgs(X,Y) -> true ; throw(gecode_error(expected(boolvarargs))). +assert_is_SetVarArgs(X,Y) :- + is_SetVarArgs(X,Y) -> true ; throw(gecode_error(expected(setvarargs))). + +assert_var(X) :- assert_var(X,_). +assert_is_int(X) :- assert_is_int(X,_). +assert_is_Space(X) :- assert_is_Space(X,_). +assert_is_IntSet(X) :- assert_is_IntSet(X,_). +assert_is_IntVar(X) :- assert_is_IntVar(X,_). +assert_is_BoolVar(X) :- assert_is_BoolVar(X,_). +assert_is_SetVar(X) :- assert_is_SetVar(X,_). +assert_is_IntArgs(X) :- assert_is_IntArgs(X,_). +assert_is_IntVarArgs(X) :- assert_is_IntVarArgs(X,_). +assert_is_BoolVarArgs(X) :- assert_is_BoolVarArgs(X,_). +assert_is_SetVarArgs(X) :- assert_is_SetVarArgs(X,_). + +new_space(Space) :- + assert_var(Space), + gecode_new_space(Space_), + Space='Space'(Space_). + +is_Space_('Space'(X),X). +is_Space(X,Y) :- nonvar(X), is_Space_(X,Y). +is_Space(X) :- is_Space(X,_). + +%% AUTOGENERATE ALL VARIANTS LATER! + +new_intvars([], Space, Lo, Hi). +new_intvars([IVar|IVars], Space, Lo, Hi) :- + new_intvar(IVar, Space, Lo, Hi), + new_intvars(IVars, Space, Lo, Hi). + +new_intvars([], Space, IntSet). +new_intvars([IVar|IVars], Space, IntSet) :- + new_intvar(IVar, Space, IntSet), + new_intvars(IVars, Space, IntSet). + +new_boolvars([], Space). +new_boolvars([BVar|BVars], Space) :- + new_boolvar(BVar, Space), + new_boolvars(BVars, Space). + +new_setvars([], Space, X1, X2, X3, X4, X5, X6). +new_setvars([SVar|SVars], Space, X1, X2, X3, X4, X5, X6) :- + new_setvar(SVar, Space, X1, X2, X3, X4, X5, X6), + new_setvars(SVars, Space, X1, X2, X3, X4, X5, X6). + +new_setvars([], Space, X1, X2, X3, X4, X5). +new_setvars([SVar|SVars], Space, X1, X2, X3, X4, X5) :- + new_setvar(SVar, Space, X1, X2, X3, X4, X5), + new_setvars(SVars, Space, X1, X2, X3, X4, X5). + +new_setvars([], Space, X1, X2, X3, X4). +new_setvars([SVar|SVars], Space, X1, X2, X3, X4) :- + new_setvar(SVar, Space, X1, X2, X3, X4), + new_setvars(SVars, Space, X1, X2, X3, X4). + +new_setvars([], Space, X1, X2, X3). +new_setvars([SVar|SVars], Space, X1, X2, X3) :- + new_setvar(SVar, Space, X1, X2, X3), + new_setvars(SVars, Space, X1, X2, X3). + +new_setvars([], Space, X1, X2). +new_setvars([SVar|SVars], Space, X1, X2) :- + new_setvar(SVar, Space, X1, X2), + new_setvars(SVars, Space, X1, X2). + +%% AUTOGENERATE LATER + +assert_integer(X) :- assert_is_int(X). + +new_intvar(IVar, Space, Lo, Hi) :- !, + assert_var(IVar), + assert_is_Space_or_Clause(Space,Space_), + assert_integer(Lo), + assert_integer(Hi), + gecode_new_intvar_from_bounds(Idx,Space_,Lo,Hi), + IVar='IntVar'(Idx). +new_intvar(IVar, Space, IntSet) :- !, + assert_var(IVar), + assert_is_Space_or_Clause(Space,Space_), + assert_is_IntSet(IntSet, L), + gecode_new_intvar_from_intset(Idx,Space_,L), + IVar='IntVar'(Idx). + +new_boolvar(BVar, Space) :- !, + assert_var(BVar), + assert_is_Space_or_Clause(Space,Space_), + gecode_new_boolvar(Idx,Space_), + BVar='BoolVar'(Idx). + +%% (GlbMin,GlbMax,LubMin,LubMax,CardMin,CardMax) 6 new_setvar_1 +%% (GlbMin,GlbMax,LubMin,LubMax,CardMin) 5 new_setvar_2 +%% (GlbMin,GlbMax,LubMin,LubMax) 4 new_setvar_3 +%% (Glb,LubMin,LubMax,CardMin,CardMax) 5 new_setvar_4 +%% (Glb,LubMin,LubMax,CardMin) 4 new_setvar_5 +%% (Glb,LubMin,LubMax) 3 new_setvar_6 +%% (GlbMin,GlbMax,Lub,CardMin,CardMax) 5 new_setvar_7 +%% (GlbMin,GlbMax,Lub,CardMin) 4 new_setvar_8 +%% (GlbMin,GlbMax,Lub) 3 new_setvar_9 +%% (Glb,Lub,CardMin,CardMax) 4 new_setvar_10 +%% (Glb,Lub,CardMin) 3 new_setvar_11 +%% (Glb,Lub) 2 new_setvar_12 + +%% 6 arguments +%% (GlbMin,GlbMax,LubMin,LubMax,CardMin,CardMax) 6 new_setvar_1 +new_setvar(SVar, Space, GlbMin, GlbMax, LubMin, LubMax, CardMin, CardMax) :- + assert_var(SVar), + assert_is_Space_or_Clause(Space,Space_), + assert_integer(GlbMin), + assert_integer(GlbMax), + assert_integer(LubMin), + assert_integer(LubMax), + assert_integer(CardMin), + assert_integer(CardMax), + gecode_new_setvar(Idx, Space_, GlbMin, GlbMax, LubMib, LubMax, CardMin, CardMax), + SVar='SetVar'(Idx). + +%% 5 arguments +%% (GlbMin,GlbMax,LubMin,LubMax,CardMin) 5 new_setvar_2 +%% (Glb,LubMin,LubMax,CardMin,CardMax) 5 new_setvar_4 +%% (GlbMin,GlbMax,Lub,CardMin,CardMax) 5 new_setvar_7 +new_setvar(SVar, Space, X1, X2, X3, X4, X5) :- + assert_var(SVar), + assert_is_Space_or_Clause(Space,Space_), + (integer(X1) + -> + assert_integer(X2), + assert_integer(X4), + assert_integer(X5), + (is_IntSet(X3,X3_) + -> gecode_new_setvar_7(Idx,Space_,X1,X2,X3_,X4,X5) + ; gecode_new_setvar_2(Idx,Space_,X1,X2,X3,X4,X5)) + ; + assert_is_IntSet(X1,X1_), + assert_integer(X2), + assert_integer(X3), + assert_integer(X4), + assert_integer(X5), + gecode_new_setvar_4(Idx,Space_,X1_,X2,X3,X4,X5)), + SVar='SetVar'(Idx). + +%% 4 arguments +%% (GlbMin,GlbMax,LubMin,LubMax) 4 new_setvar_3 +%% (Glb,LubMin,LubMax,CardMin) 4 new_setvar_5 +%% (GlbMin,GlbMax,Lub,CardMin) 4 new_setvar_8 +%% (Glb,Lub,CardMin,CardMax) 4 new_setvar_10 +new_setvar(SVar,Space,X1,X2,X3,X4) :- + assert_var(SVar), + assert_is_Space_or_Clause(Space,Space_), + assert_integer(X4), + (is_IntSet(X1,X1_) + -> (is_IntSet(X2,X2_) + -> + assert_integer(X3), + gecode_new_setvar_10(Idx,Space_,X1_,X2_,X3,X4) + ; + assert_integer(X2), + assert_integer(X3), + gecode_new_setvar_5(Idx,Space_,X1_,X2,X3,X4)) + ; + assert_integer(X1), + assert_integer(X2), + (is_IntSet(X3,X3_) + -> + gecode_new_setvar_8(Idx,Space_,X1,X2,X3_,X4) + ; + assert_integer(X3), + gecode_new_setvar_3(Idx,Space_,X1,X2,X3,X4))), + SVar='SetVar'(Idx). + +%% 3 arguments +%% (Glb,LubMin,LubMax) 3 new_setvar_6 +%% (GlbMin,GlbMax,Lub) 3 new_setvar_9 +%% (Glb,Lub,CardMin) 3 new_setvar_11 +new_setvar(SVar,Space,X1,X2,X3) :- + assert_var(SVar), + assert_is_Space_or_Clause(Space,Space_), + (is_IntSet(X1,X1_) + -> (is_IntSet(X2,X2_) + -> + assert_integer(X3), + gecode_new_setvar_11(Idx,Space_,X1_,X2_,X3) + ; + assert_integer(X2), + assert_integer(X3), + gecode_new_setvar_6(Idx,Space_,X1_,X2,X3)) + ; + assert_integer(X1), + assert_integer(X2), + assert_is_IntSet(X3,X3_), + gecode_new_setvar_9(Idx,Space_,X1,X2,X3_)), + SVar='SetVar'(Idx). + +%% 2 arguments +%% (Glb,Lub) 2 new_setvar_12 +new_setvar(SVar,Space,X1,X2) :- + assert_var(SVar), + assert_is_Space_or_Clause(Space,Space_), + assert_is_IntSet(X1,X1_), + assert_is_IntSet(X2,X2_), + gecode_new_setvar_12(Idx,Space_,X1_,X2_), + SVar='SetVar'(Idx). + +minimize(Space,IVar) :- + assert_is_Space(Space,Space_), + assert_is_IntVar(IVar,IVar_), + gecode_space_minimize(Space_,IVar_). +maximize(Space,IVar) :- + assert_is_Space(Space,Space_), + assert_is_IntVar(IVar,IVar_), + gecode_space_maximize(Space_,IVar_). +minimize(Space,IVar1,IVar2) :- + assert_is_Space(Space,Space_), + assert_is_IntVar(IVar1,IVar1_), + assert_is_IntVar(IVar2,IVar2_), + gecode_space_minimize_ratio(Space_,IVar1_,IVar2_). +maximize(Space,IVar1,IVar2) :- + assert_is_Space(Space,Space_), + assert_is_IntVar(IVar1,IVar1_), + assert_is_IntVar(IVar2,IVar2_), + gecode_space_maximize_ratio(Space_,IVar1_,IVar2_). + +search(Space, Solution) :- + assert_is_Space(Space,Space_), + assert_var(Solution), + gecode_new_engine(Space_,Engine_), + gecode_engine_search(Engine_,Solution_), + Solution='Space'(Solution_). + +%% INSPECTING VARIABLES + +get_for_vars([],Space,[],F). +get_for_vars([V|Vs],Space,[V2|V2s],F) :- + call_with_args(F,V,Space,V2), + get_for_vars(Vs,Space,V2s,F). + +get_assigned(Space, Var) :- + assert_is_Space(Space,Space_), + is_IntVar(Var,Var_) + -> gecode_intvar_assigned(Space_,Var_) + ; is_BoolVar(Var,Var_) + -> gecode_boolvar_assigned(Space_,Var_) + ; is_SetVar(Var,Var_) + -> gecode_setvar_assigned(Space_,Var_) + ; throw(gecode_error(expected(variable))). + +get_min(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_IntVar(Var,Var_) + -> gecode_intvar_min(X, Space_, Var_) + ; is_BoolVar(Var,Var_) + -> gecode_boolvar_min(X, Space_, Var_) + ; get_for_vars(X, Space, Var, gecode:get_min). + +get_max(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_IntVar(Var,Var_) + -> gecode_intvar_max(X, Space_, Var_) + ; is_BoolVar(Var,Var_) + -> gecode_boolvar_max(X, Space_, Var_) + ; get_for_vars(X, Space, Var, gecode:get_max). + +get_med(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_IntVar(Var,Var_) + -> gecode_intvar_med(X, Space_, Var_) + ; is_BoolVar(Var,Var_) + -> gecode_boolvar_med(X, Space_, Var_) + ; get_for_vars(X, Space, Var, gecode:get_med). + +get_val(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_IntVar(Var,Var_) + -> gecode_intvar_val(X, Space_, Var_) + ; is_BoolVar(Var,Var_) + -> gecode_boolvar_val(X, Space_, Var_) + ; get_for_vars(X, Space, Var, gecode:get_val). + +get_size(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_IntVar(Var,Var_) + -> gecode_intvar_size(X, Space_, Var_) + ; is_BoolVar(Var,Var_) + -> gecode_boolvar_size(X, Space_, Var_) + ; get_for_vars(X, Space, Var, gecode:get_size). + +get_width(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_IntVar(Var,Var_) + -> gecode_intvar_width(X, Space_, Var_) + ; is_BoolVar(Var,Var_) + -> gecode_boolvar_width(X, Space_, Var_) + ; get_for_vars(X, Space, Var, gecode:get_width). + +get_regret_min(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_IntVar(Var,Var_) + -> gecode_intvar_regret_min(X, Space_, Var_) + ; is_BoolVar(Var,Var_) + -> gecode_boolvar_regret_min(X, Space_, Var_) + ; get_for_vars(X, Space, Var, gecode:get_regret_min). + +get_regret_max(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_IntVar(Var,Var_) + -> gecode_intvar_regret_max(X, Space_, Var_) + ; is_BoolVar(Var,Var_) + -> gecode_boolvar_regret_max(X, Space_, Var_) + ; get_for_vars(X, Space, Var, gecode:get_regret_max). + +get_glbSize(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_glbSize(X,Space_,Var_) + ; get_for_vars(X, Space, Var, gecode:get_glbSize). + +get_lubSize(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_lubSize(X,Space_,Var_) + ; get_for_vars(X, Space, Var, gecode:get_lubSize). + +get_unknownSize(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_unknownSize(X,Space_,Var_) + ; get_for_vars(X, Space, Var, gecode:get_unknownSize). + +get_cardMin(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_cardMin(X,Space_,Var_) + ; get_for_vars(X, Space, Var, gecode:get_cardMin). + +get_cardMax(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_cardMax(X,Space_,Var_) + ; get_for_vars(X, Space, Var, gecode:get_cardMax). + +get_lubMin(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_lubMin(X,Space_,Var_) + ; get_for_vars(X, Space, Var, gecode:get_lubMin). + +get_lubMax(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_lubMax(X,Space_,Var_) + ; get_for_vars(X, Space, Var, gecode:get_lubMax). + +get_glbMin(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_glbMin(X,Space_,Var_) + ; get_for_vars(X, Space, Var, gecode:get_glbMin). + +get_glbMax(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_glbMax(X,Space_,Var_) + ; get_for_vars(X, Space, Var, gecode:get_glbMax). + +get_glb_ranges(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_glb_ranges(X,Space_,Var_) + ; get_for_vars(X,Space,Var,gecode:get_glb_ranges). + +get_lub_ranges(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_lub_ranges(X,Space_,Var_) + ; get_for_vars(X,Space,Var,gecode:get_lub_ranges). + +get_unknown_ranges(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_unknown_ranges(X,Space_,Var_) + ; get_for_vars(X,Space,Var,gecode:get_unknown_ranges). + +get_glb_values(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_glb_values(X,Space_,Var_) + ; get_for_vars(X,Space,Var,gecode:get_glb_values). + +get_lub_values(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_lub_values(X,Space_,Var_) + ; get_for_vars(X,Space,Var,gecode:get_lub_values). + +get_unknown_values(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_SetVar(Var,Var_) + -> gecode_setvar_unknown_values(X,Space_,Var_) + ; get_for_vars(X,Space,Var,gecode:get_unknown_values). + +get_ranges(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_IntVar(Var,Var_) + -> gecode_intvar_ranges(X,Space_,Var_) + ; get_for_vars(X,Space,Var,gecode:get_ranges). + +get_values(X, Space, Var) :- + assert_is_Space(Space,Space_), + is_IntVar(Var,Var_) + -> gecode_intvar_values(X,Space_,Var_) + ; get_for_vars(X,Space,Var,gecode:get_values). + +new_disjunctor(X, Space) :- + assert_is_Space(Space,Space_), + gecode_new_disjunctor(D,Space_), + X='Disjunctor'(D). + +is_Disjunctor_('Disjunctor'(D),D). +is_Disjunctor(X,Y) :- nonvar(X), is_Disjunctor_(X,Y). +is_Disjunctor(X) :- is_Disjunctor(X,_). + +assert_is_Disjunctor(X,Y) :- + is_Disjunctor(X,Y) -> true ; throw(gecode_error(expected(disjunctor))). + +new_clause(X, Disj) :- + assert_is_Disjunctor(Disj,Disj_), + gecode_new_clause(C, Disj_), + X='Clause'(C). + +is_Clause_('Clause'(C),C). +is_Clause(X,Y) :- nonvar(X), is_Clause_(X,Y). +is_Clause(X) :- is_Clause(X,_). + +assert_is_Clause(X,Y) :- + is_Clause(X,Y) -> true ; throw(gecode_error(expected(clause))). + +is_Space_or_Clause(X,Y) :- + (is_Space(X,Y);is_Clause(X,Y)), !. +assert_is_Space_or_Clause(X,Y) :- + is_Space_or_Clause(X,Y) -> true + ; throw(gecode_error(expected(space,clause))). + +new_forward(Clause, X, Y) :- + assert_is_Clause(Clause, Clause_), + (is_IntVar(X,X_) + -> (is_IntVar(Y,Y_) + -> gecode_clause_intvar_forward(Clause_,X_,Y_) + ; throw(gecode_error(forward))) + ; (is_BoolVar(X,X_) + -> (is_BoolVar(Y,Y_) + -> gecode_clause_boolvar_forward(Clause_,X_,Y_) + ; throw(gecode_error(forward))) + ; (is_SetVar(X,X_) + -> (is_SetVar(Y,Y_) + -> gecode_clause_setvar_forward(Clause_,X_,Y_) + ; throw(gecode_error(forward))) + ; (X=[] + -> Y=[] + ;(X=[H1|T1],Y=[H2|T2]) + -> (new_forward(Clause,H1,H2), + new_forward(Clause,T1,T2)) + ; throw(gecode_error(forward)))))). + +new_intvars_(L,Space,N,I,J) :- length(L,N), new_intvars(L,Space,I,J). +new_intvars_(L,Space,N,IntSet) :- length(L,N), new_intvars(L,Space,IntSet). +new_boolvars_(L,Space,N) :- length(L,N), new_boolvars(L,Space). +new_setvars_(L,Space,N,X1,X2,X3,X4,X5,X6) :- length(L,N), new_setvars(L,Space,X1,X2,X3,X4,X5,X6). +new_setvars_(L,Space,N,X1,X2,X3,X4,X5) :- length(L,N), new_setvars(L,Space,X1,X2,X3,X4,X5). +new_setvars_(L,Space,N,X1,X2,X3,X4) :- length(L,N), new_setvars(L,Space,X1,X2,X3,X4). +new_setvars_(L,Space,N,X1,X2,X3) :- length(L,N), new_setvars(L,Space,X1,X2,X3). +new_setvars_(L,Space,N,X1,X2) :- length(L,N), new_setvars(L,Space,X1,X2). + +%% more concise interface: +(X := Y) :- var(Y), !, throw(gecode_error((X := Y))). +(X := intset(I,J)) :- !, new_intset(X,I,J). +(X := intset(L)) :- !, new_intset(X,L). +(X := space) :- !, new_space(X). +(X := intvar(Space,I,J)) :- !, new_intvar(X,Space,I,J). +(X := intvar(Space,IntSet)) :- !, new_intvar(X,Space,IntSet). +(X := boolvar(Space)) :- !, new_boolvar(X,Space). +(X := setvar(Space,X1,X2,X3,X4,X5,X6)) :- !, new_setvar(X,Space,X1,X2,X3,X4,X5,X6). +(X := setvar(Space,X1,X2,X3,X4,X5)) :- !, new_setvar(X,Space,X1,X2,X3,X4,X5). +(X := setvar(Space,X1,X2,X3,X4)) :- !, new_setvar(X,Space,X1,X2,X3,X4). +(X := setvar(Space,X1,X2,X3)) :- !, new_setvar(X,Space,X1,X2,X3). +(X := setvar(Space,X1,X2)) :- !, new_setvar(X,Space,X1,X2). +(X := intvars(Space,N,I,J)) :- !, new_intvars_(X,Space,N,I,J). +(X := intvars(Space,N,IntSet)) :- !, new_intvars_(X,Space,N,IntSet). +(X := boolvars(Space,N)) :- !, new_boolvars_(X,Space,N). +(X := setvars(Space,N,X1,X2,X3,X4,X5,X6)) :- !, new_setvars_(X,Space,N,X1,X2,X3,X4,X5,X6). +(X := setvars(Space,N,X1,X2,X3,X4,X5)) :- !, new_setvars_(X,Space,N,X1,X2,X3,X4,X5). +(X := setvars(Space,N,X1,X2,X3,X4)) :- !, new_setvars_(X,Space,N,X1,X2,X3,X4). +(X := setvars(Space,N,X1,X2,X3)) :- !, new_setvars_(X,Space,N,X1,X2,X3). +(X := setvars(Space,N,X1,X2)) :- !, new_setvars_(X,Space,N,X1,X2). + +(X := min(Space,Var)) :- !, get_min(X,Space,Var). +(X := max(Space,Var)) :- !, get_max(X,Space,Var). +(X := med(Space,Var)) :- !, get_med(X,Space,Var). +(X := val(Space,Var)) :- !, get_val(X,Space,Var). +(X := size(Space,Var)) :- !, get_size(X,Space,Var). +(X := width(Space,Var)) :- !, get_width(X,Space,Var). +(X := regret_min(Space,Var)) :- !, get_regret_min(X,Space,Var). +(X := regret_max(Space,Var)) :- !, get_regret_max(X,Space,Var). +(X := ranges(Space,Var)) :- !, get_ranges(X,Space,Var). +(X := values(Space,Var)) :- !, get_values(X,Space,Var). + +(X := glbSize(Space,Var)) :- !, get_glbSize(X,Space,Var). +(X := lubSize(Space,Var)) :- !, get_lubSize(X,Space,Var). +(X := unknownSize(Space,Var)) :- !, get_unknownSize(X,Space,Var). +(X := cardMin(Space,Var)) :- !, get_cardMin(X,Space,Var). +(X := cardMax(Space,Var)) :- !, get_cardMax(X,Space,Var). +(X := lubMin(Space,Var)) :- !, get_lubMin(X,Space,Var). +(X := lubMax(Space,Var)) :- !, get_lubMax(X,Space,Var). +(X := glbMin(Space,Var)) :- !, get_glbMin(X,Space,Var). +(X := glbMax(Space,Var)) :- !, get_glbMax(X,Space,Var). +(X := glb_ranges(Space,Var)) :- !, get_glb_ranges(X,Space,Var). +(X := lub_ranges(Space,Var)) :- !, get_lub_ranges(X,Space,Var). +(X := unknown_ranges(Space,Var)) :- !, get_unknown_ranges(X,Space,Var). +(X := glb_values(Space,Var)) :- !, get_glb_values(X,Space,Var). +(X := lub_values(Space,Var)) :- !, get_lub_values(X,Space,Var). +(X := unknown_values(Space,Var)) :- !, get_unknown_values(X,Space,Var). + +(X := disjunctor(Space)) :- !, new_disjunctor(X,Space). +(X := clause(Disj)) :- !, new_clause(X,Disj). + +(X := search(Y)) :- !, search(Y,X). + +% these should be autogenerated: +(C += forward(X,Y)) :- !, new_forward(C,X,Y). +(Space += abs(X1,X2)) :- !, abs(Space,X1,X2). +(Space += abs(X1,X2,X3)) :- !, abs(Space,X1,X2,X3). +(Space += assign(X1,X2)) :- !, assign(Space,X1,X2). +(Space += atmostOne(X1,X2)) :- !, atmostOne(Space,X1,X2). +(Space += binpacking(X1,X2,X3)) :- !, binpacking(Space,X1,X2,X3). +(Space += binpacking(X1,X2,X3,X4)) :- !, binpacking(Space,X1,X2,X3,X4). +(Space += branch(X1,X2)) :- !, branch(Space,X1,X2). +(Space += branch(X1,X2,X3)) :- !, branch(Space,X1,X2,X3). +(Space += cardinality(X1,X2)) :- !, cardinality(Space,X1,X2). +(Space += cardinality(X1,X2,X3)) :- !, cardinality(Space,X1,X2,X3). +(Space += channel(X1,X2)) :- !, channel(Space,X1,X2). +(Space += channel(X1,X2,X3)) :- !, channel(Space,X1,X2,X3). +(Space += channel(X1,X2,X3,X4)) :- !, channel(Space,X1,X2,X3,X4). +(Space += channel(X1,X2,X3,X4,X5)) :- !, channel(Space,X1,X2,X3,X4,X5). +(Space += channelSorted(X1,X2)) :- !, channelSorted(Space,X1,X2). +(Space += circuit(X1)) :- !, circuit(Space,X1). +(Space += circuit(X1,X2)) :- !, circuit(Space,X1,X2). +(Space += circuit(X1,X2,X3)) :- !, circuit(Space,X1,X2,X3). +(Space += circuit(X1,X2,X3,X4)) :- !, circuit(Space,X1,X2,X3,X4). +(Space += circuit(X1,X2,X3,X4,X5)) :- !, circuit(Space,X1,X2,X3,X4,X5). +(Space += circuit(X1,X2,X3,X4,X5,X6)) :- !, circuit(Space,X1,X2,X3,X4,X5,X6). +(Space += clause(X1,X2,X3,X4)) :- !, clause(Space,X1,X2,X3,X4). +(Space += clause(X1,X2,X3,X4,X5)) :- !, clause(Space,X1,X2,X3,X4,X5). +(Space += convex(X1)) :- !, convex(Space,X1). +(Space += convex(X1,X2)) :- !, convex(Space,X1,X2). +(Space += count(X1,X2)) :- !, count(Space,X1,X2). +(Space += count(X1,X2,X3)) :- !, count(Space,X1,X2,X3). +(Space += count(X1,X2,X3,X4)) :- !, count(Space,X1,X2,X3,X4). +(Space += count(X1,X2,X3,X4,X5)) :- !, count(Space,X1,X2,X3,X4,X5). +(Space += cumulative(X1,X2,X3,X4)) :- !, cumulative(Space,X1,X2,X3,X4). +(Space += cumulative(X1,X2,X3,X4,X5)) :- !, cumulative(Space,X1,X2,X3,X4,X5). +(Space += cumulative(X1,X2,X3,X4,X5,X6)) :- !, cumulative(Space,X1,X2,X3,X4,X5,X6). +(Space += cumulative(X1,X2,X3,X4,X5,X6,X7)) :- !, cumulative(Space,X1,X2,X3,X4,X5,X6,X7). +(Space += cumulatives(X1,X2,X3,X4,X5,X6,X7)) :- !, cumulatives(Space,X1,X2,X3,X4,X5,X6,X7). +(Space += cumulatives(X1,X2,X3,X4,X5,X6,X7,X8)) :- !, cumulatives(Space,X1,X2,X3,X4,X5,X6,X7,X8). +(Space += distinct(X1)) :- !, distinct(Space,X1). +(Space += distinct(X1,X2)) :- !, distinct(Space,X1,X2). +(Space += distinct(X1,X2,X3)) :- !, distinct(Space,X1,X2,X3). +(Space += div(X1,X2,X3)) :- !, div(Space,X1,X2,X3). +(Space += div(X1,X2,X3,X4)) :- !, div(Space,X1,X2,X3,X4). +(Space += divmod(X1,X2,X3,X4)) :- !, divmod(Space,X1,X2,X3,X4). +(Space += divmod(X1,X2,X3,X4,X5)) :- !, divmod(Space,X1,X2,X3,X4,X5). +(Space += dom(X1,X2)) :- !, dom(Space,X1,X2). +(Space += dom(X1,X2,X3)) :- !, dom(Space,X1,X2,X3). +(Space += dom(X1,X2,X3,X4)) :- !, dom(Space,X1,X2,X3,X4). +(Space += dom(X1,X2,X3,X4,X5)) :- !, dom(Space,X1,X2,X3,X4,X5). +(Space += element(X1,X2,X3)) :- !, element(Space,X1,X2,X3). +(Space += element(X1,X2,X3,X4)) :- !, element(Space,X1,X2,X3,X4). +(Space += element(X1,X2,X3,X4,X5)) :- !, element(Space,X1,X2,X3,X4,X5). +(Space += element(X1,X2,X3,X4,X5,X6)) :- !, element(Space,X1,X2,X3,X4,X5,X6). +(Space += element(X1,X2,X3,X4,X5,X6,X7)) :- !, element(Space,X1,X2,X3,X4,X5,X6,X7). +(Space += linear(X1,X2,X3)) :- !, linear(Space,X1,X2,X3). +(Space += linear(X1,X2,X3,X4)) :- !, linear(Space,X1,X2,X3,X4). +(Space += linear(X1,X2,X3,X4,X5)) :- !, linear(Space,X1,X2,X3,X4,X5). +(Space += linear(X1,X2,X3,X4,X5,X6)) :- !, linear(Space,X1,X2,X3,X4,X5,X6). +(Space += max(X1,X2)) :- !, max(Space,X1,X2). +(Space += max(X1,X2,X3)) :- !, max(Space,X1,X2,X3). +(Space += max(X1,X2,X3,X4)) :- !, max(Space,X1,X2,X3,X4). +(Space += min(X1,X2)) :- !, min(Space,X1,X2). +(Space += min(X1,X2,X3)) :- !, min(Space,X1,X2,X3). +(Space += min(X1,X2,X3,X4)) :- !, min(Space,X1,X2,X3,X4). +(Space += mod(X1,X2,X3)) :- !, mod(Space,X1,X2,X3). +(Space += mod(X1,X2,X3,X4)) :- !, mod(Space,X1,X2,X3,X4). +(Space += mult(X1,X2,X3)) :- !, mult(Space,X1,X2,X3). +(Space += mult(X1,X2,X3,X4)) :- !, mult(Space,X1,X2,X3,X4). +(Space += nooverlap(X1,X2,X3,X4)) :- !, nooverlap(Space,X1,X2,X3,X4). +(Space += nooverlap(X1,X2,X3,X4,X5)) :- !, nooverlap(Space,X1,X2,X3,X4,X5). +(Space += nooverlap(X1,X2,X3,X4,X5,X6)) :- !, nooverlap(Space,X1,X2,X3,X4,X5,X6). +(Space += nooverlap(X1,X2,X3,X4,X5,X6,X7)) :- !, nooverlap(Space,X1,X2,X3,X4,X5,X6,X7). +(Space += nooverlap(X1,X2,X3,X4,X5,X6,X7,X8)) :- !, nooverlap(Space,X1,X2,X3,X4,X5,X6,X7,X8). +(Space += notMax(X1,X2)) :- !, notMax(Space,X1,X2). +(Space += notMin(X1,X2)) :- !, notMin(Space,X1,X2). +(Space += path(X1,X2,X3)) :- !, path(Space,X1,X2,X3). +(Space += path(X1,X2,X3,X4)) :- !, path(Space,X1,X2,X3,X4). +(Space += path(X1,X2,X3,X4,X5)) :- !, path(Space,X1,X2,X3,X4,X5). +(Space += path(X1,X2,X3,X4,X5,X6)) :- !, path(Space,X1,X2,X3,X4,X5,X6). +(Space += path(X1,X2,X3,X4,X5,X6,X7)) :- !, path(Space,X1,X2,X3,X4,X5,X6,X7). +(Space += path(X1,X2,X3,X4,X5,X6,X7,X8)) :- !, path(Space,X1,X2,X3,X4,X5,X6,X7,X8). +(Space += precede(X1,X2)) :- !, precede(Space,X1,X2). +(Space += precede(X1,X2,X3)) :- !, precede(Space,X1,X2,X3). +(Space += precede(X1,X2,X3,X4)) :- !, precede(Space,X1,X2,X3,X4). +(Space += rel(X1,X2)) :- !, rel(Space,X1,X2). +(Space += rel(X1,X2,X3)) :- !, rel(Space,X1,X2,X3). +(Space += rel(X1,X2,X3,X4)) :- !, rel(Space,X1,X2,X3,X4). +(Space += rel(X1,X2,X3,X4,X5)) :- !, rel(Space,X1,X2,X3,X4,X5). +(Space += sequence(X1)) :- !, sequence(Space,X1). +(Space += sequence(X1,X2)) :- !, sequence(Space,X1,X2). +(Space += sequence(X1,X2,X3,X4,X5)) :- !, sequence(Space,X1,X2,X3,X4,X5). +(Space += sequence(X1,X2,X3,X4,X5,X6)) :- !, sequence(Space,X1,X2,X3,X4,X5,X6). +(Space += sorted(X1,X2)) :- !, sorted(Space,X1,X2). +(Space += sorted(X1,X2,X3)) :- !, sorted(Space,X1,X2,X3). +(Space += sorted(X1,X2,X3,X4)) :- !, sorted(Space,X1,X2,X3,X4). +(Space += sqr(X0,X1,X2,X3)) :- !, sqr(Space,X0,X1,X2,X3). +(Space += sqr(X1,X2)) :- !, sqr(Space,X1,X2). +(Space += sqrt(X1,X2)) :- !, sqrt(Space,X1,X2). +(Space += sqrt(X1,X2,X3)) :- !, sqrt(Space,X1,X2,X3). +(Space += unary(X1,X2)) :- !, unary(Space,X1,X2). +(Space += unary(X1,X2,X3)) :- !, unary(Space,X1,X2,X3). +(Space += unary(X1,X2,X3,X4)) :- !, unary(Space,X1,X2,X3,X4). +(Space += unary(X1,X2,X3,X4,X5)) :- !, unary(Space,X1,X2,X3,X4,X5). +(Space += unshare(X1)) :- !, unshare(Space,X1). +(Space += unshare(X1,X2)) :- !, unshare(Space,X1,X2). +(Space += weights(X1,X2,X3,X4)) :- !; weights(Space,X1,X2,X3,X4). + +(Space += minimize(X)) :- !, minimize(Space,X). +(Space += maximize(X)) :- !, maximize(Space,X). +(Space += minimize(X,Y)) :- !, minimize(Space,X,Y). +(Space += maximize(X,Y)) :- !, maximize(Space,X,Y). diff --git a/library/gecode/send_more_money.yap b/library/gecode/send_more_money.yap new file mode 100644 index 000000000..7df9db5a9 --- /dev/null +++ b/library/gecode/send_more_money.yap @@ -0,0 +1,41 @@ +%% -*- prolog -*- +%%============================================================================= +%% 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 . +%%============================================================================= + +:- use_module(gecode). + +% S E N D +% + M O R E +% --------- +% M O N E Y +send_more_money(Solution) :- + Space := space, + Letters := intvars(Space,8,0,9), + [S,E,N,D,M,O,R,Y] = Letters, + Space += rel(M,'IRT_NQ',0), + Space += rel(S,'IRT_NQ',0), + Space += distinct(Letters), + C = [1000, 100, 10, 1, + 1000, 100, 10, 1, + -10000, -1000, -100, -10, -1], + X = [S,E,N,D, + M,O,R,E, + M,O,N,E,Y], + Space += linear(C, X, 'IRT_EQ', 0), + Space += branch(Letters, 'INT_VAR_SIZE_MIN', 'INT_VAL_MIN'), + SolSpace := search(Space), + Solution := val(SolSpace,Letters). diff --git a/library/gecode/send_most_money.yap b/library/gecode/send_most_money.yap new file mode 100644 index 000000000..7dae5afc9 --- /dev/null +++ b/library/gecode/send_most_money.yap @@ -0,0 +1,45 @@ +%% -*- prolog -*- +%%============================================================================= +%% 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 . +%%============================================================================= + +:- use_module(gecode). + +% S E N D +% + M O S T +% --------- +% M O N E Y +send_most_money(Solution,Amount) :- + Space := space, + Letters := intvars(Space,8,0,9), + [S,E,N,D,M,O,T,Y] = Letters, + Space += rel(M,'IRT_NQ',0), + Space += rel(S,'IRT_NQ',0), + Space += distinct(Letters), + C = [1000, 100, 10, 1, + 1000, 100, 10, 1, + -10000, -1000, -100, -10, -1], + X = [S,E,N,D, + M,O,S,T, + M,O,N,E,Y], + Space += linear(C, X, 'IRT_EQ', 0), + Money := intvar(Space,0,99999), + Space += linear([10000,1000,100,10,1],[M,O,N,E,Y],'IRT_EQ',Money), + Space += maximize(Money), + Space += branch(Letters,'INT_VAR_SIZE_MIN','INT_VAL_MIN'), + SolSpace := search(Space), + Solution := val(SolSpace,Letters), + Amount := val(SolSpace,Money). diff --git a/misc/LOCALS b/misc/LOCALS index cf27e5fd0..2f169360d 100644 --- a/misc/LOCALS +++ b/misc/LOCALS @@ -206,7 +206,7 @@ Int total_atom_table_overflow_time =0 //load_dyld #ifdef LOAD_DYLD -static dl_errno =0 +int dl_errno =0 #endif //tracer.c @@ -214,7 +214,12 @@ static dl_errno =0 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 + END_WORKER_LOCAL - - - diff --git a/misc/buildops b/misc/buildops index 50a24ee44..41343394b 100644 --- a/misc/buildops +++ b/misc/buildops @@ -31,44 +31,51 @@ main :- open('H/walkclause.h',write,L), open('H/findclause.h',write,F), open('H/headclause.h',write,H), + open('H/saveclause.h',write,S), header(W), header_rclause(C), header_walk_clause(L), header_find_clause(F), header_find_clause(H), - file('C/absmi.c', W, C, L, F, H), - start_ifdef("YAPOR", W, C, L, F, H), - file('OPTYap/or.insts.i',W, C, L, F, H), - end_ifdef(W, C, L, F, H), - start_ifdef("TABLING", W, C, L, F, H), - file('OPTYap/tab.insts.i',W,C,L, F, H), + header_save_clause(S), + file('C/absmi.c', W, C, L, F, H, S), + start_ifdef("YAPOR", W, C, L, F, H, S), + file('OPTYap/or.insts.i',W, C, L, F, H, S), + end_ifdef(W, C, L, F, H, S), + start_ifdef("TABLING", W, C, L, F, H, S), + file('OPTYap/tab.insts.i',W,C,L, F, H, S), retractall(op(_,_)), - file('OPTYap/tab.tries.insts.i', W, C, L, F, H), - end_ifdef(W, C, L, F, H), + file('OPTYap/tab.tries.insts.i', W, C, L, F, H, S), + end_ifdef(W, C, L, F, H, S), footer(W), footer_rclause(C), footer_walk_clause(L), footer_find_clause(F), footer_find_clause(H), + footer_save_clause(S), close(F), close(L), close(W), - close(C). + close(C), + close(H), + close(S). -start_ifdef(D, W, C, L, F, H) :- +start_ifdef(D, W, C, L, F, H, S) :- retractall(op(_,_)), format(W, '#ifdef ~s~n',[D]), format(C, '#ifdef ~s~n',[D]), format(L, '#ifdef ~s~n',[D]), format(F, '#ifdef ~s~n',[D]), - format(H, '#ifdef ~s~n',[D]). + format(H, '#ifdef ~s~n',[D]), + format(S, '#ifdef ~s~n',[D]). -end_ifdef(W,C,L,F,H) :- +end_ifdef(W,C,L,F,H, S) :- format(W, '#endif~n',[]), format(C, '#endif~n',[]), format(L, '#endif~n',[]), format(F, '#endif~n',[]), - format(H, '#endif~n',[]). + format(H, '#endif~n',[]), + format(S, '#endif~n',[]). header(W) :- format(W,'~n /* This file was generated automatically by \"yap -L misc/buildops\"~n please do not update */~n~n',[]). @@ -101,6 +108,17 @@ header_walk_clause(W) :- switch (op) { ',[]). +header_save_clause(W) :- + format(W,'~n /* This file was generated automatically by \"yap -L misc/buildops\"~n please do not update */~n~n + while (TRUE) { + op_numbers op; + if (max && pc >= max) return 1; + op = Yap_op_from_opcode(pc->opc); + save_Opcode(stream, op); + + /* C-code, maybe indexing */ + switch (op) { +',[]). header_find_clause(W) :- format(W,'~n /* This file was generated automatically by \"yap -L misc/buildops\"~n please do not update */~n~n @@ -110,14 +128,15 @@ header_find_clause(W) :- ',[]). -file(I,W,C,L,F,H) :- +file(I,W,C,L,F,H, S) :- open(I,read,R), process(R,grep_opcode(W)), close(R), output_rclause(C), output_walk_clause(L), output_find_clause(F), - output_head_clause(H). + output_head_clause(H), + output_save_clause(S). grep_opcode(W, Line) :- split(Line," ,();",[OP,Name,Type]), @@ -728,6 +747,12 @@ footer_find_clause(W) :- } }~n',[]). +footer_save_clause(S) :- + format(S,'default: + return -1; + } + }~n',[]). + get_field_names(F) :- open(F, read, A), loop_for_fields(A), @@ -1098,3 +1123,43 @@ opinfo("alloc_for_logical_pred",[body]). opinfo("deallocate",[body]). opinfo("table_try_single",[]). opinfo("native_me",[]). + +output_save_clause(S) :- + setof(T,O^op(T,O),Types), + member(T, Types), + output_save_type(S, T), + fail. +output_save_clause(_). + +output_save_type(S, T) :- + format(S,' /* instructions type ~s */~n',[T]), + setof(Op,op(T,Op),Ops), + dump_ops(S,Ops), + % then the code for every instruction with this header. + tinfo(T, Desc), + output_save(S, T, Desc, T), + format(S,' pc = NEXTOP(pc,~s);~n',[T]), + format(S,' break;~n',[]). + +output_save(S, "e", [], _) :- + format(S, " if (op == _Nstop || op == _copy_idb_term || op == _unify_idb_term) return 1;~n", []). +output_save(_, [], [], _). +output_save(S, [Name|Names], [Type|Types], Desc) :- + output_save_type(S, Name, Type, Desc), + output_save(S, Names, Types, Desc). + +output_save_type(S, OpT, T-"none", Desc) :- !, + get_op(OpT, Name), + format(S, " CHECK(save_~s(stream, pc->u.~s.~s));~n", [Name, Desc, T]). +output_save_type(S, OpT, T-Def, Desc) :- + get_op(OpT, Name), + format(S, "#ifdef ~s~n CHECK(save_~s(stream, pc->u.~s.~s));~n#endif~n", [Def,Name, Desc, T]). + + + + + + + + + diff --git a/packages/PLStream/pl-incl.h b/packages/PLStream/pl-incl.h index 281bb9849..1dc5bf6eb 100644 --- a/packages/PLStream/pl-incl.h +++ b/packages/PLStream/pl-incl.h @@ -9,6 +9,7 @@ #include #include #define O_HASDRIVES 1 +#define O_HASSHARES 1 #endif #ifndef PL_CONSOLE @@ -25,6 +26,7 @@ #include "Yap.h" #include "YapHeap.h" + /* try not to pollute the SWI space */ #ifdef P #undef P diff --git a/packages/PLStream/pl-prologflag.c b/packages/PLStream/pl-prologflag.c index 4d0b17616..753af0365 100644 --- a/packages/PLStream/pl-prologflag.c +++ b/packages/PLStream/pl-prologflag.c @@ -74,7 +74,9 @@ too much. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */ #ifndef __YAP_PROLOG__ static void setArgvPrologFlag(void); +#endif static void setTZPrologFlag(void); +#ifndef __YAP_PROLOG__ static void setVersionPrologFlag(void); #endif static atom_t lookupAtomFlag(atom_t key); @@ -1111,7 +1113,9 @@ initPrologFlags(void) #ifndef __YAP_PROLOG__ setArgvPrologFlag(); +#endif /* YAP_PROLOG */ setTZPrologFlag(); +#ifndef __YAP_PROLOG__ setOSPrologFlags(); setVersionPrologFlag(); #endif /* YAP_PROLOG */ @@ -1141,6 +1145,8 @@ setArgvPrologFlag() PL_discard_foreign_frame(fid); } +#endif + static void setTZPrologFlag() { tzset(); @@ -1148,6 +1154,7 @@ setTZPrologFlag() setPrologFlag("timezone", FT_INTEGER|FF_READONLY, timezone); } +#ifndef __YAP_PROLOG__ static void setVersionPrologFlag(void) diff --git a/packages/PLStream/pl-write.c b/packages/PLStream/pl-write.c index f9a6824cc..6042c8f87 100644 --- a/packages/PLStream/pl-write.c +++ b/packages/PLStream/pl-write.c @@ -276,7 +276,6 @@ PutToken(const char *s, IOSTREAM *stream) return TRUE; } - static int PutTokenN(const char *s, size_t len, IOSTREAM *stream) { if ( len > 0 ) @@ -291,6 +290,63 @@ PutTokenN(const char *s, size_t len, IOSTREAM *stream) return TRUE; } +#if __YAP_PROLOG__ +static bool +PutWideStringN(const wchar_t *str, size_t length, IOSTREAM *s) +{ size_t i; + const wchar_t *q = (const wchar_t *)str; + + for(i=0; i 0 ) + { int rc; + + TRY(rc=PutOpenToken(s[0]&0xff, stream)); + TRY(PutWideStringN(s, len, stream)); + + return rc; + } + + return TRUE; +} + +#endif + /* - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PutOpenBrace()/PutCloseBrace() are used to put additional braces around @@ -518,6 +574,11 @@ writeAtom(atom_t a, write_options *options) case AT_SYMBOL: case AT_SOLO: case AT_SPECIAL: +#if __YAP_PROLOG__ + if (isWideAtom(atom)) { + return PutWideToken(nameOfWideAtom(atom), options->out); + } +#endif return PutToken(nameOfAtom(atom), options->out); case AT_QUOTE: case AT_FULLSTOP: @@ -532,8 +593,14 @@ writeAtom(atom_t a, write_options *options) return rc; } } - } else + } else { +#if __YAP_PROLOG__ + if (isWideAtom(atom)) { + return PutWideTokenN(nameOfWideAtom(atom), atomLength(atom), options->out); + } +#endif return PutTokenN(nameOfAtom(atom), atomLength(atom), options->out); + } } @@ -886,10 +953,16 @@ writePrimitive(term_t t, write_options *options) #if __YAP_PROLOG__ { - number n; - n.type = V_INTEGER; - n.value.i = 0; - return WriteNumber(&n, options); + Opaque_CallOnWrite f; + + if ( (f = Yap_blob_write_handler_from_slot(t)) ) { + return (f)(options->out, Yap_blob_tag_from_slot(t), Yap_blob_info_from_slot(t), options->flags); + } else { + number n; + n.type = V_INTEGER; + n.value.i = 0; + return WriteNumber(&n, options); + } } #endif diff --git a/packages/PLStream/pl-yap.c b/packages/PLStream/pl-yap.c index 24f517fae..fbf1f5a96 100644 --- a/packages/PLStream/pl-yap.c +++ b/packages/PLStream/pl-yap.c @@ -993,6 +993,14 @@ int Yap_getInputStream(term_t t, IOSTREAM **s) return getInputStream(t, s); } +extern int Yap_getOutputStream(term_t t, IOSTREAM **s); + +int Yap_getOutputStream(term_t t, IOSTREAM **s) +{ + GET_LD + return getOutputStream(t, s); +} + #ifdef _WIN32 #include @@ -1157,6 +1165,20 @@ Yap_dowrite(Term t, IOSTREAM *stream, int flags, int priority) return res; } +int +isWideAtom(atom_t atom) +{ + Atom a = (Atom)atomValue(atom); + return IsWideAtom(a); +} + +wchar_t * +nameOfWideAtom(atom_t atom) +{ + Atom a = (Atom)atomValue(atom); + return RepAtom(a)->WStrOfAE; +} + #if THREADS @@ -1207,7 +1229,6 @@ error: return rc; } - int recursiveMutexInit(recursiveMutex *m) { diff --git a/packages/PLStream/pl-yap.h b/packages/PLStream/pl-yap.h index 54089ff13..55f648967 100644 --- a/packages/PLStream/pl-yap.h +++ b/packages/PLStream/pl-yap.h @@ -148,6 +148,9 @@ extern term_t Yap_CvtTerm(term_t ts); #define clearNumber(n) +wchar_t *nameOfWideAtom(atom_t atom); +int isWideAtom(atom_t atom); + inline static int charCode(Term w) { if ( IsAtomTerm(w) ) diff --git a/packages/PLStream/windows/uxnt.c b/packages/PLStream/windows/uxnt.c index 27f878d6a..752fb124d 100644 --- a/packages/PLStream/windows/uxnt.c +++ b/packages/PLStream/windows/uxnt.c @@ -516,7 +516,7 @@ are in UTF-8 encoding! char * _xos_limited_os_filename(const char *spec, char *limited) -{ const unsigned char *i = (const unsigned char*)spec; +{ const char *i = spec; char *o = limited; while(*i) diff --git a/packages/clib b/packages/clib index a6f0f4ec7..c9493b2c7 160000 --- a/packages/clib +++ b/packages/clib @@ -1 +1 @@ -Subproject commit a6f0f4ec7d5fd51ca8b268b8392da9b20bfd1b44 +Subproject commit c9493b2c73e3c8ab8b8524a13352bf0f3ec545a9 diff --git a/packages/sgml b/packages/sgml index f1c3ef54f..17f0b15b0 160000 --- a/packages/sgml +++ b/packages/sgml @@ -1 +1 @@ -Subproject commit f1c3ef54f4d9431ba5b4188cb72ca3056d20b202 +Subproject commit 17f0b15b0fb0af5fc558bc303e32d4f5e3bdce98 diff --git a/pl/boot.yap b/pl/boot.yap index 642671b3d..36c29462c 100644 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -143,8 +143,8 @@ true :- true. */ /* main execution loop */ -'$read_vars'(user_input, Goal, Mod, Pos, Bindings, Prompt, ReadComments) :- - '$swi_current_prolog_flag'(readline, true), +'$read_toplevel'(Goal, Bindings) :- + '$swi_current_prolog_flag'(readline, true), !, read_history(h, '!h', [trace, end_of_file], Prompt, Goal, Bindings), !, @@ -153,13 +153,28 @@ true :- true. ; true ). -'$read_vars'(Stream, T, Mod, Pos, V, _Prompt, ReadComments) :- - '$read'(true, T, Mod, V, Pos, Err, ReadComments, Stream), - (nonvar(Err) -> - print_message(error,Err), fail - ; - true - ). +'$read_toplevel'(Goal, Bindings) :- + prompt(_,'?- '), + prompt1('|: '), + '$system_catch'('$raw_read'(user_input, Line), prolog, E, + (print_message(error, E), + ( E = error(syntax_error(_), _) + -> fail + ; throw(E) + ))), + ( current_predicate(_, user:rl_add_history(_)) + -> format(atom(CompleteLine), '~W~W', + [ Line, [partial(true)], + '.', [partial(true)] + ]), + call(user:rl_add_history(CompleteLine)) + ; true + ), + '$system_catch'(atom_to_term(Line, Goal, Bindings), prolog, E, + ( print_message(error, E), + fail + )), !. + % reset alarms when entering top-level. '$enter_top_level' :- @@ -187,19 +202,19 @@ true :- true. '$enter_top_level' :- get_value('$top_level_goal',GA), GA \= [], !, set_value('$top_level_goal',[]), + format('hello1 ~w~n',[GA]), '$run_atom_goal'(GA), set_value('$live','$false'). '$enter_top_level' :- '$disable_docreep', - prompt(_,'| '), '$run_toplevel_hooks', - prompt1('|: '), - '$read_vars'(user_input,Command,_,Pos,Varnames, ' ?- ', no), + prompt1(' ?- '), + '$read_toplevel'(Command,Varnames), nb_setval('$spy_gn',1), - % stop at spy-points if debugging is on. + % stop at spy-points if debugging is on. nb_setval('$debug_run',off), nb_setval('$debug_jump',off), - '$command'(Command,Varnames,Pos,top), + '$command'(Command,Varnames,_Pos,top), '$sync_mmapped_arrays', set_value('$live','$false'). @@ -1102,6 +1117,13 @@ bootstrap(F) :- !, close(Stream). +'$read_vars'(Stream, T, Mod, Pos, V, _Prompt, ReadComments) :- + '$read'(true, T, Mod, V, Pos, Err, ReadComments, Stream), + (nonvar(Err) -> + print_message(error,Err), fail + ; + true + ). '$init_path_extensions' :- get_value('$extend_file_search_path',P), !, diff --git a/pl/flags.yap b/pl/flags.yap index 9bd3ad632..06fd18376 100644 --- a/pl/flags.yap +++ b/pl/flags.yap @@ -288,6 +288,12 @@ yap_flag(informational_messages,off) :- !, yap_flag(informational_messages,X) :- '$do_error'(domain_error(flag_value,informational_messages+X),yap_flag(informational_messages,X)). +yap_flag(timezone,X) :- + var(X), !, + '$swi_current_prolog_flag'(timezone, X). +yap_flag(timezone,X) :- + '$swi_set_prolog_flag'(timezone, X). + yap_flag(verbose,X) :- var(X), !, get_value('$verbose',X0), (X0 == on -> X = normal ; X = silent). @@ -748,8 +754,7 @@ yap_flag(user_error,Stream) :- yap_flag(debugger_print_options,OUT) :- var(OUT), recorded('$print_options','$debugger'(OUT),_), !. -yap_flag(debugger_print_options,Opts) :- !, - '$check_io_opts'(Opts, yap_flag(debugger_print_options,Opts)), +yap_flag(debugger_print_options,Opts) :- recorda('$print_options','$debugger'(Opts),_). :- recorda('$print_options','$debugger'([quoted(true),numbervars(true),portrayed(true),max_depth(10)]),_). @@ -757,8 +762,7 @@ yap_flag(debugger_print_options,Opts) :- !, yap_flag(toplevel_print_options,OUT) :- var(OUT), recorded('$print_options','$toplevel'(OUT),_), !. -yap_flag(toplevel_print_options,Opts) :- !, - '$check_io_opts'(Opts, yap_flag(toplevel_print_options,Opts)), +yap_flag(toplevel_print_options,Opts) :- recorda('$print_options','$toplevel'(Opts),_). :- recorda('$print_options','$toplevel'([quoted(true),numbervars(true),portrayed(true)]),_). @@ -885,6 +889,7 @@ yap_flag(dialect,yap). '$yap_system_flag'(strict_iso). '$yap_system_flag'(syntax_errors). '$yap_system_flag'(system_options). +'$yap_system_flag'(timezone). '$yap_system_flag'(to_chars_mode). '$yap_system_flag'(toplevel_hook). '$yap_system_flag'(toplevel_print_options). diff --git a/pl/init.yap b/pl/init.yap index 08117c934..681e1a52a 100644 --- a/pl/init.yap +++ b/pl/init.yap @@ -82,6 +82,7 @@ otherwise. 'eam.yap', 'chtypes.yap', 'yapor.yap', + 'qly.yap', 'udi.yap']. :- dynamic prolog:'$user_defined_flag'/4. diff --git a/pl/qly.yap b/pl/qly.yap new file mode 100644 index 000000000..acd69a981 --- /dev/null +++ b/pl/qly.yap @@ -0,0 +1,24 @@ + +/************************************************************************* +* * +* YAP Prolog * +* * +* Yap Prolog was developed at NCCUP - Universidade do Porto * +* * +* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-2011 * +* * +************************************************************************** +* * +* File: qly.yap * +* Last rev: * +* mods: * +* comments: fast save/restore * +* * +*************************************************************************/ + +save_module(Mod) :- + atom_concat(Mod,'.qly',F), + open(F, write, S, [type(binary)]), + '$save_module_preds'(S, Mod), + close(S). + diff --git a/pl/yio.yap b/pl/yio.yap index b594f0267..7fabe1286 100644 --- a/pl/yio.yap +++ b/pl/yio.yap @@ -33,8 +33,6 @@ '$check_opt_read'(Opt, G). '$check_opt'(stream_property(_,_),Opt,G) :- '$check_opt_sp'(Opt, G). -'$check_opt'(yap_flag(_,_),Opt,G) :- - '$check_opt_write'(Opt, G). '$check_opt_read'(variables(_), _) :- !. '$check_opt_read'(variable_names(_), _) :- !. @@ -94,7 +92,8 @@ fileerrors :- '$swi_set_prolog_flag'(fileerrors, true). nofileerrors :- '$swi_set_prolog_flag'(fileerrors, false). -exists(F) :- access_file(F,exist). +exists(F) :- + absolute_file_name(F, _, [file_errors(fail),access(exist),expand(true)]). /* Term IO */