enable path expansion by default

This commit is contained in:
Vítor Santos Costa 2015-04-24 10:03:44 -06:00
parent d5ce9a1376
commit 0ed3ee4fc4
16 changed files with 1551 additions and 1566 deletions

View File

@ -1010,9 +1010,6 @@ p_unary_is( USES_REGS1 )
}
out= eval1(p->FOfEE, top PASS_REGS);
if ((err=Yap_FoundArithError())) {
Functor f = Yap_MkFunctor( name, 1 );
Term t = Yap_MkApplTerm( f, 1, &top );
Yap_EvalError(err, t ,"error in %s/1", RepAtom(name)->StrOfAE);
return FALSE;
}
return Yap_unify_constant(ARG1,out);

File diff suppressed because it is too large Load Diff

View File

@ -935,6 +935,9 @@ you don't. */
#cmakedefine HAVE_OPENDIR ${HAVE_OPENDIR}
#endif
/* Define to 1 if you have the <openssl/ripemd.h> header file. */
#cmakedefine HAVE_OPENSSL_RIPEMD_H ${HAVE_OPENSSL_RIPEMD_H}
/* Define to 1 if you have the `pipe2' function. */
#ifndef HAVE_PIPE2
#cmakedefine HAVE_PIPE2 ${HAVE_PIPE2}

View File

@ -159,6 +159,21 @@
/* Define to 1 if you have the <ctype.h> header file. */
#undef HAVE_CTYPE_H
/* Define to 1 if you have the <cuddInt.h> header file. */
#undef HAVE_CUDDINT_H
/* Define to 1 if you have the <cudd/cuddInt.h> header file. */
#undef HAVE_CUDD_CUDDINT_H
/* Define to 1 if you have the <cudd/cudd.h> header file. */
#undef HAVE_CUDD_CUDD_H
/* Define to 1 if you have the <cudd.h> header file. */
#undef HAVE_CUDD_H
/* Define to 1 if you have the <cudd/util.h> header file. */
#undef HAVE_CUDD_UTIL_H
/* Define to 1 if you have the declaration of `rl_catch_signals ', and to 0 if
you don't. */
#undef HAVE_DECL_RL_CATCH_SIGNALS_
@ -535,6 +550,9 @@
/* Define to 1 if you have the `opendir' function. */
#undef HAVE_OPENDIR
/* Define to 1 if you have the <openssl/ripemd.h> header file. */
#undef HAVE_OPENSSL_RIPEMD_H
/* Define to 1 if you have the `pipe2' function. */
#undef HAVE_PIPE2
@ -881,6 +899,9 @@
/* Define to 1 if you have the `usleep' function. */
#undef HAVE_USLEEP
/* Define to 1 if you have the <util.h> header file. */
#undef HAVE_UTIL_H
/* Define to 1 if you have the `utime' function. */
#undef HAVE_UTIME

15
configure vendored
View File

@ -8377,7 +8377,7 @@ fi
done
for ac_header in netdb.h netinet/in.h netinet/tcp.h pwd.h regex.h shlobj.h
for ac_header in netdb.h netinet/in.h netinet/tcp.h openssl/ripemd.h pwd.h regex.h shlobj.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@ -13451,6 +13451,8 @@ mkdir -p packages/bdd
if test "$PKG_BDDLIB" != ""; then
ac_config_files="$ac_config_files packages/bdd/Makefile"
ac_config_files="$ac_config_files packages/bdd/cudd_config.h"
ac_config_files="$ac_config_files packages/ProbLog/simplecudd/Makefile"
ac_config_files="$ac_config_files packages/ProbLog/simplecudd_lfi/Makefile"
@ -14132,7 +14134,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 14135 "configure" */
/* #line 14137 "configure" */
public class Test {
}
EOF
@ -14308,7 +14310,7 @@ EOF
if uudecode$EXEEXT Test.uue; then
ac_cv_prog_uudecode_base64=yes
else
echo "configure: 14311: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: 14313: uudecode had trouble decoding base 64 file 'Test.uue'" >&5
echo "configure: failed file was:" >&5
cat Test.uue >&5
ac_cv_prog_uudecode_base64=no
@ -14439,7 +14441,7 @@ else
JAVA_TEST=Test.java
CLASS_TEST=Test.class
cat << \EOF > $JAVA_TEST
/* #line 14442 "configure" */
/* #line 14444 "configure" */
public class Test {
}
EOF
@ -14474,7 +14476,7 @@ JAVA_TEST=Test.java
CLASS_TEST=Test.class
TEST=Test
cat << \EOF > $JAVA_TEST
/* [#]line 14477 "configure" */
/* [#]line 14479 "configure" */
public class Test {
public static void main (String args[]) {
System.exit (0);
@ -16039,6 +16041,7 @@ do
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"YapTermConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS YapTermConfig.h" ;;
"packages/bdd/Makefile") CONFIG_FILES="$CONFIG_FILES packages/bdd/Makefile" ;;
"packages/bdd/cudd_config.h") CONFIG_FILES="$CONFIG_FILES packages/bdd/cudd_config.h" ;;
"packages/ProbLog/simplecudd/Makefile") CONFIG_FILES="$CONFIG_FILES packages/ProbLog/simplecudd/Makefile" ;;
"packages/ProbLog/simplecudd_lfi/Makefile") CONFIG_FILES="$CONFIG_FILES packages/ProbLog/simplecudd_lfi/Makefile" ;;
"packages/cplint/Makefile") CONFIG_FILES="$CONFIG_FILES packages/cplint/Makefile" ;;
@ -17623,6 +17626,7 @@ mkdir -p packages/prism/src/c/up
mkdir -p packages/prism/src/prolog
mkdir -p packages/ProbLog
mkdir -p packages/ProbLog/simplecudd
mkdir -p packages/ProbLog/simplecudd_lfi
mkdir -p packages/R
mkdir -p packages/RDF
mkdir -p packages/real
@ -18478,6 +18482,7 @@ do
"config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
"YapTermConfig.h") CONFIG_HEADERS="$CONFIG_HEADERS YapTermConfig.h" ;;
"packages/bdd/Makefile") CONFIG_FILES="$CONFIG_FILES packages/bdd/Makefile" ;;
"packages/bdd/cudd_config.h") CONFIG_FILES="$CONFIG_FILES packages/bdd/cudd_config.h" ;;
"packages/ProbLog/simplecudd/Makefile") CONFIG_FILES="$CONFIG_FILES packages/ProbLog/simplecudd/Makefile" ;;
"packages/ProbLog/simplecudd_lfi/Makefile") CONFIG_FILES="$CONFIG_FILES packages/ProbLog/simplecudd_lfi/Makefile" ;;
"packages/cplint/Makefile") CONFIG_FILES="$CONFIG_FILES packages/cplint/Makefile" ;;

View File

@ -1325,7 +1325,7 @@ AC_CHECK_HEADERS(errno.h execinfo.h fcntl.h fenv.h)
AC_CHECK_HEADERS(float.h fpu_control.h ieeefp.h inttypes.h io.h)
AC_CHECK_HEADERS(libgen.h limits.h)
AC_CHECK_HEADERS(malloc.h math.h memory.h)
AC_CHECK_HEADERS(netdb.h netinet/in.h netinet/tcp.h pwd.h regex.h shlobj.h)
AC_CHECK_HEADERS(netdb.h netinet/in.h netinet/tcp.h openssl/ripemd.h pwd.h regex.h shlobj.h)
AC_CHECK_HEADERS(siginfo.h signal.h stdarg.h stdbool.h)
AC_CHECK_HEADERS(stdint.h string.h strings.h stropts.h)
AC_CHECK_HEADERS(sys/conf.h sys/dir.h sys/file.h)
@ -2202,8 +2202,6 @@ AC_CONFIG_FILES([packages/Dialect.defs])
AC_CONFIG_FILES([packages/meld/Makefile])
AC_CONFIG_FILES([packages/xml/Makefile])
AC_CONFIG_FILES([packages/ProbLog/Makefile ])
AC_CONFIG_FILES([packages/ProbLog/simplecudd/Makefile ])
AC_CONFIG_FILES([packages/ProbLog/simplecudd_lfi/Makefile ])
AC_CONFIG_FILES([swi/library/Makefile])
AC_CONFIG_FILES([swi/library/clp/Makefile])

View File

@ -589,7 +589,7 @@ strings of wide characters:
</li>
<li>YAP_Term YAP_NWideBufferToString(wchar_t \* _buf_, size_t _len_)
</li>
<li>YAP_Term YAP_BufferToAtomList(char \* _buf_)
<li>YAP_Term YAP_BufferToAtomList(char \* _buf_)
</li>
<li>YAP_Term YAP_NBufferToAtomList(char \* _buf_, size_t _len_)
</li>
@ -787,7 +787,7 @@ The next one returns the length of a well-formed list _t_, or
`-1` otherwise:
<ul>
<li>Int YAP_ListLength(YAP_Term t)
<li>Int YAP_ListLength(YAP_Term t)
</li>
</ul>

View File

@ -526,9 +526,10 @@ handle_system_error(Error, off, G) :-
throw(error(system_error(Message),G)).
handle_system_error(Error, _Id, _Ignore, _G) :- var(Error), !.
handle_system_error(Error, SIG, off, G) :- integer(Error), !,
error_message(Error, Message).
handle_system_error(signal, SIG, off, G) :- atom(Error), !,
handle_system_error(Error, _SIG, off, G) :- integer(Error), !,
error_message(Error, Message),
throw(error(system_error(Message),G)).
handle_system_error(signal, SIG, off, G) :- !,
throw(error(system_error(child_signal(SIG)),G)).
handle_system_error(stopped, SIG, off, G) :-
throw(error(system_error(child_stopped(SIG)),G)).

View File

@ -543,7 +543,7 @@ get_file_name(term_t n, char **namep, char *tmp, int flags)
{ fid_t fid;
if ( (fid = PL_open_foreign_frame()) )
{ predicate_t pred = PL_predicate("absolute_file_name", 3, "system");
{ predicate_t pred = PL_predicate("absolute_file_name", 3, "prolog");
term_t av = PL_new_term_refs(3);
term_t options = PL_copy_term_ref(av+2);
int rc = TRUE;
@ -634,12 +634,11 @@ PL_get_file_name(term_t n, char **namep, int flags)
if ( (rc=get_file_name(n, &name, buf, flags)) )
{ if ( (flags & PL_FILE_OSPATH) )
{ if ( !(name = OsPath(name, ospath)) )
{ if ( !(name = OsPath(name, ospath)) )
return FALSE;
}
*namep = buffer_string(name, BUF_RING);
}
return rc;
}

View File

@ -1215,7 +1215,7 @@ initPrologFlags(void)
setPrologFlag("toplevel_var_size", FT_INTEGER, 1000);
setPrologFlag("toplevel_print_anon", FT_BOOL, TRUE, 0);
setPrologFlag("toplevel_prompt", FT_ATOM, "~m~d~l~! ?- ");
setPrologFlag("file_name_variables", FT_BOOL, FALSE, PLFLAG_FILEVARS);
setPrologFlag("file_name_variables", FT_BOOL, TRUE, PLFLAG_FILEVARS);
setPrologFlag("fileerrors", FT_BOOL, TRUE, PLFLAG_FILEERRORS);
#ifdef __unix__
setPrologFlag("unix", FT_BOOL|FF_READONLY, TRUE, 0);

View File

@ -2,7 +2,7 @@
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% $Date: 2011-11-28 14:41:26 +0100 (Mon, 28 Nov 2011) $
% $Date: 2011-11-28 14:41:26 +0100 (Mon, 28 Nov 2011) $
% $Revision: 6764 $
%
% This file is part of ProbLog
@ -412,24 +412,17 @@ logger_start_timer(Name) :-
(
statistics(walltime,[StartTime,_]),
bb_put(Key,StartTime)
);(
bb_get(Key,_)
)
;
(
bb_get(Key,_)
->
(
write('logger_start_timer, timer '),
write(Name),
write(' is already started'),
nl,
fail
);(
write('logger_start_timer, timer '),
write(Name),
write(' is not defined'),
nl,
fail
)
)
),!.
format(user_error, 'logger_start_timer, timer ~a is already started~n', [Name])
;
format(user_error, 'logger_start_timer, timer ~a is not defined~n', [Name])
)
),
!.
logger_stop_timer(Name) :-

View File

@ -219,7 +219,7 @@
% load library modules
:- use_module(library(system), [exec/3, file_exists/1,wait/2]).
:- use_module(library(system), [exec/3, file_exists/1,wait/2, md5/3]).
:- use_module(library(lists), [memberchk/2]).
:- yap_flag(arithmetic_exceptions, false).
@ -292,57 +292,27 @@ concat_path_with_filename(Path, File_Name, Result):-
%========================================================================
calc_md5(Filename,MD5):-
catch(calc_md5_intern(Filename,'md5sum',MD5),_,fail),
!.
calc_md5(Filename,MD5):-
catch(calc_md5_intern(Filename,'md5 -r',MD5),_,fail),
% used in Mac OS
% the -r makes the output conform with md5sum
catch(calc_md5_intern(Filename,MD5),_,fail),
!.
calc_md5(Filename,MD5):-
throw(md5error(calc_md5(Filename,MD5))).
calc_md5_intern(Filename,Command,MD5) :-
calc_md5_intern(Filename,MD5) :-
( file_exists(Filename) -> true ; throw(md5_file(Filename)) ),
file_to_codes(Filename, S, []),
md5( S, MD5, [] ),
format('~s => ~s~n', [S,MD5]).
atomic_concat([Command,' "',Filename,'"'],Call),
% execute the md5 command
exec(Call,[null,pipe(S),null],PID),
bb_put(calc_md5_temp,End-End), % use difference list
bb_put(calc_md5_temp2,0),
file_to_codes( F, Codes, LF ) :-
open(F, read, S),
get_codes( S, Codes, LF).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
( % read 32 Bytes from stdout of process
repeat,
get_byte(S,C),
(
C== -1
->
(
close(S),
wait(PID,_Status),
throw(md5error('premature end of output stream, please check os.yap calc_md5/2'))
);
true
),
bb_get(calc_md5_temp,List-[C|NewEnd]),
bb_put(calc_md5_temp,List-NewEnd),
bb_get(calc_md5_temp2,OldLength),
NewLength is OldLength+1,
bb_put(calc_md5_temp2,NewLength),
NewLength=32
),
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
get_codes(S, [C|L], LF) :-
get_code(S, C),
C \= -1,
!,
close(S),
wait(PID,_Status),
bb_delete(calc_md5_temp, FinalList-[]),
bb_delete(calc_md5_temp2,_),
atom_codes(MD5,FinalList).
get_codes(S, L, LF).
get_codes(_, LF, LF).
%========================================================================
%=
@ -364,5 +334,5 @@ path_grouping(PathSep) :-
path_separator('\\') :-
current_prolog_flag( windows, true ).
path_separator('/').
path_separator('/').

View File

@ -470,6 +470,7 @@ init_learning :-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% build BDD script for every example
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
once(init_queries),
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@ -659,7 +660,7 @@ init_queries :-
%=
%========================================================================
init_one_query(QueryID,_Query_Type) :-
init_one_query(QueryID,_Query_Type) :- trace,
create_known_values_file_name(QueryID,File_Name),
file_exists(File_Name),
!,
@ -888,19 +889,16 @@ update_query(QueryID,ClusterID ,Method,Command,PID,Output_File_Name) :-
create_bdd_output_file_name(QueryID,ClusterID,Iteration,Output_File_Name),
create_bdd_file_name(QueryID,ClusterID,BDD_File_Name),
problog_dir(PD),
concat_path_with_filename(PD,'problogbdd_lfi',Absolute_Name),
convert_filename_to_problog_path('problogbdd_lfi',Absolute_Name),
atomic_concat([Absolute_Name,
' -i "', Input_File_Name, '"',
' -l "', BDD_File_Name, '"',
' -m ',Method,
' -id ', QueryID,
' > "',
Output_File_Name,
'"'],Command),
exec(Command,[std,std,std],PID).
' -m ', Method,
' -id ', QueryID],Command),
open( Output_File_Name, write, Stream ),
exec(Command,[std, Stream ,std],PID),
close( Stream ).
update_query_wait(QueryID,_ClusterID,Count,Symbol,Command,PID,OutputFilename,BDD_Probability) :-
wait(PID,Error),
@ -983,7 +981,7 @@ my_reset_static_array(Name) :-
(
Type==int
->
forall(between(0,LastPos,Pos), update_array(Name,Pos,0))
forall(between(0,LastPos,Pos), update_array(Name,Pos,0))
;
Type==float
->

View File

@ -113,7 +113,7 @@ mkdir -p packages/bdd
if test "$PKG_BDDLIB" != ""; then
AC_CONFIG_FILES([packages/bdd/Makefile])
AC_CONFIG_FILES([packages/bdd/Makefile/config.h])
AC_CONFIG_FILES([packages/bdd/cudd_config.h])
AC_CONFIG_FILES([packages/ProbLog/simplecudd/Makefile])
AC_CONFIG_FILES([packages/ProbLog/simplecudd_lfi/Makefile])
fi

View File

@ -90,7 +90,10 @@ once/1.
*/
once(G) :- '$execute'(G), !.
once(G) :-
strip_module(G, M, C),
'$meta_call'(C, M),
!.
/** @pred forall(: _Cond_,: _Action_)

View File

@ -697,7 +697,7 @@ be lost.
open('CONIN$', read, _S, [alias(debugger_input),bom(false)]).
% last argument to do_spy says that we are at the end of a context. It
% last argument to do_spy says that we are at the end of a context. It
% is required to know whether we are controlled by the debugger.
%'$do_spy'(V, M, CP, Flag) :-
% writeln('$do_spy'(V, M, CP, Flag)), fail.
@ -889,7 +889,8 @@ be lost.
'$spycall'(G, M, _, _) :-
nb_getval('$debug_jump',true),
!,
'$execute_nonstop'(G,M).
( '$is_metapredicate'(G, M) -> '$meta_expansion'(G,M,M,M,G1,[]) ; G = G1 ),
'$execute_nonstop'(G1,M).
'$spycall'(G, M, _, _) :-
(
'$system_predicate'(G,M)