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:
rslopes 2005-09-08 21:59:58 +00:00
parent 590352c2c6
commit ed92d70e68
11 changed files with 115 additions and 28 deletions

View File

@ -11,8 +11,11 @@
* File: YapOpcodes.h * * File: YapOpcodes.h *
* comments: Central Table with all YAP opcodes * * 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 $ * $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 * 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. * 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 #else
OPCODE(or_last ,p), OPCODE(or_last ,p),
#endif /* YAPOR */ #endif /* YAPOR */
#ifdef BEAM
OPCODE(run_eam ,x),
#endif
OPCODE(call_cpred ,sla), OPCODE(call_cpred ,sla),
OPCODE(call_usercpred ,sla), OPCODE(call_usercpred ,sla),
OPCODE(call_c_wfail ,sdl), OPCODE(call_c_wfail ,sdl),

View File

@ -560,6 +560,9 @@ typedef struct pred_entry
#ifdef TABLING #ifdef TABLING
tab_ent_ptr TableOfPred; tab_ent_ptr TableOfPred;
#endif /* TABLING */ #endif /* TABLING */
#ifdef BEAM
struct Predicates *beamTable;
#endif
Term ModuleOfPred; /* module for this definition */ Term ModuleOfPred; /* module for this definition */
/* This must be at an odd number of cells, otherwise it /* This must be at an odd number of cells, otherwise it
will not be aligned on RISC machines */ will not be aligned on RISC machines */

View File

@ -447,7 +447,6 @@ Yap_unify_constant(register Term a, register Term cons)
} else return(FALSE); } else return(FALSE);
} }
deref_body(a,pt,unify_cons_unk,unify_cons_nonvar); deref_body(a,pt,unify_cons_unk,unify_cons_nonvar);
BIND(pt,cons,wake_for_cons); BIND(pt,cons,wake_for_cons);
#ifdef COROUTINING #ifdef COROUTINING

View File

@ -36,7 +36,13 @@ add_int(Int i, Int j E_ARGS)
} }
#endif #endif
/* Integer overflow, we need to use big integers */ /* Integer overflow, we need to use big integers */
#ifdef BEAM
RINT(x); RINT(x);
return( MkIntegerTerm (x));
#else
RINT(x);
#endif
} }
/* Extended version with two possibilities: /* Extended version with two possibilities:

View File

@ -144,6 +144,31 @@ typedef enum compiler_op {
#ifdef TABLING_INNER_CUTS #ifdef TABLING_INNER_CUTS
clause_with_cut_op, clause_with_cut_op,
#endif /* TABLING_INNER_CUTS */ #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, fetch_args_for_bccall,
bccall_op, bccall_op,
blob_op blob_op
@ -241,7 +266,6 @@ typedef struct intermediates {
#define TempVar 0x02000000L #define TempVar 0x02000000L
#define PermVar 0x03000000L #define PermVar 0x03000000L
#define save_b_flag 0x10000 #define save_b_flag 0x10000
#define commit_b_flag 0x10001 #define commit_b_flag 0x10001
#define save_appl_flag 0x10002 #define save_appl_flag 0x10002

View File

@ -12,8 +12,11 @@
* File: rclause.h * * File: rclause.h *
* comments: walk through a clause * * 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 $ * $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 * 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. * 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 */ /* instructions type s */
case _write_n_voids: case _write_n_voids:
case _pop_n: case _pop_n:
#ifdef BEAM
case _run_eam:
#endif
#ifdef TABLING #ifdef TABLING
case _table_new_answer: case _table_new_answer:
#endif /* TABLING */ #endif /* TABLING */

View File

@ -27,7 +27,7 @@ INCLUDEDIR=$(ROOTDIR)/include/Yap
# #
INFODIR=$(SHAREDIR)/info INFODIR=$(SHAREDIR)/info
# #3
# Add this flag to YAP_EXTRAS if you need the extension: # Add this flag to YAP_EXTRAS if you need the extension:
# -DRATIONAL_TREES: allow unification and builtins over rational trees # -DRATIONAL_TREES: allow unification and builtins over rational trees
# -DCOROUTINING: implement extra control primitives # -DCOROUTINING: implement extra control primitives
@ -53,7 +53,7 @@ YAP_EXTRAS=@YAP_EXTRAS@
# #
CC=@CC@ CC=@CC@
MPI_CC=@MPI_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) CFLAGS= @CFLAGS@ $(YAP_EXTRAS) $(DEFS) $(CPPFLAGS)
C_INTERF_FLAGS= @C_INTERF_FLAGS@ $(YAP_EXTRAS) $(DEFS) $(CPPFLAGS) -I$(srcdir)/include C_INTERF_FLAGS= @C_INTERF_FLAGS@ $(YAP_EXTRAS) $(DEFS) $(CPPFLAGS) -I$(srcdir)/include
C_PARSER_FLAGS= @C_PARSER_FLAGS@ $(YAP_EXTRAS) $(DEFS) $(CPPFLAGS) C_PARSER_FLAGS= @C_PARSER_FLAGS@ $(YAP_EXTRAS) $(DEFS) $(CPPFLAGS)
@ -113,6 +113,7 @@ HEADERS = \
$(srcdir)/H/tracer.h \ $(srcdir)/H/tracer.h \
$(srcdir)/H/threads.h \ $(srcdir)/H/threads.h \
$(srcdir)/H/yapio.h \ $(srcdir)/H/yapio.h \
$(srcdir)/BEAM/eam.h $(srcdir)/BEAM/eamamasm.h \
$(srcdir)/OPTYap/opt.config.h \ $(srcdir)/OPTYap/opt.config.h \
$(srcdir)/OPTYap/opt.proto.h $(srcdir)/OPTYap/opt.structs.h \ $(srcdir)/OPTYap/opt.proto.h $(srcdir)/OPTYap/opt.structs.h \
$(srcdir)/OPTYap/opt.macros.h $(srcdir)/OPTYap/or.macros.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/tracer.c $(srcdir)/C/unify.c $(srcdir)/C/userpreds.c \
$(srcdir)/C/utilpreds.c $(srcdir)/C/write.c $(srcdir)/console/yap.c \ $(srcdir)/C/utilpreds.c $(srcdir)/C/write.c $(srcdir)/console/yap.c \
$(srcdir)/C/ypsocks.c $(srcdir)/C/ypstdio.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.memory.c $(srcdir)/OPTYap/opt.misc.c \
$(srcdir)/OPTYap/opt.init.c \ $(srcdir)/OPTYap/opt.init.c \
$(srcdir)/OPTYap/opt.preds.c $(srcdir)/OPTYap/or.engine.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 \ or.engine.o or.cowengine.o or.sbaengine.o or.scheduler.o or.cut.o \
tab.tries.o tab.suspend.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) OBJECTS = yap.o $(LIB_OBJECTS)
@ -428,6 +435,19 @@ mpi.o: $(srcdir)/library/mpi/mpi.c
mpe.o: $(srcdir)/library/mpi/mpe.c mpe.o: $(srcdir)/library/mpi/mpe.c
$(MPI_CC) -c $(CFLAGS) $(srcdir)/library/mpi/mpe.c -o $@ $(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) ## CPP'ed files (for macro debugging)
%.i : $(srcdir)/C/%.c %.i : $(srcdir)/C/%.c

6
README
View File

@ -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 originally developed at the Universidade do Porto by Luis Damas and
Vitor Santos Costa, with contributions from the Edinburgh Prolog Vitor Santos Costa, with contributions from the Edinburgh Prolog
library, the C-Prolog manual authors, Ricardo Rocha, and many library, the C-Prolog manual authors, Ricardo Rocha, and many
others. You should read the rest of this file for information on what others. You should read the rest of this file for information on what
Yap is and for instructions on how to build it. 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: 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 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 and Linux 2.* (RedHat 4.0 through 5.2, Debian 2.*) in both the x86 and

13
configure vendored
View File

@ -857,6 +857,7 @@ Optional Features:
--enable-max-performance try using the best flags for specific architecture --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-debug-yap enable C-debugging for YAP
--enable-eam enable EAM on YAP
--enable-cygwin use cygwin library in WIN32 --enable-cygwin use cygwin library in WIN32
--enable-dynamic-loading compile Yap as a DLL --enable-dynamic-loading compile Yap as a DLL
--enable-use-malloc use malloc to allocate memory --enable-use-malloc use malloc to allocate memory
@ -2367,6 +2368,13 @@ if test "${enable_debug_yap+set}" = set; then
else else
debugyap=no debugyap=no
fi; 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. # Check whether --enable-cygwin or --disable-cygwin was given.
if test "${enable_cygwin+set}" = set; then if test "${enable_cygwin+set}" = set; then
enableval="$enable_cygwin" enableval="$enable_cygwin"
@ -6200,6 +6208,11 @@ if test "$debugyap" = "yes"
YAP_EXTRAS="$YAP_EXTRAS -DDEBUG=1" YAP_EXTRAS="$YAP_EXTRAS -DDEBUG=1"
fi fi
if test "$eam" = "yes"
then
YAP_EXTRAS="$YAP_EXTRAS -DBEAM"
fi
if test "$wamprofile" = "yes" if test "$wamprofile" = "yes"
then then
YAP_EXTRAS="$YAP_EXTRAS -DANALYST=1" YAP_EXTRAS="$YAP_EXTRAS -DANALYST=1"

View File

@ -64,6 +64,9 @@ AC_ARG_ENABLE(max-memory,
AC_ARG_ENABLE(debug-yap, AC_ARG_ENABLE(debug-yap,
[ --enable-debug-yap enable C-debugging for YAP ], [ --enable-debug-yap enable C-debugging for YAP ],
debugyap="$enableval", debugyap=no) debugyap="$enableval", debugyap=no)
AC_ARG_ENABLE(eam,
[ --enable-eam enable EAM on YAP ],
eam="$enableval", eam=no)
AC_ARG_ENABLE(cygwin, AC_ARG_ENABLE(cygwin,
[ --enable-cygwin use cygwin library in WIN32 ], [ --enable-cygwin use cygwin library in WIN32 ],
cygwin="$enableval", cygwin=no) cygwin="$enableval", cygwin=no)
@ -676,6 +679,11 @@ if test "$debugyap" = "yes"
YAP_EXTRAS="$YAP_EXTRAS -DDEBUG=1" YAP_EXTRAS="$YAP_EXTRAS -DDEBUG=1"
fi fi
if test "$eam" = "yes"
then
YAP_EXTRAS="$YAP_EXTRAS -DBEAM"
fi
if test "$wamprofile" = "yes" if test "$wamprofile" = "yes"
then then
YAP_EXTRAS="$YAP_EXTRAS -DANALYST=1" YAP_EXTRAS="$YAP_EXTRAS -DANALYST=1"

View File

@ -7,6 +7,8 @@ cd C
splat splat
cd ../H cd ../H
splat splat
cd ../BEAM
splat
cd ../OPTYap cd ../OPTYap
splat splat
cd ../VC cd ../VC
@ -81,7 +83,7 @@ cd examples
splat splat
cd ../../../.. cd ../../../..
if test "$1" = "--small"; then 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 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 fi