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

This commit is contained in:
Vitor Santos Costa 2010-09-24 12:38:35 +01:00
commit 691d66cca3
3 changed files with 14 additions and 11 deletions

View File

@ -372,7 +372,7 @@
:- dynamic dynamic_probability_fact_extract/2.
% for storing continuous parts of proofs (Hybrid ProbLog)
:- dynamic hybrid_proof/4.
:- dynamic hybrid_proof/3, hybrid_proof/4.
:- dynamic hybrid_proof_disjoint/4.
% ProbLog files declare prob. facts as P::G
@ -465,15 +465,16 @@ problog_dir(PD):- problog_path(PD).
init_global_params :-
%grow_atom_table(1000000),
getcwd(Work),
concat_path_with_filename(Work, output, WorkDir),
%%%%%%%%%%%%
% working directory: all the temporary and output files will be located there
% it assumes a subdirectory of the current working dir
% on initialization, the current dir is the one where the user's file is located
% should be changed to use temporary folder structure of operating system
%%%%%%%%%%%%
problog_define_flag(dir, problog_flag_validate_directory, 'directory for files', WorkDir, output),
tmpnam(TempFolder),
atomic_concat([TempFolder, '_problog'], TempProblogFolder),
problog_define_flag(dir, problog_flag_validate_directory, 'directory for files', TempProblogFolder, output),
check_existance('problogbdd').
check_existance(FileName):-
@ -676,6 +677,7 @@ is_valid_gaussian(X) :-
throw(invalid_gaussian(X))
).
:- multifile(user:term_expansion/1).
user:term_expansion(Goal, problog:ProbFact) :-
compound(Goal),

View File

@ -223,7 +223,7 @@
% load our own modules
:- ensure_loaded(flags).
:- dynamic [problog_dir/1, problog_working_path/1].
:- dynamic [problog_path/1, problog_working_path/1].
set_problog_path(Path):-
retractall(problog_path(_)),
@ -262,7 +262,7 @@ empty_bdd_directory(Path) :-
ground(Path),
concat_path_with_filename(Path,'query_*',Files),
atomic_concat(['rm -f ',Files],Command),
atomic_concat(['rm -f "', Files, '"'],Command),
(shell(Command) -> true; true).
%========================================================================
%= store the current succes probabilities for training and test examples
@ -307,7 +307,7 @@ calc_md5_intern(Filename,Command,MD5) :-
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
( % read 32 Bytes from stdout of process
repeat,
get0(S,C),
get_code(S,C),
(
C== -1

View File

@ -419,6 +419,7 @@ merge_ptree(T1, T2, T3) :-
% - ptree_decomposition -> ptree_decomposition_struct
% - bdd_ptree_script -> bdd_struct_ptree_script
%%%%%%%%%%%%%%%%%%%%%%%%
:- dynamic c_num/1.
bdd_struct_ptree(Trie, FileBDD, Variables) :-
bdd_struct_ptree_script(Trie, FileBDD, Variables),
@ -734,13 +735,13 @@ bdd_vars_script_intern2(A) :-
bdd_pt(Trie, false) :-
empty_ptree(Trie),
!,
once(retractall(c_num(_))),
once(assert(c_num(2))).
retractall(c_num(_)),
assert(c_num(2)).
bdd_pt(Trie, true) :-
trie_check_entry(Trie, [true], _),
!,
once(retractall(c_num(_))),
once(assert(c_num(2))).
retractall(c_num(_)),
assert(c_num(2)).
% general case: transform trie to nested tree structure for compression
bdd_pt(Trie, CT) :-