From 316811d2cda7fd41984b2513cbd5ef13b1d7854e Mon Sep 17 00:00:00 2001 From: vsc Date: Thu, 15 May 2008 13:41:48 +0000 Subject: [PATCH] user:goal_expand should be called before import add extra apply_macros and apply stuff; fix unexisting definitions. add forall/2 and ignore/1 to system stuff. git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@2237 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- C/iopreds.c | 2 +- C/tracer.c | 2 - GPL/error.pl | 4 +- H/Tags_64bits.h | 6 +- H/Yap.h | 8 +- LGPL/apply_macros.pl | 2 +- changes-5.1.html | 7 + docs/yap.tex | 73 +++++++- library/Makefile.in | 3 +- library/apply.yap | 9 + library/apply_macros.yap | 362 +++++++++++++++++++++++++++++++++++++-- library/swi.yap | 13 -- pl/arith.yap | 8 + pl/boot.yap | 26 ++- pl/messages.yap | 10 +- pl/modules.yap | 11 +- pl/utils.yap | 4 + 17 files changed, 483 insertions(+), 67 deletions(-) create mode 100644 library/apply.yap diff --git a/C/iopreds.c b/C/iopreds.c index d49319439..2631cb2ef 100644 --- a/C/iopreds.c +++ b/C/iopreds.c @@ -3870,7 +3870,7 @@ static Int } else { if (tokstart != NULL && tokstart->Tok != Ord (eot_tok)) { /* we got the end of file from an abort */ - if (Yap_ErrorMessage == "Abort") { + if (!strcmp(Yap_ErrorMessage,"Abort")) { Yap_clean_tokenizer(tokstart, Yap_VarTable, Yap_AnonVarTable); return FALSE; } diff --git a/C/tracer.c b/C/tracer.c index 304c5c019..52e8a6e4d 100644 --- a/C/tracer.c +++ b/C/tracer.c @@ -167,8 +167,6 @@ low_level_trace(yap_low_level_port port, PredEntry *pred, CELL *args) #ifdef THREADS Yap_heap_regs->thread_handle[worker_id].thread_inst_count++; #endif - UNLOCK(Yap_heap_regs->low_level_trace_lock); - return; #ifdef COMMENTED //*(H0+(0xb65f2850-0xb64b2008)/sizeof(CELL))==0xc || //0x4fd4d diff --git a/GPL/error.pl b/GPL/error.pl index 2a8bea155..d57c8280a 100644 --- a/GPL/error.pl +++ b/GPL/error.pl @@ -1,4 +1,4 @@ -/* $Id: error.pl,v 1.1 2008-02-12 17:03:52 vsc Exp $ +/* $Id: error.pl,v 1.2 2008-05-15 13:41:45 vsc Exp $ Part of SWI-Prolog @@ -172,7 +172,7 @@ not_a_list(Type, X) :- '$skip_list'(Anything, [_|More], Rest). '$skip_list'(Anything, [_|More], Rest) :- '$skip_list'(Anything, More, Rest). -'$skip_list'(Anything, Rest, Rest). +'$skip_list'(_Anything, Rest, Rest). :- endif. diff --git a/H/Tags_64bits.h b/H/Tags_64bits.h index b5a8d6544..ee61f691f 100644 --- a/H/Tags_64bits.h +++ b/H/Tags_64bits.h @@ -18,7 +18,7 @@ * Last rev: December 90 * * mods: * * comments: Original Tag Scheme for machines with 32 bits adresses * -* version: $Id: Tags_64bits.h,v 1.2 2008-01-30 10:35:43 vsc Exp $ * +* version: $Id: Tags_64bits.h,v 1.3 2008-05-15 13:41:46 vsc Exp $ * *************************************************************************/ #define TAG_64BITS 1 @@ -67,8 +67,8 @@ property list #define TagOf(t) (Unsigned(t)&TagBits) #define LowTagOf(t) (Unsigned(t)&LowTagBits) #define NonTagPart(X) (Signed(X) & MaskPrim) -#define TAGGEDA(TAG,V) (TAG | Unsigned(V)) -#define TAGGED(TAG,V) (TAG | NonTagPart(Unsigned(V)<<3)) /* SQRT(8) */ +#define TAGGEDA(TAG,V) (Unsigned(TAG) | Unsigned(V)) +#define TAGGED(TAG,V) (Unsigned(TAG) | NonTagPart(Unsigned(V)<<3)) /* SQRT(8) */ #define NONTAGGED(TAG,V) NonTagPart(Unsigned(V)<<3) /* SQRT(8) */ #define CHKTAG(t,Tag) ((Unsigned(t)&TagBits)==Tag) diff --git a/H/Yap.h b/H/Yap.h index 5a6cf2ee2..9b60fa6ae 100644 --- a/H/Yap.h +++ b/H/Yap.h @@ -10,7 +10,7 @@ * File: Yap.h.m4 * * mods: * * comments: main header file for YAP * -* version: $Id: Yap.h,v 1.35 2008-05-13 10:37:27 vsc Exp $ * +* version: $Id: Yap.h,v 1.36 2008-05-15 13:41:46 vsc Exp $ * *************************************************************************/ #include "config.h" @@ -250,7 +250,7 @@ extern char Yap_Option[20]; #endif #endif /* !IN_SECOND_QUADRANT */ -#ifdef THREADS +#ifdef USE_SYSTEM_MALLOC #define HEAP_INIT_BASE 0L #define AtomBase NULL #else @@ -855,7 +855,7 @@ inline EXTERN Term MkAtomTerm (Atom); inline EXTERN Term MkAtomTerm (Atom a) { - return (Term) ((AtomTag | (CELL) (a))); + return (Term) (AtomTag | (CELL) (a)); } @@ -876,7 +876,7 @@ inline EXTERN Term MkAtomTerm (Atom); inline EXTERN Term MkAtomTerm (Atom a) { - return (Term) (TAGGEDA (AtomTag, (CELL) (a))); + return (Term) (TAGGEDA ((CELL)AtomTag, (CELL) (a))); } diff --git a/LGPL/apply_macros.pl b/LGPL/apply_macros.pl index 9c56ab313..a8e195a93 100644 --- a/LGPL/apply_macros.pl +++ b/LGPL/apply_macros.pl @@ -1,4 +1,4 @@ -/* $Id: apply_macros.pl,v 1.1 2008-03-13 14:37:59 vsc Exp $ +/* $Id: apply_macros.pl,v 1.2 2008-05-15 13:41:46 vsc Exp $ Part of SWI-Prolog diff --git a/changes-5.1.html b/changes-5.1.html index e90f99bfa..425727307 100644 --- a/changes-5.1.html +++ b/changes-5.1.html @@ -17,6 +17,13 @@ xb

Yap-5.1.3: