Commit c19157ed authored by Mathieu Hemery's avatar Mathieu Hemery
Browse files

First draft for chek_reactants

parent e2582c24
......@@ -72,13 +72,16 @@ Coder: T. Martinez
get_model/2,
load_all/2,
parametrize_initial_concentration/0,
parametrize_reaction/0
parametrize_reaction/0,
is_wellformed/0,
is_strict/0
]
).
% Only for separate compilation/linting
:- use_module(doc).
:- use_module(formal_derivation).
:- use_module(arithmetic_rules).
:- devdoc('This secton needs documentation for the developper, in particular about the invariants concerning item, parent, id, key, kind.
......@@ -1261,3 +1264,28 @@ introduce_param(Func, Func2) :-
introduce_param(O,O).
%! is_wellformed(+model)
%
% Check if the model is wellformed (see TCS15_FGS)
is_wellformed(ModelId) :-
findall(
Molecule,
identifier_kind(ModelId, Molecule, object),
List_Molecule
),
maplist(check_reactant, List_Molecule),
maplist(check_inhibitor, List_Molecule).
check_reactant(Molecule) :-
reactions_with_reactant([Molecule], List_Reaction),
forall(member(Expr for Reaction, List_Reaction),
(
formal_derivation:derivative(Expr, Molecule, Derivative),
\+(arithmetic_rules:always_negative(Derivative))
)
).
%! is_strict(+model)
%
% Check if the model is strict (see TCS15_FGS)
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