BEAM for YAP update...
git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1384 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
parent
590352c2c6
commit
ed92d70e68
@ -11,8 +11,11 @@
|
||||
* File: YapOpcodes.h *
|
||||
* comments: Central Table with all YAP opcodes *
|
||||
* *
|
||||
* Last rev: $Date: 2005-08-01 15:40:38 $ *
|
||||
* Last rev: $Date: 2005-09-08 21:55:48 $ *
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.33 2005/08/01 15:40:38 ricroc
|
||||
* TABLING NEW: better support for incomplete tabling
|
||||
*
|
||||
* Revision 1.32 2005/07/06 19:34:11 ricroc
|
||||
* TABLING: answers for completed calls can now be obtained by loading (new option) or executing (default) them from the trie data structure.
|
||||
*
|
||||
@ -192,6 +195,9 @@
|
||||
#else
|
||||
OPCODE(or_last ,p),
|
||||
#endif /* YAPOR */
|
||||
#ifdef BEAM
|
||||
OPCODE(run_eam ,x),
|
||||
#endif
|
||||
OPCODE(call_cpred ,sla),
|
||||
OPCODE(call_usercpred ,sla),
|
||||
OPCODE(call_c_wfail ,sdl),
|
||||
|
@ -560,6 +560,9 @@ typedef struct pred_entry
|
||||
#ifdef TABLING
|
||||
tab_ent_ptr TableOfPred;
|
||||
#endif /* TABLING */
|
||||
#ifdef BEAM
|
||||
struct Predicates *beamTable;
|
||||
#endif
|
||||
Term ModuleOfPred; /* module for this definition */
|
||||
/* This must be at an odd number of cells, otherwise it
|
||||
will not be aligned on RISC machines */
|
||||
|
@ -446,7 +446,6 @@ Yap_unify_constant(register Term a, register Term cons)
|
||||
}
|
||||
} else return(FALSE);
|
||||
}
|
||||
|
||||
|
||||
deref_body(a,pt,unify_cons_unk,unify_cons_nonvar);
|
||||
BIND(pt,cons,wake_for_cons);
|
||||
|
@ -36,7 +36,13 @@ add_int(Int i, Int j E_ARGS)
|
||||
}
|
||||
#endif
|
||||
/* Integer overflow, we need to use big integers */
|
||||
|
||||
#ifdef BEAM
|
||||
RINT(x);
|
||||
return( MkIntegerTerm (x));
|
||||
#else
|
||||
RINT(x);
|
||||
#endif
|
||||
}
|
||||
|
||||
/* Extended version with two possibilities:
|
||||
|
26
H/compile.h
26
H/compile.h
@ -144,6 +144,31 @@ typedef enum compiler_op {
|
||||
#ifdef TABLING_INNER_CUTS
|
||||
clause_with_cut_op,
|
||||
#endif /* TABLING_INNER_CUTS */
|
||||
#ifdef BEAM
|
||||
run_op,
|
||||
body_op,
|
||||
endgoal_op,
|
||||
try_me_op,
|
||||
retry_me_op,
|
||||
trust_me_op,
|
||||
only_1_clause_op,
|
||||
create_first_box_op,
|
||||
create_box_op,
|
||||
create_last_box_op,
|
||||
remove_box_op,
|
||||
remove_last_box_op,
|
||||
prepare_tries,
|
||||
std_base_op,
|
||||
direct_safe_call_op,
|
||||
commit_op,
|
||||
skip_while_var_op,
|
||||
wait_while_var_op,
|
||||
force_wait_op,
|
||||
write_op,
|
||||
is_op,
|
||||
equal_op,
|
||||
exit_op,
|
||||
#endif
|
||||
fetch_args_for_bccall,
|
||||
bccall_op,
|
||||
blob_op
|
||||
@ -241,7 +266,6 @@ typedef struct intermediates {
|
||||
#define TempVar 0x02000000L
|
||||
#define PermVar 0x03000000L
|
||||
|
||||
|
||||
#define save_b_flag 0x10000
|
||||
#define commit_b_flag 0x10001
|
||||
#define save_appl_flag 0x10002
|
||||
|
@ -12,8 +12,11 @@
|
||||
* File: rclause.h *
|
||||
* comments: walk through a clause *
|
||||
* *
|
||||
* Last rev: $Date: 2005-08-01 15:40:38 $,$Author: ricroc $ *
|
||||
* Last rev: $Date: 2005-09-08 21:55:47 $,$Author: rslopes $ *
|
||||
* $Log: not supported by cvs2svn $
|
||||
* Revision 1.10 2005/08/01 15:40:38 ricroc
|
||||
* TABLING NEW: better support for incomplete tabling
|
||||
*
|
||||
* Revision 1.9 2005/07/06 19:34:11 ricroc
|
||||
* TABLING: answers for completed calls can now be obtained by loading (new option) or executing (default) them from the trie data structure.
|
||||
*
|
||||
@ -707,6 +710,9 @@ restore_opcodes(yamop *pc)
|
||||
/* instructions type s */
|
||||
case _write_n_voids:
|
||||
case _pop_n:
|
||||
#ifdef BEAM
|
||||
case _run_eam:
|
||||
#endif
|
||||
#ifdef TABLING
|
||||
case _table_new_answer:
|
||||
#endif /* TABLING */
|
||||
|
28
Makefile.in
28
Makefile.in
@ -27,7 +27,7 @@ INCLUDEDIR=$(ROOTDIR)/include/Yap
|
||||
#
|
||||
INFODIR=$(SHAREDIR)/info
|
||||
|
||||
#
|
||||
#3
|
||||
# Add this flag to YAP_EXTRAS if you need the extension:
|
||||
# -DRATIONAL_TREES: allow unification and builtins over rational trees
|
||||
# -DCOROUTINING: implement extra control primitives
|
||||
@ -45,7 +45,7 @@ INFODIR=$(SHAREDIR)/info
|
||||
#
|
||||
# check also optimisation options in INSTALL file.
|
||||
#
|
||||
YAP_EXTRAS=@YAP_EXTRAS@
|
||||
YAP_EXTRAS=@YAP_EXTRAS@
|
||||
|
||||
#
|
||||
# Please do not add YAP_EXTRA flags here: if you do check the flags
|
||||
@ -53,7 +53,7 @@ YAP_EXTRAS=@YAP_EXTRAS@
|
||||
#
|
||||
CC=@CC@
|
||||
MPI_CC=@MPI_CC@
|
||||
CPPFLAGS=@CPPFLAGS@ -I. -I$(srcdir)/H -I$(srcdir)/OPTYap
|
||||
CPPFLAGS=@CPPFLAGS@ -I. -I$(srcdir)/H -I$(srcdir)/OPTYap -I$(srcdir)/BEAM
|
||||
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)
|
||||
@ -113,6 +113,7 @@ HEADERS = \
|
||||
$(srcdir)/H/tracer.h \
|
||||
$(srcdir)/H/threads.h \
|
||||
$(srcdir)/H/yapio.h \
|
||||
$(srcdir)/BEAM/eam.h $(srcdir)/BEAM/eamamasm.h \
|
||||
$(srcdir)/OPTYap/opt.config.h \
|
||||
$(srcdir)/OPTYap/opt.proto.h $(srcdir)/OPTYap/opt.structs.h \
|
||||
$(srcdir)/OPTYap/opt.macros.h $(srcdir)/OPTYap/or.macros.h \
|
||||
@ -151,6 +152,9 @@ C_SOURCES= \
|
||||
$(srcdir)/C/tracer.c $(srcdir)/C/unify.c $(srcdir)/C/userpreds.c \
|
||||
$(srcdir)/C/utilpreds.c $(srcdir)/C/write.c $(srcdir)/console/yap.c \
|
||||
$(srcdir)/C/ypsocks.c $(srcdir)/C/ypstdio.c \
|
||||
$(srcdir)/BEAM/eam_am.c $(srcdir)/BEAM/eam_showcode.c \
|
||||
$(srcdir)/BEAM/eamindex.c $(srcdir)/BEAM/eamamasm.c \
|
||||
$(srcdir)/BEAM/eam_gc.c $(srcdir)/BEAM/eam_split.c \
|
||||
$(srcdir)/OPTYap/opt.memory.c $(srcdir)/OPTYap/opt.misc.c \
|
||||
$(srcdir)/OPTYap/opt.init.c \
|
||||
$(srcdir)/OPTYap/opt.preds.c $(srcdir)/OPTYap/or.engine.c \
|
||||
@ -201,7 +205,10 @@ OR_OBJECTS = \
|
||||
or.engine.o or.cowengine.o or.sbaengine.o or.scheduler.o or.cut.o \
|
||||
tab.tries.o tab.suspend.o
|
||||
|
||||
LIB_OBJECTS = $(ENGINE_OBJECTS) $(C_INTERFACE_OBJECTS) $(OR_OBJECTS)
|
||||
BEAM_OBJECTS = \
|
||||
eamamasm.o eam_showcode.o eamindex.o eam_am.o
|
||||
|
||||
LIB_OBJECTS = $(ENGINE_OBJECTS) $(C_INTERFACE_OBJECTS) $(OR_OBJECTS) $(BEAM_OBJECTS)
|
||||
|
||||
OBJECTS = yap.o $(LIB_OBJECTS)
|
||||
|
||||
@ -428,6 +435,19 @@ mpi.o: $(srcdir)/library/mpi/mpi.c
|
||||
mpe.o: $(srcdir)/library/mpi/mpe.c
|
||||
$(MPI_CC) -c $(CFLAGS) $(srcdir)/library/mpi/mpe.c -o $@
|
||||
|
||||
eam_showcode.o: $(srcdir)/BEAM/eam_showcode.c
|
||||
$(CC) -c $(CFLAGS) $(srcdir)/BEAM/eam_showcode.c -o $@
|
||||
|
||||
eam_am.o: $(srcdir)/BEAM/eam_am.c
|
||||
$(CC) -c $(CFLAGS) $(srcdir)/BEAM/eam_am.c -o $@
|
||||
|
||||
eamamasm.o: $(srcdir)/BEAM/eamamasm.c
|
||||
$(CC) -c $(CFLAGS) $(srcdir)/BEAM/eamamasm.c -o $@
|
||||
|
||||
eamindex.o: $(srcdir)/BEAM/eamindex.c
|
||||
$(CC) -c $(CFLAGS) $(srcdir)/BEAM/eamindex.c -o $@
|
||||
|
||||
|
||||
## CPP'ed files (for macro debugging)
|
||||
|
||||
%.i : $(srcdir)/C/%.c
|
||||
|
6
README
6
README
@ -1,17 +1,17 @@
|
||||
|
||||
|
||||
|
||||
README for Yap 4.5
|
||||
README for Yap 5.0
|
||||
|
||||
|
||||
This directory contains a release of the Yap 4.t Prolog system,
|
||||
This directory contains a release of the Yap 5.t Prolog system,
|
||||
originally developed at the Universidade do Porto by Luis Damas and
|
||||
Vitor Santos Costa, with contributions from the Edinburgh Prolog
|
||||
library, the C-Prolog manual authors, Ricardo Rocha, and many
|
||||
others. You should read the rest of this file for information on what
|
||||
Yap is and for instructions on how to build it.
|
||||
|
||||
YAP 4.2 is known to build with many versions of gcc (<= gcc-2.7.2, >=
|
||||
YAP 52 is known to build with many versions of gcc (<= gcc-2.7.2, >=
|
||||
gcc-2.8.1, >= egcs-1.0.1, gcc-2.95.*) and on a variety of Unix'es:
|
||||
SunOS 4.1, Solaris 2.*, Irix 5.2, HP-UX 10.20, Dec Alpha Unix, Linux 1.2
|
||||
and Linux 2.* (RedHat 4.0 through 5.2, Debian 2.*) in both the x86 and
|
||||
|
27
configure
vendored
27
configure
vendored
@ -855,20 +855,21 @@ Optional Features:
|
||||
--enable-threads support system threads
|
||||
--pthread-locking use pthread locking primitives for internal locking (requires threads)
|
||||
--enable-max-performance try using the best flags for specific architecture
|
||||
--enable-max-memory try using the best flags for using the memory to the most
|
||||
--enable-max-memory try using the best flags for using the memory to the most
|
||||
--enable-debug-yap enable C-debugging for YAP
|
||||
--enable-eam enable EAM on YAP
|
||||
--enable-cygwin use cygwin library in WIN32
|
||||
--enable-dynamic-loading compile Yap as a DLL
|
||||
--enable-use-malloc use malloc to allocate memory
|
||||
--enable-condor allow Yap to be used from condor
|
||||
--enable-april compile Yap to support April ILP system
|
||||
--enable-dlcompat use dlcompat library for dynamic loading on Mac OS X
|
||||
--enable-dynamic-loading compile Yap as a DLL
|
||||
--enable-use-malloc use malloc to allocate memory
|
||||
--enable-condor allow Yap to be used from condor
|
||||
--enable-april compile Yap to support April ILP system
|
||||
--enable-dlcompat use dlcompat library for dynamic loading on Mac OS X
|
||||
|
||||
Optional Packages:
|
||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
|
||||
--with-gmp=DIR use GNU Multiple Precision in DIR
|
||||
--with-jpl=JAVA_HOME use Java instalation in JAVA_HOME
|
||||
--with-jpl=JAVA_HOME use Java instalation in JAVA_HOME
|
||||
--with-readline=DIR use GNU Readline Library in DIR
|
||||
--with-mpi=DIR use MPI library in DIR
|
||||
--with-mpe=DIR use MPE library in DIR
|
||||
@ -2367,6 +2368,13 @@ if test "${enable_debug_yap+set}" = set; then
|
||||
else
|
||||
debugyap=no
|
||||
fi;
|
||||
# Check whether --enable-eam or --disable-eam was given.
|
||||
if test "${enable_eam+set}" = set; then
|
||||
enableval="$enable_eam"
|
||||
eam="$enableval"
|
||||
else
|
||||
eam=no
|
||||
fi;
|
||||
# Check whether --enable-cygwin or --disable-cygwin was given.
|
||||
if test "${enable_cygwin+set}" = set; then
|
||||
enableval="$enable_cygwin"
|
||||
@ -6200,6 +6208,11 @@ if test "$debugyap" = "yes"
|
||||
YAP_EXTRAS="$YAP_EXTRAS -DDEBUG=1"
|
||||
fi
|
||||
|
||||
if test "$eam" = "yes"
|
||||
then
|
||||
YAP_EXTRAS="$YAP_EXTRAS -DBEAM"
|
||||
fi
|
||||
|
||||
if test "$wamprofile" = "yes"
|
||||
then
|
||||
YAP_EXTRAS="$YAP_EXTRAS -DANALYST=1"
|
||||
|
24
configure.in
24
configure.in
@ -59,30 +59,33 @@ AC_ARG_ENABLE(max-performance,
|
||||
[ --enable-max-performance try using the best flags for specific architecture ],
|
||||
maxperformance="$enableval", maxperformance=no)
|
||||
AC_ARG_ENABLE(max-memory,
|
||||
[ --enable-max-memory try using the best flags for using the memory to the most ],
|
||||
[ --enable-max-memory try using the best flags for using the memory to the most ],
|
||||
maxmemory="$enableval", maxmemory=no)
|
||||
AC_ARG_ENABLE(debug-yap,
|
||||
[ --enable-debug-yap enable C-debugging for YAP ],
|
||||
debugyap="$enableval", debugyap=no)
|
||||
AC_ARG_ENABLE(eam,
|
||||
[ --enable-eam enable EAM on YAP ],
|
||||
eam="$enableval", eam=no)
|
||||
AC_ARG_ENABLE(cygwin,
|
||||
[ --enable-cygwin use cygwin library in WIN32 ],
|
||||
cygwin="$enableval", cygwin=no)
|
||||
AC_ARG_ENABLE(dynamic_loading,
|
||||
[ --enable-dynamic-loading compile Yap as a DLL ],
|
||||
[ --enable-dynamic-loading compile Yap as a DLL ],
|
||||
dynamic_loading="$enableval", dynamic_loading=no)
|
||||
AC_ARG_ENABLE(use-malloc,
|
||||
[ --enable-use-malloc use malloc to allocate memory ],
|
||||
[ --enable-use-malloc use malloc to allocate memory ],
|
||||
use_malloc="$enableval", use_malloc=no)
|
||||
AC_ARG_ENABLE(condor,
|
||||
[ --enable-condor allow Yap to be used from condor ],
|
||||
[ --enable-condor allow Yap to be used from condor ],
|
||||
use_condor="$enableval", use_condor=no)
|
||||
|
||||
AC_ARG_ENABLE(april,
|
||||
[ --enable-april compile Yap to support April ILP system],
|
||||
[ --enable-april compile Yap to support April ILP system],
|
||||
use_april="$enableval", use_april=no)
|
||||
|
||||
AC_ARG_ENABLE(dlcompat,
|
||||
[ --enable-dlcompat use dlcompat library for dynamic loading on Mac OS X],
|
||||
[ --enable-dlcompat use dlcompat library for dynamic loading on Mac OS X],
|
||||
use_dlcompat="$enableval", use_dlcompat=no)
|
||||
|
||||
AC_ARG_WITH(gmp,
|
||||
@ -99,7 +102,7 @@ AC_ARG_WITH(gmp,
|
||||
[yap_cv_gmp=yes])
|
||||
|
||||
AC_ARG_WITH(jpl,
|
||||
[ --with-jpl=JAVA_HOME use Java instalation in JAVA_HOME],
|
||||
[ --with-jpl=JAVA_HOME use Java instalation in JAVA_HOME],
|
||||
if test "$withval" = yes; then
|
||||
yap_cv_jpl="$JAVA_HOME"
|
||||
dynamic_loading=yes
|
||||
@ -237,7 +240,7 @@ if test "$GCC" = "yes"
|
||||
then
|
||||
if test -z "${mycflags}"
|
||||
then
|
||||
if test "$debugyap" = "yes"
|
||||
if test "$debugyap" = "yes"
|
||||
then
|
||||
CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes"
|
||||
C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes"
|
||||
@ -675,6 +678,11 @@ if test "$debugyap" = "yes"
|
||||
then
|
||||
YAP_EXTRAS="$YAP_EXTRAS -DDEBUG=1"
|
||||
fi
|
||||
|
||||
if test "$eam" = "yes"
|
||||
then
|
||||
YAP_EXTRAS="$YAP_EXTRAS -DBEAM"
|
||||
fi
|
||||
|
||||
if test "$wamprofile" = "yes"
|
||||
then
|
||||
|
@ -7,6 +7,8 @@ cd C
|
||||
splat
|
||||
cd ../H
|
||||
splat
|
||||
cd ../BEAM
|
||||
splat
|
||||
cd ../OPTYap
|
||||
splat
|
||||
cd ../VC
|
||||
@ -81,7 +83,7 @@ cd examples
|
||||
splat
|
||||
cd ../../../..
|
||||
if test "$1" = "--small"; then
|
||||
tar cvzf "$version"-small.tar.gz --exclude=CVS "$version"/{Artistic,INSTALL,README*,changes*,config*,install-sh,Makefile.in,.depend.in,distribute,C,H,VC,console,docs,include,library,misc,pl,LGPL/README,LGPL/pillow/[C-Z]*,LGPL/pillow/*.pl,LGPL/pillow/doc/*info*,LGPL/JPL/jpl.yap,LGPL/JPL/jpl_paths.yap.in,LGPL/JPL/Makefile.in,LGPL/JPL/java,LGPL/JPL/src,build-distr,OPTYap,CLPQR,CHR,CLPBN} # --exclude=CLPQR/clpqr/examples --exclude=CHR/chr/examples
|
||||
tar cvzf "$version"-small.tar.gz --exclude=CVS "$version"/{Artistic,INSTALL,README*,changes*,config*,install-sh,Makefile.in,.depend.in,distribute,C,H,VC,console,docs,include,library,misc,pl,LGPL/README,LGPL/pillow/[C-Z]*,LGPL/pillow/*.pl,LGPL/pillow/doc/*info*,LGPL/JPL/jpl.yap,LGPL/JPL/jpl_paths.yap.in,LGPL/JPL/Makefile.in,LGPL/JPL/java,LGPL/JPL/src,build-distr,OPTYap,BEAM,CLPQR,CHR,CLPBN} # --exclude=CLPQR/clpqr/examples --exclude=CHR/chr/examples
|
||||
else
|
||||
tar cvzf "$version".tar.gz --exclude=CVS "$version"/{Artistic,INSTALL,README*,changes*,config*,install-sh,Makefile.in,.depend.in,distribute,C,H,VC,console,docs,include,library,misc,pl,LGPL/README,LGPL/pillow/[C-Z]*,LGPL/pillow/*.pl,LGPL/pillow/doc/*info*,LGPL/JPL/jpl.yap,LGPL/JPL/jpl_paths.yap.in,LGPL/JPL/Makefile.in,LGPL/JPL/java,LGPL/JPL/src,build-distr,build-distr,OPTYap,CLPQR,CHR,CLPBN,Logtalk}
|
||||
tar cvzf "$version".tar.gz --exclude=CVS "$version"/{Artistic,INSTALL,README*,changes*,config*,install-sh,Makefile.in,.depend.in,distribute,C,H,VC,console,docs,include,library,misc,pl,LGPL/README,LGPL/pillow/[C-Z]*,LGPL/pillow/*.pl,LGPL/pillow/doc/*info*,LGPL/JPL/jpl.yap,LGPL/JPL/jpl_paths.yap.in,LGPL/JPL/Makefile.in,LGPL/JPL/java,LGPL/JPL/src,build-distr,build-distr,OPTYap,BEAM,CLPQR,CHR,CLPBN,Logtalk}
|
||||
fi
|
||||
|
Reference in New Issue
Block a user