Merge branch 'master' of yap.dcc.fc.up.pt:yap-6
This commit is contained in:
commit
691d66cca3
@ -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
|
||||||
@ -465,15 +465,16 @@ problog_dir(PD):- problog_path(PD).
|
|||||||
|
|
||||||
init_global_params :-
|
init_global_params :-
|
||||||
%grow_atom_table(1000000),
|
%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
|
% working directory: all the temporary and output files will be located there
|
||||||
% it assumes a subdirectory of the current working dir
|
% it assumes a subdirectory of the current working dir
|
||||||
% 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),
|
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('problogbdd').
|
||||||
|
|
||||||
check_existance(FileName):-
|
check_existance(FileName):-
|
||||||
@ -676,6 +677,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),
|
||||||
|
@ -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
|
||||||
|
@ -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) :-
|
||||||
|
Reference in New Issue
Block a user