Merge branch 'master' of gitosis@yap.dcc.fc.up.pt:yap-6

This commit is contained in:
Vítor Manuel de Morais Santos Costa 2009-11-18 13:13:51 +00:00
commit 71de4ed52a
18 changed files with 11355 additions and 2287 deletions

View File

@ -4856,9 +4856,9 @@ fetch_next_static_clause(PredEntry *pe, yamop *i_code, Term th, Term tb, Term tr
Terms[2] = tr; Terms[2] = tr;
cl = (StaticClause *)Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredStaticClause->CodeOfPred,Otapl), cp_ptr); cl = (StaticClause *)Yap_FollowIndexingCode(pe, i_code, Terms, NEXTOP(PredStaticClause->CodeOfPred,Otapl), cp_ptr);
UNLOCK(pe->PELock); UNLOCK(pe->PELock);
th = Terms[0]; th = Deref(Terms[0]);
tb = Terms[1]; tb = Deref(Terms[1]);
tr = Terms[2]; tr = Deref(Terms[2]);
/* don't do this!! I might have stored a choice-point and changed ASP /* don't do this!! I might have stored a choice-point and changed ASP
Yap_RecoverSlots(3); Yap_RecoverSlots(3);
*/ */

View File

@ -696,8 +696,8 @@ static CELL *MkDBTerm(register CELL *pt0, register CELL *pt0_end,
continue; continue;
} }
case (CELL)FunctorLongInt: case (CELL)FunctorLongInt:
*StoPoint++ = AbsAppl(CodeMax);
CheckDBOverflow(3); CheckDBOverflow(3);
*StoPoint++ = AbsAppl(CodeMax);
CodeMax = copy_long_int(CodeMax, ap2); CodeMax = copy_long_int(CodeMax, ap2);
++pt0; ++pt0;
continue; continue;

View File

@ -1631,7 +1631,8 @@ JumpToEnv(Term t) {
to the emulator */ to the emulator */
P = (yamop *)FAILCODE; P = (yamop *)FAILCODE;
/* try to recover space */ /* try to recover space */
H = B->cp_h; /* can only do that when we recover space */
/* H = B->cp_h; */
t = clean_trail(t, dbt, B->cp_a1); t = clean_trail(t, dbt, B->cp_a1);
B->cp_a3 = t; B->cp_a3 = t;
if (first_func != NULL) { if (first_func != NULL) {

View File

@ -732,9 +732,6 @@ search_pc_pred(yamop *pc_ptr,clauseentry *beg, clauseentry *end) {
} }
} }
extern void Yap_InitAbsmi(void);
extern int Yap_rational_tree_loop(CELL *pt0, CELL *pt0_end, CELL **to_visit0, CELL **to_visit_max);
static Int profend(void); static Int profend(void);
static int static int

View File

@ -2160,6 +2160,8 @@ check_bom(int sno, StreamDesc *st)
int ch; int ch;
ch = st->stream_getc(sno); ch = st->stream_getc(sno);
if (ch == EOFCHAR)
return TRUE;
switch(ch) { switch(ch) {
case 0xFE: case 0xFE:
{ {

View File

@ -53,8 +53,6 @@ rtree_loop:
to_visit -= 3; to_visit -= 3;
if (to_visit < to_visit_max) { if (to_visit < to_visit_max) {
to_visit = Yap_shift_visit(to_visit, &to_visit_max); to_visit = Yap_shift_visit(to_visit, &to_visit_max);
} }
to_visit[0] = pt0; to_visit[0] = pt0;
to_visit[1] = pt0_end; to_visit[1] = pt0_end;

View File

@ -2542,6 +2542,7 @@ p_variant(void) /* variant terms t1 and t2 */
return FALSE; return FALSE;
} }
static int subsumes_complex(register CELL *pt0, register CELL *pt0_end, register static int subsumes_complex(register CELL *pt0, register CELL *pt0_end, register
CELL *pt1) CELL *pt1)
{ {
@ -2601,6 +2602,8 @@ static int subsumes_complex(register CELL *pt0, register CELL *pt0_end, register
Bind_Global(pt0, new); Bind_Global(pt0, new);
if (d0 != d1) { /* avoid loops */ if (d0 != d1) { /* avoid loops */
Bind_Global(VarOfTerm(new), d1); Bind_Global(VarOfTerm(new), d1);
if (Yap_rational_tree_loop(VarOfTerm(new)-1,VarOfTerm(new),(CELL **)AuxSp,(CELL **)AuxBase))
goto fail;
} }
} else { } else {
if (d0 == d1) continue; if (d0 == d1) continue;
@ -2759,7 +2762,9 @@ p_subsumes(void) /* subsumes terms t1 and t2 */
return (TRUE); return (TRUE);
if (IsVarTerm(t1)) { if (IsVarTerm(t1)) {
Bind(VarOfTerm(t1), t2); Bind(VarOfTerm(t1), t2);
return(TRUE); if (Yap_rational_tree_loop(VarOfTerm(t1)-1,VarOfTerm(t1),(CELL **)AuxSp,(CELL **)AuxBase))
return FALSE;
return TRUE;
} else if (IsVarTerm(t2)) } else if (IsVarTerm(t2))
return(FALSE); return(FALSE);
if (IsAtomOrIntTerm(t1)) { if (IsAtomOrIntTerm(t1)) {

View File

@ -346,6 +346,7 @@ void STD_PROTO(Yap_InitLowLevelTrace,(void));
void STD_PROTO(Yap_udi_init,(void)); void STD_PROTO(Yap_udi_init,(void));
/* unify.c */ /* unify.c */
int STD_PROTO(Yap_rational_tree_loop, (CELL *, CELL *, CELL **, CELL **));
void STD_PROTO(Yap_InitAbsmi,(void)); void STD_PROTO(Yap_InitAbsmi,(void));
void STD_PROTO(Yap_InitUnify,(void)); void STD_PROTO(Yap_InitUnify,(void));
void STD_PROTO(Yap_TrimTrail,(void)); void STD_PROTO(Yap_TrimTrail,(void));

13530
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -11,6 +11,7 @@ dnl store the environment's compilation flags
mycflags="$CFLAGS" mycflags="$CFLAGS"
AC_PROG_CC AC_PROG_CC
AC_PROG_CXX
AC_PROG_AWK AC_PROG_AWK
AC_SUBST(GCC) AC_SUBST(GCC)
AC_SUBST(C_INTERF_FLAGS) AC_SUBST(C_INTERF_FLAGS)
@ -379,9 +380,11 @@ then
if test "$debugyap" = "yes" if test "$debugyap" = "yes"
then then
CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes" CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes"
CXXFLAGS="-O -g -Wall"
C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes" C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes"
else else
CFLAGS="-O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes" CFLAGS="-O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes"
CXXFLAGS="-O3 -fomit-frame-pointer -Wall"
case "`$CC --version < /dev/null`" in case "`$CC --version < /dev/null`" in
*3.4*) CFLAGS="-fno-gcse -fno-crossjumping $CFLAGS" ;; *3.4*) CFLAGS="-fno-gcse -fno-crossjumping $CFLAGS" ;;
esac esac
@ -390,11 +393,13 @@ then
case "$target_cpu" in case "$target_cpu" in
i*86*) i*86*)
CFLAGS="-DBP_FREE $CFLAGS" CFLAGS="-DBP_FREE $CFLAGS"
CXXFLAGS="-DBP_FREE $CXXFLAGS"
;; ;;
sparc*) sparc*)
case "$target_os" in case "$target_os" in
*solaris[2-9]*) dnl *solaris[2-9]*) dnl
CFLAGS="-mno-app-regs -DOPTIMISE_ALL_REGS_FOR_SPARC=1 $CFLAGS" CFLAGS="-mno-app-regs -DOPTIMISE_ALL_REGS_FOR_SPARC=1 $CFLAGS"
CXXFLAGS="-mno-app-regs -DOPTIMISE_ALL_REGS_FOR_SPARC=1 $CFPPLAGS"
;; ;;
esac esac
;; ;;
@ -407,18 +412,23 @@ then
case "$target_cpu" in case "$target_cpu" in
athlon) athlon)
CFLAGS="-march=athlon $CFLAGS" CFLAGS="-march=athlon $CFLAGS"
CXXFLAGS="-march=athlon $CXXFLAGS"
;; ;;
i686*) i686*)
CFLAGS="-march=i686 $CFLAGS" CFLAGS="-march=i686 $CFLAGS"
CXXFLAGS="-march=i686 $CXXFLAGS"
;; ;;
i586*) i586*)
CFLAGS="-march=i586 $CFLAGS" CFLAGS="-march=i586 $CFLAGS"
CXXFLAGS="-march=i586 $CXXFLAGS"
;; ;;
i486*) i486*)
CFLAGS="-march=i486 $CFLAGS" CFLAGS="-march=i486 $CFLAGS"
CXXFLAGS="-march=i486 $CXXFLAGS"
;; ;;
i386*) i386*)
CFLAGS="-march=i386 $CFLAGS" CFLAGS="-march=i386 $CFLAGS"
CXXFLAGS="-march=i386 $CXXFLAGS"
;; ;;
esac esac
fi fi
@ -441,6 +451,7 @@ else
elif test "$CC" = "cl" elif test "$CC" = "cl"
then then
CFLAGS="/nologo" CFLAGS="/nologo"
CXXFLAGS="-/nologo"
CPP="/nologo /E" CPP="/nologo /E"
fi fi
;; ;;
@ -450,8 +461,10 @@ else
if test "$debugyap" = "yes" if test "$debugyap" = "yes"
then then
CFLAGS="-Ae -g -O" CFLAGS="-Ae -g -O"
CXXFLAGS="-Ae -g -O"
else else
CFLAGS="-Ae +O3 +Onolimit" CFLAGS="-Ae +O3 +Onolimit"
CXXFLAGS="-Ae +O3 +Onolimit"
fi fi
fi fi
dnl LDFLAGS="+e UserCPredicate $LDFLAGS" dnl LDFLAGS="+e UserCPredicate $LDFLAGS"
@ -754,6 +767,7 @@ dnl defaults
INSTALL_DLLS="#" INSTALL_DLLS="#"
EXTRA_OBJS="" EXTRA_OBJS=""
SHLIB_LD="#" SHLIB_LD="#"
SHLIB_LOWER_LD="#"
SHLIB_SWI_LD="#" SHLIB_SWI_LD="#"
DO_SECOND_LD="#" DO_SECOND_LD="#"
M4="m4" M4="m4"
@ -775,6 +789,7 @@ case "$target_os" in
then then
SHLIB_SUFFIX=".so" SHLIB_SUFFIX=".so"
SHLIB_LD="$CC -shared -export-dynamic" SHLIB_LD="$CC -shared -export-dynamic"
SHLIB_LOWER_LD="$SHLIB_LD"
SHLIB_SWI_LD="$CC -shared -export-dynamic" SHLIB_SWI_LD="$CC -shared -export-dynamic"
DO_SECOND_LD="" DO_SECOND_LD=""
LIBS="$LIBS -ldl" LIBS="$LIBS -ldl"
@ -833,6 +848,7 @@ case "$target_os" in
#this tells ld to export all non-static symbols, #this tells ld to export all non-static symbols,
#otherwise no external predicates. #otherwise no external predicates.
SHLIB_LD="$CC -shared -export-dynamic" SHLIB_LD="$CC -shared -export-dynamic"
SHLIB_LOWER_LD="$SHLIB_LD"
SHLIB_SWI_LD="$CC -shared -export-dynamic" SHLIB_SWI_LD="$CC -shared -export-dynamic"
DO_SECOND_LD="" DO_SECOND_LD=""
SHLIB_SUFFIX=".sl" SHLIB_SUFFIX=".sl"
@ -881,6 +897,7 @@ dnl Linux has both elf and a.out, in this case we found elf
SHLIB_SUFFIX=".so" SHLIB_SUFFIX=".so"
DO_SECOND_LD="" DO_SECOND_LD=""
SHLIB_LD="ld -n32 -shared -rdata_shared" SHLIB_LD="ld -n32 -shared -rdata_shared"
SHLIB_LOWER_LD="$SHLIB_LD"
SHLIB_SWI_LD="ld -n32 -shared -rdata_shared" SHLIB_SWI_LD="ld -n32 -shared -rdata_shared"
INSTALL_DLLS="" INSTALL_DLLS=""
;; ;;
@ -903,6 +920,7 @@ dnl Linux has both elf and a.out, in this case we found elf
# SHLIB_LD="$CC -bundle -bundle_loader \$(abs_top_builddir)/yap -L\$(abs_top_builddir) -lYap -undefined dynamic_lookup -Wl,-x -dead-strip -dead_strip_dylibs" # SHLIB_LD="$CC -bundle -bundle_loader \$(abs_top_builddir)/yap -L\$(abs_top_builddir) -lYap -undefined dynamic_lookup -Wl,-x -dead-strip -dead_strip_dylibs"
# LDFLAGS="-Wl,-x -dead_strip -dead_strip_dylibs $LDFLAGS" # LDFLAGS="-Wl,-x -dead_strip -dead_strip_dylibs $LDFLAGS"
SHLIB_LD="$CC -bundle -flat_namespace -undefined suppress" SHLIB_LD="$CC -bundle -flat_namespace -undefined suppress"
SHLIB_LOWER_LD="$SHLIB_LD"
SHLIB_SWI_LD="$CC -bundle -flat_namespace -undefined suppress" SHLIB_SWI_LD="$CC -bundle -flat_namespace -undefined suppress"
INSTALL_DLLS="" INSTALL_DLLS=""
CC="$CC -fstrict-aliasing -freorder-blocks -fsched-interblock -Wall -Wstrict-aliasing=2" CC="$CC -fstrict-aliasing -freorder-blocks -fsched-interblock -Wall -Wstrict-aliasing=2"
@ -920,6 +938,7 @@ dnl Linux has both elf and a.out, in this case we found elf
LDFLAGS="-Wl,--export-dynamic $LDFLAGS" LDFLAGS="-Wl,--export-dynamic $LDFLAGS"
SHLIB_CFLAGS="-fPIC" SHLIB_CFLAGS="-fPIC"
SHLIB_LD="ld -Bshareable -x" SHLIB_LD="ld -Bshareable -x"
SHLIB_LOWER_LD="$SHLIB_LD"
SHLIB_SWI_LD="ld -Bshareable -x" SHLIB_SWI_LD="ld -Bshareable -x"
DO_SECOND_LD="" DO_SECOND_LD=""
SHLIB_SUFFIX=".so" SHLIB_SUFFIX=".so"
@ -931,6 +950,7 @@ dnl Linux has both elf and a.out, in this case we found elf
LDFLAGS="-dynamic $LDFLAGS" LDFLAGS="-dynamic $LDFLAGS"
SHLIB_CFLAGS="-fPIC" SHLIB_CFLAGS="-fPIC"
SHLIB_LD="$CC -shared" SHLIB_LD="$CC -shared"
SHLIB_LOWER_LD="$SHLIB_LD"
SHLIB_SWI_LD="$CC -shared" SHLIB_SWI_LD="$CC -shared"
DO_SECOND_LD="" DO_SECOND_LD=""
SHLIB_SUFFIX=".so" SHLIB_SUFFIX=".so"
@ -942,6 +962,7 @@ dnl Linux has both elf and a.out, in this case we found elf
YAPLIB="libWYap.a" YAPLIB="libWYap.a"
SHLIB_CFLAGS="" SHLIB_CFLAGS=""
SHLIB_LD="\$(CC) -shared -Wl,--export-all-symbols ../../yap.dll" SHLIB_LD="\$(CC) -shared -Wl,--export-all-symbols ../../yap.dll"
SHLIB_LOWER_LD="\$(CC) -shared -Wl,--export-all-symbols ../../../yap.dll"
SHLIB_SWI_LD="\$(CC) -shared -Wl,--export-all-symbols ../../yap.dll ../../packages/PLStream/plstream.dll" SHLIB_SWI_LD="\$(CC) -shared -Wl,--export-all-symbols ../../yap.dll ../../packages/PLStream/plstream.dll"
SHLIB_SUFFIX=".dll" SHLIB_SUFFIX=".dll"
C_PARSER_FLAGS="$C_INTERF_FLAGS" C_PARSER_FLAGS="$C_INTERF_FLAGS"
@ -1251,6 +1272,7 @@ AC_SUBST(INSTALL_DLLS)
dnl if we need to merge several .o files into a single dll. dnl if we need to merge several .o files into a single dll.
AC_SUBST(MERGE_DLL_OBJS) AC_SUBST(MERGE_DLL_OBJS)
dnl C-flags used to compile a file that will be loaded dynamically dnl C-flags used to compile a file that will be loaded dynamically
AC_SUBST(CXXFLAGS)
AC_SUBST(SHLIB_CFLAGS) AC_SUBST(SHLIB_CFLAGS)
dnl suffix for loadable binary (.so,.dll,.o) dnl suffix for loadable binary (.so,.dll,.o)
AC_SUBST(SHLIB_SUFFIX) AC_SUBST(SHLIB_SUFFIX)
@ -1260,6 +1282,7 @@ AC_SUBST(EXEC_SUFFIX)
dnl how to call the loader dnl how to call the loader
AC_SUBST(DO_SECOND_LD) AC_SUBST(DO_SECOND_LD)
AC_SUBST(SHLIB_LD) AC_SUBST(SHLIB_LD)
AC_SUBST(SHLIB_LOWER_LD)
AC_SUBST(SHLIB_SWI_LD) AC_SUBST(SHLIB_SWI_LD)
AC_SUBST(DYNLIB_LD) AC_SUBST(DYNLIB_LD)
dnl objects in YAP library dnl objects in YAP library

@ -1 +1 @@
Subproject commit c325e4564bb8d4e32c27f2061df85f13d315974e Subproject commit e071f01c1d9015e6d3fabc73092a6e902541485a

@ -1 +1 @@
Subproject commit a2d2f03107eecd45462cd61a678035132cf06326 Subproject commit eb6d27251c2548c25e6d37fff2a27a014caaa7aa

View File

@ -18,7 +18,8 @@ LIBDIR=$(EROOTDIR)/lib/Yap
# #
# #
CC=@CC@ CC=@CC@
CFLAGS= @CFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../../.. -I$(srcdir)/../../../include CXX=@CXX@
CXXFLAGS= @CXXFLAGS@ $(YAP_EXTRAS) $(DEFS) -I$(srcdir) -I../../.. -I$(srcdir)/../../../include
# #
# #
# You shouldn't need to change what follows. # You shouldn't need to change what follows.
@ -61,10 +62,10 @@ all: $(SOBJS)
# default rule # default rule
%.o : $(srcdir)/%.C %.o : $(srcdir)/%.C
$(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $< -o $@ $(CXX) -c $(CXXFLAGS) $(SHLIB_CFLAGS) $< -o $@
@DO_SECOND_LD@pl-minisat@SHLIB_SUFFIX@: $(OBJS) @DO_SECOND_LD@pl-minisat@SHLIB_SUFFIX@: $(OBJS)
@DO_SECOND_LD@ @SHLIB_LD@ -o pl-minisat@SHLIB_SUFFIX@ $(OBJS) @DO_SECOND_LD@ @SHLIB_LOWER_LD@ -o pl-minisat@SHLIB_SUFFIX@ $(OBJS)
install: all install: all
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(LIBDIR) $(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(LIBDIR)
@ -75,9 +76,9 @@ clean:
depend: $(HEADERS) $(C_SOURCES) depend: $(HEADERS) $(C_SOURCES)
-@if test "$(GCC)" = yes; then\ -@if test "$(GCC)" = yes; then\
$(CC) -MM -MG $(CFLAGS) -I$(srcdir) -I$(srcdir)/../../include -I$(srcdir)/../../H $(C_SOURCES) >> Makefile;\ $(CC) -MM -MG $(CFLAGS) -I$(srcdir) -I$(srcdir)/../../../include -I$(srcdir)/../../../H $(C_SOURCES) >> Makefile;\
else\ else\
makedepend -f - -- $(CFLAGS) -I$(srcdir)/../../H -I$(srcdir)/../../include -- $(C_SOURCES) |\ makedepend -f - -- $(CFLAGS) -I$(srcdir)/../../../H -I$(srcdir)/../../../include -- $(C_SOURCES) |\
sed 's|.*/\([^:]*\):|\1:|' >> Makefile ;\ sed 's|.*/\([^:]*\):|\1:|' >> Makefile ;\
fi fi

View File

@ -163,6 +163,7 @@ true :- true.
'$run_atom_goal'(GA), '$run_atom_goal'(GA),
set_value('$live','$false'). set_value('$live','$false').
'$enter_top_level' :- '$enter_top_level' :-
'$disable_docreep',
prompt(_,' ?- '), prompt(_,' ?- '),
prompt(' | '), prompt(' | '),
'$run_toplevel_hooks', '$run_toplevel_hooks',

View File

@ -384,11 +384,18 @@ debugging :-
fail. fail.
% if we are in % if we are in
'$loop_spy2'(GoalNumber, G, Module, CalledFromDebugger, CP) :- '$loop_spy2'(GoalNumber, G0, Module, CalledFromDebugger, CP) :-
/* the following choice point is where the predicate is called */ /* the following choice point is where the predicate is called */
b_getval('$spy_glist',[info(_,_,_,Retry,Det)|_]), /* get goal list */ (
( '$is_metapredicate'(G0, Module)
/* call port */ ->
'$meta_expansion'(G0,Module,Module,Module,G,[])
;
G = G0
),
b_getval('$spy_glist',[info(_,_,_,Retry,Det)|_]), /* get goal list */
(
/* call port */
'$enter_goal'(GoalNumber, G, Module), '$enter_goal'(GoalNumber, G, Module),
'$spycall'(G, Module, CalledFromDebugger, Retry), '$spycall'(G, Module, CalledFromDebugger, Retry),
'$disable_docreep', '$disable_docreep',
@ -501,7 +508,7 @@ debugging :-
CP is '$last_choice_pt', CP is '$last_choice_pt',
'$static_clause'(G,M,_,R), '$static_clause'(G,M,_,R),
% I may backtrack to here from far away % I may backtrack to here from far away
'$disable_docreep', '$disable_docreep',
( (
'$continue_debugging'(no, '$execute_clause'(G, M, R, CP)) '$continue_debugging'(no, '$execute_clause'(G, M, R, CP))
; ;
@ -549,12 +556,14 @@ debugging :-
% ( SL = L -> SLL = '>' ; SLL = ' '), % ( SL = L -> SLL = '>' ; SLL = ' '),
SLL = ' ', SLL = ' ',
( Module\=prolog, ( Module\=prolog,
Module\=user -> Module\=user
format(user_error,'~a~a~a (~d) ~q: ~a:',[Det,CSPY,SLL,L,P0,Module]) ->
GW = Module:G
; ;
format(user_error,'~a~a~a (~d) ~q:',[Det,CSPY,SLL,L,P0]) GW = G
), ),
'$debugger_write'(user_error,G). format(user_error,'~a~a~a (~d) ~q:',[Det,CSPY,SLL,L,P0]),
'$debugger_write'(user_error,GW).
'$unleashed'(call) :- get_value('$leash',L), L /\ 2'1000 =:= 0. %' '$unleashed'(call) :- get_value('$leash',L), L /\ 2'1000 =:= 0. %'
'$unleashed'(exit) :- get_value('$leash',L), L /\ 2'0100 =:= 0. %' '$unleashed'(exit) :- get_value('$leash',L), L /\ 2'0100 =:= 0. %'

View File

@ -94,7 +94,7 @@ module(N) :-
Arity2 is Arity+2, Arity2 is Arity+2,
'$process_exports'(Exports,Mod,ExportedPreds). '$process_exports'(Exports,Mod,ExportedPreds).
'$process_exports'([op(Prio,Assoc,Name)|Exports],Mod,ExportedPreds) :- !, '$process_exports'([op(Prio,Assoc,Name)|Exports],Mod,ExportedPreds) :- !,
op(Prio,Assoc,Name), op(Prio,Assoc,prolog:Name),
'$process_exports'(Exports,Mod,ExportedPreds). '$process_exports'(Exports,Mod,ExportedPreds).
'$process_exports'([Trash|_],Mod,_) :- '$process_exports'([Trash|_],Mod,_) :-
'$do_error'(type_error(predicate_indicator,Trash),module(Mod,[Trash])). '$do_error'(type_error(predicate_indicator,Trash),module(Mod,[Trash])).

View File

@ -95,6 +95,10 @@ op(P,T,V) :-
'$op2'(P, T, A), '$op2'(P, T, A),
'$opl'(P, T, As). '$opl'(P, T, As).
'$op2'(P,T,A) :-
atom(A),
prolog_load_context(module, Mod), Mod \= user, !,
'$opdec'(P,T,A,Mod).
'$op2'(P,T,A) :- '$op2'(P,T,A) :-
atom(A), !, atom(A), !,
'$opdec'(P,T,A,prolog). '$opdec'(P,T,A,prolog).

View File

@ -132,13 +132,13 @@ open(F,T,S,Opts) :-
'$process_open_opts'(L,N0,N, Aliases, Encoding, BOM, DefaultExpand). '$process_open_opts'(L,N0,N, Aliases, Encoding, BOM, DefaultExpand).
'$value_open_opt'(text,_,1,X) :- X is 128-2. % default '$value_open_opt'(text,_,1,X) :- X is 0xffff-2. % default
'$value_open_opt'(binary,_,2, X) :- X is 128-1. '$value_open_opt'(binary,_,2, X) :- X is 0xffff-1.
'$value_open_opt'(true,_,4, X) :- X is 128-8. '$value_open_opt'(true,_,4, X) :- X is 0xffff-8.
'$value_open_opt'(false,_,8, X) :- X is 128-4. '$value_open_opt'(false,_,8, X) :- X is 0xffff-4.
'$value_open_opt'(error,_,16, X) :- X is 128-32-64. '$value_open_opt'(error,_,16, X) :- X is 0xffff-0x0060.
'$value_open_opt'(eof_code,_,32, X) :- X is 128-16-64. '$value_open_opt'(eof_code,_,32, X) :- X is 0xffff-0x0050.
'$value_open_opt'(reset,64, X) :- X is 128-32-16. '$value_open_opt'(reset, _, 64, X) :- X is 0xffff-0x0030.
%128 -> use bom %128 -> use bom
%256 -> do not use bom %256 -> do not use bom
%512 -> do prolog on unrepresentable char %512 -> do prolog on unrepresentable char