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

This commit is contained in:
Vitor Santos Costa 2010-10-08 10:46:11 +01:00
commit 361c5ad78f
11 changed files with 69 additions and 32 deletions

View File

@ -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,

View File

@ -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

View File

@ -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 :-

View File

@ -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],

View File

@ -7,6 +7,8 @@
* * * *
* Author: Theofrastos Mantadelis * * Author: Theofrastos Mantadelis *
* File: general.c * * File: general.c *
* $Date:: 2010-10-06 13:20:59 +0200 (Wed, 06 Oct 2010) $ *
* $Revision:: 4880 $ *
* * * *
******************************************************************************** ********************************************************************************
* * * *

View File

@ -7,6 +7,8 @@
* * * *
* Author: Theofrastos Mantadelis * * Author: Theofrastos Mantadelis *
* File: general.h * * File: general.h *
* $Date:: 2010-10-06 13:20:59 +0200 (Wed, 06 Oct 2010) $ *
* $Revision:: 4880 $ *
* * * *
******************************************************************************** ********************************************************************************
* * * *

View File

@ -7,6 +7,8 @@
* * * *
* Author: Theofrastos Mantadelis, Angelika Kimmig, Bernd Gutmann * * Author: Theofrastos Mantadelis, Angelika Kimmig, Bernd Gutmann *
* File: problogbdd.c * * File: problogbdd.c *
* $Date:: 2010-10-06 18:06:08 +0200 (Wed, 06 Oct 2010) $ *
* $Revision:: 4883 $ *
* * * *
******************************************************************************** ********************************************************************************
* * * *
@ -345,6 +347,7 @@ int main(int argc, char **arg) {
MyManager.f = LOW(MyManager.manager); MyManager.f = LOW(MyManager.manager);
MyManager.varmap = InitNamedVars(1, 0); MyManager.varmap = InitNamedVars(1, 0);
bdd = OnlineGenerateBDD(MyManager.manager, &MyManager.varmap); bdd = OnlineGenerateBDD(MyManager.manager, &MyManager.varmap);
bakbdd = bdd;
ivarcnt = GetVarCount(MyManager.manager); ivarcnt = GetVarCount(MyManager.manager);
} else if(params.independent_forest>0){ } else if(params.independent_forest>0){
// the flag to create a forest of independent bdds is set // the flag to create a forest of independent bdds is set

View File

@ -7,6 +7,8 @@
* * * *
* Author: Bernd Gutmann * * Author: Bernd Gutmann *
* File: problogmath.c * * File: problogmath.c *
* $Date:: 2010-10-06 13:20:59 +0200 (Wed, 06 Oct 2010) $ *
* $Revision:: 4880 $ *
* * * *
******************************************************************************** ********************************************************************************
* * * *

View File

@ -7,8 +7,8 @@
* * * *
* Author: Bernd Gutmann * * Author: Bernd Gutmann *
* File: problogmath.h * * File: problogmath.h *
* $Date:: 2010-02-18 18:04:54 +0100 (Thu, 18 Feb 2010) $ * * $Date:: 2010-10-06 13:20:59 +0200 (Wed, 06 Oct 2010) $ *
* $Revision:: 3623 $ * * $Revision:: 4880 $ *
* * * *
******************************************************************************** ********************************************************************************
* * * *

View File

@ -7,6 +7,8 @@
* * * *
* Author: Theofrastos Mantadelis * * Author: Theofrastos Mantadelis *
* File: simplecudd.c * * File: simplecudd.c *
* $Date:: 2010-10-06 13:20:59 +0200 (Wed, 06 Oct 2010) $ *
* $Revision:: 4880 $ *
* * * *
******************************************************************************** ********************************************************************************
* * * *
@ -1710,7 +1712,16 @@ void onlinetraverse(DdManager *manager, namedvars varmap, hisqueue *HisQueue, Dd
switch(inputline[1]) { switch(inputline[1]) {
case '?': case '?':
printf("Available instructions:\n\t@c : current node\n\t@n,[BFS, DFS] : expand and go to next node\n\t@t,[BFS, DFS] : throw and go to next node\n"); printf("Available instructions:\n\t@c : current node\n\t@n,[BFS, DFS] : expand and go to next node\n\t@t,[BFS, DFS] : throw and go to next node\n");
printf("\t@h : high node of current\n\t@l : low node of current\n\t@v,[variable] : variable values\n\t@e terminates\n"); printf("\t@h : high node of current\n\t@l : low node of current\n\t@v,[variable] : variable values\n\t@r restart traverse from parent node\n\t@e terminates\n");
break;
case 'r':
curnode = bdd;
iQsize = 0;
iRoot = 1;
free(Q);
Q = (DdNode **) malloc(sizeof(DdNode *) * iQsize);
Q2 = NULL;
ReInitHistory(his, varmap.varcnt);
break; break;
case 'c': case 'c':
if (iRoot) { if (iRoot) {

View File

@ -7,6 +7,8 @@
* * * *
* Author: Theofrastos Mantadelis * * Author: Theofrastos Mantadelis *
* File: simplecudd.h * * File: simplecudd.h *
* $Date:: 2010-10-06 13:20:59 +0200 (Wed, 06 Oct 2010) $ *
* $Revision:: 4880 $ *
* * * *
******************************************************************************** ********************************************************************************
* * * *