Commit 9e076803 authored by SOLIMAN Sylvain's avatar SOLIMAN Sylvain

Handle qual files with annotations (and debug)

parent 788a6925
......@@ -75,13 +75,15 @@ add_qual_file(Filename) :-
forall(
(
xpath(Model, '//'('qual:qualitativeSpecies'),
element('qual:qualitativeSpecies', Attributes, [])),
element('qual:qualitativeSpecies', Attributes, _)),
member('qual:id'=Id, Attributes)
),
(
debug(qual, "QSpecies: ~w", Id),
member('qual:initialLevel'=Level, Attributes)
->
assertz(qual_species(Id)),
debug(qual, "Initial level: ~w", Level),
present(Id, Level)
;
assertz(qual_species(Id))
......@@ -137,6 +139,7 @@ add_qual_transition([], _Transition).
add_qual_transition([element('qual:output', Output, []) | ListOfOutputs], Transition) :-
member('qual:qualitativeSpecies'=OutputId, Output),
member(element('qual:listOfFunctionTerms', [], Functions), Transition),
debug(qual, "Output: ~w", OutputId),
(
% already computed for another output
default_term(_)
......@@ -178,11 +181,15 @@ add_qual_functions([], OutputId) :-
add_qual_functions([Function | L], OutputId) :-
Function = element('qual:functionTerm', ['qual:resultLevel'=Level], [Maths]),
!,
debug(qual, "Level: ~w, Function: ~w", [Level, Maths]),
atom_bool(Level, Result),
Maths = element(math, _NameSpace, [MathElt]),
debug(qual, "Math function: ~w", [MathElt]),
mathml_to_bool(MathElt, Bool),
debug(qual, "Bool function: ~w", [Bool]),
dnf(Bool, DBool),
bool_simplify(DBool, SBool),
debug(qual, "Simplified function: ~w", [SBool]),
forall(
member(OBool, SBool),
assertz(function_terms(OBool, Result))
......@@ -363,6 +370,14 @@ dnf(and(X, Y), And) :-
And
).
dnf(and(X), XX) :-
!,
dnf(X, XX).
dnf(or(X), XX) :-
!,
dnf(X, XX).
dnf(or(X, Y), Or) :-
!,
dnf(X, XX),
......
Markdown is supported
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