Small changes for modularity improvements

This commit is contained in:
Theofrastos Mantadelis 2010-09-24 12:33:02 +02:00
parent 52a4680ac7
commit 42fc10cf58
3 changed files with 13 additions and 9 deletions

View File

@ -372,7 +372,7 @@
:- dynamic dynamic_probability_fact_extract/2. :- dynamic dynamic_probability_fact_extract/2.
% for storing continuous parts of proofs (Hybrid ProbLog) % for storing continuous parts of proofs (Hybrid ProbLog)
:- dynamic hybrid_proof/4. :- dynamic hybrid_proof/3, hybrid_proof/4.
:- dynamic hybrid_proof_disjoint/4. :- dynamic hybrid_proof_disjoint/4.
% ProbLog files declare prob. facts as P::G % ProbLog files declare prob. facts as P::G
@ -473,7 +473,9 @@ init_global_params :-
% on initialization, the current dir is the one where the user's file is located % 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 % should be changed to use temporary folder structure of operating system
%%%%%%%%%%%% %%%%%%%%%%%%
problog_define_flag(dir, problog_flag_validate_directory, 'directory for files', WorkDir, output), tmpname(TempFolder),
atomic_concat([TempFolder, '_problog'], TempProblogFolder),
problog_define_flag(dir, problog_flag_validate_directory, 'directory for files', WorkDir, TempProblogFolder),
check_existance('problogbdd'). check_existance('problogbdd').
check_existance(FileName):- check_existance(FileName):-
@ -676,6 +678,7 @@ is_valid_gaussian(X) :-
throw(invalid_gaussian(X)) throw(invalid_gaussian(X))
). ).
:- multifile(user:term_expansion/1).
user:term_expansion(Goal, problog:ProbFact) :- user:term_expansion(Goal, problog:ProbFact) :-
compound(Goal), compound(Goal),

View File

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

View File

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