ProbLog versioning, ProbLog Tabling warning message instead of error
This commit is contained in:
parent
ff6bd1dda0
commit
d1839b730c
packages/ProbLog
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
%
|
%
|
||||||
% $Date: 2010-10-05 18:15:57 +0200 (Tue, 05 Oct 2010) $
|
% $Date: 2010-10-06 12:56:13 +0200 (Wed, 06 Oct 2010) $
|
||||||
% $Revision: 4876 $
|
% $Revision: 4877 $
|
||||||
%
|
%
|
||||||
% This file is part of ProbLog
|
% This file is part of ProbLog
|
||||||
% http://dtai.cs.kuleuven.be/problog
|
% http://dtai.cs.kuleuven.be/problog
|
||||||
@ -249,6 +249,7 @@
|
|||||||
non_ground_fact/1,
|
non_ground_fact/1,
|
||||||
export_facts/1,
|
export_facts/1,
|
||||||
problog_help/0,
|
problog_help/0,
|
||||||
|
problog_version/0,
|
||||||
show_inference/0,
|
show_inference/0,
|
||||||
problog_dir/1,
|
problog_dir/1,
|
||||||
set_problog_flag/2,
|
set_problog_flag/2,
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
%
|
%
|
||||||
% $Date: 2010-10-05 18:15:57 +0200 (Tue, 05 Oct 2010) $
|
% $Date: 2010-10-06 12:56:13 +0200 (Wed, 06 Oct 2010) $
|
||||||
% $Revision: 4876 $
|
% $Revision: 4877 $
|
||||||
%
|
%
|
||||||
% This file is part of ProbLog
|
% This file is part of ProbLog
|
||||||
% http://dtai.cs.kuleuven.be/problog
|
% http://dtai.cs.kuleuven.be/problog
|
||||||
@ -212,6 +212,7 @@
|
|||||||
convert_filename_to_working_path/2,
|
convert_filename_to_working_path/2,
|
||||||
convert_filename_to_problog_path/2,
|
convert_filename_to_problog_path/2,
|
||||||
concat_path_with_filename/3,
|
concat_path_with_filename/3,
|
||||||
|
concat_path_with_filename2/3,
|
||||||
split_path_file/3,
|
split_path_file/3,
|
||||||
check_existance/1,
|
check_existance/1,
|
||||||
calc_md5/2]).
|
calc_md5/2]).
|
||||||
@ -249,6 +250,13 @@ concat_path_with_filename(Path, File_Name, Result):-
|
|||||||
path_seperator(Path_Seperator),
|
path_seperator(Path_Seperator),
|
||||||
atomic_concat([Path_Absolute, Path_Seperator, File_Name], Result).
|
atomic_concat([Path_Absolute, Path_Seperator, File_Name], Result).
|
||||||
|
|
||||||
|
concat_path_with_filename2(Path, File_Name, Result):-
|
||||||
|
nonvar(File_Name),
|
||||||
|
nonvar(Path),
|
||||||
|
path_seperator(Path_Seperator),
|
||||||
|
(atomic_concat(Path_Absolute, Path_Seperator, Path) ; Path_Absolute = Path),
|
||||||
|
atomic_concat([Path_Absolute, Path_Seperator, File_Name], Result).
|
||||||
|
|
||||||
%========================================================================
|
%========================================================================
|
||||||
%= Calculate the MD5 checksum of +Filename by calling md5sum
|
%= Calculate the MD5 checksum of +Filename by calling md5sum
|
||||||
%= in case m5sum is not installed, try md5, otherwise fail
|
%= in case m5sum is not installed, try md5, otherwise fail
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
%
|
%
|
||||||
% $Date: 2010-10-05 18:15:57 +0200 (Tue, 05 Oct 2010) $
|
% $Date: 2010-10-06 12:56:13 +0200 (Wed, 06 Oct 2010) $
|
||||||
% $Revision: 4876 $
|
% $Revision: 4877 $
|
||||||
%
|
%
|
||||||
% This file is part of ProbLog
|
% This file is part of ProbLog
|
||||||
% http://dtai.cs.kuleuven.be/problog
|
% http://dtai.cs.kuleuven.be/problog
|
||||||
@ -222,7 +222,8 @@
|
|||||||
show_inference/0,
|
show_inference/0,
|
||||||
problog_flags/0,
|
problog_flags/0,
|
||||||
problog_flags/1,
|
problog_flags/1,
|
||||||
problog_help/0]).
|
problog_help/0,
|
||||||
|
problog_version/0]).
|
||||||
|
|
||||||
% load library modules
|
% load library modules
|
||||||
:- use_module(library(lists), [member/2]).
|
:- use_module(library(lists), [member/2]).
|
||||||
@ -231,7 +232,7 @@
|
|||||||
% load our own modules
|
% load our own modules
|
||||||
:- use_module(flags).
|
:- use_module(flags).
|
||||||
:- use_module(variables).
|
:- use_module(variables).
|
||||||
:- use_module(os, [check_existance/1, convert_filename_to_problog_path/2]).
|
:- use_module(os, [check_existance/1, convert_filename_to_problog_path/2, concat_path_with_filename2/3]).
|
||||||
:- use_module(version_control, [get_version/3]).
|
:- use_module(version_control, [get_version/3]).
|
||||||
|
|
||||||
|
|
||||||
@ -299,8 +300,7 @@ make_column_format([HC|TC], [HS|TS], Format, Acc):-
|
|||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
|
|
||||||
problog_help :-
|
problog_help :-
|
||||||
print_version,
|
format('~2nProbLog inference currently offers the following inference methods:~n',[]),
|
||||||
format('~nProbLog inference currently offers the following inference methods:~n',[]),
|
|
||||||
show_inference,
|
show_inference,
|
||||||
problog:problog_path(PD),
|
problog:problog_path(PD),
|
||||||
format('~nProbLog directory: ~q~n',[PD]),
|
format('~nProbLog directory: ~q~n',[PD]),
|
||||||
@ -314,28 +314,33 @@ problog_help :-
|
|||||||
nl,
|
nl,
|
||||||
flush_output.
|
flush_output.
|
||||||
|
|
||||||
print_version :-
|
problog_version :-
|
||||||
|
MainProblogFiles = ['problog.yap', 'problog_learning.yap', 'dtproblog.yap'],
|
||||||
nl,
|
nl,
|
||||||
print_group_line('Version Information'),
|
print_group_line_bold('Version Information'),
|
||||||
check_existance('problog.yap'),
|
print_version(MainProblogFiles, ''),
|
||||||
convert_filename_to_problog_path('problog.yap', Path),
|
print_sep_line,
|
||||||
get_version(Path, Version, Revision),
|
|
||||||
format('~w~35+ Last Modified at:~w~65+Revision:~w~n', ['problog.yap', Version, Revision]),
|
|
||||||
convert_filename_to_problog_path('problog', ProblogPath),
|
convert_filename_to_problog_path('problog', ProblogPath),
|
||||||
directory_files(ProblogPath, ProblogFiles),
|
directory_files(ProblogPath, ProblogFiles),
|
||||||
print_version(ProblogFiles),
|
sort(ProblogFiles, ProblogFilesS),
|
||||||
print_sep_line.
|
print_version(ProblogFilesS, 'problog'),
|
||||||
|
print_sep_line_bold.
|
||||||
|
|
||||||
print_version([]).
|
print_version([], _Path).
|
||||||
print_version([H|T]):-
|
print_version([H|T], Path):-
|
||||||
atom_concat('.', _, H), !,
|
atom_concat(_, '.yap', H), !,
|
||||||
print_version(T).
|
(Path == '' ->
|
||||||
print_version([H|T]):-
|
FileName = H
|
||||||
atom_concat('problog/', H, FileName),
|
;
|
||||||
|
concat_path_with_filename2(Path, H, FileName)
|
||||||
|
),
|
||||||
|
check_existance(FileName),
|
||||||
convert_filename_to_problog_path(FileName, FilePath),
|
convert_filename_to_problog_path(FileName, FilePath),
|
||||||
get_version(FilePath, Version, Revision),
|
get_version(FilePath, Version, Revision),
|
||||||
format('~w~35+ Last Modified at:~w~65+Revision:~w~n', [FileName, Version, Revision]),
|
format('~w~35+ Last Modified at:~w~65+Revision:~w~n', [FileName, Version, Revision]),
|
||||||
print_version(T).
|
print_version(T, Path).
|
||||||
|
print_version([_H|T], Path):-
|
||||||
|
print_version(T, Path).
|
||||||
|
|
||||||
|
|
||||||
show_inference :-
|
show_inference :-
|
||||||
|
@ -2,8 +2,8 @@
|
|||||||
|
|
||||||
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|
||||||
%
|
%
|
||||||
% $Date: 2010-09-28 21:04:43 +0200 (Tue, 28 Sep 2010) $
|
% $Date: 2010-10-06 12:56:13 +0200 (Wed, 06 Oct 2010) $
|
||||||
% $Revision: 4838 $
|
% $Revision: 4877 $
|
||||||
%
|
%
|
||||||
% This file is part of ProbLog
|
% This file is part of ProbLog
|
||||||
% http://dtai.cs.kuleuven.be/problog
|
% http://dtai.cs.kuleuven.be/problog
|
||||||
@ -328,8 +328,9 @@ problog_table(Name/Arity, Module) :-
|
|||||||
atom_concat(['problog_', Name, '_tabled'], ExactName),
|
atom_concat(['problog_', Name, '_tabled'], ExactName),
|
||||||
|
|
||||||
% Monte carlo tabling
|
% Monte carlo tabling
|
||||||
table(Module:MCName/Arity),
|
catch((table(Module:MCName/Arity),
|
||||||
assertz(problog_tabled(Module:Name/Arity)),
|
assertz(problog_tabled(Module:Name/Arity))), _,
|
||||||
|
(format(user_error, 'Warning: Tabling was not enabled over compilation, montecarlo tabling is disabled!~nPredicate: ~q~n', [Module:MCName/Arity]))),
|
||||||
|
|
||||||
findall(_,(
|
findall(_,(
|
||||||
OriginalPred =.. [OriginalName|Args],
|
OriginalPred =.. [OriginalName|Args],
|
||||||
|
Reference in New Issue
Block a user