From f44ef18fedb1bcf05a785987ff3a012905e27631 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Wed, 23 Nov 2016 17:23:59 -0600 Subject: [PATCH] fix atom_to_term and increase sharing on CUDD stuff --- C/atomic.c | 81 ++- C/c_interface.c | 13 +- C/cdmgr.c | 4 - C/compiler.c | 5 +- C/errors.c | 6 +- C/exec.c | 6 +- C/flags.c | 18 +- C/text.c | 6 +- CMakeLists.txt | 2 + CXX/yapdb.hh | 2 +- GIT | 10 - Untitled | 337 ---------- callcount.yap | 152 ----- cmake/Config.cmake | 25 +- cmake/cudd.cmake | 7 +- {packages/bdd => cmake}/cudd_config.h.cmake | 0 example.py | 14 - heap_top_ | 0 include/YapError.h | 6 +- libYap.cmake | 2 +- os/fmem.c | 3 +- os/readterm.c | 156 ++--- os/yapio.h | 3 +- packages/bdd/CMakeLists.txt | 5 - packages/bdd/simplecudd/simplecudd.c | 222 +------ packages/bdd/simplecudd/simplecudd.h | 3 +- packages/bdd/simplecudd_lfi/simplecudd.h | 3 +- packages/cplint/CMakeLists.txt | 8 +- packages/myddas/sqlite3/CMakeLists.txt | 8 +- pl/dbload.yap | 10 +- x.py | 652 -------------------- x.tgz | Bin 15374 -> 0 bytes 32 files changed, 190 insertions(+), 1579 deletions(-) delete mode 100644 GIT delete mode 100644 Untitled delete mode 100644 callcount.yap rename {packages/bdd => cmake}/cudd_config.h.cmake (100%) delete mode 100644 example.py delete mode 100644 heap_top_ delete mode 100644 x.py delete mode 100644 x.tgz diff --git a/C/atomic.c b/C/atomic.c index b71049052..30e7221aa 100644 --- a/C/atomic.c +++ b/C/atomic.c @@ -885,7 +885,6 @@ static Int string_concat3(USES_REGS1) { Term t2, t3, ot; Term tf = 0; bool g1, g2, g3; - Atom at; int l = push_text_stack(); restart_aux: t1 = Deref(ARG1); @@ -909,7 +908,6 @@ restart_aux: return cont_string_concat3(PASS_REGS1); } else { LOCAL_Error_TYPE = INSTANTIATION_ERROR; - at = NULL; } if (tf) { if (Yap_unify(ot, tf)) { @@ -1880,14 +1878,13 @@ static Int cont_sub_atomic(USES_REGS1) { size_t minv, len, after, sz; wchar_t *wp = NULL; const unsigned char *p = NULL, *p5 = NULL; - bool sub_atom = TRUE; - + mask = IntegerOfTerm(EXTRA_CBACK_ARG(5, 1)); minv = IntegerOfTerm(EXTRA_CBACK_ARG(5, 2)); len = IntegerOfTerm(EXTRA_CBACK_ARG(5, 3)); after = IntegerOfTerm(EXTRA_CBACK_ARG(5, 4)); sz = IntegerOfTerm(EXTRA_CBACK_ARG(5, 5)); - + if (!IsVarTerm(tat1)) { if (IsAtomTerm(tat1)) { p = AtomOfTerm(tat1)->UStrOfAE; @@ -1907,7 +1904,7 @@ static Int cont_sub_atomic(USES_REGS1) { bool found = false; { const unsigned char *p1 = p; - + while (!found) { p = skip_utf8(p1, minv); if (cmpn_utf8(p, p5, len) == 0) { @@ -2219,6 +2216,73 @@ static Int cont_sub_atomic(USES_REGS1) { return sub_atomic(false, true PASS_REGS); } + + static Int atomic_to_term(USES_REGS1) { + Term t1 = Deref(ARG1), rc; + const char *s; + size_t len; + if (IsVarTerm(t1)) { + Yap_Error(INSTANTIATION_ERROR, t1, "read_term_from_string/3"); + return (FALSE); + } else if (!IsAtomicTerm(t1)) { + Yap_Error(TYPE_ERROR_ATOMIC, t1, "read_term_from_atomic/3"); + return (FALSE); + } else { + Term t = Yap_AtomicToString(t1 PASS_REGS); + s = (const char *)UStringOfTerm(t); + len = strlen_utf8((unsigned char *)s); + } + encoding_t enc = ENC_ISO_UTF8; + rc = Yap_StringToTerm(s, len, &enc, 1200, ARG3); + if (!rc) + return false; + return Yap_unify(rc, ARG2); + } + + static Int atom_to_term(USES_REGS1) { + Term t1 = Deref(ARG1), rc; + const char *s; + size_t len; + if (IsVarTerm(t1)) { + Yap_Error(INSTANTIATION_ERROR, t1, "read_term_from_string/3"); + return (FALSE); + } else if (!IsAtomTerm(t1)) { + Yap_Error(TYPE_ERROR_ATOM, t1, "read_term_from_atomic/3"); + return (FALSE); + } else { + Term t = Yap_AtomicToString(t1 PASS_REGS); + s = StringOfTerm(t); + len = strlen_utf8((const unsigned char *)s); + } + encoding_t enc = ENC_ISO_UTF8; + rc = Yap_StringToTerm(s, len, &enc, 1200, ARG3); + if (!rc) + return false; + return Yap_unify(rc, ARG2); + } + + + static Int string_to_term(USES_REGS1) { + Term t1 = Deref(ARG1), rc; + const char *s; + size_t len; + if (IsVarTerm(t1)) { + Yap_Error(INSTANTIATION_ERROR, t1, "read_term_from_string/3"); + return (FALSE); + } else if (!IsStringTerm(t1)) { + Yap_Error(TYPE_ERROR_STRING, t1, "read_term_from_string/3"); + return (FALSE); + } else { + s = StringOfTerm(t1); + len = strlen_utf8((const unsigned char *)s); + } + encoding_t enc = ENC_ISO_UTF8; + rc = Yap_StringToTerm(s, len, &enc, 1200, ARG3); + if (!rc) + return false; + return Yap_unify(rc, ARG2); + } + static Int cont_current_atom(USES_REGS1) { Atom catom; Int i = IntOfTerm(EXTRA_CBACK_ARG(1, 2)); @@ -2357,6 +2421,11 @@ static Int cont_sub_atomic(USES_REGS1) { */ + + Yap_InitCPred("atom_to_term", 3, atom_to_term, 0); + Yap_InitCPred("atomic_to_term", 3, atomic_to_term, 0); + Yap_InitCPred("string_to_term", 3, string_to_term, 0); + Yap_InitCPred("atom_chars", 2, atom_chars, 0); /** @pred atom_chars(? _A_,? _L_) is iso diff --git a/C/c_interface.c b/C/c_interface.c index 54f18ccc6..17ec56df9 100755 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -452,7 +452,7 @@ X_API Atom YAP_LookupAtom(const char *c) { X_API Atom YAP_LookupWideAtom(const wchar_t *c) { CACHE_REGS Atom a; - + while (TRUE) { a = Yap_NWCharsToAtom(c, -1 USES_REGS); @@ -1187,10 +1187,10 @@ Int YAP_ExecuteOnCut(PredEntry *pe, CPredicate exec_code, Yap_CloseSlots(CurSlot); PP = NULL; // B = LCL0-(CELL*)oB; - if (false && Yap_RaiseException()) { + if (!val && Yap_RaiseException()) { return false; } else { /* TRUE */ - return true; + return val; } } @@ -1373,12 +1373,13 @@ X_API Term YAP_NWideBufferToString(const wchar_t *s, size_t len) { /* copy a string to a buffer */ X_API Term YAP_ReadBuffer(const char *s, Term *tp) { CACHE_REGS - Term t; + Term tv, t; BACKUP_H(); + if (*tp) tv = *tp; else tv = 0; LOCAL_ErrorMessage = NULL; while (!(t = Yap_StringToTerm(s, strlen(s) + 1, &LOCAL_encoding, - GLOBAL_MaxPriority, tp))) { + GLOBAL_MaxPriority,tv))) { if (LOCAL_ErrorMessage) { if (!strcmp(LOCAL_ErrorMessage, "Stack Overflow")) { if (!Yap_dogc(0, NULL PASS_REGS)) { @@ -2306,7 +2307,7 @@ YAP_file_type_t YAP_Init(YAP_init_args *yap_init) { GLOBAL_PrologShouldHandleInterrupts = yap_init->PrologShouldHandleInterrupts; Yap_InitSysbits(0); /* init signal handling and time, required by later functions */ - GLOBAL_argv = yap_init->Argv; + GLOBAL_argv = yap_init->Argv; GLOBAL_argc = yap_init->Argc; if (0 && ((YAP_QLY && yap_init->SavedState) || (YAP_BOOT_PL && (yap_init->YapPrologBootFile)))) { diff --git a/C/cdmgr.c b/C/cdmgr.c index 858e304be..65acb4b91 100644 --- a/C/cdmgr.c +++ b/C/cdmgr.c @@ -1447,11 +1447,7 @@ static int not_was_reconsulted(PredEntry *p, Term t, int mode) { static void addcl_permission_error(AtomEntry *ap, Int Arity, int in_use) { CACHE_REGS - Term t, ti[2]; - ti[0] = MkAtomTerm(AbsAtom(ap)); - ti[1] = MkIntegerTerm(Arity); - t = Yap_MkApplTerm(FunctorSlash, 2, ti); LOCAL_Error_TYPE = PERMISSION_ERROR_MODIFY_STATIC_PROCEDURE; LOCAL_ErrorMessage = Malloc( 256 ); diff --git a/C/compiler.c b/C/compiler.c index 77d8906a3..868c588bf 100644 --- a/C/compiler.c +++ b/C/compiler.c @@ -1093,7 +1093,7 @@ static void c_bifun(basic_preds Op, Term t1, Term t2, Term t3, Term Goal, char s[32]; Yap_bip_name(Op, s); - Yap_ThrowError(INSTANTIATION_ERROR , t2, "compiling %s/3", s); + Yap_ThrowError(INSTANTIATION_ERROR , t2, "compiling %s/3", s); save_machine_regs(); siglongjmp(cglobs->cint.CompilerBotch, 1); } @@ -1110,9 +1110,10 @@ static void c_bifun(basic_preds Op, Term t1, Term t2, Term t3, Term Goal, i2 = IntegerOfTerm(t2); if (i2 < 0) { - Yap_ThrowError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO , t2,4, "compiling functor/3"); + Yap_ThrowError(DOMAIN_ERROR_NOT_LESS_THAN_ZERO , t2, "compiling functor/3"); save_machine_regs(); siglongjmp(cglobs->cint.CompilerBotch, 1); + } if (IsNumTerm(t1)) { /* we will always fail */ diff --git a/C/errors.c b/C/errors.c index 6d8aac85b..7f749141b 100755 --- a/C/errors.c +++ b/C/errors.c @@ -311,11 +311,11 @@ yap_error_descriptor_t *Yap_popErrorContext(void) { } void Yap_ThrowError__(const char *file, const char *function, int lineno, - yap_error_number type, Term where, int code, ...) { + yap_error_number type, Term where, ...) { va_list ap; char tmpbuf[MAXPATHLEN]; - va_start(ap, code); + va_start(ap, where); char *format = va_arg(ap, char *); if (format != NULL) { #if HAVE_VSNPRINTF @@ -328,7 +328,7 @@ Yap_Error__(file, function, lineno, type, where, tmpbuf); } else { Yap_Error__(file, function, lineno, type, where); } - siglongjmp(LOCAL_RestartEnv, code); + siglongjmp(LOCAL_RestartEnv, 4); } /** diff --git a/C/exec.c b/C/exec.c index fa669c67a..681e8e408 100755 --- a/C/exec.c +++ b/C/exec.c @@ -1023,7 +1023,6 @@ static Int protect_stack(USES_REGS1) { static Int setup_call_catcher_cleanup(USES_REGS1) { Term Setup = Deref(ARG1); - Term cmod = CurrentModule; Int oENV = LCL0 - ENV; choiceptr B0 = B; Term t3, t4; @@ -1051,8 +1050,6 @@ static Int setup_call_catcher_cleanup(USES_REGS1) { prune_inner_computation(B0); } // at this point starts actual goal execution.... - cmod = CurrentModule; - rc = Yap_RunTopGoal(Yap_GetFromSlot(h2), false); complete_inner_computation(B); t4 = Yap_GetFromSlot(h4); @@ -2010,7 +2007,7 @@ bool is_cleanup_cp(choiceptr cp_b) { } static Int JumpToEnv() { - choiceptr handler = B, oh = NULL; + choiceptr handler = B; /* just keep the throwm object away, we don't need to care about it */ /* careful, previous step may have caused a stack shift, @@ -2028,7 +2025,6 @@ static Int JumpToEnv() { handler->cp_b == NULL)) { break; } - oh = handler; handler = handler->cp_b; } if (LOCAL_PrologMode & AsyncIntMode) { diff --git a/C/flags.c b/C/flags.c index d185a38ae..bf04be85c 100644 --- a/C/flags.c +++ b/C/flags.c @@ -182,7 +182,7 @@ static Term stream(Term inp) { } -static bool +static bool set_error_stream( Term inp ) { if( IsVarTerm(inp) ) return Yap_unify( inp, Yap_StreamUserName( LOCAL_c_error_stream ) ); @@ -191,7 +191,7 @@ set_error_stream( Term inp ) { return true; } -static bool +static bool set_input_stream( Term inp ) { if( IsVarTerm(inp) ) return Yap_unify( inp, Yap_StreamUserName( LOCAL_c_input_stream ) ); @@ -199,7 +199,7 @@ set_input_stream( Term inp ) { return true; } -static bool +static bool set_output_stream( Term inp ) { if( IsVarTerm(inp) ) return Yap_unify( inp, Yap_StreamUserName( LOCAL_c_output_stream ) ); @@ -870,7 +870,7 @@ static Int cont_prolog_flag(USES_REGS1) { } EXTRA_CBACK_ARG(3, 1) = MkIntTerm(++i); flag = getYapFlag(f); - if (!Yap_unify(f, ARG2)) + if (!Yap_unify(flag, ARG2)) return false; return setYapFlag(f, Deref(ARG3)); } @@ -1175,7 +1175,7 @@ static Int source_mode(USES_REGS1) { if (!current && !Yap_unify_constant(ARG1, TermFalse)) return false; targ = Deref(ARG2); - setYapFlag(TermSource, ARG2); + setYapFlag(TermSource, targ); return true; } @@ -1319,7 +1319,7 @@ static bool setInitialValue(bool bootstrap, flag_func f, const char *s, CACHE_REGS encoding_t encoding = ENC_ISO_UTF8; t0 = - Yap_StringToTerm(s, strlen(s) + 1, &encoding, GLOBAL_MaxPriority, NULL); + Yap_StringToTerm(s, strlen(s) + 1, &encoding, GLOBAL_MaxPriority, 0L); if (!t0) return false; if (IsAtomTerm(t0) || IsIntTerm(t0)) { @@ -1434,7 +1434,7 @@ do_prolog_flag_property(Term tflag, } } // UNLOCK(GLOBAL_Prolog_Flag[sno].prolog_flaglock); - free(args); + free(args); return rc; } @@ -1540,7 +1540,7 @@ static Int do_create_prolog_flag(USES_REGS1) { if (fv) { if (args[PROLOG_FLAG_PROPERTY_KEEP].used && args[PROLOG_FLAG_PROPERTY_KEEP].tvalue == TermTrue) { - free(args); + free(args); return true; } } else { @@ -1633,7 +1633,7 @@ void Yap_InitFlags(bool bootstrap) { if (GLOBAL_Stream[StdInStream].status & Readline_Stream_f) { setBooleanGlobalPrologFlag(READLINE_FLAG, true); } - + if (!bootstrap) { Yap_InitCPredBack("current_prolog_flag", 2, 1, current_prolog_flag, cont_yap_flag, 0); diff --git a/C/text.c b/C/text.c index 727783149..66b83dbea 100644 --- a/C/text.c +++ b/C/text.c @@ -731,7 +731,7 @@ static Term write_number(unsigned char *s, seq_tv_t *out, int size, bool error_o static Term string_to_term(void *s, seq_tv_t *out, size_t leng USES_REGS) { Term o; o = out->val.t = - Yap_StringToTerm(s, strlen(s) + 1, &out->enc, GLOBAL_MaxPriority, NULL); + Yap_StringToTerm(s, strlen(s) + 1, &out->enc, GLOBAL_MaxPriority, 0L); return o; } @@ -740,7 +740,7 @@ bool write_Text(unsigned char *inp, seq_tv_t *out, size_t leng USES_REGS) { if (out->type == 0) { return true; } - + if (out->type & YAP_STRING_TERM) { if ((out->val.t = string_to_term(inp, out, leng PASS_REGS)) != 0L) return out->val.t != 0; @@ -948,7 +948,7 @@ bool Yap_Concat_Text(int tot, seq_tv_t inp[], seq_tv_t *out USES_REGS) { unsigned char *buf; int i; size_t leng; - + bufv = Malloc(tot * sizeof(unsigned char *)); if (!bufv) { return NULL; diff --git a/CMakeLists.txt b/CMakeLists.txt index 34f61d613..5589a888f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,6 +53,8 @@ if(NOT COMMAND find_host_program) endmacro() endif() +option(BUILD_SHARED_LIBS "Build shared library" ON) + include(Prelims NO_POLICY_SCOPE) include(Sources NO_POLICY_SCOPE) diff --git a/CXX/yapdb.hh b/CXX/yapdb.hh index 2be2fb58f..8375ab9ef 100644 --- a/CXX/yapdb.hh +++ b/CXX/yapdb.hh @@ -138,7 +138,7 @@ protected: BACKUP_MACHINE_REGS(); Term *modp = NULL; - out = Yap_StringToTerm(s0, strlen(s0) + 1, &LOCAL_encoding, 1200, &names); + out = Yap_StringToTerm(s0, strlen(s0) + 1, &LOCAL_encoding, 1200, names); // extern char *s0; // fprintf(stderr,"ap=%p arity=%d text=%s", ap, ap->ArityOfPE, s); // Yap_DebugPlWrite(out); diff --git a/GIT b/GIT deleted file mode 100644 index 6bd7e5185..000000000 --- a/GIT +++ /dev/null @@ -1,10 +0,0 @@ - -You need at least git-1.6 to install the development version. - -Please proceed as follows for the main branch: - -git clone git://gitorious.org/yap-git/mainline.git yap -cd yap-6 -git submodule init -git submodule update - diff --git a/Untitled b/Untitled deleted file mode 100644 index 1b2556d6c..000000000 --- a/Untitled +++ /dev/null @@ -1,337 +0,0 @@ -Process: Python [88916] -Path: /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python -Identifier: Python -Version: 2.7.10 (2.7.10) -Code Type: X86-64 (Native) -Parent Process: Atom Helper [88821] -Responsible: Atom [88817] -User ID: 501 - -Date/Time: 2016-06-12 12:40:34.078 +0100 -OS Version: Mac OS X 10.11.5 (15F34) -Report Version: 11 -Anonymous UUID: B8085CAA-5C3C-7B89-D7A4-E30E7D5EAC9C - -Sleep/Wake UUID: ABD12798-599D-4E2A-8BAF-24F5ACC919E7 - -Time Awake Since Boot: 220000 seconds -Time Since Wake: 4000 seconds - -System Integrity Protection: enabled - -Crashed Thread: 0 Dispatch queue: com.apple.main-thread - -Exception Type: EXC_BAD_ACCESS (SIGSEGV) -Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000008 - -VM Regions Near 0x8: ---> - __TEXT 0000000105287000-0000000105288000 [ 4K] r-x/rwx SM=COW /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python - -Thread 0 Crashed:: Dispatch queue: com.apple.main-thread -0 org.python.python 0x000000010532ffce 0x10528f000 + 659406 -1 org.python.python 0x0000000105330481 PyGILState_Ensure + 55 -2 com.apple.LLDB.framework 0x0000000108b1e37a lldb_private::ScriptInterpreterPython::Locker::DoAcquireLock() + 28 -3 com.apple.LLDB.framework 0x0000000108b23a6b lldb_private::ScriptInterpreterPython::Clear() + 37 -4 com.apple.LLDB.framework 0x000000010885e510 lldb_private::Debugger::Clear() + 266 -5 com.apple.LLDB.framework 0x000000010885f8ec lldb_private::Debugger::~Debugger() + 28 -6 com.apple.LLDB.framework 0x000000010885fc0e lldb_private::Debugger::~Debugger() + 14 -7 libc++.1.dylib 0x00007fff91f31cb8 std::__1::__shared_weak_count::__release_shared() + 44 -8 com.apple.LLDB.framework 0x00000001068a06cf std::__1::__vector_base, std::__1::allocator > >::~__vector_base() + 49 -9 libsystem_c.dylib 0x00007fff9321246b __cxa_finalize_ranges + 345 -10 libsystem_c.dylib 0x00007fff9321276f exit + 55 -11 org.python.python 0x000000010533200c 0x10528f000 + 667660 -12 org.python.python 0x0000000105331c45 PyErr_PrintEx + 41 -13 org.python.python 0x0000000105331668 PyRun_SimpleFileExFlags + 750 -14 org.python.python 0x0000000105343011 Py_Main + 3137 -15 libdyld.dylib 0x00007fff8d16d5ad start + 1 - -Thread 1: -0 libsystem_kernel.dylib 0x00007fff9af6bf72 mach_msg_trap + 10 -1 libsystem_kernel.dylib 0x00007fff9af6b3b3 mach_msg + 55 -2 com.apple.CoreFoundation 0x00007fff95f861c4 __CFRunLoopServiceMachPort + 212 -3 com.apple.CoreFoundation 0x00007fff95f8568c __CFRunLoopRun + 1356 -4 com.apple.CoreFoundation 0x00007fff95f84ed8 CFRunLoopRunSpecific + 296 -5 com.apple.CoreFoundation 0x00007fff95fc69b1 CFRunLoopRun + 97 -6 com.apple.DebugSymbols 0x00007fff87a2c69a SpotlightQueryThread(void*) + 346 -7 libsystem_pthread.dylib 0x00007fff9490e99d _pthread_body + 131 -8 libsystem_pthread.dylib 0x00007fff9490e91a _pthread_start + 168 -9 libsystem_pthread.dylib 0x00007fff9490c351 thread_start + 13 - -Thread 2: -0 libsystem_kernel.dylib 0x00007fff9af725e2 __workq_kernreturn + 10 -1 libsystem_pthread.dylib 0x00007fff9490e578 _pthread_wqthread + 1283 -2 libsystem_pthread.dylib 0x00007fff9490c341 start_wqthread + 13 - -Thread 3: -0 libsystem_kernel.dylib 0x00007fff9af725e2 __workq_kernreturn + 10 -1 libsystem_pthread.dylib 0x00007fff9490e578 _pthread_wqthread + 1283 -2 libsystem_pthread.dylib 0x00007fff9490c341 start_wqthread + 13 - -Thread 4:: Dispatch queue: com.apple.libdispatch-manager -0 libsystem_kernel.dylib 0x00007fff9af72efa kevent_qos + 10 -1 libdispatch.dylib 0x00007fff87927165 _dispatch_mgr_invoke + 216 -2 libdispatch.dylib 0x00007fff87926dcd _dispatch_mgr_thread + 52 - -Thread 5: -0 libsystem_kernel.dylib 0x00007fff9af725e2 __workq_kernreturn + 10 -1 libsystem_pthread.dylib 0x00007fff9490e578 _pthread_wqthread + 1283 -2 libsystem_pthread.dylib 0x00007fff9490c341 start_wqthread + 13 - -Thread 6: -0 libsystem_kernel.dylib 0x00007fff9af725e2 __workq_kernreturn + 10 -1 libsystem_pthread.dylib 0x00007fff9490e578 _pthread_wqthread + 1283 -2 libsystem_pthread.dylib 0x00007fff9490c341 start_wqthread + 13 - -Thread 7: -0 libsystem_kernel.dylib 0x00007fff9af725e2 __workq_kernreturn + 10 -1 libsystem_pthread.dylib 0x00007fff9490e578 _pthread_wqthread + 1283 -2 libsystem_pthread.dylib 0x00007fff9490c341 start_wqthread + 13 - -Thread 0 crashed with X86 Thread State (64-bit): - rax: 0x0000000000000001 rbx: 0x00007fb1e266bdb0 rcx: 0x00000b0000000000 rdx: 0x00007fb1e2403388 - rdi: 0x00007fb1e2403368 rsi: 0x00000b0000000b00 rbp: 0x00007fff5a9785a0 rsp: 0x00007fff5a978580 - r8: 0x00000000fffffffc r9: 0x00007fb1e2403380 r10: 0x00000000ffffffff r11: 0xffffffff00000000 - r12: 0x0000000000000001 r13: 0x0000000000000000 r14: 0x0000000000000000 r15: 0x0000000000000001 - rip: 0x000000010532ffce rfl: 0x0000000000010206 cr2: 0x0000000000000008 - -Logical CPU: 6 -Error Code: 0x00000004 -Trap Number: 14 - - -Binary Images: - 0x105287000 - 0x105287fff org.python.python (2.7.10 - 2.7.10) <307E6E15-ECF7-3BB2-AF06-3E8D23DFDECA> /System/Library/Frameworks/Python.framework/Versions/2.7/Resources/Python.app/Contents/MacOS/Python - 0x10528f000 - 0x105380ff7 org.python.python (2.7.10 - 2.7.10) <83AFAAA7-BDFA-354D-8A7A-8F40A30ACB91> /System/Library/Frameworks/Python.framework/Versions/2.7/Python - 0x105746000 - 0x105747fff _locale.so (94) <4394AC91-22AE-3D7D-85C4-792A4F35F3F2> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_locale.so - 0x10580c000 - 0x10580dff7 time.so (94) <94E8BF2A-7841-32AD-8722-6B2526999CA1> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/time.so - 0x105814000 - 0x105816fff select.so (94) <22170D1C-40EF-303A-8BB7-A48E783F9350> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/select.so - 0x10581d000 - 0x10581efff fcntl.so (94) <419069D5-A61F-3925-B320-EA7B9E38F44B> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/fcntl.so - 0x105823000 - 0x105826fff _struct.so (94) <0DCC6B47-A763-3AA6-82C5-B6A58073286B> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_struct.so - 0x10582d000 - 0x10582ffff binascii.so (94) <9044E1C3-221F-3B79-847A-C9C3D8FEA9FD> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/binascii.so - 0x105834000 - 0x105835fff cStringIO.so (94) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cStringIO.so - 0x10596c000 - 0x10596dfff libpanel.5.4.dylib (46) /usr/lib/libpanel.5.4.dylib - 0x1059a2000 - 0x1059b0fff _ctypes.so (94) <57C51BC5-542B-3E78-94AC-0AC3DDEAFE8F> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ctypes.so - 0x1059bd000 - 0x1059c1fff itertools.so (94) <889782F7-5414-3881-BAAB-83CACDFDF0C5> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/itertools.so - 0x1059cb000 - 0x1059cefff operator.so (94) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/operator.so - 0x1059d5000 - 0x1059d6ff7 readline.so (94) <9761BEFB-EF61-3542-B6D7-D4EE20F4FCF2> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/readline.so - 0x1059dd000 - 0x1059dffff _collections.so (94) <5FEB3871-0B8F-3233-876C-0E81CF581963> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_collections.so - 0x1059e6000 - 0x1059e7fff _heapq.so (94) <9200023E-75BA-3F20-843C-398C3709CA88> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_heapq.so - 0x1059ed000 - 0x1059f4ff7 _socket.so (94) <0995C171-1F75-3087-89BE-EC0F68FB1231> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_socket.so - 0x1059ff000 - 0x105a00fff _functools.so (94) <49B479ED-A07D-322D-9A29-AFF4CA084219> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_functools.so - 0x105a05000 - 0x105a0efff _ssl.so (94) <027A0AA6-E941-32D2-A091-47C3A43DD846> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_ssl.so - 0x105a1a000 - 0x105a25fff cPickle.so (94) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/cPickle.so - 0x105a2c000 - 0x105a3bfff _io.so (94) <39FEF2EC-8D20-33A6-B91F-EF7B2FAE9009> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_io.so - 0x105a4c000 - 0x105a4fff7 math.so (94) <216DBA90-4498-361D-8321-B41F9A3B121C> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/math.so - 0x105a56000 - 0x105a57fff _hashlib.so (94) /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_hashlib.so - 0x105a5d000 - 0x105a5eff7 _random.so (94) <5A3C615E-01F8-37C2-A3F2-B1EDEB31C954> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_random.so - 0x105a63000 - 0x105a66ff7 strop.so (94) <44D8B4D6-D536-31EE-94EA-4F3C0FC773FA> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/strop.so - 0x105a6c000 - 0x105a6cfff _scproxy.so (94) <07D4037C-CB1A-3850-9C0A-A29446A772CE> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_scproxy.so - 0x105ab1000 - 0x105ab5fff _json.so (94) <8DF51919-72DB-335D-B4F5-D8B3B7A96A89> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/_json.so - 0x105ac0000 - 0x105ac9ff7 datetime.so (94) <94EF278A-0BE1-3990-A13B-2A5F36F64263> /System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload/datetime.so - 0x10687c000 - 0x10941cff7 com.apple.LLDB.framework (1.350.0.21.9 - 350.0.21.9) <7862FFB0-5204-36DE-A5FA-9BE017CC7E45> /Applications/Xcode.app/Contents/SharedFrameworks/LLDB.framework/Versions/A/LLDB - 0x7fff6497b000 - 0x7fff649b225f dyld (360.22) /usr/lib/dyld - 0x7fff87008000 - 0x7fff872a2ff3 com.apple.security (7.0 - 57337.50.23) <8B6CF71D-A63E-34C9-9227-0AACAB643584> /System/Library/Frameworks/Security.framework/Versions/A/Security - 0x7fff875a4000 - 0x7fff875a6ff7 com.apple.xpc.ServiceManagement (1.0 - 1) /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement - 0x7fff875d7000 - 0x7fff875dbfff libGIF.dylib (1450) /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib - 0x7fff8767e000 - 0x7fff87686fff com.apple.CoreServices.FSEvents (1223.10.1 - 1223.10.1) <7F5B7A23-BC1D-3FA9-A9B8-D534F1E1979A> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents - 0x7fff87765000 - 0x7fff877a7ff7 com.apple.Metal (56.6 - 56.6) <2B2C0F78-20B8-3878-B9B1-DE18BB92919D> /System/Library/Frameworks/Metal.framework/Versions/A/Metal - 0x7fff877a8000 - 0x7fff8780eff7 libsystem_network.dylib (583.50.1) /usr/lib/system/libsystem_network.dylib - 0x7fff8780f000 - 0x7fff8791efe7 libvDSP.dylib (563.5) <9AB6CA3C-4F0E-35E6-9184-9DF86E7C3DAD> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib - 0x7fff8791f000 - 0x7fff8794cfff libdispatch.dylib (501.40.12) /usr/lib/system/libdispatch.dylib - 0x7fff87961000 - 0x7fff87964fff libCoreVMClient.dylib (119.5) <560D70FB-709F-3030-96C9-F249FCB7DA6D> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib - 0x7fff87a2b000 - 0x7fff87a65ff7 com.apple.DebugSymbols (132 - 132) <23A42C53-B941-3871-9EE2-4C87A46005B5> /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols - 0x7fff87a66000 - 0x7fff87a6fff7 com.apple.CommonAuth (4.0 - 2.0) <4B8673E1-3697-3FE2-8D30-AC7AC5D4F8BF> /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth - 0x7fff87a9f000 - 0x7fff87abbff3 libresolv.9.dylib (60) /usr/lib/libresolv.9.dylib - 0x7fff87b6d000 - 0x7fff87c5fff7 libiconv.2.dylib (44) /usr/lib/libiconv.2.dylib - 0x7fff87c60000 - 0x7fff87c60fff com.apple.Accelerate.vecLib (3.10 - vecLib 3.10) <054DFE32-737D-3211-9A14-0FC5E1A880E3> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib - 0x7fff87dcf000 - 0x7fff87e76fff com.apple.LanguageModeling (1.0 - 1) <58C18A47-BDE7-3CBE-81C0-797029D170A1> /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling - 0x7fff87e77000 - 0x7fff87f27fe7 libvMisc.dylib (563.5) <6D73C20D-D1C4-3BA5-809B-4B597C15AA86> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib - 0x7fff87f5a000 - 0x7fff882aefff com.apple.Foundation (6.9 - 1259) <71A9D3A0-0B1F-3E3A-86F3-1486365A6EF2> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation - 0x7fff88488000 - 0x7fff88488fff com.apple.CoreServices (728.12 - 728.12) /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices - 0x7fff884b9000 - 0x7fff8850afff com.apple.audio.CoreAudio (4.3.0 - 4.3.0) /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio - 0x7fff8874d000 - 0x7fff88755ffb libsystem_dnssd.dylib (625.50.5) <4D10E12B-59B5-386F-82DA-326F18028F0A> /usr/lib/system/libsystem_dnssd.dylib - 0x7fff88756000 - 0x7fff8876cff7 libLinearAlgebra.dylib (1162.2) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib - 0x7fff8876d000 - 0x7fff8879efff com.apple.GSS (4.0 - 2.0) /System/Library/Frameworks/GSS.framework/Versions/A/GSS - 0x7fff88c4f000 - 0x7fff88d3efff libxml2.2.dylib (29.7) <32BBF51E-B084-3FC2-AE9C-C008BE84102B> /usr/lib/libxml2.2.dylib - 0x7fff88ef9000 - 0x7fff88f01fff libcopyfile.dylib (127) /usr/lib/system/libcopyfile.dylib - 0x7fff88f71000 - 0x7fff88fa7fff libssl.0.9.8.dylib (59.40.2) <523FEBFA-4BF7-3A69-83B7-164265BE7F4D> /usr/lib/libssl.0.9.8.dylib - 0x7fff88fa8000 - 0x7fff88faaff7 libRadiance.dylib (1450) /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib - 0x7fff893ee000 - 0x7fff89417ff7 libxslt.1.dylib (14.2) <6E8D0F06-9086-32D3-9D87-3870A1CE9E99> /usr/lib/libxslt.1.dylib - 0x7fff8949d000 - 0x7fff894b7ff3 liblzma.5.dylib (10) /usr/lib/liblzma.5.dylib - 0x7fff894b8000 - 0x7fff894dcfff libJPEG.dylib (1450) <1775E59E-D82C-3F7A-8E4F-B0C13F88F691> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib - 0x7fff894dd000 - 0x7fff894e0fff com.apple.IOSurface (108.2.1 - 108.2.1) /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface - 0x7fff89742000 - 0x7fff89747fff com.apple.TCC (1.0 - 1) /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC - 0x7fff89b44000 - 0x7fff89b46fff libsystem_coreservices.dylib (19.2) <1B3F5AFC-FFCD-3ECB-8B9A-5538366FB20D> /usr/lib/system/libsystem_coreservices.dylib - 0x7fff89bdd000 - 0x7fff89bddff7 libunc.dylib (29) /usr/lib/system/libunc.dylib - 0x7fff89bde000 - 0x7fff89c09ffb libarchive.2.dylib (33.20.2) <6C370A21-63FD-3A68-B4B3-5333F24B770B> /usr/lib/libarchive.2.dylib - 0x7fff8a0fc000 - 0x7fff8a16bfff com.apple.SearchKit (1.4.0 - 1.4.0) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit - 0x7fff8a170000 - 0x7fff8a174fff libcache.dylib (75) <9548AAE9-2AB7-3525-9ECE-A2A7C4688447> /usr/lib/system/libcache.dylib - 0x7fff8a1e1000 - 0x7fff8a1fdff7 libsystem_malloc.dylib (67.40.1) <5748E8B2-F81C-34C6-8B13-456213127678> /usr/lib/system/libsystem_malloc.dylib - 0x7fff8a245000 - 0x7fff8a245fff libmetal_timestamp.dylib (600.0.44.1) <6576F284-BACA-332A-A6E7-FA1C347636E3> /System/Library/PrivateFrameworks/GPUCompiler.framework/libmetal_timestamp.dylib - 0x7fff8a2d9000 - 0x7fff8a2dafff liblangid.dylib (122) <9CC4F0D1-5C51-3B69-BC8F-EE3A51FD0822> /usr/lib/liblangid.dylib - 0x7fff8a2db000 - 0x7fff8a2e9fff com.apple.opengl (12.1.0 - 12.1.0) /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL - 0x7fff8ae82000 - 0x7fff8aeabff7 libxpc.dylib (765.50.8) <54D1328E-054E-3DAA-89E2-375722F9D18F> /usr/lib/system/libxpc.dylib - 0x7fff8aeac000 - 0x7fff8b2a8fff libLAPACK.dylib (1162.2) <987E42B0-5108-3065-87F0-9DF7616A8A06> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib - 0x7fff8b3a2000 - 0x7fff8b648ff7 com.apple.CoreData (120 - 641.3) /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData - 0x7fff8b649000 - 0x7fff8b678ffb libsystem_m.dylib (3105) <08E1A4B2-6448-3DFE-A58C-ACC7335BE7E4> /usr/lib/system/libsystem_m.dylib - 0x7fff8be57000 - 0x7fff8be6efff libmarisa.dylib (4) /usr/lib/libmarisa.dylib - 0x7fff8c64b000 - 0x7fff8c778ff3 com.apple.CoreText (352.0 - 494.11) <08E8640E-6602-3A00-BC28-94235FD311B4> /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText - 0x7fff8c794000 - 0x7fff8c7e9fff com.apple.AE (701 - 701) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE - 0x7fff8c83b000 - 0x7fff8c83dfff com.apple.loginsupport (1.0 - 1) <9B2F5F9B-ED38-313F-B798-D2B667BCD6B5> /System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport - 0x7fff8cb98000 - 0x7fff8cb9bfff libsystem_sandbox.dylib (460.50.4) <150A9D3D-F69E-32F7-8C7B-8E72CAAFF7E4> /usr/lib/system/libsystem_sandbox.dylib - 0x7fff8cb9c000 - 0x7fff8cb9cff7 libkeymgr.dylib (28) <8371CE54-5FDD-3CE9-B3DF-E98C761B6FE0> /usr/lib/system/libkeymgr.dylib - 0x7fff8cbff000 - 0x7fff8cc00fff com.apple.TrustEvaluationAgent (2.0 - 25) <0239494E-FEFE-39BC-9FC7-E251BA5128F1> /System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent - 0x7fff8cc01000 - 0x7fff8cc01fff libOpenScriptingUtil.dylib (169.1) /usr/lib/libOpenScriptingUtil.dylib - 0x7fff8d16a000 - 0x7fff8d16dffb libdyld.dylib (360.22) /usr/lib/system/libdyld.dylib - 0x7fff8d245000 - 0x7fff8d246fff libffi.dylib (18.1) <5BA9612C-747E-33CE-9DB1-3C01ECF3041D> /usr/lib/libffi.dylib - 0x7fff8d2e2000 - 0x7fff8d378fff com.apple.ColorSync (4.9.0 - 4.9.0) <8FC37E20-6579-3CB2-9D49-BC39FC38DF87> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSync.framework/Versions/A/ColorSync - 0x7fff8d6fd000 - 0x7fff8d771ff7 com.apple.Heimdal (4.0 - 2.0) <5D365381-8B5E-3259-8867-FC4A7D307BDE> /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal - 0x7fff8d772000 - 0x7fff8d773fff libDiagnosticMessagesClient.dylib (100) <4243B6B4-21E9-355B-9C5A-95A216233B96> /usr/lib/libDiagnosticMessagesClient.dylib - 0x7fff8d7e3000 - 0x7fff8d808ff7 libPng.dylib (1450) /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib - 0x7fff8ebb0000 - 0x7fff8ed56ff7 com.apple.audio.toolbox.AudioToolbox (1.13 - 1.13) <082319FC-59F2-3D36-AC9B-94759724E302> /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox - 0x7fff8f074000 - 0x7fff8f090ff7 libextension.dylib (78) /usr/lib/libextension.dylib - 0x7fff8f127000 - 0x7fff8f137fff libbsm.0.dylib (34) <7E14504C-A8B0-3574-B6EB-5D5FABC72926> /usr/lib/libbsm.0.dylib - 0x7fff8f177000 - 0x7fff903c5fe7 com.apple.CoreGraphics (1.600.0 - 957) /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics - 0x7fff903c6000 - 0x7fff904eafff libsqlite3.dylib (216.4) <280D67B8-F93D-3587-A146-19F36C817548> /usr/lib/libsqlite3.dylib - 0x7fff90521000 - 0x7fff9055fff7 libGLImage.dylib (12.1) /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib - 0x7fff90622000 - 0x7fff90667ff7 com.apple.coreservices.SharedFileList (24.4 - 24.5) <1D2AD77B-778F-3253-A295-3D0A32A8121C> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList - 0x7fff90709000 - 0x7fff90717fff libxar.1.dylib (302) <03207F66-2C4A-3DBD-8D81-70F4C85903C4> /usr/lib/libxar.1.dylib - 0x7fff90e64000 - 0x7fff90e73ffb com.apple.LangAnalysis (1.7.0 - 1.7.0) <18D21123-A3E7-3851-974A-08E5D4540475> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis - 0x7fff90f0b000 - 0x7fff90f57fff com.apple.print.framework.PrintCore (11.2 - 472.2) <5AE8AA6B-CE09-397D-B0D4-0F9CCBF1F77D> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore - 0x7fff90f96000 - 0x7fff90fbafff com.apple.MultitouchSupport.framework (304.12 - 304.12) <65CB7653-EACD-3ADB-ABB6-2E0671708301> /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport - 0x7fff91154000 - 0x7fff91165ff7 libsystem_trace.dylib (201.10.3) /usr/lib/system/libsystem_trace.dylib - 0x7fff911f6000 - 0x7fff91254fff com.apple.SystemConfiguration (1.14 - 1.14) /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration - 0x7fff919db000 - 0x7fff919f2ff7 libsystem_coretls.dylib (83.40.5) /usr/lib/system/libsystem_coretls.dylib - 0x7fff919f3000 - 0x7fff919f3fff com.apple.ApplicationServices (48 - 48) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices - 0x7fff91b86000 - 0x7fff91bd2ffb com.apple.HIServices (1.22 - 550) <6B76B41C-CF5A-34C4-89F4-EFD7CA3D1C9D> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices - 0x7fff91c23000 - 0x7fff91c64ff7 libGLU.dylib (12.1) /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib - 0x7fff91c65000 - 0x7fff91c96ff7 libncurses.5.4.dylib (46) /usr/lib/libncurses.5.4.dylib - 0x7fff91ef6000 - 0x7fff91f49ff7 libc++.1.dylib (120.1) <8FC3D139-8055-3498-9AC5-6467CB7F4D14> /usr/lib/libc++.1.dylib - 0x7fff91f8c000 - 0x7fff91f8eff7 libquarantine.dylib (80) <0F4169F0-0C84-3A25-B3AE-E47B3586D908> /usr/lib/system/libquarantine.dylib - 0x7fff91fc3000 - 0x7fff91fddfff com.apple.Kerberos (3.0 - 1) <1B4744BF-E5AE-38E2-AA56-E22D3270F2E8> /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos - 0x7fff9233c000 - 0x7fff9269ef3f libobjc.A.dylib (680) <7489D2D6-1EFD-3414-B18D-2AECCCC90286> /usr/lib/libobjc.A.dylib - 0x7fff926df000 - 0x7fff926f0fff libcmph.dylib (6) /usr/lib/libcmph.dylib - 0x7fff92756000 - 0x7fff9279bff3 libFontRegistry.dylib (155.2) /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib - 0x7fff927b9000 - 0x7fff927c4ff7 libcommonCrypto.dylib (60075.50.1) <93732261-34B4-3914-B7A2-90A81A182DBA> /usr/lib/system/libcommonCrypto.dylib - 0x7fff927c5000 - 0x7fff927c6ffb libremovefile.dylib (41) <552EF39E-14D7-363E-9059-4565AC2F894E> /usr/lib/system/libremovefile.dylib - 0x7fff93126000 - 0x7fff93131ff7 libChineseTokenizer.dylib (16) <79B8C67A-3061-3C78-92CD-4650719E68D4> /usr/lib/libChineseTokenizer.dylib - 0x7fff93132000 - 0x7fff9313cfff com.apple.NetAuth (6.0 - 6.0) /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth - 0x7fff931b3000 - 0x7fff93240fff libsystem_c.dylib (1082.50.1) /usr/lib/system/libsystem_c.dylib - 0x7fff93250000 - 0x7fff935e5fdb com.apple.vImage (8.0 - 8.0) <4BAC9B6F-7482-3580-8787-AB0A5B4D331B> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage - 0x7fff9394a000 - 0x7fff939bffff com.apple.framework.IOKit (2.0.2 - 1179.50.2) /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit - 0x7fff939e9000 - 0x7fff93a02fff com.apple.CFOpenDirectory (10.11 - 194) <11F95672-55E0-3F9D-9171-5E8C56AEE948> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory - 0x7fff93ad9000 - 0x7fff93ae1fff libGFXShared.dylib (12.1) <5A0C2493-200C-30BE-97D5-8E8C0B8E604D> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib - 0x7fff93ae2000 - 0x7fff93aeafff libsystem_networkextension.dylib (385.40.36) <66095DC7-6539-38F2-95EE-458F15F6D014> /usr/lib/system/libsystem_networkextension.dylib - 0x7fff93d66000 - 0x7fff93d83ff7 com.apple.AppleVPAFramework (2.1.2 - 2.1.2) <41378C0B-B56A-3A73-9BD0-E06FA1F87B8C> /System/Library/PrivateFrameworks/AppleVPA.framework/Versions/A/AppleVPA - 0x7fff94496000 - 0x7fff9449efff com.apple.NetFS (6.0 - 4.0) <842A5346-24C3-3F22-9ECF-E586A10EA1F2> /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS - 0x7fff9449f000 - 0x7fff944a4ff7 libmacho.dylib (875.1) <318264FA-58F1-39D8-8285-1F6254EE410E> /usr/lib/system/libmacho.dylib - 0x7fff944a5000 - 0x7fff944cefff libsystem_info.dylib (477.50.4) /usr/lib/system/libsystem_info.dylib - 0x7fff945f8000 - 0x7fff9466ffeb libcorecrypto.dylib (335.50.1) /usr/lib/system/libcorecrypto.dylib - 0x7fff94672000 - 0x7fff9467afef libsystem_platform.dylib (74.40.2) <29A905EF-6777-3C33-82B0-6C3A88C4BA15> /usr/lib/system/libsystem_platform.dylib - 0x7fff947a8000 - 0x7fff94835dd7 com.apple.AppleJPEG (1.0 - 1) <558ACADA-C41F-3EEF-82A0-C2D7B13C5428> /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG - 0x7fff9490b000 - 0x7fff94914ff7 libsystem_pthread.dylib (138.10.4) <3DD1EF4C-1D1B-3ABF-8CC6-B3B1CEEE9559> /usr/lib/system/libsystem_pthread.dylib - 0x7fff94915000 - 0x7fff94923ff7 libbz2.1.0.dylib (38) <28E54258-C0FE-38D4-AB76-1734CACCB344> /usr/lib/libbz2.1.0.dylib - 0x7fff949d8000 - 0x7fff949e4fff com.apple.speech.synthesis.framework (5.4.12 - 5.4.12) <71DA00B8-5EA2-326B-8814-59DB25512F65> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis - 0x7fff949e5000 - 0x7fff94a43fff com.apple.CoreServices.OSServices (728.12 - 728.12) <776EBD4F-7052-377F-A70D-E2FDBD465A5E> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices - 0x7fff94c55000 - 0x7fff94c6dfef libcompression.dylib (28) /usr/lib/libcompression.dylib - 0x7fff94d75000 - 0x7fff94d81ff7 com.apple.OpenDirectory (10.11 - 194) <31A67AD5-5CC2-350A-96D7-821DF4BC4196> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory - 0x7fff94dd2000 - 0x7fff94de9ff7 libsystem_asl.dylib (323.50.1) <41F8E11F-1BD0-3F1D-BA3A-AA1577ED98A9> /usr/lib/system/libsystem_asl.dylib - 0x7fff95efc000 - 0x7fff96372fff com.apple.CoreFoundation (6.9 - 1258.1) <943A1383-DA6A-3DC0-ABCD-D9AEB3D0D34D> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation - 0x7fff96a8b000 - 0x7fff96a8cffb libSystem.B.dylib (1226.10.1) /usr/lib/libSystem.B.dylib - 0x7fff96b0b000 - 0x7fff96b67fff libTIFF.dylib (1450) <14EB7C03-7DDA-3276-BAC5-D597913AC9C4> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib - 0x7fff9788c000 - 0x7fff97900ff3 com.apple.securityfoundation (6.0 - 55126) <130656AE-2711-3914-8736-D8B021C93FE0> /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation - 0x7fff97901000 - 0x7fff9796fff7 com.apple.ApplicationServices.ATS (377 - 394.4) <9779E916-0788-3CAC-B1EC-F68BCB12A2B6> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS - 0x7fff97970000 - 0x7fff979c1ff7 libcups.2.dylib (435.2) <91584A40-214D-33E8-A613-CE22289037C8> /usr/lib/libcups.2.dylib - 0x7fff97acb000 - 0x7fff97ad4ff3 libsystem_notify.dylib (150.40.1) /usr/lib/system/libsystem_notify.dylib - 0x7fff97c56000 - 0x7fff97c58fff libCVMSPluginSupport.dylib (12.1) /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib - 0x7fff97c59000 - 0x7fff97c5cff7 libCoreFSCache.dylib (119.5) <2389D7DA-B8EF-3EB4-AAAF-FBEDE01CDECA> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib - 0x7fff97d7b000 - 0x7fff97d80ff7 libheimdal-asn1.dylib (453.40.10) <981DE40B-FA16-36F7-BE92-8C8A115D6CD9> /usr/lib/libheimdal-asn1.dylib - 0x7fff97d81000 - 0x7fff97d9fffb libedit.3.dylib (43) <1D3E3152-4001-3C19-B56A-7543F1BBA47C> /usr/lib/libedit.3.dylib - 0x7fff987b2000 - 0x7fff989bffff libicucore.A.dylib (551.51.3) <5BC80F94-C90D-3175-BD96-FF1DC222EC9C> /usr/lib/libicucore.A.dylib - 0x7fff989c0000 - 0x7fff989c0ff7 liblaunch.dylib (765.50.8) <834ED605-5114-3641-AA4D-ECF31B801C50> /usr/lib/system/liblaunch.dylib - 0x7fff98b55000 - 0x7fff98b8ffff com.apple.QD (3.12 - 302) <0FE53180-2895-3D14-A1E7-F82DE1D106E1> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD - 0x7fff98be1000 - 0x7fff98be1fff libenergytrace.dylib (10.40.1) <0A491CA7-3451-3FD5-999A-58AB4362682B> /usr/lib/libenergytrace.dylib - 0x7fff98c36000 - 0x7fff98c41fff libGL.dylib (12.1) <70D51643-04AC-3400-8F11-A6FC25985289> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib - 0x7fff98c77000 - 0x7fff98ca0fff libc++abi.dylib (125) /usr/lib/libc++abi.dylib - 0x7fff98cb0000 - 0x7fff98cdfff7 com.apple.DictionaryServices (1.2 - 250.3) <30250542-CBAA-39C1-91AA-B57A5DE17594> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices - 0x7fff98ce0000 - 0x7fff98ce7ff7 libcompiler_rt.dylib (62) /usr/lib/system/libcompiler_rt.dylib - 0x7fff98d10000 - 0x7fff98fa6fff libmecabra.dylib (696.5) /usr/lib/libmecabra.dylib - 0x7fff99bdb000 - 0x7fff99bdbfff com.apple.Accelerate (1.10 - Accelerate 1.10) <185EC96A-5AF0-3620-A4ED-4D3654D25B39> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate - 0x7fff99bdc000 - 0x7fff99bddfff libsystem_blocks.dylib (65) <1244D9D5-F6AA-35BB-B307-86851C24B8E5> /usr/lib/system/libsystem_blocks.dylib - 0x7fff99d2d000 - 0x7fff99e94fff libBLAS.dylib (1162.2) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib - 0x7fff99f74000 - 0x7fff9a259ffb com.apple.CoreServices.CarbonCore (1136.2 - 1136.2) <2DBAFC9A-6CD6-351D-B1F4-87D81AA6D640> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore - 0x7fff9a2cc000 - 0x7fff9a312ff7 libauto.dylib (186) <999E610F-41FC-32A3-ADCA-5EC049B65DFB> /usr/lib/libauto.dylib - 0x7fff9a359000 - 0x7fff9a35ffff com.apple.IOAccelerator (205.10 - 205.10) /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator - 0x7fff9a40b000 - 0x7fff9a410ff3 libunwind.dylib (35.3) /usr/lib/system/libunwind.dylib - 0x7fff9a833000 - 0x7fff9a923fff libJP2.dylib (1450) /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib - 0x7fff9ab94000 - 0x7fff9aba5fff libSparseBLAS.dylib (1162.2) /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib - 0x7fff9abea000 - 0x7fff9ac8afff com.apple.Metadata (10.7.0 - 972.34) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata - 0x7fff9af5b000 - 0x7fff9af79ff7 libsystem_kernel.dylib (3248.50.21) <78E54D59-D2B0-3F54-9A4A-0A68D671F253> /usr/lib/system/libsystem_kernel.dylib - 0x7fff9b073000 - 0x7fff9b159ff7 libcrypto.0.9.8.dylib (59.40.2) <2486D801-C756-3488-B519-1AA6807E8948> /usr/lib/libcrypto.0.9.8.dylib - 0x7fff9b3c1000 - 0x7fff9b4bdff7 libFontParser.dylib (158.6) <267A9AE4-4138-3112-8D73-BDFDC96568FF> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib - 0x7fff9b4c2000 - 0x7fff9b4ddff7 libCRFSuite.dylib (34) <078B4CD8-6A8C-3067-B2BA-0C2A0BAB8AC3> /usr/lib/libCRFSuite.dylib - 0x7fff9b625000 - 0x7fff9b8acff3 com.apple.CFNetwork (760.5.1 - 760.5.1) /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork - 0x7fff9b928000 - 0x7fff9baeefe7 com.apple.ImageIO.framework (3.3.0 - 1450) <18ABA1F4-43EC-3990-9777-C91FD3D6AF71> /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO - 0x7fff9bdf0000 - 0x7fff9be24ff7 com.apple.CoreVideo (1.8 - 191.3) <1AA24A1B-CB84-3F6B-B6DE-11494542649C> /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo - 0x7fff9bf5b000 - 0x7fff9bf60fff com.apple.DiskArbitration (2.7 - 2.7) /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration - 0x7fff9bf61000 - 0x7fff9c086fff com.apple.LaunchServices (728.12 - 728.12) /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices - 0x7fff9c0e4000 - 0x7fff9c0effff libkxld.dylib (3248.50.21) <99195052-038E-3490-ACF8-76F9AC43897E> /usr/lib/system/libkxld.dylib - 0x7fff9d382000 - 0x7fff9d386fff libpam.2.dylib (20) /usr/lib/libpam.2.dylib - 0x7fff9d4b7000 - 0x7fff9d4c8ff7 libz.1.dylib (61.20.1) /usr/lib/libz.1.dylib - 0x7fff9d4ca000 - 0x7fff9d4f8ff7 com.apple.CoreServicesInternal (248.2 - 248.2) <6E111F0A-D7F1-3738-ADE7-CF983BD4EC8B> /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal - 0x7fff9d4f9000 - 0x7fff9d4fbff7 libsystem_configuration.dylib (802.40.13) <3DEB7DF9-6804-37E1-BC83-0166882FF0FF> /usr/lib/system/libsystem_configuration.dylib - 0x7fff9d5ab000 - 0x7fff9d5acfff libsystem_secinit.dylib (20) <32B1A8C6-DC84-3F4F-B8CE-9A52B47C3E6B> /usr/lib/system/libsystem_secinit.dylib - -External Modification Summary: - Calls made by other processes targeting this process: - task_for_pid: 11 - thread_create: 0 - thread_set_state: 0 - Calls made by this process: - task_for_pid: 0 - thread_create: 0 - thread_set_state: 0 - Calls made by all processes on this machine: - task_for_pid: 199747 - thread_create: 0 - thread_set_state: 9181 - -VM Region Summary: -ReadOnly portion of Libraries: Total=231.3M resident=0K(0%) swapped_out_or_unallocated=231.3M(100%) -Writable regions: Total=112.3M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=112.3M(100%) - - VIRTUAL REGION -REGION TYPE SIZE COUNT (non-coalesced) -=========== ======= ======= -Activity Tracing 2048K 2 -Dispatch continuations 16.0M 2 -Kernel Alloc Once 4K 2 -MALLOC 75.5M 22 -MALLOC guard page 32K 7 -STACK GUARD 56.0M 9 -Stack 11.1M 16 -VM_ALLOCATE 7448K 21 -__DATA 11.8M 183 -__LINKEDIT 101.5M 32 -__TEXT 129.8M 182 -__UNICODE 552K 2 -mapped file 47.0M 49 -shared memory 324K 9 -=========== ======= ======= -TOTAL 458.9M 524 - -Model: MacBookPro11,5, BootROM MBP114.0172.B09, 4 processors, Intel Core i7, 2,5 GHz, 16 GB, SMC 2.30f2 -Graphics: AMD Radeon R9 M370X, AMD Radeon R9 M370X, PCIe, 2048 MB -Graphics: Intel Iris Pro, Intel Iris Pro, Built-In -Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533642465238412D50422020 -Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1600 MHz, 0x80AD, 0x484D54343147533642465238412D50422020 -AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x152), Broadcom BCM43xx 1.0 (7.21.95.175.1a6) -Bluetooth: Version 4.4.5f3 17904, 3 services, 27 devices, 1 incoming serial ports -Network Service: Wi-Fi, AirPort, en0 -Serial ATA Device: APPLE SSD SM0512G, 500,28 GB -USB Device: USB 3.0 Bus -USB Device: Card Reader -USB Device: Apple Internal Keyboard / Trackpad -USB Device: Bluetooth USB Host Controller -Thunderbolt Bus: MacBook Pro, Apple Inc., 27.1 diff --git a/callcount.yap b/callcount.yap deleted file mode 100644 index f8be21661..000000000 --- a/callcount.yap +++ /dev/null @@ -1,152 +0,0 @@ -/************************************************************************* -* * -* YAP Prolog * -* * -* Yap Prolog was developed at NCCUP - Universidade do Porto * -* * -* Copyright L.Damas, V.S.Costa and Universidade do Porto 1985-1997 * -* * -************************************************************************** -* * -* File: callcount.yap * -* Last rev: 8/2/02 * -* mods: * -* comments: Some profiling predicates available in yap * -* * -*************************************************************************/ - -%% @{ - -/** @defgroup Profiling Profiling Prolog Programs -@ingroup extensions - -YAP includes two profilers. The count profiler keeps information on the -number of times a predicate was called. This information can be used to -detect what are the most commonly called predicates in the program. The -count profiler can be compiled by setting YAP's flag profiling -to `on`. The time-profiler is a `gprof` profiler, and counts -how many ticks are being spent on specific predicates, or on other -system functions such as internal data-base accesses or garbage collects. - -The YAP profiling sub-system is currently under -development. Functionality for this sub-system will increase with newer -implementation. - - - */ - -%% @{ - -/** @defgroup Call_Counting Counting Calls -@ingroup Profiling - -Predicates compiled with YAP's flag call_counting set to -`on` update counters on the numbers of calls and of -retries. Counters are actually decreasing counters, so that they can be -used as timers. Three counters are available: - -+ `calls`: number of predicate calls since execution started or since -system was reset; -+ `retries`: number of retries for predicates called since -execution started or since counters were reset; -+ `calls_and_retries`: count both on predicate calls and -retries. - -These counters can be used to find out how many calls a certain -goal takes to execute. They can also be used as timers. - -The code for the call counters piggybacks on the profiling -code. Therefore, activating the call counters also activates the profiling -counters. - -These are the predicates that access and manipulate the call counters. -*/ - -:- system_module( '$_callcount', [call_count/3, - call_count_data/3, - call_count_reset/0], []). - -:- use_system_module( '$_errors', ['$do_error'/2]). - - -/** @pred call_count_data(- _Calls_, - _Retries_, - _CallsAndRetries_) - - -Give current call count data. The first argument gives the current value -for the _Calls_ counter, next the _Retries_ counter, and last -the _CallsAndRetries_ counter. - -*/ -call_count_data(Calls, Retries, Both) :- - '$call_count_info'(Calls, Retries, Both). - -/** @pred call_count_reset - - -Reset call count counters. All timers are also reset. - -*/ -call_count_reset :- - '$call_count_reset'. - -/** @pred call_count(? _CallsMax_, ? _RetriesMax_, ? _CallsAndRetriesMax_) - - -Set call counters as timers. YAP will generate an exception -if one of the instantiated call counters decreases to 0: - -+ _CallsMax_ - - throw the exception `call_counter` when the -counter `calls` reaches 0; - -+ _RetriesMax_ - - throw the exception `retry_counter` when the -counter `retries` reaches 0; - -+ _CallsAndRetriesMax_ - - throw the exception -`call_and_retry_counter` when the counter `calls_and_retries` -reaches 0. - - YAP will ignore counters that are called with unbound arguments. - -Next, we show a simple example of how to use call counters: - -~~~~~{.prolog} - ?- yap_flag(call_counting,on), [-user]. l :- l. end_of_file. yap_flag(call_counting,off). - -yes - -yes - ?- catch((call_count(10000,_,_),l),call_counter,format("limit_exceeded.~n",[])). - -limit_exceeded. - -yes -~~~~~ -Notice that we first compile the looping predicate `l/0` with -call_counting `on`. Next, we catch/3 to handle an -exception when `l/0` performs more than 10000 reductions. - - - */ -call_count(Calls, Retries, Both) :- - '$check_if_call_count_on'(Calls, CallsOn), - '$check_if_call_count_on'(Retries, RetriesOn), - '$check_if_call_count_on'(Both, BothOn), - '$call_count_set'(Calls, CallsOn, Retries, RetriesOn, Both, BothOn). - -'$check_if_call_count_on'(Calls, 1) :- integer(Calls), !. -'$check_if_call_count_on'(Calls, 0) :- var(Calls), !. -'$check_if_call_count_on'(Calls, A) :- - '$do_error'(type_error(integer,Calls),call_count(A)). - -%% @} - -/** -@} -*/ - diff --git a/cmake/Config.cmake b/cmake/Config.cmake index 86ce9e31f..a3f476fc9 100644 --- a/cmake/Config.cmake +++ b/cmake/Config.cmake @@ -15,13 +15,15 @@ include(TestBigEndian) include(GetGitRevisionDescription) # modern systems do this. + set(MALLOC_T "void *") OPTION(WITH_SYSTEM_MALLOC "use malloc to allocate memory" ON) OPTION(WITH_DL_MALLOC "use malloc to allocate memory" OFF) OPTION(WITH_YAP_MALLOC - "use malloc to allocate memory" OFF) + "use malloc to allocate mem + ory" OFF) if (WITH_SYSTEM_MALLOC) set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS USE_SYSTEM_MALLOC=1) @@ -144,6 +146,7 @@ endif (HAVE_LIBDL) if (WIN32) check_library_exists(comdlg32 FindText "" HAVE_LIBCOMDLG32) if (HAVE_LIBCOMDLG32) + set(EXTRALIBS ${EXTRALIBS} comdlg32) endif (HAVE_LIBCOMDLG32) check_library_exists(msvcrt strtok "" HAVE_LIBMSCRT) @@ -215,6 +218,7 @@ if (HAVE_LIBPTHREAD) endif (HAVE_LIBPTHREAD) + check_library_exists(unicode main "" HAVE_LIBUNICODE) if (HAVE_LIBUNICODE) set(EXTRALIBS ${EXTRALIBS} unicode) @@ -261,10 +265,8 @@ check_symbol_exists(flsll HAVE_FLSLL) check_function_exists(fmemopen HAVE_FMEMOPEN) check_function_exists(fpclass HAVE_FPCLASS) check_function_exists(ftime HAVE_FTIME) -check_function_exists(ftruncate HAVE_FTRUNCATE) -check_function_exists(funopen HAVE_FUNOPEN) -check_function_exists(gcc HAVE_GCC) -check_function_exists(getcwd HAVE_GETCWD) +check_function_exists(ftru +wd HAVE_GETCWD) check_function_exists(getenv HAVE_GETENV) check_function_exists(getexecname HAVE_GETEXECNAME) check_function_exists(gethostbyname HAVE_GETHOSTBYNAME) @@ -321,7 +323,8 @@ check_function_exists(setlocale HAVE_SETLOCALE) check_function_exists(setsid HAVE_SETSID) check_function_exists(shmat HAVE_SHMAT) check_function_exists(sigaction HAVE_SIGACTION) -check_symbol_exists(SIGFPE signal.h HAVE_SIGFPE) +check_symbol_exists(SI +GFPE signal.h HAVE_SIGFPE) check_function_exists(siggetmask HAVE_SIGGETMASK) check_symbol_exists(SIGINFO signal.h HAVE_SIGINFO) check_function_exists(siginterrupt HAVE_SIGINTERRUPT) @@ -396,5 +399,13 @@ configure_file(${CMAKE_CURRENT_LIST_DIR}/../YapTermConfig.h.cmake configure_file(${CMAKE_CURRENT_LIST_DIR}/../config.h.cmake ${CMAKE_BINARY_DIR}/config.h) configure_file(${CMAKE_CURRENT_LIST_DIR}/../GitSHA1.c.in GitSHA1.c @ONLY) - configure_file(${CMAKE_CURRENT_LIST_DIR}/../os/YapIOConfig.h.cmake ${CMAKE_BINARY_DIR}/os/YapIOConfig.h) + +check_include_files( "stdio.h;cudd.h" HAVE_CTYPE_HUDD_H ) + +check_include_files( "stdio.h;cuddI.h" HAVE_CUDD_H ) +check_include_files( "cudd.h;cuddInt.h" HAVE_CUDDINT_H ) +check_include_files( "stdio.h;cudd/cudd.h" HAVE_CUDD_CUDD_H ) +check_include_files( "stdio.h;cudd/cuddInt.h" HAVE_CUDD_CUDDINT_H ) +configure_file (cmake/cudd_config.h.cmake + "${CMAKE_CURRENT_BINARY_DIR}/cudd_config.h" ) diff --git a/cmake/cudd.cmake b/cmake/cudd.cmake index de2d30096..7345e360d 100644 --- a/cmake/cudd.cmake +++ b/cmake/cudd.cmake @@ -1,5 +1,5 @@ - + option (WITH_CUDD "BDD CUDD package" ON) if (WITH_CUDD) @@ -18,10 +18,7 @@ if (CUDD_FOUND) set( CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${CUDD_INCLUDE_DIR} ) -check_include_files( "stdio.h;cudd.h" HAVE_CUDD_H ) -check_include_files( "stdio.h;cudd/cudd.h" HAVE_CUDD_CUDD_H ) -check_include_files( "cuddInt.h" HAVE_CUDDINT_H ) -check_include_files( "cudd/cuddInt.h" HAVE_CUDD_CUDDINT_H ) endif (CUDD_FOUND) + endif(WITH_CUDD) diff --git a/packages/bdd/cudd_config.h.cmake b/cmake/cudd_config.h.cmake similarity index 100% rename from packages/bdd/cudd_config.h.cmake rename to cmake/cudd_config.h.cmake diff --git a/example.py b/example.py deleted file mode 100644 index 92e2246d6..000000000 --- a/example.py +++ /dev/null @@ -1,14 +0,0 @@ -# python commands - -import yap - -engine = yap.YAPEngine(); -# engine = yap.YAPEngine(yap.YAPParams()); - -while True: - s = raw_input("Prolog Query: ") - q = engine.query(s) - print "success" - while q.next(): - ar = q.namedVars(); - print ar diff --git a/heap_top_ b/heap_top_ deleted file mode 100644 index e69de29bb..000000000 diff --git a/include/YapError.h b/include/YapError.h index 9c68dbcce..a9ea6810f 100644 --- a/include/YapError.h +++ b/include/YapError.h @@ -42,7 +42,7 @@ struct yami *Yap_Error__(const char *file, const char *function, int lineno, yap_error_number err, YAP_Term wheret, ...); void Yap_ThrowError__(const char *file, const char *function, int lineno, - yap_error_number err, YAP_Term wheret, int code, ...) __attribute__ ((noreturn)); + yap_error_number err, YAP_Term wheret, ...) __attribute__ ((noreturn)); #define Yap_NilError(id, ...) \ @@ -51,8 +51,8 @@ void Yap_ThrowError__(const char *file, const char *function, int lineno, #define Yap_Error(id, inp, ...) \ Yap_Error__(__FILE__, __FUNCTION__, __LINE__, id, inp, __VA_ARGS__) -#define Yap_ThrowError(id, inp, code, ...) \ -Yap_ThrowError__(__FILE__, __FUNCTION__, __LINE__, id, inp, code, __VA_ARGS__) +#define Yap_ThrowError(id, inp, ...) \ +Yap_ThrowError__(__FILE__, __FUNCTION__, __LINE__, id, inp, __VA_ARGS__) #ifdef YAP_TERM_H /** diff --git a/libYap.cmake b/libYap.cmake index 4a1c0df8c..5cdddcc92 100644 --- a/libYap.cmake +++ b/libYap.cmake @@ -57,7 +57,7 @@ ENDIF("${isSystemDir}" STREQUAL "-1") include_directories (H H/generated include os OPTYap utf8proc JIT/HPP) -include_directories (BEFORE ${CMAKE_BINARY_DIR}) +include_directories (BEFORE ${CMAKE_BINARY_DIR} ${CMAKE_TOP_BINARY_DIR}) if (ANDROID) include_directories (CXX ${CMAKE_SOURCE_DIR}/../generated/src/jni) diff --git a/os/fmem.c b/os/fmem.c index a2cf28a85..6362602c7 100644 --- a/os/fmem.c +++ b/os/fmem.c @@ -110,11 +110,10 @@ static char SccsId[] = "%W% %G%"; bool Yap_set_stream_to_buf(StreamDesc *st, const char *buf, size_t nchars) { FILE *f; - stream_flags_t flags; // like any file stream. st->file = f = fmemopen((void *)buf, nchars, "r"); - flags = Input_Stream_f | InMemory_Stream_f | Seekable_Stream_f; + st->status = Input_Stream_f | InMemory_Stream_f | Seekable_Stream_f; Yap_DefaultStreamOps(st); return true; } diff --git a/os/readterm.c b/os/readterm.c index 34c63ae62..bc9c9cc7f 100644 --- a/os/readterm.c +++ b/os/readterm.c @@ -1211,26 +1211,23 @@ static Int style_checker(USES_REGS1) { } X_API Term Yap_StringToTerm(const char *s, size_t len, encoding_t *encp, - int prio, Term *bindings) { + int prio, Term bindings) { CACHE_REGS - Term bvar = MkVarTerm(), ctl; - yhandle_t sl; - int lvl = push_text_stack(); + Term ctl; + int lvl = push_text_stack(); if (len == 0) { Term rval = TermEof; if (rval && bindings) { - *bindings = TermNil; + rval = Yap_unify(bindings , TermNil ); } pop_text_stack(lvl); return rval; } if (bindings) { - ctl = Yap_MkApplTerm(Yap_MkFunctor(AtomVariableNames, 1), 1, &bvar); - sl = Yap_PushHandle(bvar); + ctl = Yap_MkApplTerm(Yap_MkFunctor(AtomVariableNames, 1), 1, &bindings); } else { ctl = TermNil; - sl = 0; } Term rval; @@ -1239,9 +1236,6 @@ X_API Term Yap_StringToTerm(const char *s, size_t len, encoding_t *encp, rval = Yap_read_term(stream, ctl, 3); Yap_CloseStream(stream); UNLOCK(GLOBAL_Stream[stream].streamlock); - if (rval && bindings) { - *bindings = Yap_PopHandle(sl); - } pop_text_stack(lvl); return rval; } @@ -1290,107 +1284,6 @@ Term Yap_AtomToTerm(Atom a, Term opts) { return rval; } -/** - * @pred read_term_from_string( +_String_ , - _T_ , + _Options_ - * - * read a term _T_ stored in constant _String_ according to _Options_ - * - * @param _String_ the source _String_ - * @param _T_ the output term _T_, may be any term - * @param _Options_ read_term/3 options. - * - * @notes Idea from SWI-Prolog, in YAP only works with strings - * Check read_term_from_atomic/3 for the general version. - */ -static Int read_term_from_string(USES_REGS1) { - Term t1 = Deref(ARG1), rc; - const unsigned char *s; - size_t len; - if (IsVarTerm(t1)) { - Yap_Error(INSTANTIATION_ERROR, t1, "read_term_from_string/3"); - return (FALSE); - } else if (!IsStringTerm(t1)) { - Yap_Error(TYPE_ERROR_STRING, t1, "read_term_from_string/3"); - return (FALSE); - } else { - s = UStringOfTerm(t1); - len = strlen_utf8(s); - } - char *ss = (char *)s; - encoding_t enc = ENC_ISO_UTF8; - int sno = Yap_open_buf_read_stream(ss, len, &enc, MEM_BUF_USER); - rc = Yap_read_term(sno, Deref(ARG3), 3); - Yap_CloseStream(sno); - if (!rc) - return false; - return Yap_unify(rc, ARG2); -} - -static Int string_to_term(USES_REGS1) { - Term t1 = Deref(ARG1), rc; - const char *s; - size_t len; - if (IsVarTerm(t1)) { - Yap_Error(INSTANTIATION_ERROR, t1, "read_term_from_string/3"); - return (FALSE); - } else if (!IsStringTerm(t1)) { - Yap_Error(TYPE_ERROR_STRING, t1, "read_term_from_string/3"); - return (FALSE); - } else { - s = StringOfTerm(t1); - len = strlen_utf8((const unsigned char *)s); - } - encoding_t enc = ENC_ISO_UTF8; - rc = Yap_StringToTerm(s, len, &enc, 1200, &ARG3); - if (!rc) - return false; - return Yap_unify(rc, ARG2); -} - -static Int atomic_to_term(USES_REGS1) { - Term t1 = Deref(ARG1), rc; - const char *s; - size_t len; - if (IsVarTerm(t1)) { - Yap_Error(INSTANTIATION_ERROR, t1, "read_term_from_string/3"); - return (FALSE); - } else if (!IsAtomicTerm(t1)) { - Yap_Error(TYPE_ERROR_ATOMIC, t1, "read_term_from_atomic/3"); - return (FALSE); - } else { - Term t = Yap_AtomicToString(t1 PASS_REGS); - s = (const char *)UStringOfTerm(t); - len = strlen_utf8((unsigned char *)s); - } - encoding_t enc = ENC_ISO_UTF8; - rc = Yap_StringToTerm(s, len, &enc, 1200, &ARG3); - if (!rc) - return false; - return Yap_unify(rc, ARG2); -} - -static Int atom_to_term(USES_REGS1) { - Term t1 = Deref(ARG1), rc; - const char *s; - size_t len; - if (IsVarTerm(t1)) { - Yap_Error(INSTANTIATION_ERROR, t1, "read_term_from_string/3"); - return (FALSE); - } else if (!IsAtomTerm(t1)) { - Yap_Error(TYPE_ERROR_ATOM, t1, "read_term_from_atomic/3"); - return (FALSE); - } else { - Term t = Yap_AtomicToString(t1 PASS_REGS); - s = StringOfTerm(t); - len = strlen_utf8((const unsigned char *)s); - } - encoding_t enc = ENC_ISO_UTF8; - rc = Yap_StringToTerm(s, len, &enc, 1200, &ARG3); - if (!rc) - return false; - return Yap_unify(rc, ARG2); -} - /** * @pred read_term_from_atomic( +_Atomic_ , - _T_ , + _Options_ ) * @@ -1430,6 +1323,42 @@ static Int read_term_from_atomic(USES_REGS1) { return Yap_unify(rc, ARG2); } +/** + * @pred read_term_from_string( +_String_ , - _T_ , + _Options_ + * + * read a term _T_ stored in constant _String_ according to _Options_ + * + * @param _String_ the source _String_ + * @param _T_ the output term _T_, may be any term + * @param _Options_ read_term/3 options. + * + * @notes Idea from SWI-Prolog, in YAP only works with strings + * Check read_term_from_atomic/3 for the general version. + */ +static Int read_term_from_string(USES_REGS1) { + Term t1 = Deref(ARG1), rc; + const unsigned char *s; + size_t len; + if (IsVarTerm(t1)) { + Yap_Error(INSTANTIATION_ERROR, t1, "read_term_from_string/3"); + return (FALSE); + } else if (!IsStringTerm(t1)) { + Yap_Error(TYPE_ERROR_STRING, t1, "read_term_from_string/3"); + return (FALSE); + } else { + s = UStringOfTerm(t1); + len = strlen_utf8(s); + } + char *ss = (char *)s; + encoding_t enc = ENC_ISO_UTF8; + int sno = Yap_open_buf_read_stream(ss, len, &enc, MEM_BUF_USER); + rc = Yap_read_term(sno, Deref(ARG3), 3); + Yap_CloseStream(sno); + if (!rc) + return false; + return Yap_unify(rc, ARG2); +} + void Yap_InitReadTPreds(void) { Yap_InitCPred("read", 1, read1, SyncPredFlag); Yap_InitCPred("read", 2, read2, SyncPredFlag); @@ -1440,9 +1369,6 @@ void Yap_InitReadTPreds(void) { Yap_InitCPred("read_term_from_atom", 3, read_term_from_atom, 0); Yap_InitCPred("read_term_from_atomic", 3, read_term_from_atomic, 0); Yap_InitCPred("read_term_from_string", 3, read_term_from_string, 0); - Yap_InitCPred("atom_to_term", 3, atom_to_term, 0); - Yap_InitCPred("atomic_to_term", 3, atomic_to_term, 0); - Yap_InitCPred("string_to_term", 3, string_to_term, 0); Yap_InitCPred("fileerrors", 0, fileerrors, SyncPredFlag); Yap_InitCPred("nofileeleerrors", 0, nofileerrors, SyncPredFlag); diff --git a/os/yapio.h b/os/yapio.h index 8ce7d80ca..755609c92 100644 --- a/os/yapio.h +++ b/os/yapio.h @@ -105,8 +105,7 @@ typedef enum mem_buf_source { extern char *Yap_MemStreamBuf(int sno); -extern X_API Term Yap_StringToTerm(const char *s, size_t len, encoding_t *encp, - int prio, Term *bindings_p); +extern X_API Term Yap_StringToTerm(const char *s, size_t len, encoding_t *encp,int prio, Term bindings); extern Term Yap_StringToNumberTerm(const char *s, encoding_t *encp, bool error_on); extern int Yap_FormatFloat(Float f, char **s, size_t sz); extern int Yap_open_buf_read_stream(const char *buf, size_t nchars, diff --git a/packages/bdd/CMakeLists.txt b/packages/bdd/CMakeLists.txt index 388bef694..36cc5ac02 100644 --- a/packages/bdd/CMakeLists.txt +++ b/packages/bdd/CMakeLists.txt @@ -32,10 +32,6 @@ IF (CUDD_FOUND) ${CMAKE_CURRENT_BINARY_DIR} ) - configure_file ("${PROJECT_SOURCE_DIR}/cudd_config.h.cmake" - "${CMAKE_CURRENT_BINARY_DIR}/cudd_config.h" ) - - if(DEFINED YAP_MAJOR_VERSION) TARGET_LINK_LIBRARIES(cudd ${CUDD_LIBRARIES} @@ -66,4 +62,3 @@ IF (CUDD_FOUND) INSTALL(FILES trie_sp.yap DESTINATION ${libpl}) ENDIF (CUDD_FOUND) - diff --git a/packages/bdd/simplecudd/simplecudd.c b/packages/bdd/simplecudd/simplecudd.c index e9b082c25..6327b502d 100644 --- a/packages/bdd/simplecudd/simplecudd.c +++ b/packages/bdd/simplecudd/simplecudd.c @@ -1,224 +1,4 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -/****************************************************************************** \ +/*********************************************************************vii * * * SimpleCUDD library (www.cs.kuleuven.be/~theo/tools/simplecudd.html) * * SimpleCUDD was developed at Katholieke Universiteit Leuven(www.kuleuven.be) * diff --git a/packages/bdd/simplecudd/simplecudd.h b/packages/bdd/simplecudd/simplecudd.h index 64a3f8ea0..746d9423f 100644 --- a/packages/bdd/simplecudd/simplecudd.h +++ b/packages/bdd/simplecudd/simplecudd.h @@ -193,7 +193,7 @@ #include #include #include "config.h" -#include "../cudd_config.h" +#include "cudd_config.h" #if HAVE_CUDD_UTIL_H #include @@ -352,4 +352,3 @@ void ExpandNodes(hisqueue *Nodes, int index, int nodenum); int simpleBDDtoDot(DdManager *manager, DdNode *bdd, char *filename); int simpleNamedBDDtoDot(DdManager *manager, namedvars varmap, DdNode *bdd, char *filename); - diff --git a/packages/bdd/simplecudd_lfi/simplecudd.h b/packages/bdd/simplecudd_lfi/simplecudd.h index b5b78d239..bdca14271 100644 --- a/packages/bdd/simplecudd_lfi/simplecudd.h +++ b/packages/bdd/simplecudd_lfi/simplecudd.h @@ -192,7 +192,7 @@ #include #include "pqueue.h" #include "config.h" -#include "../cudd_config.h" +#include "cudd_config.h" #if HAVE_CUDD_UTIL_H #include #elif HAVE_UTIL_H @@ -353,4 +353,3 @@ void ExpandNodes(hisqueue *Nodes, int index, int nodenum); int simpleBDDtoDot(DdManager *manager, DdNode *bdd, const char *filename); int simpleNamedBDDtoDot(DdManager *manager, namedvars varmap, DdNode *bdd, const char *filename); - diff --git a/packages/cplint/CMakeLists.txt b/packages/cplint/CMakeLists.txt index 5e7a968fb..83b8353a6 100644 --- a/packages/cplint/CMakeLists.txt +++ b/packages/cplint/CMakeLists.txt @@ -1,4 +1,4 @@ - + # Be sure to also update these in Makefile! set(SO_MAJOR 1) set(SO_MINOR 0) @@ -63,7 +63,7 @@ IF (CUDD_FOUND) slipcover/revise_sl.pl slipcover/slipcover.pl ) - + set (CPLINT_TEST_PROGRAMS testcpl.pl testlpad.pl @@ -151,7 +151,7 @@ IF (CUDD_FOUND) ARCHIVE DESTINATION ${dlls} ) - + add_library (cplint SHARED ${CPLINT_SOURCES} ) @@ -162,7 +162,7 @@ IF (CUDD_FOUND) ) TARGET_LINK_LIBRARIES(cplint - ${CUDD_LIBRARIES} + ${CUDD_LIBRARIES} libYap ) diff --git a/packages/myddas/sqlite3/CMakeLists.txt b/packages/myddas/sqlite3/CMakeLists.txt index dc0a32306..17daa9a1c 100644 --- a/packages/myddas/sqlite3/CMakeLists.txt +++ b/packages/myddas/sqlite3/CMakeLists.txt @@ -45,6 +45,12 @@ Android/jni/sqlite/nativehelper/ScopedLocalRef.h endif (ANDROID) -add_component( Yapsqlite3 +add_component( Yapsqlite3 ${YAPSQLITE3_SOURCES} ) + MY_set_target_properties(Yapsqlite3 + PROPERTIES + # RPATH ${libdir} VERSION ${LIBYAPTAI_FULL_VERSION} + # SOVERSION ${LIBYAPTAI_MAJOR_VERSION}.${LIBYAPTAI_MINOR_VERSION} + POSITION_INDEPENDENT_CODE TRUE + ) diff --git a/pl/dbload.yap b/pl/dbload.yap index 6e2dd3781..757b2e0cf 100644 --- a/pl/dbload.yap +++ b/pl/dbload.yap @@ -25,11 +25,11 @@ :- use_system_module( attributes, [get_module_atts/2, put_module_atts/2]). -:- dynamic dbloading/6, dbprocess/2. - -dbload_from_stream(R, M0, rdf, term ) :- - '$lines_in_file'(R, Lines), - '$input_lines'(R, Type, Lines). +load_mega_clause( Stream ) :- + line_spec( Stream, Line), + repeat, + ( fact( Stream ), fail ; + stream_property(Stream, at_end_of_file( on )). '$input_lines'(R, csv, yeLines ) :- '$process_lines'(R, Lines, Type ), diff --git a/x.py b/x.py deleted file mode 100644 index 995318a69..000000000 --- a/x.py +++ /dev/null @@ -1,652 +0,0 @@ -#! /usr/bin/env python3 -# -# druwid is machine learning tool for adverse drug discovery -# -# It relies on the Aleph ILP learner, written and maintained by Ashwin Srinivasan\ -# -# Authos: Vitor Santos Costa, David Page -# Bugs are from Vitor Santos Costa -# - -import matplotlib -import matplotlib.image as mpimg -#matplotlib.use('Agg') - -import argparse -import csv -import heapq -import logging -import networkx as nx -import os -import numpy as np -import pandas as pd -import sys -import threading -import time -import yap - -graphics_ability = False - -if graphics_ability: - import PIL - def display_pdf(id): - im = Image.open(self.shown_clause[id]) - im.show() - - -logging.basicConfig(level=logging.DEBUG, - format='[%(levelname)s] (%(threadName)-10s) %(message)s', - ) - - -from collections import namedtuple -from enum import IntEnum -from queue import Queue -from dru.druplot import plotClause -from dru.shell import alephShell - -# class Console(InteractiveConsole): - -# def __init__(*args): InteractiveConsole.__init__(*args) - -compile = namedtuple('consult', 'FileName') -ensure_loaded = namedtuple('ensure_loaded', 'FileName') -loadFile = namedtuple('load_file', 'FileName Opts') -add_example = namedtuple('add_example', 'polarity case id b e') -set = namedtuple('set', 'key val') -setting = namedtuple('setting', ' key') -clsrc = namedtuple('clsrc', ' key ids') -clgraph = namedtuple('clgraph', ' key') -clhist = namedtuple('clhist', ' key first pos') -clause_info = namedtuple('clause_info', ' key Text Symbs H1Pos H2Pos CH1Pos CH2Pos ') -learn = namedtuple('learn', 'example') -learn_in_thread = namedtuple('learn_in_thread', 'example') -#learner = namedtuple('learn', 'class') -# assert = namedtuple('assert', 'fact') -load_ptable = namedtuple('load_ptable', 'File') -load_files = namedtuple('load_files', 'File Opts') - - -# prolog engine -class y: - E = None - - def run(g): - y.E.goal(g) - - def f(g): - y.E.fun(g) - - -# Schema information on Marshfiel mode table ( 2016 data ) -# -# TBD: make it match/ genrate a mode declaration -# - -# column headers, StudyId refers to the study participant -# -class DiagFields: - StudyID = 0 - DX_CODE= 1 - AGE= 2 - FACILITY_NUM= 3 - PROV_ID= 4 - DX_DESC= 5 - DX_TYPE_ID= 6 - DX_TYPE_DESC= 7 - DX_SUB_TYPE_ID= 8 - DX_SUB_TYPE_DESC= 9 - DX_CODE_CATEGORY= 10 - DX_CODE_CATEGORY_DESC= 11 - DX_CODE_SUBCATEGORY= 12 - DX_CODE_SUBCATEGORY_DESC= 13 - DATA_SOURCE= 14 - -# -# operations to fetch data from meds -# -class DiagOps(DiagFields): - ''' Selects age, id, and one descriptor: we chose to use DX_DESC so that people - can understand the rules easily. ''' - - def import_row( self ): - return ( DiagFields.StudyID, DiagFields.AGE, DiagFields.DX_DESC ) - - def pred(self): - return yap.YAPPrologPredicate( self.name, 3 ) - - def __init__(self, name, ids): - self.name = name - self.ids = ids - -# column headers, StudyId refers to the study participant -# -class MedFields( IntEnum ): - StudyID = 0 - AGE = 1 - GCN_SEQ_NUM= 2 - DRUG_NAME= 3 - GENERIC_NAME= 4 - DOSAGE= 5 - FREQUENCY= 6 - ACTION_ATTRIBUTE_DESC= 7 - ACTION_VALUE_DESC = 8 - ACTION_IN_PLAN_CODE= 9 - THERAPEUTIC_GENERIC_ID= 10 - THERAPEUTIC_GENERIC_DESC= 11 - THERAPEUTIC_SPECIFIC_ID= 12 - THERAPEUTIC_SPECIFIC_DESC= 13 - DRUG_SOURCE= 14 - DATA_SOURCE = 15 - - # - # operations to fetch data from meds - # -class MedOps: - ''' Operations as designed for the Marshfield meds table''' - - arity = 3 - - def import_row( self ): - return ( MedFields.StudyID, MedFields.AGE, MedFields.DRUG_NAME ) - - def pred( self ): - return yap.YAPPredicate( self.name, 3 ) - - def __init__(self, name, ids): - self.name = name - self.ids = ids - -class PrologTable: - '''Access tables in Prolog format''' - - def query( self ): - args = [ 0 for x in range(self.arity) ] - return self.pname._make( args ) - - def __init__(self, p, name): - self.p = p - self.name = name - self.arity = p.arity() - ArgNames = [ "A" + str(x+1) for x in range(self.arity) ] - self.pname = namedtuple(self.name, ArgNames) - - def __iter__(self): - goal = self.pname._make( ) - return PrologTableIter(self, e, goal) - -class PrologTableIter: - - def __init__(self, e, goal): - try: - self.e = e - self.q = e.YAPQuery(goal) - except: - print('Error') - - def __iter__(self): - # Iterators are iterables too. - # Adding this functions to make them so. - return self - - def next(self): - if self.q.next(): - return goal - else: - self.q.close() - self.q = None - raise StopIteration() - -class DBStore: - '''store operations: csv to pl, and so on''' - - def filter ( self, row ): - id = int(row[self.StudyID]) - - if id in self.ids: - ex1 = self.ids[ id ] - ex2 = self.ids[ -id ] - - age = int(float(row[self.AGE])*1000) - if ex2[1] <= age and age <= ex2[2]: - id = -id - elif ex1[1] > age or age > ex1[2]: - return None - desc = row[self.DESC] - return id, age, desc - - def __init__(self, File, dbi, ids ): - self.ids = ids - OFile = "data/" + dbi.name + '.yap' - if os.path.isfile(OFile) : - print("loading db from "+OFile) - y.run( load_files( OFile , []) ) - return - with open(File) as csvfile: - print("Converting db from "+File+ " to "+OFile) - with open( OFile, "w") as out: - csvfile.seek(0) - reader = csv.reader(csvfile, delimiter = '|', quoting = csv.QUOTE_MINIMAL ) - ( self.StudyID, self.AGE, self.DESC ) = dbi.import_row() - P = dbi.pred() - reader.__next__() - for row in reader: - tuple = self.filter( row ) - if tuple: - out.write( dbi.name + "( " + str(tuple[0]) +" , " + str(tuple[1])+ ", \'" + str(tuple[2]) + "\').\n" ) - print("loading db from "+OFile) - y.E.reSet() - y.run( load_ptable( OFile ) ) - - def save_table(self, File, name): - p = self.YAPPredicate(name, 3) - with open(File, 'w', newline='') as csvfile: - fieldnames = ['Id', 'Age', 'Attribute' ] - writer = csv.writer(csvfile, delimiter='|', fieldnames=fieldnames) - writer.writerows(PrologTable(p, name)) - -class Examples: - ''' Support for the manipulation and processing of examples. - - So far, only loadng examples''' - - ids = {} - - def __init__(self, File): - if File.lower().endswith(('.yap','.pl','.pro','.prolog')): - E.run( add_prolog( File ) ) - return - print("loading examples from "+File) - with open(File) as csvfile: - dialect = csv.Sniffer().sniff(csvfile.read(1024)) - dialect.delimiter = '|' - dialect.quoting = csv.QUOTE_MINIMAL - csvfile.seek(0) - reader = csv.reader(csvfile, dialect) - reader.__next__() - for row in reader: - ( cdb, pdb, id, b, e ) = row - case = cdb == "1" or cdb == 't' or cdb == '+' - Type = pdb == "1" or pdb == 't' or pdb == '+' - if Type: - id = int(id) - ti = 1 - else: - id = -int(id) - ti = 0 - if case: - ci = 1 - else: - ci = 0 - b = int(float(b)*1000) - e = int(float(e)*1000) - y.run( add_example(ti, ci, id, b, e) ) - self.ids[id] = ( case, b, e ) - -cols = ['Id', 'Ref', 'Parent', 'TPP', 'TPN', 'TNN', ' CPP', 'CPN', 'CNN'] -indx= ['Id'] - - - -class ClauseQueue: - '''Auxiliary class that represents the list of visited clauses.''' - - ''' queue size ''' - size = 1024*256 - best = 8 - q = [] - count = 0 - - def parentText(self, parent): - [row] = self.DF.loc[self.DF.Id==parent].values.tolist( ) - return "Parent "+str(parent)+", cases " +repr(row[3:6])+", controls " +repr(row[6:9]) - - def showQueue(self, n): - L = heapq.nlargest(n, self.q) - S = "[ *********************************************************************\nbest rules at " + repr(self.count) +" nodes:\n" - S += "Node".rjust(6) + "Score".rjust(10) + "Parent".rjust(6) +" | " +"Matches on Cases".center(24) +" | " +"Matches on Controls".center(24) + '|\n' - S += "".rjust(6) + "".rjust(10) + "".rjust(6) + " | " +"Generic".center(8) + "Both".center(8) + "Brand".center(8) + " | " +"Generic".center(8) + "Both".center(8) + "Brand".center(8) + '|\n' - S += "".rjust(6) + "".rjust(10) + "".rjust(6) + " | " + "Only".center(8) + "".center(8) + "Only".center(8) + " | " +"Only".center(8) + "".center(8) + "Only".center(8) + '|\n' - for cl in L: - S += self.clauseToStringRow( cl ) - S += "\n[ ********************************************************************* ]\n\n" - for cl in L: - S += self.PrintClbyId( cl ) - return S - - - def loadHists(self): - hists = {} - if self.ipcs[0]: - hists["case_after_first"] = self.histpcs[0][0:self.ipcs[0]] - if self.ipcs[1]: - hists["case_after_last"] = self.histpcs[1][0:self.ipcs[1]] - if self.ipcs[2]: - hists["case_bef_first"] = self.histpcs[2][0:self.ipcs[2]] - if self.ipcs[3]: - hists["case_bef_last"] = self.histpcs[3][0:self.ipcs[3]] - if self.ipcs[4]: - hists["control_after_first"] = self.histpcs[4][0:self.ipcs[4]] - if self.ipcs[5]: - hists["control_after_last"] = self.histpcs[5][0:self.ipcs[5]] - if self.ipcs[6]: - hists["control_bef_first"] = self.histpcs[6][0:self.ipcs[6]] - if self.ipcs[7]: - hists["control_bef_last"] = self.histpcs[7][0:self.ipcs[7]] - return hists - - def attendRequests(self): - while not self.command_q.empty(): - msg = self.command_q.get() - if msg[0] == "show_clause": - row = msg[1] - y.run( clsrc( row[1], self ) ) - parent = row[2] - parentDesc = self.parentText(parent) - self.hists = self.loadHists() - print( hists) - self.reply_q.put( ("show_clause", parentDesc ) ) - - - # this method implements PrintCl if YAP is running - def printClWithThreads(self, row): - try: - id = row[0] - # if id in self.shown_clause: - # im = Image.open(self.shown_clause[id]) - # im.show() - # return - #Prolog does the firat half - self.queue.prolog_q.put( ( "show_clause" , row ) ) - ( x, parentDesc )= self.queue.reply_q.get() - self.shown_clause[id] = plotClause(row[0],parentDesc, row[3:6], row[3:9], Text, (self.GraphV,self.d), self.hists) - except Exception as e: - print( 'trieref = ' + trieref ) - raise - - # this method implements PrintCl if YAP is not running - def printClNoThreads(self, row): - try: - id = row[0] - if graphics_ability and id in self.shown_clause: - display_pdf( id ) - im = Image.open(self.shown_clause[id]) - im.show() - return - #Prolog does the real work - y.run( clsrc( row[1], self ) ) - parent = row[2] - self.hists = self.loadHists() - parentDesc = self.parentText(parent) - # and then sealib - self.shown_clause[id] = plotClause(row[0],parentDesc, row[3:6], row[6:9], self.Text ) - except Exception as e: - print( 'trieref = ' + trieref ) - raise - - def clauseToStringRow(self, id): - try: - [row] = self.DF.loc[self.DF.Id==id].values.tolist( ) - S = "" + repr(id).rjust(6) + "{:10.3f}".format(cl[0]) + repr(row[2]).rjust(6) +" | " + repr(row[3]).rjust(6) + repr(row[4]).rjust(6) + repr(row[5]).rjust(6) + ' | '+ repr(row[6]).rjust(6) + repr(row[7]).rjust(6) + repr(row[8]).rjust(6) + '|\n' - return S - except Exception as e: - print( str(e) ) - raise - - def printClauseAsRow(self, id): - print( self.clauseToStringRow( id ) ) - - - def printClbyId(self, id): - try: - [row] = self.DF.loc[self.DF.Id==id].values.tolist( ) - self.printClause( row ) - except Exception as e: - print( str(e) ) - raise - - def printClbyTrieRef(self, trieref): - try: - [row] = self.DF.loc[self.DF.Ref==trieref].values.tolist() - self.printClause( row ) - except Exception as e: - print( str(e) ) - raise - - def idFromTrieRef( self, trieref ): - try: - row = self.DF.loc[self.DF.Ref==trieref] - return int(row.at['Id','Id' ]) - except Exception as e: - print("node = "+str(trieref)) - print(self.DF) - raise - - def add(self, parent, score, trieref, c): - try: - #import pdb - #pdb.set_trace() - self.count += 1 - k = [self.count,trieref,parent,c[0],c[1],c[2],c[3],c[4],c[5]] - heapq.heappush(self.q, (score, self.count)) - self.DF = self.DF.append(pd.DataFrame([k],columns=cols,index=indx)) - if not self.command_q.empty(): - self.attendRequests() - except Exception as e: - print("new node = "+str(self.count)) - print("parent = "+str(parent)) - print(self.DF) - raise - - def link(self, parent, trieref): - try: - row = self.DF.loc[self.DF.Ref==trieref] - if not self.command_q.empty(): - self.attendRequests() - except Exception as e: - print("new node = "+str(trieref)) - print("parent = "+str(parent)) - print(self.DF) - raise - - def pushHistogram( self, i, val): - try: - x = self.ipcs[i] - self.histpcs[i][x] = val - self.ipcs[i] = x+1 - except Exception as e: - print("i = "+str(i)) - print("x = "+str(x)) - print(self.DF) - raise - - - def initHistograms( self ): - self.histpcs = ( [None]*2400, [None]*2400, [None]*2400, [None]*2400, - [None]*2400, [None]*2400, [None]*2400, [None]*2400) - self.resetHistograms() - - def resetHistograms( self ): - self.ipcs = [ 0, 0, 0, 0, 0, 0, 0, 0 ] - - def setClauseText( self, txt ): - self.Text = txt - - def setClauseGraph( self, labels,edges ): - G=nx.DiGraph() - dict = {} - for (i,l) in labels: - G.add_node(i,label=i) - dict[i] = l.strip()[0].lower() - for (i,j) in edges: - G.add_edge(i,j) - self.GraphV = G - self.d = dict - return G - - def __repr__(self): - l = heapq.nlargest(self.q, 10) - for i in l: - print( l ) - - def __init__(self): - self.command_q = Queue() - self.reply_q = Queue() - self.GraphV=nx.Graph() - self.count = 0 - self.DF = pd.DataFrame([[0,88998993,0,4,3,2,1,160,400]],columns=cols, index=indx) - self.shown_clause = {} - -class LineSettings: - '''Isolate interface with argparse ''' - - - - opts = None - - def __init__(self): - parser = argparse.ArgumentParser(description='''Search for ADRs using EHR data. - The arguments are CSV files for the databases, with at least 3 fields: - - an integer giving the patient id, called key - - a float point giving the patient\'s age in years, called age - - a string describing the diagnosis, called data -dppb - The case and control files are alos in CSV form, withe the following fields: - Key,AgeBefStart,AgeStartEnd,AgeAfterStart,AGeAfterEnd - -p ''') - parser.add_argument('--save-db', dest='save', default=None, help="save the processed DB in Prolog, CSV, pickle") - parser.add_argument('--meds', dest='meds', default="data/meds.csv", help="CSV or Tab like with the medications database") - parser.add_argument('--diags', dest='diags', default="data/diags.csv", help="CSV or Tab like with the medications database") - parser.add_argument('--examples', dest='examples', default="data/exs.csv" , help="CSV or Tab like with the cases and controls") - parser.add_argument('--labs', type=argparse.FileType('r'), default=None, help="unsupported for now") - parser.add_argument('--min_examples', type=int, default=20, help="minimal number of examples to cover") - parser.add_argument('--seed', type=int, default=0, help="examples to start search, 0 if tries to cinsider all") - parser.add_argument('-f', default=" " , help="jupyter notebook") - parser.add_argument('--interactive', type = bool, default=True, help="run as line mode, or run as closed script ()") - self.opts = parser.parse_args() - - def map(self): - return vars(self.opts) - - -class Aleph: - - e = None - - def add_db(self, p, t): - queue.addClause(t) - - def set_options( self, xargs): - - if 'min-examples' in xargs: - self.set('minpos', xargs[ 'min_examples' ] ) - if 'verbosity' in xargs: - self.set('verbosity', xargs[ 'verbosity' ] ) - if 'search' in xargs: - self.set('search', xargs[ 'search' ] ) - if 'nodes' in xargs: - self.set('nodes', xargs[ 'nodes' ] ) - - def set( self, parameter, value): - '''Set an integer parameter, eg nodes, seeds or noise''' - y.run(set(parameter, value)) - - def setting( self, parameter): - '''Return the Aleph setting for parameter p, or show all - the current settings''' - if parameter: - value = yap.YAPVarTerm() - y.run(setting(parameter, value)) - # return value - y.run( settings ) - - def induce( self, index = 0): - '''Learn clauses''' - y.run( learn( index ) ) - - def induceInThread( self, index = 0): - '''Learn clauses as a separe thread''' - if self.learning: - print("Already learning" ) - return - self.learning = True - y.run( learn_in_thread( index ) ) - - def query_prolog( self, y, Query): - y.run( Query ) - - def rule( self, id ): - self.queue.printClause( id ) - - def histogram( self, Dict ): - pass - - def induceInThread( self, index = 0 ): - kw = {} - kw["index"] = index - t = threading.Thread(target=self.induceInThread, kwargs=kw) - t.setDaemon = True - self.queue.printClause = self.queue.printClWithThreads - t.start() - self.queue.printClause = self.queue.printClNoThreads - - def rules( self, count = 100 ): - self.queue.showQueue() - - def golearn( self ): - - try: - # import pdb - # pdb.set_trace() - self.learning = False - alephShell( self ).cmdloop() - q.close() - - except SyntaxError as err: - print("Syntax Error error: {0}".format(err)) - print( sys.exc_info()[0] ) - except EOFError: - return - except RuntimeError as err: - print("YAP Execution Error: {0}".format(err)) - print( sys.exc_info()[0] ) - except ValueError as err: - print("Could not convert data to an integer: {0}.", format(rr)) - print( sys.exc_info()[0] ) - except NameError as err: - print("Bad Name: {0}.", format(err)) - print( sys.exc_info()[0] ) - except Exception as err: - print("Unexpected error:" + sys.exc_info() ) - print( sys.exc_info()[0] ) - - - def learn( self ): - - while True: - self.golearn() - - def __init__(self, queue): - ''' Initialize Aleph by loading the data-bases and the example''' - - if y.E == None: - y.E = yap.YAPEngine() - y.run( ensure_loaded( sys.druwid_root +'/druwid.yap' ) ) - y.E.reSet() - x_args = LineSettings().map() - exf = x_args['examples'] - exs = Examples(exf) - di = x_args['diags'] - exmap = exs.ids - diags = DBStore( di, DiagOps( "diags", exmap ), exmap ) - md = x_args['meds'] - meds = DBStore(md, MedOps( "meds", exmap ) , exmap ) - y.E.reSet() - save_db = x_args['save'] - self.set_options( x_args ) - self.interactive = x_args['interactive'] - self.queue = queue - self.learning = False - self.queue.initHistograms( ) - self.queue.printClause = self.queue.printClNoThreads diff --git a/x.tgz b/x.tgz deleted file mode 100644 index 6979758002aa4b056d83fde552f1929ed1aa8e60..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 15374 zcmV+pJn_RHiwFQCY6e&U1MPk3dfP^_==>F*qT`wIkkm#hw&Ss4&!s48xuHmnNX3)! z_`?U0po9?!FaRi7nfU)XPjVmRzR7u#TUEWF8w(d%i<2vUiAAEjtE+44>gq!G!RAl) zr0;x+H!l8gU!Pj7_Ugq8hJU|%^^*S9w)pQ_t-kf*yR90le+yqWcg@{K0-|9JAvv@Pc!u zKQ}6Y@X0#YcEpCxmE#2yXUOcBb(+o7W46vtefP=(WiHw=St zW1tnb?I>oUbMuDr>(_e2aWIVDn6L)HcO-#loXSbg^P zE!$Fc@maIG+p>-t|6sLGBlwj5=y;J+RHI%Kb^M__DwQ^?C01qq3pZjTAT{HSA~v>N zpAGHUUXS8%I*6yC!$v{KVlaR@~xz?hih`seUt6S4LO-V|i#*~Z4^G#P7)d1GwgHkEJ0dWS3@D3T8+MVfWAP_U&^gWdA8Kb``ioRy~`J)>w5ChuiQd za({8Gm_@(PkHXf~35d#e=`)SNI^%`$Hqw9-K{a7O4cqgAfsNt-+GexC1rj6}u`_sl z2@2D{aBi3#IyN>9ok0K;;o2BqI1H%EfOGgY4sAd3>=>xELDXT)^*!Va4aN1{*rLwL zt{*cjs4yDo^#wAd-0n6TZ7V@;{T+^jRjAI)@dnr~4%@9xIcltO7z_ zE`xG})kHckc^jLL=8E31W~i64L^6st&ML>(@* z#r?2q1?sKVO~545s{N|4Re6d?)nsAlfZ_F3!)=Dz$8xm^yI6h80gGk0|;}4(v#lwV`ZFl);P}l73K88=HO0i`v1p(X4X{WiNQy&^>o!{`l`O{j!(* zaRk#HjQ{6pAo18mfUiWOV0vbj_I`rW?|5nNW_%WS8d-S_#PzkP0j^%UeCG!!|0^%w zfr3jXj@WZB&MwS1k*L!{S^%xEj%WLq{Bdg!AJ^$|3m6VF8M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