Commit 988ec23d authored by Mathieu Hemery's avatar Mathieu Hemery
Browse files

Try improving modifiers detection trhough arithmetical stuff

parent 02ff9fe3
......@@ -47,7 +47,14 @@ derivate_raw(A / B, Variable, D / (B ^ 2)) :-
derivate_raw(A ^ B, Variable, Result) :-
!,
derivate_raw(exp(B * log(A)), Variable, Result).
(
derivate(B, Variable, 0)
->
derivate(A, Variable, Aprime),
Result = Aprime*B*A^(B-1)
;
derivate_raw(exp(B * log(A)), Variable, Result)
).
derivate_raw(sqrt(A), Variable, Result) :-
!,
......
......@@ -143,6 +143,7 @@ add_catalysts([Head|Tail], Reactants => Products, NewReactants => NProducts+Head
NewReactants = Reactants+Head
).
% TODO -- remove Head from Reactants & Products if necessary
add_inhibitors([], Reaction, Reaction).
add_inhibitors([Head|Tail], Reaction, NewReaction) :-
models:formal_inhibitor(Head, Reaction),
......
......@@ -1322,12 +1322,13 @@ introduce_param(O,O).
%! formal_reactant(+Molecule, +Reaction)
formal_reactant(Mol, Reactants => _Products) :- !,
formal_reactant(Mol, Reactants/_Inhibtors => _Products) :- !,
is_present(Mol, Reactants).
formal_reactant(Mol, Reactants/_Inhibtors => _Products) :- !,
formal_reactant(Mol, Reactants => _Products) :- !,
is_present(Mol, Reactants).
%! formal_catalyst(+Molecule, +Reaction)
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