Commit a0c99644 authored by HEMERY Mathieu's avatar HEMERY Mathieu
Browse files

Merge branch 'develop' of https://gitlab.inria.fr/lifeware/biocham into develop

parents fec8f036 08a32ec0
......@@ -19,6 +19,7 @@
expand_formula/2,
validity_domain/2,
satisfaction_degree/3,
satisfaction_degree/4,
generate_domain_cpp/1,
generate_domain_cpp/2,
generate_objective/1,
......@@ -380,44 +381,57 @@ delete_ltl_pattern(FunctorSet) :-
validity_domain(Formula, Domain) :-
compute_domain('ppl_validity_domain.cc', Formula, none, DomainRaw),
compute_domain('ppl_validity_domain.cc', Formula, none, DomainRaw, standard),
reformat_domain(DomainRaw, Domain).
satisfaction_degree(Formula, Objective, SatisfactionDegree) :-
satisfaction_degree(Formula, Objective, SatisfactionDegree, standard).
satisfaction_degree(Formula, Objective, SatisfactionDegree, Mode) :-
compute_domain(
'satisfaction_degree.cc', Formula, some(Objective), SatisfactionDegree
'satisfaction_degree.cc', Formula, some(Objective), SatisfactionDegree,
Mode
).
:- devdoc('\\section{Private predicates}').
compute_domain(CppProgram, Formula, Objective, Result) :-
compute_domain(CppProgram, Formula, Objective, Result, Mode) :-
CFilename = 'check.inc',
TableFilename = 'check.csv',
ExecutableFilename = 'check',
expand_formula(Formula, ExpandedFormula),
with_clean(
[foltl:column/2],
(
populate_table_columns,
with_output_to_file(
CFilename,
(
generate_domain_cpp(ExpandedFormula),
(
% generate executable if normal mode (standard) or first of a loop
memberchk(Mode, [standard, first])
->
expand_formula(Formula, ExpandedFormula),
with_clean(
[foltl:column/2],
(
populate_table_columns,
with_output_to_file(
CFilename,
(
Objective = some(Objective0)
->
generate_objective([Objective0])
;
true
generate_domain_cpp(ExpandedFormula),
(
Objective = some(Objective0)
->
generate_objective([Objective0])
;
true
)
)
)
)
)
),
compile_domain_cpp_program(CppProgram, ExecutableFilename)
;
% just reuse existing ExecutableFilename
true
),
compile_domain_cpp_program(CppProgram, ExecutableFilename),
export_table(TableFilename),
call_subprocess(
ExecutableFilename, [TableFilename], [stdout(pipe(ResultStream))]
......@@ -431,8 +445,19 @@ compute_domain(CppProgram, Formula, Objective, Result) :-
(
have_to_delete_temporary_files
->
delete_file(CFilename),
delete_file(ExecutableFilename),
(
memberchk(Mode, [standard, last])
->
delete_file(ExecutableFilename)
;
% keep executable if mode is first or loop
Mode == first
->
% remove .inc file if first
delete_file(CFilename)
;
true
),
delete_file(TableFilename)
;
true
......
......@@ -336,7 +336,18 @@ robustness_aux(
normal_sample(ParameterList, VariationCoefficient),
numerical_simulation,
debug(robustness, "Satisfaction for ~w with ~w~n", [Formula, Objective]),
satisfaction_degree(Formula, Objective, Degree),
(
J == 1
->
Mode = first
;
J == NSamples
->
Mode = last
;
Mode = loop
),
satisfaction_degree(Formula, Objective, Degree, Mode),
debug(robustness, "Satisfaction: ~w~n", [Degree]),
nb_getval(robustness_mean, Mean),
% nb_getval(robustness_ssd, Ssd),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment