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

Protect split_bidir. against convoluted parameters

parent 9cad6166
...@@ -69,7 +69,9 @@ split_bidirectional_reaction(Expression for Reactant => Product) :- ...@@ -69,7 +69,9 @@ split_bidirectional_reaction(Expression for Reactant => Product) :-
( (
ode:substitute_functions(Expression, Expr), ode:substitute_functions(Expression, Expr),
distribute(Expr, DistExpr), distribute(Expr, DistExpr),
DistExpr = Up - Down DistExpr = Up - Down,
models:formal_product(P, Reactant => Product),
present_in_kinetics(P, Down)
-> ->
delete_reaction(Expression for Reactant => Product), delete_reaction(Expression for Reactant => Product),
add_reaction(Up for Reactant => Product), add_reaction(Up for Reactant => Product),
......
...@@ -1330,6 +1330,15 @@ formal_reactant(Mol, Reactants => _Products) :- !, ...@@ -1330,6 +1330,15 @@ formal_reactant(Mol, Reactants => _Products) :- !,
is_present(Mol, Reactants). is_present(Mol, Reactants).
%! formal_product(+Molecule, +Reaction)
formal_product(Mol, _Reactants/_Inhibtors => Products) :- !,
is_present(Mol, Products).
formal_product(Mol, _Reactants => Products) :- !,
is_present(Mol, Products).
%! formal_catalyst(+Molecule, +Reaction) %! formal_catalyst(+Molecule, +Reaction)
formal_catalyst(Mol, Reactants => Products) :- !, formal_catalyst(Mol, Reactants => Products) :- !,
......
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