Commit 9cad6166 authored by Mathieu Hemery's avatar Mathieu Hemery
Browse files

Add a present_in_kinetics test and use it to boost check_model

parent 93dc3aa4
......@@ -2,7 +2,8 @@
kinetics,
[
kinetics/4,
add_coefficient/2
add_coefficient/2,
present_in_kinetics/2
]
).
......@@ -95,6 +96,19 @@ make_sum([RS * RO | Tail], S, O, Expression, Sum) :-
add_coefficient(C, 1 * C).
%! present_in_kinetics(+Molecule, +Kinetics)
%
% Test if the Molecule (or whatever actually) is present in the kinetics
present_in_kinetics(Molecule, Molecule) :- !.
present_in_kinetics(Molecule, Kinetics) :-
Kinetics =.. [_Functor|Decomposed],
present_in_kinetics_sr(Molecule, Decomposed).
present_in_kinetics_sr(Molecule, [Head|Tail]) :-
present_in_kinetics(Molecule, Head),!;
present_in_kinetics_sr(Molecule, Tail).
:-doc('Useful abbreviations for mass action law kinetics (with inhibitors), Michaelis-Menten kinetics, Hill kinetics (with inhibitors).').
......
......@@ -85,6 +85,7 @@ Coder: T. Martinez
:- use_module(arithmetic_rules).
:- use_module(doc).
:- use_module(formal_derivation).
:- use_module(kinetics).
:- use_module(reaction_rules).
:- use_module(util).
......@@ -1373,14 +1374,21 @@ test_wellformed([Molecule|Tail], Expression_raw for Reaction) :-
;
formal_reactant(Molecule, Reaction)
->
present_in_kinetics(Molecule, Expression),
test_wf_reactant(Molecule, Expression)
;
formal_inhibitor(Molecule, Reaction)
->
present_in_kinetics(Molecule, Expression),
test_wf_inhibitor(Molecule, Expression)
;
!,
test_wf_other(Molecule, Expression)
(
\+(present_in_kinetics(Molecule, Expression)),
!
;
test_wf_other(Molecule, Expression)
)
),
test_wellformed(Tail, Expression for Reaction).
......
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