From 50b692d2c10ebec1d15cd8ee048badf1d5fa82bf Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 4 Mar 2010 09:13:06 +0000 Subject: [PATCH 01/28] change release to 6.0.3 --- H/Yap.h | 2 +- Makefile.in | 2 +- docs/yap.tex | 2 +- misc/Yap.spec | 2 +- misc/yap.nsi | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/H/Yap.h b/H/Yap.h index bebe9127a..d827740df 100644 --- a/H/Yap.h +++ b/H/Yap.h @@ -90,7 +90,7 @@ #undef USE_THREADED_CODE #endif #define inline __inline -#define YAP_VERSION "Yap-6.0.2" +#define YAP_VERSION "Yap-6.0.3" #define BIN_DIR "c:\\Yap\\bin" #define LIB_DIR "c:\\Yap\\lib\\Yap" diff --git a/Makefile.in b/Makefile.in index c1844a41a..85e666d43 100755 --- a/Makefile.in +++ b/Makefile.in @@ -98,7 +98,7 @@ YAPLIB=@YAPLIB@ #4.1VPATH=@srcdir@:@srcdir@/OPTYap CWD=$(PWD) # -VERSION=6.0.2 +VERSION=6.0.3 MYDDAS_VERSION=MYDDAS-0.9.1 # diff --git a/docs/yap.tex b/docs/yap.tex index c5f74031f..ae34dfb3b 100644 --- a/docs/yap.tex +++ b/docs/yap.tex @@ -8,7 +8,7 @@ a\input texinfo @c -*- mode: texinfo; coding: latin-1; -*- @c @setchapternewpage odd @c %**end of header -@set VERSION 6.0.2 +@set VERSION 6.0.3 @set EDITION 4.2.6 @set UPDATED Feb 2010 diff --git a/misc/Yap.spec b/misc/Yap.spec index 33e31d331..f94c61afc 100644 --- a/misc/Yap.spec +++ b/misc/Yap.spec @@ -3,7 +3,7 @@ Name: Yap Summary: Prolog Compiler -Version: 6.0.2 +Version: 6.0.3 Packager: Vitor Santos Costa Release: 1 Source: http://www.dcc.fc.up.pt/~vsc/Yap/%{name}-%{version}.tar.gz diff --git a/misc/yap.nsi b/misc/yap.nsi index de8cb3125..28a32475a 100755 --- a/misc/yap.nsi +++ b/misc/yap.nsi @@ -268,4 +268,4 @@ Function .onInstFailed installer, please contact yap-users@sf.net" FunctionEnd -outfile "yap-6.0.2-installer.exe" +outfile "yap-6.0.3-installer.exe" From c58e9f456285c5ab00286edd090baf8e59f92476 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 4 Mar 2010 23:41:45 +0000 Subject: [PATCH 02/28] export attributes. --- library/atts.yap | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/library/atts.yap b/library/atts.yap index c3476f09b..e76d91b57 100644 --- a/library/atts.yap +++ b/library/atts.yap @@ -15,9 +15,7 @@ * * *************************************************************************/ -:- module(attributes, []). - -:- op(1150, fx, attribute). +:- module(attributes, [op(1150, fx, attribute)]). :- multifile user:goal_expansion/3. From abec8208d3c4d25e972ad8e372e08989c44e4744 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 4 Mar 2010 23:42:17 +0000 Subject: [PATCH 03/28] export operator. --- packages/CLPBN/clpbn.yap | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/packages/CLPBN/clpbn.yap b/packages/CLPBN/clpbn.yap index 9f75234e8..c5090bdcb 100644 --- a/packages/CLPBN/clpbn.yap +++ b/packages/CLPBN/clpbn.yap @@ -9,14 +9,13 @@ clpbn_run_solver/3, clpbn_init_solver/5, clpbn_run_solver/4, - clpbn_init_graph/1]). + clpbn_init_graph/1, + op( 500, xfy, with)]). :- use_module(library(atts)). :- use_module(library(lists)). :- use_module(library(terms)). -:- op( 500, xfy, with). - % % avoid the overhead of using goal_expansion/2. % From cef4a27d1cb94f5cc9ab097ac4000270f20e6180 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 4 Mar 2010 23:45:33 +0000 Subject: [PATCH 04/28] export new_variables_in_term and variables_within_term (obs from Jiefei Ma). --- library/terms.yap | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/library/terms.yap b/library/terms.yap index 66d79dbbd..682215ccf 100644 --- a/library/terms.yap +++ b/library/terms.yap @@ -16,17 +16,19 @@ *************************************************************************/ :- module(terms, [ - term_hash/2, - term_hash/4, - instantiated_term_hash/4, - variant/2, - unifiable/3, - subsumes/2, - subsumes_chk/2, - cyclic_term/1, - acyclic_term/1, - variable_in_term/2 - ]). + term_hash/2, + term_hash/4, + instantiated_term_hash/4, + variant/2, + unifiable/3, + subsumes/2, + subsumes_chk/2, + cyclic_term/1, + acyclic_term/1, + variable_in_term/2, + variables_within_term/3, + new_variables_in_term/3 + ]). term_hash(T,H) :- term_hash(T, -1, 33554432, H). From 75d1b897e0341ca29e8ae7afe70c0d9a4ee927c8 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 5 Mar 2010 00:00:00 +0000 Subject: [PATCH 05/28] fix fragile export. --- library/cleanup.yap | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/library/cleanup.yap b/library/cleanup.yap index 5023056b1..f2aeb3cf2 100644 --- a/library/cleanup.yap +++ b/library/cleanup.yap @@ -29,17 +29,17 @@ % Read the Source. :- module( cleanup, [ - call_cleanup/2, - call_cleanup/1, - on_cleanup/1, - cleanup_all/0 - ]). + call_cleanup/2, + call_cleanup/1, + on_cleanup/1, + cleanup_all/0, + op(1150, fx,fragile) + ]). :- multifile user:goal_expansion/3. :- user_defined_directive(fragile(G), cleanup:cleanup_expansion(G)). -:- op(1150, fx,fragile). :- meta_predicate call_cleanup(:,:), From 43a1a754dd3699edb85e1dfdf50d1fa66799100e Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 5 Mar 2010 00:01:04 +0000 Subject: [PATCH 06/28] erf function (patch from Bernd Gutmann). --- C/arith1.c | 22 ++++++++++++++++++++++ H/eval.h | 2 ++ config.h.in | 1 + configure | 10 ++++++---- configure.in | 2 +- docs/yap.tex | 6 ++++++ 6 files changed, 38 insertions(+), 5 deletions(-) diff --git a/C/arith1.c b/C/arith1.c index 86ab48c31..49d6fe112 100644 --- a/C/arith1.c +++ b/C/arith1.c @@ -418,6 +418,26 @@ eval1(Int fi, Term t) { RERROR(); #endif } + case op_erf: + { + Float dbl = get_float(t), out; +#if HAVE_ERF + out = erf(dbl); + RFLOAT(out); +#else + RERROR(); +#endif + } + case op_erfc: + { + Float dbl = get_float(t), out; +#if HAVE_ERF + out = erfc(dbl); + RFLOAT(out); +#else + RERROR(); +#endif + } /* floor(x) maximum integer greatest or equal to X @@ -814,6 +834,8 @@ static InitUnEntry InitUnTab[] = { {"float_integer_part", op_fintp}, {"sign", op_sign}, {"lgamma", op_lgamma}, + {"erf",op_erf}, + {"erfc",op_erfc}, {"random", op_random1} }; diff --git a/H/eval.h b/H/eval.h index e1cb2916b..8319e2a4e 100644 --- a/H/eval.h +++ b/H/eval.h @@ -93,6 +93,8 @@ typedef enum { op_fintp, op_sign, op_lgamma, + op_erf, + op_erfc, op_random1 } arith1_op; diff --git a/config.h.in b/config.h.in index 7c353fe5c..772d08d30 100755 --- a/config.h.in +++ b/config.h.in @@ -160,6 +160,7 @@ #undef HAVE_CTIME #undef HAVE_DLOPEN #undef HAVE_DUP2 +#undef HAVE_ERF #undef HAVE_FECLEAREXCEPT #undef HAVE_FESETTRAPENABLE #undef HAVE_FETESTEXCEPT diff --git a/configure b/configure index 3aff7acf8..c19032f7f 100755 --- a/configure +++ b/configure @@ -8499,12 +8499,14 @@ _ACEOF fi done -for ac_func in feclearexcept +for ac_func in erf feclearexcept do : - ac_fn_c_check_func "$LINENO" "feclearexcept" "ac_cv_func_feclearexcept" -if test "x$ac_cv_func_feclearexcept" = x""yes; then : + as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" +eval as_val=\$$as_ac_var + if test "x$as_val" = x""yes; then : cat >>confdefs.h <<_ACEOF -#define HAVE_FECLEAREXCEPT 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi diff --git a/configure.in b/configure.in index d9b656da9..d5232b90a 100755 --- a/configure.in +++ b/configure.in @@ -1501,7 +1501,7 @@ dnl Checks for library functions. AC_TYPE_SIGNAL AC_CHECK_FUNCS(access) AC_CHECK_FUNCS(acosh asinh atanh chdir ctime dlopen dup2) -AC_CHECK_FUNCS(feclearexcept) +AC_CHECK_FUNCS(erf feclearexcept) AC_CHECK_FUNCS(fesettrapenable fgetpos finite fpclass ftime getcwd getenv) AC_CHECK_FUNCS(gethostbyname gethostid gethostname) AC_CHECK_FUNCS(gethrtime getpagesize) diff --git a/docs/yap.tex b/docs/yap.tex index ae34dfb3b..b5d4701e8 100644 --- a/docs/yap.tex +++ b/docs/yap.tex @@ -3849,6 +3849,12 @@ Hyperbolic arc tangent. @item lgamma(@var{X}) gamma function. +@item erf(@var{X}) +gaussian error function. + +@item erfc(@var{X}) +complementary gaussian error function. + @item random(@var{X}) [ISO] An integer random number between 0 and @var{X}. From 2685a8449d9a2769740cb55800c8bf15af0f42ff Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 5 Mar 2010 08:15:02 +0000 Subject: [PATCH 07/28] installation patches from Keri Harris --- CLPQR/Makefile.in | 2 +- GPL/Makefile.in | 2 +- LGPL/Makefile.in | 2 +- LGPL/clp/Makefile.in | 2 +- LGPL/swi_console/Makefile.in | 2 +- Makefile.in | 8 ++++---- library/Makefile.in | 2 +- library/lammpi/Makefile.in | 2 +- library/matlab/Makefile.in | 2 +- library/matrices/Makefile.in | 2 +- library/matrix/Makefile.in | 2 +- library/mpi/Makefile.in | 4 ++-- library/mpi/mpi.c | 3 --- library/random/Makefile.in | 2 +- library/regex/Makefile.in | 2 +- library/rltree/Makefile.in | 2 +- library/system/Makefile.in | 2 +- library/tries/Makefile.in | 2 +- library/yap2swi/Makefile.in | 2 +- packages/CLPBN/Makefile.in | 2 +- packages/PLStream/Makefile.in | 2 +- packages/ProbLog/Makefile.in | 2 +- packages/ProbLog/simplecudd/Makefile.in | 2 +- packages/cplint/Makefile.in | 2 +- packages/plunit/Makefile.in | 4 ++-- packages/sgml/Makefile.in | 4 ++-- packages/swi-minisat2/C/Makefile.in | 2 +- packages/swi-minisat2/Makefile.in | 2 +- 28 files changed, 33 insertions(+), 36 deletions(-) diff --git a/CLPQR/Makefile.in b/CLPQR/Makefile.in index 3ff1a7333..27313d4b4 100644 --- a/CLPQR/Makefile.in +++ b/CLPQR/Makefile.in @@ -9,7 +9,7 @@ BINDIR = $(ROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(ROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # where YAP should look for architecture-independent Prolog libraries # diff --git a/GPL/Makefile.in b/GPL/Makefile.in index 2a5df7404..cf245620c 100644 --- a/GPL/Makefile.in +++ b/GPL/Makefile.in @@ -9,7 +9,7 @@ BINDIR = $(ROOTDIR)/bin # # where YAP should look for binary libraries # -LIBDIR=$(ROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # where YAP should look for architecture-independent Prolog libraries # diff --git a/LGPL/Makefile.in b/LGPL/Makefile.in index 848616d4a..bec218559 100644 --- a/LGPL/Makefile.in +++ b/LGPL/Makefile.in @@ -9,7 +9,7 @@ BINDIR = $(ROOTDIR)/bin # # where YAP should look for binary libraries # -LIBDIR=$(ROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # where YAP should look for architecture-independent Prolog libraries # diff --git a/LGPL/clp/Makefile.in b/LGPL/clp/Makefile.in index 1af5a18f7..1c227209d 100644 --- a/LGPL/clp/Makefile.in +++ b/LGPL/clp/Makefile.in @@ -9,7 +9,7 @@ BINDIR = $(ROOTDIR)/bin # # where YAP should look for binary libraries # -LIBDIR=$(ROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # where YAP should look for architecture-independent Prolog libraries # diff --git a/LGPL/swi_console/Makefile.in b/LGPL/swi_console/Makefile.in index 30e373f67..6319f8c5e 100644 --- a/LGPL/swi_console/Makefile.in +++ b/LGPL/swi_console/Makefile.in @@ -8,7 +8,7 @@ EROOTDIR = @exec_prefix@ # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/Makefile.in b/Makefile.in index 85e666d43..a091972d7 100755 --- a/Makefile.in +++ b/Makefile.in @@ -12,8 +12,8 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for binary libraries # -LIBDIR=$(EROOTDIR)/lib -YAPLIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@ +YAPLIBDIR=@libdir@/Yap # # where YAP should look for architecture-independent Prolog libraries # @@ -59,7 +59,7 @@ YAPSTARTUP=startup.yss # CC=@CC@ MPI_CC=@MPI_CC@ -CPPFLAGS=@CPPFLAGS@ -I. -I$(srcdir)/H -I$(srcdir)/OPTYap -I$(srcdir)/BEAM -I$(srcdir)/packages/MYDDAS +CPPFLAGS=@CPPFLAGS@ -I. -I$(srcdir)/H -I$(srcdir)/OPTYap -I$(srcdir)/BEAM -I$(srcdir)/MYDDAS CFLAGS= @CFLAGS@ $(YAP_EXTRAS) $(DEFS) $(CPPFLAGS) C_INTERF_FLAGS= @C_INTERF_FLAGS@ $(YAP_EXTRAS) $(DEFS) $(CPPFLAGS) -I$(srcdir)/include C_PARSER_FLAGS= @C_PARSER_FLAGS@ $(YAP_EXTRAS) $(DEFS) $(CPPFLAGS) @@ -499,7 +499,7 @@ libYap.a: $(LIB_OBJECTS) $(RANLIB) libYap.a @DYNYAPLIB@: $(LIB_OBJECTS) - @DYNLIB_LD@ -o @YAPLIB@ $(LIB_OBJECTS) $(LIBS) $(LDFLGS) + @DYNLIB_LD@ -o @YAPLIB@ $(LIB_OBJECTS) $(LIBS) $(LDFLAGS) install: install_bin install_data diff --git a/library/Makefile.in b/library/Makefile.in index 5dd3d578c..ece4339ed 100644 --- a/library/Makefile.in +++ b/library/Makefile.in @@ -9,7 +9,7 @@ BINDIR = $(ROOTDIR)/bin # # where YAP should look for binary libraries # -LIBDIR=$(ROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # where YAP should look for architecture-independent Prolog libraries # diff --git a/library/lammpi/Makefile.in b/library/lammpi/Makefile.in index 5893f07ff..6105e6a0b 100644 --- a/library/lammpi/Makefile.in +++ b/library/lammpi/Makefile.in @@ -17,7 +17,7 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/library/matlab/Makefile.in b/library/matlab/Makefile.in index efd14f2c2..8d36cf071 100644 --- a/library/matlab/Makefile.in +++ b/library/matlab/Makefile.in @@ -13,7 +13,7 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/library/matrices/Makefile.in b/library/matrices/Makefile.in index 82e9ba729..105d97d3e 100644 --- a/library/matrices/Makefile.in +++ b/library/matrices/Makefile.in @@ -13,7 +13,7 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/library/matrix/Makefile.in b/library/matrix/Makefile.in index 82e9ba729..105d97d3e 100644 --- a/library/matrix/Makefile.in +++ b/library/matrix/Makefile.in @@ -13,7 +13,7 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/library/mpi/Makefile.in b/library/mpi/Makefile.in index 6c8cba93a..f6668b815 100644 --- a/library/mpi/Makefile.in +++ b/library/mpi/Makefile.in @@ -21,8 +21,8 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for binary libraries # -LIBDIR=$(EROOTDIR)/lib -YAPLIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@ +YAPLIBDIR=@libdir@/Yap # # where YAP should look for architecture-independent Prolog libraries # diff --git a/library/mpi/mpi.c b/library/mpi/mpi.c index d26cf0c17..8ada34123 100644 --- a/library/mpi/mpi.c +++ b/library/mpi/mpi.c @@ -26,9 +26,6 @@ static char *rcsid = "$Header: /Users/vitor/Yap/yap-cvsbackup/library/mpi/mpi.c, #include "Yatom.h" #include "yapio.h" -/* for AtomEof */ -#include "Heap.h" - #include #include #include diff --git a/library/random/Makefile.in b/library/random/Makefile.in index 670806630..65dbd6cac 100644 --- a/library/random/Makefile.in +++ b/library/random/Makefile.in @@ -13,7 +13,7 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/library/regex/Makefile.in b/library/regex/Makefile.in index 7c6aecfea..1ec662895 100644 --- a/library/regex/Makefile.in +++ b/library/regex/Makefile.in @@ -13,7 +13,7 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/library/rltree/Makefile.in b/library/rltree/Makefile.in index c1752e328..92a123b73 100644 --- a/library/rltree/Makefile.in +++ b/library/rltree/Makefile.in @@ -17,7 +17,7 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/library/system/Makefile.in b/library/system/Makefile.in index 7c92b60a1..584823944 100644 --- a/library/system/Makefile.in +++ b/library/system/Makefile.in @@ -13,7 +13,7 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/library/tries/Makefile.in b/library/tries/Makefile.in index 28c24f7e9..badc3c951 100644 --- a/library/tries/Makefile.in +++ b/library/tries/Makefile.in @@ -13,7 +13,7 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/library/yap2swi/Makefile.in b/library/yap2swi/Makefile.in index e768a3710..121fc213c 100644 --- a/library/yap2swi/Makefile.in +++ b/library/yap2swi/Makefile.in @@ -13,7 +13,7 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/packages/CLPBN/Makefile.in b/packages/CLPBN/Makefile.in index 87a1dd21f..3230bf51f 100644 --- a/packages/CLPBN/Makefile.in +++ b/packages/CLPBN/Makefile.in @@ -9,7 +9,7 @@ BINDIR = $(ROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(ROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # where YAP should look for architecture-independent Prolog libraries # diff --git a/packages/PLStream/Makefile.in b/packages/PLStream/Makefile.in index 0f6eb492a..d1d9542bb 100755 --- a/packages/PLStream/Makefile.in +++ b/packages/PLStream/Makefile.in @@ -14,7 +14,7 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/packages/ProbLog/Makefile.in b/packages/ProbLog/Makefile.in index b61d8a9ee..220b44d02 100644 --- a/packages/ProbLog/Makefile.in +++ b/packages/ProbLog/Makefile.in @@ -9,7 +9,7 @@ BINDIR = $(ROOTDIR)/bin # # where YAP should look for binary libraries # -LIBDIR=$(ROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # where YAP should look for architecture-independent Prolog libraries # diff --git a/packages/ProbLog/simplecudd/Makefile.in b/packages/ProbLog/simplecudd/Makefile.in index e11a3559f..7e4c1be50 100644 --- a/packages/ProbLog/simplecudd/Makefile.in +++ b/packages/ProbLog/simplecudd/Makefile.in @@ -13,7 +13,7 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/packages/cplint/Makefile.in b/packages/cplint/Makefile.in index 47f9ef139..7a6e3ec2c 100644 --- a/packages/cplint/Makefile.in +++ b/packages/cplint/Makefile.in @@ -12,7 +12,7 @@ BINDIR = $(ROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(ROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # where YAP should look for architecture-independent Prolog libraries # diff --git a/packages/plunit/Makefile.in b/packages/plunit/Makefile.in index 8d7e9590e..acef95c06 100644 --- a/packages/plunit/Makefile.in +++ b/packages/plunit/Makefile.in @@ -17,9 +17,9 @@ EROOTDIR = @exec_prefix@ srcdir=@srcdir@ BINDIR = $(EROOTDIR)/bin -LIBDIR=$(EROOTDIR)/lib +LIBDIR=@libdir@ SHAREDIR=$(EROOTDIR)/share/Yap -YAPLIBDIR=$(EROOTDIR)/lib/Yap +YAPLIBDIR=@libdir@/Yap PL=@EXTEND_DYNLOADER_PATH@ $(DESTDIR)$(BINDIR)/yap $(DESTDIR)$(YAPLIBDIR)/startup.yss LN_S=@LN_S@ diff --git a/packages/sgml/Makefile.in b/packages/sgml/Makefile.in index 7f5809be2..73e8fb182 100644 --- a/packages/sgml/Makefile.in +++ b/packages/sgml/Makefile.in @@ -16,8 +16,8 @@ abs_top_builddir = @abs_top_builddir@ srcdir=@srcdir@ BINDIR = $(EROOTDIR)/bin -LIBDIR=$(EROOTDIR)/lib -YAPLIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@ +YAPLIBDIR=@libdir@/Yap SHAREDIR=$(ROOTDIR)/share/Yap SHELL=@SHELL@ diff --git a/packages/swi-minisat2/C/Makefile.in b/packages/swi-minisat2/C/Makefile.in index e1609fcf9..4b77aea1b 100644 --- a/packages/swi-minisat2/C/Makefile.in +++ b/packages/swi-minisat2/C/Makefile.in @@ -14,7 +14,7 @@ BINDIR = $(EROOTDIR)/bin # # where YAP should look for libraries # -LIBDIR=$(EROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # CC=@CC@ diff --git a/packages/swi-minisat2/Makefile.in b/packages/swi-minisat2/Makefile.in index 8f401300e..16e8013f4 100644 --- a/packages/swi-minisat2/Makefile.in +++ b/packages/swi-minisat2/Makefile.in @@ -9,7 +9,7 @@ BINDIR = $(ROOTDIR)/bin # # where YAP should look for binary libraries # -LIBDIR=$(ROOTDIR)/lib/Yap +LIBDIR=@libdir@/Yap # # where YAP should look for architecture-independent Prolog libraries # From 5ab629e8e0a34c84c560befa1332a6e2f0b56b0a Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 5 Mar 2010 08:23:24 +0000 Subject: [PATCH 08/28] cut_c is now always installed. --- configure | 28 ---------------------------- configure.in | 22 ---------------------- 2 files changed, 50 deletions(-) diff --git a/configure b/configure index c19032f7f..3940ba1e3 100755 --- a/configure +++ b/configure @@ -734,7 +734,6 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking -enable_cut_c enable_tabling enable_or_parallelism enable_rational_trees @@ -1401,7 +1400,6 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-cut-c support for executing c code when a cut occurs --enable-tabling support tabling --enable-or-parallelism support or-parallelism as: env-copy,sba,a-cow --enable-rational-trees support infinite rational trees @@ -3552,13 +3550,6 @@ done -# Check whether --enable-cut-c was given. -if test "${enable_cut_c+set}" = set; then : - enableval=$enable_cut_c; cutc="$enableval" -else - cutc=no -fi - # Check whether --enable-tabling was given. if test "${enable_tabling+set}" = set; then : enableval=$enable_tabling; tabling="$enableval" @@ -5482,25 +5473,6 @@ $as_echo "$yap_cv_odbc" >&6; } echo "-------------------------------" exit fi - - if test "$cutc" = no - then - echo - echo - echo "********************************************************" - echo - echo - echo "!!!!!! WARNING !!!!!!" - echo "The MYDDAS interface makes no sense without cut-c" - echo "Please contact tiagosoares@ncc.up.pt for help" - echo - echo "Enabling cut-c" - echo - echo "********************************************************" - echo - echo - cutc="yes" - fi fi if test "$myddasstats" = "yes" diff --git a/configure.in b/configure.in index d5232b90a..a39f27619 100755 --- a/configure.in +++ b/configure.in @@ -17,9 +17,6 @@ AC_SUBST(GCC) AC_SUBST(C_INTERF_FLAGS) AC_SUBST(C_PARSER_FLAGS) -AC_ARG_ENABLE(cut-c, - [ --enable-cut-c support for executing c code when a cut occurs ], - cutc="$enableval", cutc=no) AC_ARG_ENABLE(tabling, [ --enable-tabling support tabling ], tabling="$enableval", tabling=no) @@ -615,25 +612,6 @@ then echo "-------------------------------" exit fi - - if test "$cutc" = no - then - echo - echo - echo "********************************************************" - echo - echo - echo "!!!!!! WARNING !!!!!!" - echo "The MYDDAS interface makes no sense without cut-c" - echo "Please contact tiagosoares@ncc.up.pt for help" - echo - echo "Enabling cut-c" - echo - echo "********************************************************" - echo - echo - cutc="yes" - fi fi if test "$myddasstats" = "yes" From e92107e4cc5208db573e1dee7cb8ff4c990aa4ad Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 5 Mar 2010 08:33:29 +0000 Subject: [PATCH 09/28] version is 6.0 --- pl/boot.yap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pl/boot.yap b/pl/boot.yap index 9765f1c52..96c0aa5aa 100755 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -56,7 +56,7 @@ true :- true. ( retractall(user:library_directory(_)), '$system_library_directories'(D), - assert(user:library_directory(D)), + assertz(user:library_directory(D)), fail ; true From e4f3a127e05eb7a0ab4c5412ba1e0b38ada83a3a Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 5 Mar 2010 08:33:40 +0000 Subject: [PATCH 10/28] make sure environment variables are consulted first. --- pl/consult.yap | 5 ++--- pl/init.yap | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/pl/consult.yap b/pl/consult.yap index d83db29b9..6a825be09 100644 --- a/pl/consult.yap +++ b/pl/consult.yap @@ -878,11 +878,10 @@ absolute_file_name(File,Opts,TrueFileName) :- '$system_library_directories'(Dir) :- getenv('YAPSHAREDIR', Dir). -'$system_library_directories'(Dir) :- - get_value(system_library_directory,Dir). - '$system_library_directories'(Dir) :- getenv('YAPCOMMONSDIR', Dir). +'$system_library_directories'(Dir) :- + get_value(system_library_directory,Dir). '$system_library_directories'(Dir) :- get_value(prolog_commons_directory,Dir). diff --git a/pl/init.yap b/pl/init.yap index 4c3e0a745..47f5207ae 100644 --- a/pl/init.yap +++ b/pl/init.yap @@ -116,7 +116,7 @@ lists:member(X,[_|L]) :- :- ['protect.yap']. -version(yap,[5,1]). +version(yap,[6,0]). system_mode(verbose,on) :- set_value('$verbose',on). system_mode(verbose,off) :- set_value('$verbose',off). From 08257b281787f66c1a248ce20b1b84b1773a7383 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 5 Mar 2010 09:51:52 +0000 Subject: [PATCH 11/28] use YAPSHAREDIR instead of YAP_PL_SRCDIR to book from Prolog files. --- C/c_interface.c | 54 ++++++++++++++++++++++--------------------------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/C/c_interface.c b/C/c_interface.c index f5f69a35f..2a462f378 100644 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -364,6 +364,9 @@ #if !HAVE_STRNCPY #define strncpy(X,Y,Z) strcpy(X,Y) #endif +#if !HAVE_STRNCAT +#define strncat(X,Y,Z) strcat(X,Y) +#endif #if defined(_MSC_VER) && defined(YAP_EXPORTS) #define X_API __declspec(dllexport) @@ -2264,6 +2267,25 @@ do_bootfile (char *bootfilename) #endif } +static void +construct_init_file(char *boot_file, char *BootFile) +{ + /* trust YAPSHAREDIR over YAP_PL_SRCDIR, and notice that the code is / dependent. */ +#if HAVE_GETENV + if (getenv("YAPSHAREDIR")) { + strncpy(boot_file, getenv("YAPSHAREDIR"), 256); + strncat(boot_file, "/pl/", 255); + } else { +#endif + strncpy(boot_file, YAP_PL_SRCDIR, 256); + strncat(boot_file, "/", 255); +#if HAVE_GETENV + } +#endif + strncat(boot_file, BootFile, 255); +} + + /* this routine is supposed to be called from an external program that wants to control Yap */ @@ -2489,21 +2511,7 @@ YAP_Init(YAP_init_args *yap_init) /* read the bootfile */ if (!do_bootstrap) { -#if HAVE_STRNCAT - strncpy(boot_file, YAP_PL_SRCDIR, 256); -#else - strcpy(boot_file, YAP_PL_SRCDIR); -#endif -#if HAVE_STRNCAT - strncat(boot_file, "/", 255); -#else - strcat(boot_file, "/"); -#endif -#if HAVE_STRNCAT - strncat(boot_file, BootFile, 255); -#else - strcat(boot_file, BootFile); -#endif + construct_init_file(boot_file, BootFile); yap_init->YapPrologBootFile = boot_file; } do_bootfile (yap_init->YapPrologBootFile ? yap_init->YapPrologBootFile : BootFile); @@ -2513,21 +2521,7 @@ YAP_Init(YAP_init_args *yap_init) Atom atfile; Functor fgoal; YAP_Term goal, as[2]; -#if HAVE_STRNCAT - strncpy(init_file, YAP_PL_SRCDIR, 256); -#else - strcpy(init_file, YAP_PL_SRCDIR); -#endif -#if HAVE_STRNCAT - strncat(init_file, "/", 255); -#else - strcat(init_file, "/"); -#endif -#if HAVE_STRNCAT - strncat(init_file, InitFile, 255); -#else - strcat(init_file, InitFile); -#endif + construct_init_file(init_file, InitFile); /* consult init file */ atfile = Yap_LookupAtom(init_file); as[0] = MkAtomTerm(atfile); From 5e26f604c6e6e9c58a66c164dda8c0545ab321da Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 5 Mar 2010 10:22:48 +0000 Subject: [PATCH 12/28] fix makefiles to define $exec_prefix --- Makefile.in | 1 + library/lammpi/Makefile.in | 3 ++- library/matlab/Makefile.in | 1 + library/matrices/Makefile.in | 1 + library/matrix/Makefile.in | 1 + library/mpi/Makefile.in | 1 + library/random/Makefile.in | 1 + library/regex/Makefile.in | 1 + library/rltree/Makefile.in | 1 + library/system/Makefile.in | 1 + library/tries/Makefile.in | 1 + packages/PLStream/Makefile.in | 1 + packages/ProbLog/simplecudd/Makefile.in | 1 + packages/chr | 2 +- packages/clpqr | 2 +- packages/jpl | 2 +- packages/plunit/Makefile.in | 1 + packages/sgml/Makefile.in | 1 + packages/swi-minisat2/C/Makefile.in | 1 + packages/swi-minisat2/Makefile.in | 1 + 20 files changed, 21 insertions(+), 4 deletions(-) diff --git a/Makefile.in b/Makefile.in index a091972d7..14c2d951e 100755 --- a/Makefile.in +++ b/Makefile.in @@ -3,6 +3,7 @@ # (EROOT for architecture-dependent files) # prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ # diff --git a/library/lammpi/Makefile.in b/library/lammpi/Makefile.in index 6105e6a0b..301b22ade 100644 --- a/library/lammpi/Makefile.in +++ b/library/lammpi/Makefile.in @@ -7,7 +7,8 @@ # (EROOT for architecture-dependent files) # prefix = @prefix@ -ROOTDIR = $(prefix) +exec_prefix = @exec_prefix@ +OOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ # diff --git a/library/matlab/Makefile.in b/library/matlab/Makefile.in index 8d36cf071..147df354d 100644 --- a/library/matlab/Makefile.in +++ b/library/matlab/Makefile.in @@ -3,6 +3,7 @@ # (EROOT for architecture-dependent files) # prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ diff --git a/library/matrices/Makefile.in b/library/matrices/Makefile.in index 105d97d3e..6720f3935 100644 --- a/library/matrices/Makefile.in +++ b/library/matrices/Makefile.in @@ -3,6 +3,7 @@ # (EROOT for architecture-dependent files) # prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ diff --git a/library/matrix/Makefile.in b/library/matrix/Makefile.in index 105d97d3e..6720f3935 100644 --- a/library/matrix/Makefile.in +++ b/library/matrix/Makefile.in @@ -3,6 +3,7 @@ # (EROOT for architecture-dependent files) # prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ diff --git a/library/mpi/Makefile.in b/library/mpi/Makefile.in index f6668b815..efd87a718 100644 --- a/library/mpi/Makefile.in +++ b/library/mpi/Makefile.in @@ -11,6 +11,7 @@ # (EROOT for architecture-dependent files) # prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ diff --git a/library/random/Makefile.in b/library/random/Makefile.in index 65dbd6cac..3b7212b5c 100644 --- a/library/random/Makefile.in +++ b/library/random/Makefile.in @@ -3,6 +3,7 @@ # (EROOT for architecture-dependent files) # prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ diff --git a/library/regex/Makefile.in b/library/regex/Makefile.in index 1ec662895..109b1112f 100644 --- a/library/regex/Makefile.in +++ b/library/regex/Makefile.in @@ -3,6 +3,7 @@ # (EROOT for architecture-dependent files) # prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ diff --git a/library/rltree/Makefile.in b/library/rltree/Makefile.in index 92a123b73..72ebf95c0 100644 --- a/library/rltree/Makefile.in +++ b/library/rltree/Makefile.in @@ -7,6 +7,7 @@ # (EROOT for architecture-dependent files) # prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ diff --git a/library/system/Makefile.in b/library/system/Makefile.in index 584823944..94190010c 100644 --- a/library/system/Makefile.in +++ b/library/system/Makefile.in @@ -3,6 +3,7 @@ # (EROOT for architecture-dependent files) # prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ diff --git a/library/tries/Makefile.in b/library/tries/Makefile.in index badc3c951..8b86f79b5 100644 --- a/library/tries/Makefile.in +++ b/library/tries/Makefile.in @@ -3,6 +3,7 @@ # (EROOT for architecture-dependent files) # prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ diff --git a/packages/PLStream/Makefile.in b/packages/PLStream/Makefile.in index d1d9542bb..7bdbc8c70 100755 --- a/packages/PLStream/Makefile.in +++ b/packages/PLStream/Makefile.in @@ -4,6 +4,7 @@ # GCC=@GCC@ prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ diff --git a/packages/ProbLog/simplecudd/Makefile.in b/packages/ProbLog/simplecudd/Makefile.in index 7e4c1be50..17be51be2 100644 --- a/packages/ProbLog/simplecudd/Makefile.in +++ b/packages/ProbLog/simplecudd/Makefile.in @@ -3,6 +3,7 @@ # (EROOT for architecture-dependent files) # prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ diff --git a/packages/chr b/packages/chr index f6bb78212..99090acf4 160000 --- a/packages/chr +++ b/packages/chr @@ -1 +1 @@ -Subproject commit f6bb7821268b5c6df1ce83a9d60af1f90a9dd673 +Subproject commit 99090acf47044ad4a6dc78da634668bdc2bae485 diff --git a/packages/clpqr b/packages/clpqr index e3ee70d59..dc903cf88 160000 --- a/packages/clpqr +++ b/packages/clpqr @@ -1 +1 @@ -Subproject commit e3ee70d5971a5af8c9a2a3a5fe8a1892c3777f2b +Subproject commit dc903cf885614c5caef0411dcf35c650d4f290b4 diff --git a/packages/jpl b/packages/jpl index 9f80255cc..cb4b29949 160000 --- a/packages/jpl +++ b/packages/jpl @@ -1 +1 @@ -Subproject commit 9f80255cce18ee268792631aa1180e19a496346f +Subproject commit cb4b299493f80d424dcd19f1928ebb2e0203bdb2 diff --git a/packages/plunit/Makefile.in b/packages/plunit/Makefile.in index acef95c06..185362b15 100644 --- a/packages/plunit/Makefile.in +++ b/packages/plunit/Makefile.in @@ -11,6 +11,7 @@ SHELL=@SHELL@ ifeq (@PROLOG_SYSTEM@,yap) prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ diff --git a/packages/sgml/Makefile.in b/packages/sgml/Makefile.in index 73e8fb182..ee7d1dfa5 100644 --- a/packages/sgml/Makefile.in +++ b/packages/sgml/Makefile.in @@ -9,6 +9,7 @@ ifeq (@PROLOG_SYSTEM@,yap) prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ diff --git a/packages/swi-minisat2/C/Makefile.in b/packages/swi-minisat2/C/Makefile.in index 4b77aea1b..ccf2ba4c0 100644 --- a/packages/swi-minisat2/C/Makefile.in +++ b/packages/swi-minisat2/C/Makefile.in @@ -4,6 +4,7 @@ # GCC=@GCC@ prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ abs_top_builddir = @abs_top_builddir@ diff --git a/packages/swi-minisat2/Makefile.in b/packages/swi-minisat2/Makefile.in index 16e8013f4..f650e16ec 100644 --- a/packages/swi-minisat2/Makefile.in +++ b/packages/swi-minisat2/Makefile.in @@ -1,6 +1,7 @@ # # default base directory for YAP installation # +# ROOTDIR = @prefix@ # # where the binary should be From 2f073c546df881f0aa7d4e9196d5d8f667a552f3 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Fri, 5 Mar 2010 10:38:20 +0000 Subject: [PATCH 13/28] get rid of shlib --- shlib | 1 - 1 file changed, 1 deletion(-) delete mode 160000 shlib diff --git a/shlib b/shlib deleted file mode 160000 index 9ca7abd12..000000000 --- a/shlib +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 9ca7abd128989d971a265c856bea3e1770812664 From 84979058763a68bbe9a6b4c20943f0a2454548d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa=20II?= Date: Fri, 5 Mar 2010 16:49:37 +0000 Subject: [PATCH 14/28] declare erf to Prolog --- pl/arith.yap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pl/arith.yap b/pl/arith.yap index dfa616909..be7347dc6 100644 --- a/pl/arith.yap +++ b/pl/arith.yap @@ -308,6 +308,8 @@ do_not_compile_expressions :- set_value('$c_arith',[]). '$unaryop'(float_fractional_part(X) ,float_fractional_part ,X). '$unaryop'(float_integer_part(X) ,float_integer_part ,X). '$unaryop'(lgamma(X) ,lgamma ,X). +'$unaryop'(erf(X) ,erf ,X). +'$unaryop'(erfc(X) ,erfc ,X). % These are the binary arithmetic operators '$binaryop'(X+Y ,+ ,X,Y). From 8fc50d9935f081cbed2d31611b1898dbfd38788f Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 6 Mar 2010 00:16:49 +0000 Subject: [PATCH 15/28] make YAP throw a runtime-error on unknown arithmetic ops. --- C/arith1.c | 12 +--------- C/arith2.c | 12 +--------- pl/arith.yap | 68 ++++------------------------------------------------ 3 files changed, 6 insertions(+), 86 deletions(-) diff --git a/C/arith1.c b/C/arith1.c index 49d6fe112..f495bb632 100644 --- a/C/arith1.c +++ b/C/arith1.c @@ -901,17 +901,7 @@ p_unary_op_as_integer(void) ExpEntry *p; if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, 1)))) { - Term ti[2]; - - /* error */ - ti[0] = t; - ti[1] = MkIntTerm(1); - t = Yap_MkApplTerm(FunctorSlash, 2, ti); - Yap_Error(TYPE_ERROR_EVALUABLE, t, - "functor %s/%d for arithmetic expression", - RepAtom(name)->StrOfAE,2); - P = FAILCODE; - return(FALSE); + return Yap_unify(ARG1,ARG2); } return Yap_unify_constant(ARG2,MkIntTerm(p->FOfEE)); } diff --git a/C/arith2.c b/C/arith2.c index cd4db2f96..250cb5ed6 100644 --- a/C/arith2.c +++ b/C/arith2.c @@ -1242,17 +1242,7 @@ p_binary_op_as_integer(void) ExpEntry *p; if (EndOfPAEntr(p = RepExpProp(Yap_GetExpProp(name, 2)))) { - Term ti[2]; - - /* error */ - ti[0] = t; - ti[1] = MkIntTerm(1); - t = Yap_MkApplTerm(FunctorSlash, 2, ti); - Yap_Error(TYPE_ERROR_EVALUABLE, t, - "functor %s/%d for arithmetic expression", - RepAtom(name)->StrOfAE,2); - P = FAILCODE; - return(FALSE); + return Yap_unify(ARG1,ARG2); } return Yap_unify_constant(ARG2,MkIntTerm(p->FOfEE)); } diff --git a/pl/arith.yap b/pl/arith.yap index be7347dc6..5defb58ac 100644 --- a/pl/arith.yap +++ b/pl/arith.yap @@ -85,7 +85,8 @@ do_not_compile_expressions :- set_value('$c_arith',[]). '$do_c_built_in'(X is Y, M, P) :- primitive(X), !, '$do_c_built_in'(X =:= Y, M, P). -'$do_c_built_in'(X is Y, M, (P,A=X)) :- nonvar(X), !, +'$do_c_built_in'(X is Y, M, (P,A=X)) :- + nonvar(X), !, '$do_c_built_in'(A is Y, M, P). '$do_c_built_in'(X is Y, _, P) :- nonvar(Y), % Don't rewrite variables @@ -163,11 +164,11 @@ do_not_compile_expressions :- set_value('$c_arith',[]). '$expand_expr'(A, true, A) :- atomic(A), !. '$expand_expr'(T, E, V) :- - '$unaryop'(T, O, A), !, + T =.. [O, A], !, '$expand_expr'(A, Q, X), '$expand_expr'(O, X, V, Q, E). '$expand_expr'(T, E, V) :- - '$binaryop'(T, O, A, B), !, + T =.. [O, A, B], !, '$expand_expr'(A, Q, X), '$expand_expr'(B, R, Y), '$expand_expr'(O, X, Y, V, Q, S), @@ -272,67 +273,6 @@ do_not_compile_expressions :- set_value('$c_arith',[]). '$preprocess_args_for_non_commutative'(X, Y, Z, W, E) :- '$do_and'(Z = X, Y = W, E). - - -% These are the unary arithmetic operators -'$unaryop'(+X ,+ ,X). -'$unaryop'(-X ,- ,X). -'$unaryop'(\(X) ,\ ,X). -'$unaryop'(exp(X) ,exp ,X). -'$unaryop'(log(X) ,log ,X). -'$unaryop'(log10(X) ,log10 ,X). -'$unaryop'(sqrt(X) ,sqrt ,X). -'$unaryop'(sin(X) ,sin ,X). -'$unaryop'(cos(X) ,cos ,X). -'$unaryop'(tan(X) ,tan ,X). -'$unaryop'(asin(X) ,asin ,X). -'$unaryop'(acos(X) ,acos ,X). -'$unaryop'(atan(X) ,atan ,X). -'$unaryop'(atan2(X) ,atan2 ,X). -'$unaryop'(sinh(X) ,sinh ,X). -'$unaryop'(cosh(X) ,cosh ,X). -'$unaryop'(tanh(X) ,tanh ,X). -'$unaryop'(asinh(X) ,asinh ,X). -'$unaryop'(acosh(X) ,acosh ,X). -'$unaryop'(atanh(X) ,atanh ,X). -'$unaryop'(floor(X) ,floor ,X). -'$unaryop'(abs(X) ,abs ,X). -'$unaryop'(float(X) ,float ,X). -'$unaryop'(+(X) ,+ ,X). -'$unaryop'(integer(X) ,integer,X). -'$unaryop'(truncate(X) ,truncate,X). -'$unaryop'(round(X) ,round ,X). -'$unaryop'(ceiling(X) ,ceiling,X). -'$unaryop'(msb(X) ,msb ,X). -'$unaryop'(sign(X) ,sign ,X). -'$unaryop'(float_fractional_part(X) ,float_fractional_part ,X). -'$unaryop'(float_integer_part(X) ,float_integer_part ,X). -'$unaryop'(lgamma(X) ,lgamma ,X). -'$unaryop'(erf(X) ,erf ,X). -'$unaryop'(erfc(X) ,erfc ,X). - -% These are the binary arithmetic operators -'$binaryop'(X+Y ,+ ,X,Y). -'$binaryop'(X-Y ,- ,X,Y). -'$binaryop'(X*Y ,* ,X,Y). -'$binaryop'(X/Y ,/ ,X,Y). -'$binaryop'(X mod Y ,mod ,X,Y). -'$binaryop'(X rem Y ,rem ,X,Y). -'$binaryop'(X//Y ,// ,X,Y). -'$binaryop'(X/\Y ,/\ ,X,Y). -'$binaryop'(X\/Y ,\/ ,X,Y). -'$binaryop'(X#Y ,'#' ,X,Y). -'$binaryop'(X<>Y ,>> ,X,Y). -'$binaryop'(X^Y ,^ ,X,Y). -'$binaryop'(X**Y ,** ,X,Y). -'$binaryop'(exp(X,Y) ,exp ,X,Y). -'$binaryop'(max(X,Y) ,max ,X,Y). -'$binaryop'(min(X,Y) ,min ,X,Y). -'$binaryop'(gcd(X,Y) ,gcd ,X,Y). -'$binaryop'(atan2(X,Y) ,atan2 ,X,Y). - - /* Arithmetics */ % M and N nonnegative integers, N is the successor of M From ffaad94334ae256e833290fdcad70fa79dd09981 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 6 Mar 2010 00:18:24 +0000 Subject: [PATCH 16/28] another exec_prefix (obs from Jos de Roo). --- LGPL/swi_console/Makefile.in | 1 + 1 file changed, 1 insertion(+) diff --git a/LGPL/swi_console/Makefile.in b/LGPL/swi_console/Makefile.in index 6319f8c5e..76833a5ea 100644 --- a/LGPL/swi_console/Makefile.in +++ b/LGPL/swi_console/Makefile.in @@ -3,6 +3,7 @@ # (EROOT for architecture-dependent files) # prefix = @prefix@ +exec_prefix = @exec_prefix@ ROOTDIR = $(prefix) EROOTDIR = @exec_prefix@ # From fa517450ee084237bdfd447bb036f1fa44c01e0b Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 6 Mar 2010 00:25:22 +0000 Subject: [PATCH 17/28] Since YAPBOOTDIR doesn't appear to be referenced anywhere I've attached a patch to remove it from configure.in. (Keri Harris). --- configure | 6 +++--- configure.in | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/configure b/configure index 3940ba1e3..0273a7208 100755 --- a/configure +++ b/configure @@ -6871,7 +6871,7 @@ then YAPLIB="$DYNYAPLIB" DYNLIB_LD="$CC -dynamiclib -Wl,-install_name,$prefix/lib/libYap.dylib" PRE_DYNLOADER_PATH="DYLD_LIBRARY_PATH=\$(abs_top_builddir)" - EXTEND_DYNLOADER_PATH="DYLD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPBOOTDIR=\$(DESTDIR)\$(SHAREDIR)/pl YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" + EXTEND_DYNLOADER_PATH="DYLD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" # CROSS_SIMULATOR="DYLD_LIBRARY_PATH=." ;; *) @@ -6886,7 +6886,7 @@ then JAVA_TARGET=sparc ;; esac - EXTEND_DYNLOADER_PATH="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPBOOTDIR=\$(DESTDIR)\$(SHAREDIR)/pl YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" + EXTEND_DYNLOADER_PATH="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" PRE_DYNLOADER_PATH="LD_LIBRARY_PATH=\$(abs_top_builddir)" LDFLAGS="$LDFLAGS -Wl,-R,$JAVA_HOME/jre/lib/$JAVA_TARGET" DYNYAPLIB=libYap"$SHLIB_SUFFIX" @@ -6895,7 +6895,7 @@ then esac else PRE_DYNLOADER_PATH="" - EXTEND_DYNLOADER_PATH="YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPBOOTDIR=\$(DESTDIR)\$(SHAREDIR)/pl YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" + EXTEND_DYNLOADER_PATH="YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" DYNYAPLIB=libYap.notused fi diff --git a/configure.in b/configure.in index a39f27619..1f4ea7265 100755 --- a/configure.in +++ b/configure.in @@ -1016,7 +1016,7 @@ then YAPLIB="$DYNYAPLIB" DYNLIB_LD="$CC -dynamiclib -Wl,-install_name,$prefix/lib/libYap.dylib" PRE_DYNLOADER_PATH="DYLD_LIBRARY_PATH=\$(abs_top_builddir)" - EXTEND_DYNLOADER_PATH="DYLD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPBOOTDIR=\$(DESTDIR)\$(SHAREDIR)/pl YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" + EXTEND_DYNLOADER_PATH="DYLD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" # CROSS_SIMULATOR="DYLD_LIBRARY_PATH=." ;; *) @@ -1031,7 +1031,7 @@ then JAVA_TARGET=sparc ;; esac - EXTEND_DYNLOADER_PATH="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPBOOTDIR=\$(DESTDIR)\$(SHAREDIR)/pl YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" + EXTEND_DYNLOADER_PATH="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" PRE_DYNLOADER_PATH="LD_LIBRARY_PATH=\$(abs_top_builddir)" LDFLAGS="$LDFLAGS -Wl,-R,$JAVA_HOME/jre/lib/$JAVA_TARGET" DYNYAPLIB=libYap"$SHLIB_SUFFIX" @@ -1040,7 +1040,7 @@ then esac else PRE_DYNLOADER_PATH="" - EXTEND_DYNLOADER_PATH="YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPBOOTDIR=\$(DESTDIR)\$(SHAREDIR)/pl YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" + EXTEND_DYNLOADER_PATH="YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" DYNYAPLIB=libYap.notused fi From a98cc1ac65d8015a5498db9165cdfc734d281a39 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 8 Mar 2010 09:13:52 +0000 Subject: [PATCH 18/28] fix bad label for gc --- C/amasm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/C/amasm.c b/C/amasm.c index 1bedb0653..0ed3f350a 100644 --- a/C/amasm.c +++ b/C/amasm.c @@ -3510,6 +3510,7 @@ do_pass(int pass_no, yamop **entry_codep, int assembling, int *clause_has_blobsp if (!ystop_found && cip->cpc->nextInst != NULL && (cip->cpc->nextInst->op == mark_initialised_pvars_op || + cip->cpc->nextInst->op == mark_live_regs_op || cip->cpc->nextInst->op == blob_op)) { ystop_found = TRUE; code_p = a_il((CELL)*entry_codep, _Ystop, code_p, pass_no, cip); From 6dbc6f09fa38adcf5d3e7c0cc122c7c8f4539ae4 Mon Sep 17 00:00:00 2001 From: Ricardo Rocha Date: Tue, 9 Mar 2010 14:48:20 +0000 Subject: [PATCH 19/28] new built-in predicate abolish_all_frozen_choice_points/0 --- OPTYap/opt.preds.c | 23 +++++++++++++++++------ OPTYap/tab.macros.h | 10 ++++++++++ 2 files changed, 27 insertions(+), 6 deletions(-) diff --git a/OPTYap/opt.preds.c b/OPTYap/opt.preds.c index 96c15ae61..26b0ecc88 100644 --- a/OPTYap/opt.preds.c +++ b/OPTYap/opt.preds.c @@ -65,8 +65,9 @@ static Int p_worker(void); #endif /* YAPOR */ #ifdef TABLING -static Int p_freeze(void); -static Int p_wake(void); +static Int p_freeze_choice_point(void); +static Int p_wake_choice_point(void); +static Int p_abolish_all_frozen_choice_points(void); static Int p_table(void); static Int p_tabling_mode(void); static Int p_abolish_table(void); @@ -139,8 +140,9 @@ void Yap_init_optyap_preds(void) { Yap_InitCPred("or_statistics", 0, p_or_statistics, SafePredFlag|SyncPredFlag); #endif /* YAPOR */ #ifdef TABLING - Yap_InitCPred("freeze_choice_point", 1, p_freeze, SafePredFlag|SyncPredFlag); - Yap_InitCPred("wake_choice_point", 1, p_wake, SafePredFlag|SyncPredFlag); + Yap_InitCPred("freeze_choice_point", 1, p_freeze_choice_point, SafePredFlag|SyncPredFlag); + Yap_InitCPred("wake_choice_point", 1, p_wake_choice_point, SafePredFlag|SyncPredFlag); + Yap_InitCPred("abolish_all_frozen_choice_points", 0, p_abolish_all_frozen_choice_points, SafePredFlag|SyncPredFlag); Yap_InitCPred("$c_table", 2, p_table, SafePredFlag|SyncPredFlag|HiddenPredFlag); Yap_InitCPred("$c_tabling_mode", 3, p_tabling_mode, SafePredFlag|SyncPredFlag|HiddenPredFlag); Yap_InitCPred("$c_abolish_table", 2, p_abolish_table, SafePredFlag|SyncPredFlag|HiddenPredFlag); @@ -552,7 +554,8 @@ Int p_or_statistics(void) { #ifdef TABLING -static Int p_freeze(void) { +static +Int p_freeze_choice_point(void) { Term term_arg, term_cp; term_arg = Deref(ARG1); @@ -565,7 +568,8 @@ static Int p_freeze(void) { } -static Int p_wake(void) { +static +Int p_wake_choice_point(void) { Term term_arg; term_arg = Deref(ARG1); @@ -577,6 +581,13 @@ static Int p_wake(void) { } +static +Int p_abolish_all_frozen_choice_points(void) { + abolish_all_frozen_cps(); + return (TRUE); +} + + static Int p_table(void) { Term mod, t; diff --git a/OPTYap/tab.macros.h b/OPTYap/tab.macros.h index 3431b0ecd..906665ede 100644 --- a/OPTYap/tab.macros.h +++ b/OPTYap/tab.macros.h @@ -35,6 +35,7 @@ STD_PROTO(static inline void free_subgoal_trie_hash_chain, (sg_hash_ptr)); STD_PROTO(static inline void free_answer_trie_hash_chain, (ans_hash_ptr)); STD_PROTO(static inline choiceptr freeze_current_cp, (void)); STD_PROTO(static inline void resume_frozen_cp, (choiceptr)); +STD_PROTO(static inline void abolish_all_frozen_cps, (void)); #ifdef YAPOR STD_PROTO(static inline void pruning_over_tabling_data_structures, (void)); @@ -815,6 +816,15 @@ void resume_frozen_cp(choiceptr frozen_cp) { } +static inline +void abolish_all_frozen_cps(void) { + B_FZ = B_BASE; + H_FZ = H_BASE; + TR_FZ = TR_BASE; + return; +} + + #ifdef YAPOR static inline void pruning_over_tabling_data_structures(void) { From abe4744fe7777f3edcd23549c326e14572572656 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 9 Mar 2010 22:01:42 +0000 Subject: [PATCH 20/28] fix error handling. --- C/cmppreds.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/C/cmppreds.c b/C/cmppreds.c index c829f54e9..795b522c5 100644 --- a/C/cmppreds.c +++ b/C/cmppreds.c @@ -643,8 +643,11 @@ p_acomp(void) { /* $a_compare(?R,+X,+Y) */ Term t1 = Deref(ARG1); Term t2 = Deref(ARG2); + Int out; - return a_cmp(t1, t2); + out = a_cmp(t1, t2); + if (ArithError) { Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage); return FALSE; } + return out; } static Int @@ -675,42 +678,48 @@ a_eq(Term t1, Term t2) } } out = a_cmp(t1,t2); - return !ArithError && (out == 0); + if (ArithError) { Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage); return FALSE; } + return out == 0; } static Int a_dif(Term t1, Term t2) { Int out = a_cmp(Deref(t1),Deref(t2)); - return !ArithError && out != 0; + if (ArithError) { Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage); return FALSE; } + return out != 0; } static Int a_gt(Term t1, Term t2) { /* A > B */ Int out = a_cmp(Deref(t1),Deref(t2)); - return !ArithError && out > 0; + if (ArithError) { Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage); return FALSE; } + return out > 0; } static Int a_ge(Term t1, Term t2) { /* A >= B */ Int out = a_cmp(Deref(t1),Deref(t2)); - return !ArithError && out >= 0; + if (ArithError) { Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage); return FALSE; } + return out >= 0; } static Int a_lt(Term t1, Term t2) { /* A < B */ Int out = a_cmp(Deref(t1),Deref(t2)); - return !ArithError && out < 0; + if (ArithError) { Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage); return FALSE; } + return out < 0; } static Int a_le(Term t1, Term t2) { /* A <= B */ Int out = a_cmp(Deref(t1),Deref(t2)); - return !ArithError && out <= 0; + if (ArithError) { Yap_Error(Yap_Error_TYPE, Yap_Error_Term, Yap_ErrorMessage); return FALSE; } + return out <= 0; } From 96a15851a7d8cfb7c57a9e529562c989cf67ec74 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Tue, 9 Mar 2010 22:00:46 +0000 Subject: [PATCH 21/28] fix unnecessary choicepoint in [a]. --- pl/consult.yap | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pl/consult.yap b/pl/consult.yap index 6a825be09..acda552b7 100644 --- a/pl/consult.yap +++ b/pl/consult.yap @@ -43,7 +43,7 @@ load_files(Files,Opts) :- '$check_files'(Files,Call) :- var(Files), !, '$do_error'(instantiation_error,Call). -'$check_files'(M:Files,Call) :- +'$check_files'(M:Files,Call) :- !, (var(M) -> '$do_error'(instantiation_error,Call) From ff97f53a24efc0a36b0dfc6de5f935dc3f991b38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa=20II?= Date: Fri, 12 Mar 2010 18:03:15 +0000 Subject: [PATCH 22/28] expand_index was broken for long_ints --- C/index.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/C/index.c b/C/index.c index 7b35d8ec7..c89caa756 100644 --- a/C/index.c +++ b/C/index.c @@ -3448,7 +3448,7 @@ install_clause(ClauseDef *cls, PredEntry *ap, istack_entry *stack) if (IsExtensionFunctor(f)) { if (f == FunctorDBRef) { if (cls->u.t_ptr != sp->extra) break; - } else { + } else if (f == FunctorDouble) { CELL *pt = RepAppl(sp->extra); if (cls->u.t_ptr) { CELL *pt1 = RepAppl(cls->u.t_ptr); @@ -3461,6 +3461,12 @@ install_clause(ClauseDef *cls, PredEntry *ap, istack_entry *stack) #endif if (t != t1) break; } + } else { + CELL *pt = RepAppl(sp->extra); + CELL *pt1 = RepAppl(cls->u.t_ptr); + Term t = MkIntTerm(pt[1] & (MAX_ABS_INT-1)), + t1 = MkIntTerm(pt1[1] & (MAX_ABS_INT-1)); + if (t != t1) break; } } } @@ -3610,7 +3616,7 @@ install_log_upd_clause(ClauseDef *cls, PredEntry *ap, istack_entry *stack) if (IsExtensionFunctor(f)) { if (f == FunctorDBRef) { if (cls->u.t_ptr != sp->extra) break; - } else { + } else if (f == FunctorDouble) { CELL *pt = RepAppl(sp->extra); CELL *pt1 = RepAppl(cls->u.t_ptr); #if SIZEOF_DOUBLE == 2*SIZEOF_LONG_INT @@ -3621,6 +3627,12 @@ install_log_upd_clause(ClauseDef *cls, PredEntry *ap, istack_entry *stack) t1 = MkIntTerm(pt1[1]); #endif if (t != t1) break; + } else { + CELL *pt = RepAppl(sp->extra); + CELL *pt1 = RepAppl(cls->u.t_ptr); + Term t = MkIntTerm(pt[1] & (MAX_ABS_INT-1)), + t1 = MkIntTerm(pt1[1] & (MAX_ABS_INT-1)); + if (t != t1) break; } } } From ee0022bb47dbecbacc890066809e563783d25668 Mon Sep 17 00:00:00 2001 From: Ricardo Rocha Date: Fri, 12 Mar 2010 20:02:32 +0000 Subject: [PATCH 23/28] checking for frozen segments in the trail stack in now done using the macro IN_BETWEEN(Yap_TrailBase, ref, Yap_TrailTop) --- C/exec.c | 4 ++-- OPTYap/opt.init.c | 6 +++--- OPTYap/opt.macros.h | 4 ---- OPTYap/or.cowengine.c | 2 +- OPTYap/or.engine.c | 14 +++++++------- OPTYap/or.sbaengine.c | 14 +++++++------- OPTYap/or.threadengine.c | 8 ++++---- OPTYap/tab.macros.h | 19 +++++++++++-------- 8 files changed, 35 insertions(+), 36 deletions(-) diff --git a/C/exec.c b/C/exec.c index 91da5760c..b7a14bd5b 100644 --- a/C/exec.c +++ b/C/exec.c @@ -1614,8 +1614,8 @@ Yap_InitYaamRegs(void) #ifdef SBA BSEG = #endif /* SBA */ - BBREG = B_FZ = B_BASE; - TR = TR_FZ = TR_BASE; + BBREG = B_FZ = (choiceptr) Yap_LocalBase; + TR = TR_FZ = (tr_fr_ptr) Yap_TrailBase; #endif /* FROZEN_STACKS */ LOCK(SignalLock); CreepFlag = CalculateStackGap(); diff --git a/OPTYap/opt.init.c b/OPTYap/opt.init.c index 6dfbae84f..3e579399b 100644 --- a/OPTYap/opt.init.c +++ b/OPTYap/opt.init.c @@ -176,7 +176,7 @@ void Yap_init_local(void) { #ifdef YAPOR /* local data related to or-parallelism */ LOCAL = REMOTE + worker_id; - Set_LOCAL_top_cp(B_BASE); + Set_LOCAL_top_cp((choiceptr) Yap_LocalBase); LOCAL_top_or_fr = GLOBAL_root_or_fr; LOCAL_load = 0; LOCAL_share_request = MAX_WORKERS; @@ -193,7 +193,7 @@ void Yap_init_local(void) { LOCAL_top_sg_fr = NULL; LOCAL_top_dep_fr = GLOBAL_root_dep_fr; #ifdef YAPOR - Set_LOCAL_top_cp_on_stack(B_BASE); /* ??? */ + Set_LOCAL_top_cp_on_stack((choiceptr) Yap_LocalBase); /* ??? */ LOCAL_top_susp_or_fr = GLOBAL_root_or_fr; #endif /* YAPOR */ #endif /* TABLING */ @@ -210,7 +210,7 @@ void make_root_frames(void) { INIT_LOCK(OrFr_lock(or_fr)); OrFr_alternative(or_fr) = NULL; BITMAP_copy(OrFr_members(or_fr), GLOBAL_bm_present_workers); - SetOrFr_node(or_fr, B_BASE); + SetOrFr_node(or_fr, (choiceptr) Yap_LocalBase); OrFr_nearest_livenode(or_fr) = NULL; OrFr_depth(or_fr) = 0; Set_OrFr_pend_prune_cp(or_fr, NULL); diff --git a/OPTYap/opt.macros.h b/OPTYap/opt.macros.h index 0064feaa4..f52595e2e 100644 --- a/OPTYap/opt.macros.h +++ b/OPTYap/opt.macros.h @@ -29,10 +29,6 @@ extern int Yap_page_size; -#define H_BASE ((CELL *) Yap_GlobalBase) -#define B_BASE ((choiceptr) Yap_LocalBase) -#define TR_BASE ((tr_fr_ptr) Yap_TrailBase) - #if SIZEOF_INT_P == 4 #define ALIGN 3 #define ALIGNMASK 0xfffffffc diff --git a/OPTYap/or.cowengine.c b/OPTYap/or.cowengine.c index 3ac324071..4bf967cb0 100644 --- a/OPTYap/or.cowengine.c +++ b/OPTYap/or.cowengine.c @@ -79,7 +79,7 @@ void make_root_choice_point(void) { void free_root_choice_point(void) { B = LOCAL_top_cp->cp_b; - LOCAL_top_cp = B_BASE; + LOCAL_top_cp = (choiceptr) Yap_LocalBase; return; } diff --git a/OPTYap/or.engine.c b/OPTYap/or.engine.c index 6bb5ed7f9..f0ac8a2d7 100644 --- a/OPTYap/or.engine.c +++ b/OPTYap/or.engine.c @@ -123,7 +123,7 @@ void free_root_choice_point(void) { #ifdef TABLING LOCAL_top_cp_on_stack = #endif /* TABLING */ - LOCAL_top_cp = GLOBAL_root_cp = OrFr_node(GLOBAL_root_or_fr) = B_BASE; + LOCAL_top_cp = GLOBAL_root_cp = OrFr_node(GLOBAL_root_or_fr) = (choiceptr) Yap_LocalBase; return; } @@ -224,13 +224,13 @@ int q_share_work(int worker_p) { RESET_VARIABLE(aux_cell); #ifdef TABLING } else if (IsPairTerm(aux_cell)) { - /* avoid frozen segments */ aux_cell = (CELL) RepPair(aux_cell); - if ((ADDR) aux_cell >= TrailBase) { + if (IN_BETWEEN(Yap_TrailBase, aux_cell, Yap_TrailTop)) { + /* avoid frozen segments */ TR = (tr_fr_ptr) aux_cell; #ifdef TABLING_ERRORS - if (TR > (tr_fr_ptr) TrailTop) - TABLING_ERROR_MESSAGE("TR > TrailTop (q_share_work)"); + if (TR > (tr_fr_ptr) Yap_TrailTop) + TABLING_ERROR_MESSAGE("TR > Yap_TrailTop (q_share_work)"); if (TR < aux_tr) TABLING_ERROR_MESSAGE("TR < aux_tr (q_share_work)"); #endif /* TABLING_ERRORS */ @@ -338,9 +338,9 @@ sync_with_p: } #ifdef TABLING } else if (IsPairTerm(aux_cell)) { - /* avoid frozen segments */ aux_cell = (CELL) RepPair(aux_cell); - if ((ADDR) aux_cell >= TrailBase) + if (IN_BETWEEN(Yap_TrailBase, aux_cell, Yap_TrailTop)) { + /* avoid frozen segments */ aux_tr = (tr_fr_ptr) aux_cell; #endif /* TABLING */ #ifdef MULTI_ASSIGNMENT_VARIABLES diff --git a/OPTYap/or.sbaengine.c b/OPTYap/or.sbaengine.c index 28dc49391..36c686e5c 100644 --- a/OPTYap/or.sbaengine.c +++ b/OPTYap/or.sbaengine.c @@ -103,9 +103,9 @@ void make_root_choice_point(void) { LOCAL_load = 0; LOCAL_prune_request = NULL; BRANCH(worker_id, 0) = 0; - H_FZ = H_BASE; - B_FZ = B_BASE; - TR_FZ = TR_BASE; + H_FZ = (CELL *) Yap_GlobalBase; + B_FZ = (choiceptr) Yap_LocalBase; + TR_FZ = (tr_fr_ptr) Yap_TrailBase; } @@ -113,10 +113,10 @@ void free_root_choice_point(void) { reset_trail(LOCAL_top_cp->cp_tr, TR); TR = LOCAL_top_cp->cp_tr; B = LOCAL_top_cp->cp_b; - LOCAL_top_cp = B_BASE; - H_FZ = H_BASE; - B_FZ = B_BASE; - TR_FZ = TR_BASE; + LOCAL_top_cp = (choiceptr) Yap_LocalBase; + H_FZ = (CELL *) Yap_GlobalBase; + B_FZ = (choiceptr) Yap_LocalBase; + TR_FZ = (tr_fr_ptr) Yap_TrailBase; } diff --git a/OPTYap/or.threadengine.c b/OPTYap/or.threadengine.c index 194d75946..62dc5774f 100644 --- a/OPTYap/or.threadengine.c +++ b/OPTYap/or.threadengine.c @@ -96,11 +96,11 @@ void make_root_choice_point(void) { void free_root_choice_point(void) { B = Get_LOCAL_top_cp()->cp_b; #ifdef TABLING - Set_LOCAL_top_cp_on_stack(B_BASE); + Set_LOCAL_top_cp_on_stack((choiceptr) Yap_LocalBase); #endif /* TABLING */ - Set_GLOBAL_root_cp( B_BASE ); - Set_LOCAL_top_cp( B_BASE ); - SetOrFr_node(GLOBAL_root_or_fr, B_BASE); + Set_GLOBAL_root_cp((choiceptr) Yap_LocalBase); + Set_LOCAL_top_cp((choiceptr) Yap_LocalBase); + SetOrFr_node(GLOBAL_root_or_fr, (choiceptr) Yap_LocalBase); return; } diff --git a/OPTYap/tab.macros.h b/OPTYap/tab.macros.h index 906665ede..da22d394f 100644 --- a/OPTYap/tab.macros.h +++ b/OPTYap/tab.macros.h @@ -492,7 +492,7 @@ void unbind_variables(tr_fr_ptr unbind_tr, tr_fr_ptr end_tr) { RESET_VARIABLE(ref); } else if (IsPairTerm(ref)) { ref = (CELL) RepPair(ref); - if ((ADDR)ref >= Yap_TrailBase) { + if (IN_BETWEEN(Yap_TrailBase, ref, Yap_TrailTop)) { /* avoid frozen segments */ unbind_tr = (tr_fr_ptr) ref; #ifdef TABLING_ERRORS @@ -531,7 +531,7 @@ void rebind_variables(tr_fr_ptr rebind_tr, tr_fr_ptr end_tr) { *((CELL *)ref) = TrailVal(rebind_tr); } else if (IsPairTerm(ref)) { ref = (CELL) RepPair(ref); - if ((ADDR)ref >= Yap_TrailBase) { + if (IN_BETWEEN(Yap_TrailBase, ref, Yap_TrailTop)) { /* avoid frozen segments */ rebind_tr = (tr_fr_ptr) ref; #ifdef TABLING_ERRORS @@ -575,7 +575,8 @@ void restore_bindings(tr_fr_ptr unbind_tr, tr_fr_ptr rebind_tr) { RESET_VARIABLE(ref); } else if (IsPairTerm(ref)) { ref = (CELL) RepPair(ref); - if ((ADDR)ref >= Yap_TrailBase) { + if (IN_BETWEEN(Yap_TrailBase, ref, Yap_TrailTop)) { + /* avoid frozen segments */ unbind_tr = (tr_fr_ptr) ref; #ifdef TABLING_ERRORS if (unbind_tr > (tr_fr_ptr) Yap_TrailTop) @@ -601,7 +602,8 @@ void restore_bindings(tr_fr_ptr unbind_tr, tr_fr_ptr rebind_tr) { ref = (CELL) TrailTerm(--end_tr); if (IsPairTerm(ref)) { ref = (CELL) RepPair(ref); - if ((ADDR)ref >= Yap_TrailBase) { + if (IN_BETWEEN(Yap_TrailBase, ref, Yap_TrailTop)) { + /* avoid frozen segments */ end_tr = (tr_fr_ptr) ref; #ifdef TABLING_ERRORS if (end_tr > (tr_fr_ptr) Yap_TrailTop) @@ -618,7 +620,8 @@ void restore_bindings(tr_fr_ptr unbind_tr, tr_fr_ptr rebind_tr) { *((CELL *)ref) = TrailVal(rebind_tr); } else if (IsPairTerm(ref)) { ref = (CELL) RepPair(ref); - if ((ADDR)ref >= Yap_TrailBase) { + if (IN_BETWEEN(Yap_TrailBase, ref, Yap_TrailTop)) { + /* avoid frozen segments */ rebind_tr = (tr_fr_ptr) ref; #ifdef TABLING_ERRORS if (rebind_tr > (tr_fr_ptr) Yap_TrailTop) @@ -818,9 +821,9 @@ void resume_frozen_cp(choiceptr frozen_cp) { static inline void abolish_all_frozen_cps(void) { - B_FZ = B_BASE; - H_FZ = H_BASE; - TR_FZ = TR_BASE; + B_FZ = (choiceptr) Yap_LocalBase; + H_FZ = (CELL *) Yap_GlobalBase; + TR_FZ = (tr_fr_ptr) Yap_TrailBase; return; } From 6f1281849ca4f34650bcda262775ed21f2af3a36 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sun, 14 Mar 2010 09:30:24 +0000 Subject: [PATCH 24/28] SWI compatibility for term_expansion --- pl/boot.yap | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pl/boot.yap b/pl/boot.yap index 96c0aa5aa..2395cd5cd 100755 --- a/pl/boot.yap +++ b/pl/boot.yap @@ -401,6 +401,8 @@ true :- true. ( '$notrace'(M:G) -> true ; format(user_error,':- ~w:~w failed.~n',[M,G]) ), '$enter_system_mode'. + '$continue_with_command'(Where,V,'$stream_position'(C,_P,A1,A2,A3),'$source_location'(_F,L):G,Source) :- !, + '$continue_with_command'(Where,V,'$stream_position'(C,L,A1,A2,A3),G,Source). '$continue_with_command'(reconsult,V,Pos,G,Source) :- '$go_compile_clause'(G,V,Pos,5,Source), fail. From e33b7502b54b0041c145dec779fd30ccea66ba47 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sun, 14 Mar 2010 09:31:25 +0000 Subject: [PATCH 25/28] SWI compatibility --- pl/protect.yap | 1 + 1 file changed, 1 insertion(+) diff --git a/pl/protect.yap b/pl/protect.yap index a1538558b..b847548b5 100644 --- a/pl/protect.yap +++ b/pl/protect.yap @@ -39,6 +39,7 @@ '$hide'('$stream') :- !, fail. /* not $STREAM */ '$hide'('$stream_position') :- !, fail. /* not stream position */ '$hide'('$hacks') :- !, fail. +'$hide'('$source_location') :- !, fail. '$hide'('$messages') :- !, fail. '$hide'(Name) :- hide(Name), fail. From ce540b5dd404f1d5d8cf681aa30e054f3b6f0857 Mon Sep 17 00:00:00 2001 From: RIGUZZI FABRIZIO - Dipartimento di Ingegneria Date: Mon, 15 Mar 2010 09:51:39 +0100 Subject: [PATCH 26/28] Fixed compilation of cplint under new packages folder --- packages/cplint/doc/Makefile | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 packages/cplint/doc/Makefile diff --git a/packages/cplint/doc/Makefile b/packages/cplint/doc/Makefile new file mode 100644 index 000000000..786d90969 --- /dev/null +++ b/packages/cplint/doc/Makefile @@ -0,0 +1,8 @@ + +manual.pdf: manual.tex manual.bbl + pdflatex manual + pdflatex manual + +manual.html: manual.tex manual.bbl + htlatex manual + From 577c7721d7ab44df6f1febd5fa06dade55d3419c Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 15 Mar 2010 14:20:41 +0000 Subject: [PATCH 27/28] upgrade to cuurent chr --- packages/chr | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/chr b/packages/chr index 99090acf4..91ad6583a 160000 --- a/packages/chr +++ b/packages/chr @@ -1 +1 @@ -Subproject commit 99090acf47044ad4a6dc78da634668bdc2bae485 +Subproject commit 91ad6583a1387ad6c645c46f258fd671d92fe9fb From 3742f09c1022bf60dbdb6f5344d14fb4682ef604 Mon Sep 17 00:00:00 2001 From: Ricardo Rocha Date: Mon, 15 Mar 2010 14:21:16 +0000 Subject: [PATCH 28/28] missing brackets in condition using macro new_dependency_frame() --- OPTYap/opt.init.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/OPTYap/opt.init.c b/OPTYap/opt.init.c index 3e579399b..80d9dd5b2 100644 --- a/OPTYap/opt.init.c +++ b/OPTYap/opt.init.c @@ -231,8 +231,9 @@ void make_root_frames(void) { #ifdef TABLING /* root dependency frame */ - if (!GLOBAL_root_dep_fr) + if (!GLOBAL_root_dep_fr) { new_dependency_frame(GLOBAL_root_dep_fr, FALSE, NULL, NULL, NULL, NULL, NULL); + } #endif /* TABLING */ }